forked from science-ation/science-ation
Allow superuser to edit other peoples accounts
Show pending email if there is one
This commit is contained in:
parent
6b37f4b721
commit
fa3a661b62
@ -37,8 +37,14 @@ if(!isset($_SESSION['accounts_id'])) {
|
|||||||
/* Superuser may edit this for any account, if the user is not a superuser, force
|
/* Superuser may edit this for any account, if the user is not a superuser, force
|
||||||
* the accounts_id to be whatever is in the session */
|
* the accounts_id to be whatever is in the session */
|
||||||
if($_SESSION['superuser']) {
|
if($_SESSION['superuser']) {
|
||||||
$accounts_id = intval($_GET['accounts_id']);
|
if($_GET['accounts_id']) {
|
||||||
if($accounts_id == 0) $accounts_id = $_SESSION['accounts_id'];
|
$accounts_id = intval($_GET['accounts_id']);
|
||||||
|
} else if($_GET['users_id']) {
|
||||||
|
$u=user_load(intval($_GET['users_id']));
|
||||||
|
$accounts_id=$u['accounts_id'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$accounts_id = $_SESSION['accounts_id'];
|
||||||
} else {
|
} else {
|
||||||
$accounts_id = $_SESSION['accounts_id'];
|
$accounts_id = $_SESSION['accounts_id'];
|
||||||
}
|
}
|
||||||
@ -83,8 +89,7 @@ case 'save':
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($save) {
|
if($save) {
|
||||||
// action_create_set_email($accounts_id, $email);
|
account_set_email($accounts_id,$email);
|
||||||
mysql_query("UPDATE accounts SET email='".mysql_real_escape_string($email)."' WHERE id={$accounts_id}");
|
|
||||||
happy_("An email has been sent to %1 to confirm the new email address", array($email));
|
happy_("An email has been sent to %1 to confirm the new email address", array($email));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,9 +160,7 @@ case 'save':
|
|||||||
$a = account_load($accounts_id);
|
$a = account_load($accounts_id);
|
||||||
|
|
||||||
$d = '';
|
$d = '';
|
||||||
$email = $a['email'];
|
|
||||||
$username_link = ($a['link_username_to_email'] == 'yes') ? 'checked="checked"' : '';
|
$username_link = ($a['link_username_to_email'] == 'yes') ? 'checked="checked"' : '';
|
||||||
$username = $a['username'];
|
|
||||||
|
|
||||||
if($_SESSION['password_expired'] == true) {
|
if($_SESSION['password_expired'] == true) {
|
||||||
echo error(i18n('Your password has expired. You must choose a new password now.'));
|
echo error(i18n('Your password has expired. You must choose a new password now.'));
|
||||||
@ -174,19 +177,32 @@ case 'save':
|
|||||||
<table width="90%">
|
<table width="90%">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: left" colspan="2"><b>Email</b><hr /></td>
|
<td style="text-align: left" colspan="2"><b>Email</b><hr /></td>
|
||||||
</tr><tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
<td><label for="email"><?=i18n('Email')?>:</label></td>
|
<td><label for="email"><?=i18n('Email')?>:</label></td>
|
||||||
<td><input id="email" <?=$d?> name="email" type="text" size="30" value="<?=$email?>"></td>
|
<td><input id="email" <?=$d?> name="email" type="text" size="30" value="<?=$a['email']?>"></td>
|
||||||
</tr><tr>
|
</tr>
|
||||||
<td></td><td>
|
<? if($a['pendingemail']) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><label for="email"><?=i18n('Pending Email')?>:</label></td>
|
||||||
|
<td><?=$a['pendingemail']?> is currently pending confirmation</td>
|
||||||
|
</tr>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
<div style="font-size: 0.75em;"><?=i18n('Changing the email address will cause a confirmation email to be sent to the new email address before the change will take effect.')?></div>
|
<div style="font-size: 0.75em;"><?=i18n('Changing the email address will cause a confirmation email to be sent to the new email address before the change will take effect.')?></div>
|
||||||
<br />
|
<br />
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
<td style="text-align: left" colspan="2"><b>Username</b><hr /></td>
|
<td style="text-align: left" colspan="2"><b>Username</b><hr /></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><?=i18n('Username')?>:</td>
|
<td><?=i18n('Username')?>:</td>
|
||||||
<td> <input <?=$ud?> <?=$d?> id="username" name=username type="text" size="20" value="<?=$username?>"><br />
|
<td> <input <?=$ud?> <?=$d?> id="username" name=username type="text" size="20" value="<?=$a['username']?>"><br />
|
||||||
<input id="username_link" <?=$username_link?> <?=$d?> type="checkbox" name="username_link" value="yes" />
|
<input id="username_link" <?=$username_link?> <?=$d?> type="checkbox" name="username_link" value="yes" />
|
||||||
<?=i18n('Use the email address as the login username')?><br />
|
<?=i18n('Use the email address as the login username')?><br />
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user