- added possibility to unlock customers who got locked because of too many login-fails, fixes #473
This commit is contained in:
@@ -107,10 +107,12 @@ if($page == 'customers'
|
|||||||
$last_login = ((int)$row['lastlogin_succ'] == 0) ? $lng['panel']['neverloggedin'] : date('d.m.Y', $row['lastlogin_succ']);
|
$last_login = ((int)$row['lastlogin_succ'] == 0) ? $lng['panel']['neverloggedin'] : date('d.m.Y', $row['lastlogin_succ']);
|
||||||
|
|
||||||
$column_style = '';
|
$column_style = '';
|
||||||
|
$unlock_link = '';
|
||||||
if($row['loginfail_count'] >= $settings['login']['maxloginattempts']
|
if($row['loginfail_count'] >= $settings['login']['maxloginattempts']
|
||||||
&& $row['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])
|
&& $row['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])
|
||||||
) {
|
) {
|
||||||
$column_style = ' style="background-color: #f99122;"';
|
$column_style = ' style="background-color: #f99122;"';
|
||||||
|
$unlock_link = '<a href="'.$filename.'?s='.$s.'&page='.$page.'&action=unlock&id='.$row['customerid'].'">'.$lng['panel']['unlock'].'</a><br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains email_autoresponder');
|
$row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains email_autoresponder');
|
||||||
@@ -144,6 +146,31 @@ if($page == 'customers'
|
|||||||
redirectTo('index.php', Array('action' => 'login'));
|
redirectTo('index.php', Array('action' => 'login'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif($action == 'unlock'
|
||||||
|
&& $id != 0)
|
||||||
|
{
|
||||||
|
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid`='" . (int)$id . "' " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . $db->escape($userinfo['adminid']) . "' "));
|
||||||
|
|
||||||
|
if($result['loginname'] != '')
|
||||||
|
{
|
||||||
|
if(isset($_POST['send'])
|
||||||
|
&& $_POST['send'] == 'send')
|
||||||
|
{
|
||||||
|
$result = $db->query("UPDATE
|
||||||
|
`" . TABLE_PANEL_CUSTOMERS . "`
|
||||||
|
SET
|
||||||
|
`loginfail_count` = '0'
|
||||||
|
WHERE
|
||||||
|
`customerid`= '" . (int)$id . "'"
|
||||||
|
);
|
||||||
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ask_yesno('customer_reallyunlock', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['loginname']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
elseif($action == 'delete'
|
elseif($action == 'delete'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1511,4 +1511,8 @@ $lng['admin']['ipsandports']['docroot']['description'] = 'You can define a custo
|
|||||||
// ADDED IN FROXLOR 0.9.14-svn6
|
// ADDED IN FROXLOR 0.9.14-svn6
|
||||||
$lng['serversettings']['login_domain_login'] = 'Allow login with domains';
|
$lng['serversettings']['login_domain_login'] = 'Allow login with domains';
|
||||||
|
|
||||||
|
// ADDED IN FROXLOR 0.9.14
|
||||||
|
$lng['panel']['unlock'] = 'unlock';
|
||||||
|
$lng['question']['customer_reallyunlock'] = 'Do you really want to unlock customer %s?';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1494,4 +1494,8 @@ $lng['admin']['ipsandports']['docroot']['description'] = 'Hier kann ein benutzer
|
|||||||
// ADDED IN FROXLOR 0.9.14-svn6
|
// ADDED IN FROXLOR 0.9.14-svn6
|
||||||
$lng['serversettings']['login_domain_login'] = 'Erlaube Anmeldung mit Domains';
|
$lng['serversettings']['login_domain_login'] = 'Erlaube Anmeldung mit Domains';
|
||||||
|
|
||||||
|
// ADDED IN FROXLOR 0.9.14
|
||||||
|
$lng['panel']['unlock'] = 'entsperren';
|
||||||
|
$lng['question']['customer_reallyunlock'] = 'Wollen Sie den Kunden %s wirklich entsperren?';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -27,5 +27,5 @@
|
|||||||
<td class="field_name"><b><font color="green">{$row['emails_used']}</font></b>/<b><font color="#FD6204">{$row['emails']}</font></b><br /><b><font color="green">{$row['subdomains_used']}</font></b>/<b><font color="#FD6204">{$row['subdomains']}</font></b></td>
|
<td class="field_name"><b><font color="green">{$row['emails_used']}</font></b>/<b><font color="#FD6204">{$row['emails']}</font></b><br /><b><font color="green">{$row['subdomains_used']}</font></b>/<b><font color="#FD6204">{$row['subdomains']}</font></b></td>
|
||||||
<td class="field_name"><b><font color="green">{$row['email_accounts_used']}</font></b>/<b><font color="#FD6204">{$row['email_accounts']}</font></b><br /><b><font color="green">{$row['email_forwarders_used']}</font></b>/<b><font color="#FD6204">{$row['email_forwarders']}</font></b></td>
|
<td class="field_name"><b><font color="green">{$row['email_accounts_used']}</font></b>/<b><font color="#FD6204">{$row['email_accounts']}</font></b><br /><b><font color="green">{$row['email_forwarders_used']}</font></b>/<b><font color="#FD6204">{$row['email_forwarders']}</font></b></td>
|
||||||
<td class="field_name" style=" text-align: center; "><if $row['deactivated'] == '1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if><br />{$last_login}</td>
|
<td class="field_name" style=" text-align: center; "><if $row['deactivated'] == '1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if><br />{$last_login}</td>
|
||||||
<td class="field_name"><a href="$filename?s=$s&page=$page&action=edit&id={$row['customerid']}">{$lng['panel']['edit']}</a><br /><a href="$filename?s=$s&page=$page&action=delete&id={$row['customerid']}">{$lng['panel']['delete']}</a></td>
|
<td class="field_name">{$unlock_link}<a href="$filename?s=$s&page=$page&action=edit&id={$row['customerid']}">{$lng['panel']['edit']}</a><br /><a href="$filename?s=$s&page=$page&action=delete&id={$row['customerid']}">{$lng['panel']['delete']}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user