Commit a51e7b1d authored by Richard Mansfield's avatar Richard Mansfield

Suspended message not showing on edit user page

parent d6215bb3
......@@ -48,7 +48,8 @@ if (!$USER->get('admin')) {
}
}
if (empty($user->suspendedcusr)) {
$suspended = $user->get('suspendedcusr');
if (empty($suspended)) {
$suspendform = pieform(array(
'name' => 'edituser_suspend',
'plugintype' => 'core',
......@@ -86,6 +87,7 @@ if (empty($user->suspendedcusr)) {
),
)
));
$suspender = display_name(get_record('usr', 'id', $suspended));
}
function edituser_suspend_submit(Pieform $form, $values) {
......@@ -357,6 +359,10 @@ function edituser_institution_submit(Pieform $form, $values) {
$smarty = smarty();
$smarty->assign('user', $user);
$smarty->assign('suspended', $suspended);
if ($suspended) {
$smarty->assign('suspendedby', get_string('suspendedby', 'admin', $suspender));
}
$smarty->assign('suspendform', $suspendform);
$smarty->assign('siteform', $siteform);
$smarty->assign('institutionform', $institutionform);
......
......@@ -260,6 +260,7 @@ $string['suspendedreason'] = 'Reason for suspension';
$string['suspendedreasondescription'] = 'The explanation you enter here will be displayed to the user when they try to login';
$string['unsuspenduser'] = 'Unsuspend User';
$string['thisuserissuspended'] = 'This user has been suspended';
$string['suspendedby'] = 'This user has been suspended by %s';
$string['filequota'] = 'File quota (MB)';
// Institutions
......
......@@ -3,10 +3,10 @@
{include file="columnfullstart.tpl"}
<div id="edituser">
<h2><a href="{$WWWROOT}user/view.php?id={$user->id}">{$user->firstname} {$user->lastname} ({$user->username})</a></h2>
{if empty($user->suspendedcusr)}
{if !$suspended}
<h3>{str tag="suspenduser" section="admin"}</h3>
{else}
<h4>{str tag="thisuserissuspended" section="admin"}</h4>
<h4>{$suspendedby|escape}</h4>
<div><strong>{str tag="suspendedreason" section="admin"}:</strong></div>
<div>{$user->suspendedreason}</div>
{/if}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment