Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
bcddc472
Commit
bcddc472
authored
Dec 27, 2007
by
Richard Mansfield
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update remote user record when changing a user's authinstance
parent
3e237b29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
htdocs/admin/users/edit.php
htdocs/admin/users/edit.php
+16
-5
No files found.
htdocs/admin/users/edit.php
View file @
bcddc472
...
...
@@ -189,11 +189,22 @@ function edituser_site_submit(Pieform $form, $values) {
// Authinstance can be changed by institutional admins if both the
// old and new authinstances belong to the admin's institutions
if
(
isset
(
$values
[
'authinstance'
])
&&
(
$USER
->
get
(
'admin'
)
||
(
$USER
->
is_institutional_admin
(
get_field
(
'auth_instance'
,
'institution'
,
'id'
,
$values
[
'authinstance'
]))
&&
$USER
->
is_institutional_admin
(
get_field
(
'auth_instance'
,
'institution'
,
'id'
,
$user
->
authinstance
)))))
{
$user
->
authinstance
=
$values
[
'authinstance'
];
if
(
isset
(
$values
[
'authinstance'
])
&&
$values
[
'authinstance'
]
!=
$user
->
authinstance
)
{
$authinst
=
get_records_select_assoc
(
'auth_instance'
,
'id = ? OR id = ?'
,
array
(
$values
[
'authinstance'
],
$user
->
authinstance
));
if
(
$USER
->
get
(
'admin'
)
||
(
$USER
->
is_institutional_admin
(
$authinst
[
$values
[
'authinstance'
]]
->
institution
)
&&
$USER
->
is_institutional_admin
(
$authinst
[
$user
->
authinstance
]
->
institution
)))
{
delete_records
(
'auth_remote_user'
,
'authinstance'
,
$user
->
authinstance
,
'localusr'
,
$user
->
id
);
if
(
$authinst
[
$values
[
'authinstance'
]]
->
authname
!=
'internal'
)
{
insert_record
(
'auth_remote_user'
,
(
object
)
array
(
'authinstance'
=>
$values
[
'authinstance'
],
'remoteusername'
=>
$user
->
username
,
'localusr'
=>
$user
->
id
,
));
}
$user
->
authinstance
=
$values
[
'authinstance'
];
}
}
update_record
(
'usr'
,
$user
);
...
...
Write
Preview
Markdown
is supported
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