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
266c3323
Commit
266c3323
authored
Mar 03, 2009
by
Richard Mansfield
Browse files
Don't let institutional admins delete users (bug 3141)
parent
19c005a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/edit.php
View file @
266c3323
...
...
@@ -298,10 +298,20 @@ $deleteform = pieform(array(
),
));
function
edituser_delete_validate
(
Pieform
$form
,
$values
)
{
global
$USER
,
$SESSION
;
if
(
!
$USER
->
get
(
'admin'
))
{
$form
->
set_error
(
'submit'
,
get_string
(
'deletefailed'
,
'admin'
));
$SESSION
->
add_error_msg
(
get_string
(
'deletefailed'
,
'admin'
));
}
}
function
edituser_delete_submit
(
Pieform
$form
,
$values
)
{
global
$SESSION
;
delete_user
(
$values
[
'id'
]);
$SESSION
->
add_ok_msg
(
get_string
(
'userdeletedsuccessfully'
,
'admin'
));
global
$SESSION
,
$USER
;
if
(
$USER
->
get
(
'admin'
))
{
delete_user
(
$values
[
'id'
]);
$SESSION
->
add_ok_msg
(
get_string
(
'userdeletedsuccessfully'
,
'admin'
));
}
redirect
(
'/admin/users/search.php'
);
}
...
...
htdocs/theme/default/templates/admin/users/edit.tpl
View file @
266c3323
...
...
@@ -34,11 +34,13 @@
<h4>
{
str
tag
=
"suspenduser"
section
=
admin
}
</h4>
{
$suspendform
}
</td>
{
if
$USER
->
get
(
'admin'
)
}
<td
id=
"delete"
>
<h4>
{
str
tag
=
deleteuser
section
=
admin
}
</h4>
<p>
{
str
tag
=
deleteusernote
section
=
admin
}
</p>
{
$deleteform
}
</td>
{/
if
}
</tr>
</table>
...
...
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