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
01ab5b32
Commit
01ab5b32
authored
Mar 03, 2009
by
Richard Mansfield
Browse files
Don't let institutional admins suspend site admins/staff
parent
266c3323
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/users/edit.php
View file @
01ab5b32
...
...
@@ -267,10 +267,15 @@ else {
}
function
edituser_suspend_submit
(
Pieform
$form
,
$values
)
{
global
$SESSION
;
suspend_user
(
$values
[
'id'
],
$values
[
'reason'
]);
$SESSION
->
add_ok_msg
(
get_string
(
'usersuspended'
,
'admin'
));
redirect
(
'/admin/users/edit.php?id='
.
$values
[
'id'
]);
global
$SESSION
,
$USER
,
$user
;
if
(
!
$USER
->
get
(
'admin'
)
&&
(
$user
->
get
(
'admin'
)
||
$user
->
get
(
'staff'
)))
{
$SESSION
->
add_error_msg
(
get_string
(
'errorwhilesuspending'
,
'admin'
));
}
else
{
suspend_user
(
$user
->
get
(
'id'
),
$values
[
'reason'
]);
$SESSION
->
add_ok_msg
(
get_string
(
'usersuspended'
,
'admin'
));
}
redirect
(
'/admin/users/edit.php?id='
.
$user
->
get
(
'id'
));
}
function
edituser_unsuspend_submit
(
Pieform
$form
,
$values
)
{
...
...
htdocs/theme/default/templates/admin/users/edit.tpl
View file @
01ab5b32
...
...
@@ -25,6 +25,7 @@
<p>
{
str
tag
=
"usereditdescription"
section
=
"admin"
}
</p>
{
$siteform
}
<!--<h3>
{
str
tag
=
"suspenduser"
section
=
"admin"
}
</h3>-->
{
if
$USER
->
get
(
'admin'
)
||
(!
$user
->
get
(
'admin'
)
&&
!
$user
->
get
(
'staff'
))
}
<hr>
<h3
id=
"suspend"
>
{
str
tag
=
"suspenddeleteuser"
section
=
admin
}
</h3>
<p>
{
str
tag
=
"suspenddeleteuserdescription"
section
=
admin
}
</p>
...
...
@@ -43,6 +44,7 @@
{/
if
}
</tr>
</table>
{/
if
}
{
if
(
$institutions
)
}
<hr>
...
...
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