more integration of domain deactivated flag
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1892,8 +1892,8 @@ class Domains extends ApiCommand implements ResourceEntity
|
||||
if ($deactivated != $result['deactivated']) {
|
||||
// deactivate email accounts
|
||||
$yesno = ($deactivated ? 'N' : 'Y');
|
||||
$pop3 = ($deactivated ? '0' : (int)$result['pop3']);
|
||||
$imap = ($deactivated ? '0' : (int)$result['imap']);
|
||||
$pop3 = ($deactivated ? '0' : (int)$customer['pop3']);
|
||||
$imap = ($deactivated ? '0' : (int)$customer['imap']);
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_MAIL_USERS . "`
|
||||
|
||||
@@ -95,9 +95,13 @@ class EmailAccounts extends ApiCommand implements ResourceEntity
|
||||
$customer = $this->getCustomerData('email_accounts');
|
||||
|
||||
// check for imap||pop3 == 1, see #1298
|
||||
// d00p, 6.5.2023 @revert this - if a customer has resources which allow email accounts
|
||||
// it implicitly allowed SMTP, e.g. sending of emails which also requires an account to exist
|
||||
/*
|
||||
if ($customer['imap'] != '1' && $customer['pop3'] != '1') {
|
||||
Response::standardError('notallowedtouseaccounts', '', true);
|
||||
}
|
||||
*/
|
||||
|
||||
if (!empty($emailaddr)) {
|
||||
$idna_convert = new IdnaWrapper();
|
||||
|
||||
@@ -60,18 +60,18 @@ class Style
|
||||
$today = time();
|
||||
$termination_css = 'bg-warning';
|
||||
if ($cdate < $today) {
|
||||
$termination_css = 'bg-danger';
|
||||
$termination_css = 'bg-danger text-light';
|
||||
}
|
||||
}
|
||||
$deactivated = $attributes['fields']['deactivated'] || $attributes['fields']['customer_deactivated'];
|
||||
return $deactivated ? 'bg-info' : $termination_css;
|
||||
return $deactivated ? 'bg-info text-light' : $termination_css;
|
||||
}
|
||||
|
||||
public static function resultCustomerLockedOrDeactivated(array $attributes): string
|
||||
{
|
||||
$row_css = '';
|
||||
if ((int)$attributes['fields']['deactivated'] == 1) {
|
||||
$row_css = 'bg-info';
|
||||
$row_css = 'bg-info text-light';
|
||||
} elseif (
|
||||
$attributes['fields']['loginfail_count'] >= Settings::Get('login.maxloginattempts')
|
||||
&& $attributes['fields']['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))
|
||||
|
||||
@@ -186,7 +186,7 @@ return [
|
||||
'url' => 'admin_customers.php?page=customers',
|
||||
'label' => lng('admin.customers'),
|
||||
'required_resources' => 'customers',
|
||||
'add_shortlink' => CurrentUser::canAddResource('customers') ? 'admin_customers.php?page=customers&action=add' : null,
|
||||
'add_shortlink' => CurrentUser::isAdmin() && CurrentUser::canAddResource('customers') ? 'admin_customers.php?page=customers&action=add' : null,
|
||||
],
|
||||
[
|
||||
'url' => 'admin_admins.php?page=admins',
|
||||
@@ -198,7 +198,7 @@ return [
|
||||
'url' => 'admin_domains.php?page=domains',
|
||||
'label' => lng('admin.domains'),
|
||||
'required_resources' => 'domains',
|
||||
'add_shortlink' => CurrentUser::canAddResource('domains') ? 'admin_domains.php?page=domains&action=add' : null,
|
||||
'add_shortlink' => CurrentUser::isAdmin() && CurrentUser::canAddResource('domains') ? 'admin_domains.php?page=domains&action=add' : null,
|
||||
],
|
||||
[
|
||||
'url' => 'admin_domains.php?page=sslcertificates',
|
||||
|
||||
Reference in New Issue
Block a user