Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
df089016
Commit
df089016
authored
Jul 23, 2013
by
Aaron Wells
Browse files
Better usage of the DML API
Bug1180194 Change-Id: Idfaad6ba9138eabc8e0efa4f72a5a3da224c7eab
parent
5e2f3e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/bulk.php
View file @
df089016
...
@@ -211,9 +211,8 @@ function changeauth_submit(Pieform $form, $values) {
...
@@ -211,9 +211,8 @@ function changeauth_submit(Pieform $form, $values) {
if
(
$user
->
authinstance
!=
$values
[
'authinstance'
])
{
if
(
$user
->
authinstance
!=
$values
[
'authinstance'
])
{
// Authinstance can be changed by institutional admins if both the
// Authinstance can be changed by institutional admins if both the
// old and new authinstances belong to the admin's institutions
// old and new authinstances belong to the admin's institutions
$authinst
=
get_records_select_assoc
(
'auth_instance'
,
'id = ?'
,
$authinst
=
get_field
(
'auth_instance'
,
'institution'
,
'id'
,
$user
->
authinstance
);
array
(
$user
->
authinstance
));
if
(
$USER
->
get
(
'admin'
)
||
$USER
->
is_institutional_admin
(
$authinst
))
{
if
(
$USER
->
get
(
'admin'
)
||
$USER
->
is_institutional_admin
(
$authinst
[
$user
->
authinstance
]
->
institution
))
{
// determine the current remoteusername
// determine the current remoteusername
$current_remotename
=
get_field
(
'auth_remote_user'
,
'remoteusername'
,
$current_remotename
=
get_field
(
'auth_remote_user'
,
'remoteusername'
,
'authinstance'
,
$user
->
authinstance
,
'localusr'
,
$user
->
id
);
'authinstance'
,
$user
->
authinstance
,
'localusr'
,
$user
->
id
);
...
@@ -221,10 +220,7 @@ function changeauth_submit(Pieform $form, $values) {
...
@@ -221,10 +220,7 @@ function changeauth_submit(Pieform $form, $values) {
$current_remotename
=
$user
->
username
;
$current_remotename
=
$user
->
username
;
}
}
// remove row if new authinstance row already exists to avoid doubleups
// remove row if new authinstance row already exists to avoid doubleups
if
(
$remoteuserexists
=
get_records_select_assoc
(
'auth_remote_user'
,
'localusr = ? AND authinstance = ?'
,
delete_records
(
'auth_remote_user'
,
'authinstance'
,
$values
[
'authinstance'
],
'localusr'
,
$user
->
id
);
array
(
$user
->
id
,
$values
[
'authinstance'
])))
{
delete_records
(
'auth_remote_user'
,
'authinstance'
,
$values
[
'authinstance'
],
'localusr'
,
$user
->
id
);
}
insert_record
(
'auth_remote_user'
,
(
object
)
array
(
insert_record
(
'auth_remote_user'
,
(
object
)
array
(
'authinstance'
=>
$values
[
'authinstance'
],
'authinstance'
=>
$values
[
'authinstance'
],
'remoteusername'
=>
$current_remotename
,
'remoteusername'
=>
$current_remotename
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment