mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 00:14:40 +03:00
Merge pull request #79 from Mibew/login
Disable ability to change operator's login This feature was actually broken since 1.6.6
This commit is contained in:
commit
5bbd730110
@ -29,9 +29,21 @@ $errors = array();
|
||||
$opId = '';
|
||||
|
||||
loadsettings();
|
||||
if (isset($_POST['login']) && isset($_POST['password'])) {
|
||||
if ((isset($_POST['opid']) || isset($_POST['login'])) && isset($_POST['password'])) {
|
||||
$opId = verifyparam("opid", "/^(\d{1,10})?$/", "");
|
||||
if ($opId) {
|
||||
$given_operator = operator_by_id($opId);
|
||||
if (!$given_operator) {
|
||||
$errors[] = getlocal("no_such_operator");
|
||||
$login = '';
|
||||
}
|
||||
else {
|
||||
$login = $given_operator['vclogin'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$login = getparam('login');
|
||||
}
|
||||
$email = getparam('email');
|
||||
$jabber = getparam('jabber');
|
||||
$password = getparam('password');
|
||||
|
@ -24,6 +24,8 @@ $operator = check_login();
|
||||
csrfchecktoken();
|
||||
check_permissions($operator, $can_administrate);
|
||||
|
||||
$errors = array();
|
||||
|
||||
if (isset($_GET['act']) && $_GET['act'] == 'del') {
|
||||
$operatorid = isset($_GET['id']) ? $_GET['id'] : "";
|
||||
|
||||
|
@ -62,7 +62,7 @@ require_once('inc_errors.php');
|
||||
<div class="field">
|
||||
<div class="flabel"><?php echo getlocal('form.field.login') ?><span class="required">*</span></div>
|
||||
<div class="fvalue">
|
||||
<input type="text" name="login" size="40" value="<?php echo form_value('login') ?>" class="formauth"<?php echo $page['canmodify'] ? "" : " disabled=\"disabled\"" ?>/>
|
||||
<input type="text" name="login" size="40" value="<?php echo form_value('login') ?>" class="formauth"<?php echo $page['canmodify'] && !$page['opid'] ? "" : " disabled=\"disabled\"" ?>/>
|
||||
</div>
|
||||
<div class="fdescr"> — <?php echo getlocal('form.field.login.description') ?></div>
|
||||
<br clear="all"/>
|
||||
|
Loading…
Reference in New Issue
Block a user