implemented new Setting-class, refs #1325
Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
@@ -35,7 +35,7 @@ if($page == 'overview') {
|
||||
$fields = array(
|
||||
'd.domain' => $lng['domains']['domainname']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_DOMAINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
|
||||
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
|
||||
@@ -118,7 +118,7 @@ if($page == 'overview') {
|
||||
foreach ($domain_sort_array as $sortkey => $domain_array) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($domain_array[$sortkey]);
|
||||
if($settings['system']['awstats_enabled'] == '1') {
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$statsapp = 'awstats';
|
||||
} else {
|
||||
$statsapp = 'webalizer';
|
||||
@@ -138,7 +138,7 @@ if($page == 'overview') {
|
||||
|
||||
// get ssl-ips if activated
|
||||
$show_ssledit = false;
|
||||
if ($settings['system']['use_ssl'] == '1' && domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1') {
|
||||
if (Settings::Get('system.use_ssl') == '1' && domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1') {
|
||||
$show_ssledit = true;
|
||||
}
|
||||
$row = htmlentities_array($row);
|
||||
@@ -195,7 +195,7 @@ if($page == 'overview') {
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
ask_yesno('domains_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['domain']));
|
||||
}
|
||||
@@ -205,7 +205,7 @@ if($page == 'overview') {
|
||||
} elseif ($action == 'add') {
|
||||
if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$subdomain = $idna_convert->encode(preg_replace(Array('/\:(\d)+$/', '/^https?\:\/\//'), '', validate($_POST['subdomain'], 'subdomain', '', 'subdomainiswrong')));
|
||||
$subdomain = $idna_convert->encode(preg_replace(array('/\:(\d)+$/', '/^https?\:\/\//'), '', validate($_POST['subdomain'], 'subdomain', '', 'subdomainiswrong')));
|
||||
$domain = $idna_convert->encode($_POST['domain']);
|
||||
$domain_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `domain` = :domain
|
||||
@@ -257,7 +257,7 @@ if($page == 'overview') {
|
||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($idna_convert->encode($path))) {
|
||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if((($path == '') || ($path == '/')) && $settings['system']['documentroot_use_default_value'] == 1) {
|
||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $completedomain);
|
||||
} else {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
@@ -344,7 +344,7 @@ if($page == 'overview') {
|
||||
|
||||
if ($_doredirect) {
|
||||
$did = Database::lastInsertId();
|
||||
$redirect = isset($_POST['redirectcode']) ? (int)$_POST['redirectcode'] : $settings['customredirect']['default'];
|
||||
$redirect = isset($_POST['redirectcode']) ? (int)$_POST['redirectcode'] : Settings::Get('customredirect.default');
|
||||
addRedirectToDomain($did, $redirect);
|
||||
}
|
||||
|
||||
@@ -401,10 +401,10 @@ if($page == 'overview') {
|
||||
}
|
||||
|
||||
$redirectcode = '';
|
||||
if($settings['customredirect']['enabled'] == '1') {
|
||||
if (Settings::Get('customredirect.enabled') == '1') {
|
||||
$codes = getRedirectCodesArray();
|
||||
foreach ($codes as $rc) {
|
||||
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id'], $settings['customredirect']['default']);
|
||||
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ if($page == 'overview') {
|
||||
}
|
||||
|
||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
|
||||
$subdomain_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/domains/formfield.domains_add.php';
|
||||
$subdomain_add_form = htmlform::genHTMLForm($subdomain_add_data);
|
||||
@@ -460,7 +460,7 @@ if($page == 'overview') {
|
||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($idna_convert->encode($path))) {
|
||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if((($path == '') || ($path == '/')) && $settings['system']['documentroot_use_default_value'] == 1) {
|
||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $result['domain']);
|
||||
} else {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
@@ -579,7 +579,7 @@ if($page == 'overview') {
|
||||
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$result['domain'] = $idna_convert->decode($result['domain']);
|
||||
@@ -606,20 +606,20 @@ if($page == 'overview') {
|
||||
}
|
||||
|
||||
if (preg_match('/^https?\:\/\//', $result['documentroot']) && validateUrl($idna_convert->encode($result['documentroot']))) {
|
||||
if($settings['panel']['pathedit'] == 'Dropdown') {
|
||||
if (Settings::Get('panel.pathedit') == 'Dropdown') {
|
||||
$urlvalue = $result['documentroot'];
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
} else {
|
||||
$urlvalue = '';
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot'], true);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $result['documentroot'], true);
|
||||
}
|
||||
} else {
|
||||
$urlvalue = '';
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot']);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $result['documentroot']);
|
||||
}
|
||||
|
||||
$redirectcode = '';
|
||||
if($settings['customredirect']['enabled'] == '1') {
|
||||
if (Settings::Get('customredirect.enabled') == '1') {
|
||||
$def_code = getDomainRedirectId($id);
|
||||
$codes = getRedirectCodesArray();
|
||||
foreach ($codes as $rc) {
|
||||
|
||||
@@ -37,7 +37,7 @@ if ($page == 'overview') {
|
||||
'm.email_full' => $lng['emails']['emailaddress'],
|
||||
'm.destination' => $lng['emails']['forwarders']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_MAIL_VIRTUAL, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_MAIL_VIRTUAL, $fields);
|
||||
$result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m`
|
||||
LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`)
|
||||
LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`)
|
||||
@@ -106,7 +106,7 @@ if ($page == 'overview') {
|
||||
$row['destination'] = substr($row['destination'], 0, 32) . '... (' . $destinations_count . ')';
|
||||
}
|
||||
|
||||
$row['mboxsize'] = size_readable($row['mboxsize'], 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$row['mboxsize'] = size_readable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int)Settings::Get('panel.decimal_places') . 'f %s');
|
||||
|
||||
$row = htmlentities_array($row);
|
||||
eval("\$accounts.=\"" . getTemplate("email/emails_email") . "\";");
|
||||
@@ -143,7 +143,7 @@ if ($page == 'overview') {
|
||||
|
||||
if ($result['popaccountid'] != 0) {
|
||||
// Free the Quota used by the email account
|
||||
if ($settings['system']['mail_quota_enabled'] == 1) {
|
||||
if (Settings::Get('system.mail_quota_enabled') == 1) {
|
||||
$stmt = Database::prepare("SELECT `quota` FROM `" . TABLE_MAIL_USERS . "`
|
||||
WHERE `customerid`= :customerid
|
||||
AND `id`= :id"
|
||||
@@ -286,7 +286,7 @@ if ($page == 'overview') {
|
||||
|
||||
$email_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_add.php';
|
||||
|
||||
if ($settings['catchall']['catchall_enabled'] != '1') {
|
||||
if (Settings::Get('catchall.catchall_enabled') != '1') {
|
||||
unset($email_add_data['emails_add']['sections']['section_a']['fields']['iscatchall']);
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ if ($page == 'overview') {
|
||||
|
||||
$email_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_edit.php';
|
||||
|
||||
if ( $settings['catchall']['catchall_enabled'] != '1' ) {
|
||||
if (Settings::Get('catchall.catchall_enabled') != '1') {
|
||||
unset($email_edit_data['emails_edit']['sections']['section_a']['fields']['mail_catchall']);
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ if ($page == 'overview') {
|
||||
eval("echo \"" . getTemplate("email/emails_edit") . "\";");
|
||||
}
|
||||
} elseif ($action == 'togglecatchall' && $id != 0) {
|
||||
if ( $settings['catchall']['catchall_enabled'] == '1' ) {
|
||||
if (Settings::Get('catchall.catchall_enabled') == '1') {
|
||||
$stmt = Database::prepare("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid`, `popaccountid` FROM `" . TABLE_MAIL_VIRTUAL . "`
|
||||
WHERE `customerid`= :cid
|
||||
AND `id`= :id"
|
||||
@@ -427,13 +427,13 @@ if ($page == 'overview') {
|
||||
$password = validate($_POST['email_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
|
||||
if ($settings['panel']['sendalternativemail'] == 1) {
|
||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
||||
$alternative_email = $idna_convert->encode(validate($_POST['alternative_email'], 'alternative_email'));
|
||||
} else {
|
||||
$alternative_email = '';
|
||||
}
|
||||
|
||||
if ($settings['system']['mail_quota_enabled'] == 1) {
|
||||
if (Settings::Get('system.mail_quota_enabled') == 1) {
|
||||
if ($userinfo['email_quota'] != '-1' && ($quota == 0 || ($quota + $userinfo['email_quota_used']) > $userinfo['email_quota'])) {
|
||||
standard_error('allocatetoomuchquota', $quota);
|
||||
}
|
||||
@@ -444,7 +444,7 @@ if ($page == 'overview') {
|
||||
if ($email_full == '') {
|
||||
standard_error(array('stringisempty', 'emailadd'));
|
||||
}
|
||||
elseif ($password == '' && !($settings['panel']['sendalternativemail'] == 1 && validateEmail($alternative_email))) {
|
||||
elseif ($password == '' && !(Settings::Get('panel.sendalternativemail') == 1 && validateEmail($alternative_email))) {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
} else {
|
||||
if ($password == '') {
|
||||
@@ -455,30 +455,30 @@ if ($page == 'overview') {
|
||||
|
||||
$email_user=substr($email_full,0,strrpos($email_full,"@"));
|
||||
$email_domain=substr($email_full,strrpos($email_full,"@")+1);
|
||||
$maildirname=trim($settings['system']['vmail_maildirname']);
|
||||
$maildirname=trim(Settings::Get('system.vmail_maildirname'));
|
||||
// Add trailing slash to Maildir if needed
|
||||
$maildirpath=$maildirname;
|
||||
if (!empty($maildirname) and substr($maildirname,-1) != "/") $maildirpath.="/";
|
||||
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_MAIL_USERS . "`
|
||||
(`customerid`, `email`, `username`, " . ($settings['system']['mailpwcleartext'] == '1' ? '`password`, ' : '') . " `password_enc`, `homedir`, `maildir`, `uid`, `gid`, `domainid`, `postfix`, `quota`, `imap`, `pop3`) ".
|
||||
"VALUES (:cid, :email, :username, " . ($settings['system']['mailpwcleartext'] == '1' ? ":password, " : '') . ":password_enc, :homedir, :maildir, :uid, :gid, :domainid, 'y', :quota, :imap, :pop3)"
|
||||
(`customerid`, `email`, `username`, " . (Settings::Get('system.mailpwcleartext') == '1' ? '`password`, ' : '') . " `password_enc`, `homedir`, `maildir`, `uid`, `gid`, `domainid`, `postfix`, `quota`, `imap`, `pop3`) ".
|
||||
"VALUES (:cid, :email, :username, " . (Settings::Get('system.mailpwcleartext') == '1' ? ":password, " : '') . ":password_enc, :homedir, :maildir, :uid, :gid, :domainid, 'y', :quota, :imap, :pop3)"
|
||||
);
|
||||
$params = array(
|
||||
"cid" => $userinfo['customerid'],
|
||||
"email" => $email_full,
|
||||
"username" => $username,
|
||||
"password_enc" => $cryptPassword,
|
||||
"homedir" => $settings['system']['vmail_homedir'],
|
||||
"homedir" => Settings::Get('system.vmail_homedir'),
|
||||
"maildir" => $userinfo['loginname'] . '/' . $email_domain . "/" . $email_user . "/" . $maildirpath,
|
||||
"uid" => $settings['system']['vmail_uid'],
|
||||
"gid" => $settings['system']['vmail_gid'],
|
||||
"uid" => Settings::Get('system.vmail_uid'),
|
||||
"gid" => Settings::Get('system.vmail_gid'),
|
||||
"domainid" => $result['domainid'],
|
||||
"quota" => $quota,
|
||||
"imap" => $userinfo['imap'],
|
||||
"pop3" => $userinfo['pop3']
|
||||
);
|
||||
if ($settings['system']['mailpwcleartext'] == '1') { $params["password"] = $password; }
|
||||
if (Settings::Get('system.mailpwcleartext') == '1') { $params["password"] = $password; }
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$popaccountid = Database::lastInsertId();
|
||||
@@ -555,7 +555,7 @@ if ($page == 'overview') {
|
||||
|
||||
$mail->ClearAddresses();
|
||||
|
||||
if (validateEmail($alternative_email) && $settings['panel']['sendalternativemail'] == 1) {
|
||||
if (validateEmail($alternative_email) && Settings::Get('panel.sendalternativemail') == 1) {
|
||||
$stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid`= :adminid
|
||||
AND `language`= :lang
|
||||
@@ -603,7 +603,7 @@ if ($page == 'overview') {
|
||||
} else {
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = htmlentities_array($result);
|
||||
$quota = $settings['system']['mail_quota'];
|
||||
$quota = Settings::Get('system.mail_quota');
|
||||
|
||||
$account_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_addaccount.php';
|
||||
$account_add_form = htmlform::genHTMLForm($account_add_data);
|
||||
@@ -638,7 +638,7 @@ if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'");
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_MAIL_USERS . "`
|
||||
SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = :password, " : '') . "
|
||||
SET " . (Settings::Get('system.mailpwcleartext') == '1' ? "`password` = :password, " : '') . "
|
||||
`password_enc`= :password_enc
|
||||
WHERE `customerid`= :cid
|
||||
AND `id`= :id"
|
||||
@@ -648,7 +648,7 @@ if ($page == 'overview') {
|
||||
"cid" => $userinfo['customerid'],
|
||||
"id" => $result['popaccountid']
|
||||
);
|
||||
if ($settings['system']['mailpwcleartext'] == '1') { $params["password"] = $password; }
|
||||
if (Settings::Get('system.mailpwcleartext') == '1') { $params["password"] = $password; }
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||
@@ -665,7 +665,7 @@ if ($page == 'overview') {
|
||||
eval("echo \"" . getTemplate("email/account_changepw") . "\";");
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'changequota' && $settings['system']['mail_quota_enabled'] == '1' && $id != 0) {
|
||||
} elseif ($action == 'changequota' && Settings::Get('system.mail_quota_enabled') == '1' && $id != 0) {
|
||||
$stmt = Database::prepare("SELECT `v`.`id`, `v`.`email`, `v`.`email_full`, `v`.`iscatchall`, `v`.`destination`, `v`.`customerid`, `v`.`popaccountid`, `u`.`quota`
|
||||
FROM `" . TABLE_MAIL_VIRTUAL . "` `v`
|
||||
LEFT JOIN `" . TABLE_MAIL_USERS . "` `u`
|
||||
@@ -751,7 +751,7 @@ if ($page == 'overview') {
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
if ($settings['system']['mail_quota_enabled'] == '1' && $userinfo['email_quota'] != '-1') {
|
||||
if (Settings::Get('system.mail_quota_enabled') == '1' && $userinfo['email_quota'] != '-1') {
|
||||
$quota = (int)$result['quota'];
|
||||
} else {
|
||||
$quota = 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ if($page == 'overview') {
|
||||
'username' => $lng['login']['username'],
|
||||
'path' => $lng['panel']['path']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_HTPASSWDS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_HTPASSWDS, $fields);
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
|
||||
);
|
||||
@@ -83,7 +83,7 @@ if($page == 'overview') {
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
|
||||
@@ -151,10 +151,10 @@ if($page == 'overview') {
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added htpasswd for '" . $username . " (" . $path . ")'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
|
||||
$htpasswd_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htpasswd_add.php';
|
||||
$htpasswd_add_form = htmlform::genHTMLForm($htpasswd_add_data);
|
||||
@@ -214,7 +214,7 @@ if($page == 'overview') {
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
@@ -244,7 +244,7 @@ if($page == 'overview') {
|
||||
'error500path' => $lng['extras']['error500path'],
|
||||
'options_cgi' => $lng['extras']['execute_perl']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_HTACCESS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_HTACCESS, $fields);
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
|
||||
);
|
||||
@@ -298,7 +298,7 @@ if($page == 'overview') {
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid'], "id" => $id));
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
ask_yesno('extras_reallydelete_pathoptions', $filename, array('id' => $id, 'page' => $page, 'action' => $action), str_replace($userinfo['documentroot'], '', $result['path']));
|
||||
}
|
||||
@@ -367,10 +367,10 @@ if($page == 'overview') {
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added htaccess for '" . $path . "'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
|
||||
$htaccess_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htaccess_add.php';
|
||||
@@ -436,7 +436,7 @@ if($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'");
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
|
||||
|
||||
@@ -37,7 +37,7 @@ if ($page == 'overview') {
|
||||
'username' => $lng['login']['username'],
|
||||
'homedir' => $lng['panel']['path']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_FTP_USERS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_FTP_USERS, $fields);
|
||||
|
||||
$result_stmt = Database::prepare("SELECT `id`, `username`, `homedir` FROM `" . TABLE_FTP_USERS . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
|
||||
@@ -157,7 +157,7 @@ if ($page == 'overview') {
|
||||
$sendinfomail = 0;
|
||||
}
|
||||
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$ftpusername = validate($_POST['ftp_username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/');
|
||||
if ($ftpusername == '') {
|
||||
standard_error(array('stringisempty', 'username'));
|
||||
@@ -175,7 +175,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
$username = $ftpusername . "@" . $ftpdomain;
|
||||
} else {
|
||||
$username = $userinfo['loginname'] . $settings['customer']['ftpprefix'] . (intval($userinfo['ftp_lastaccountnumber']) + 1);
|
||||
$username = $userinfo['loginname'] . Settings::Get('customer.ftpprefix') . (intval($userinfo['ftp_lastaccountnumber']) + 1);
|
||||
}
|
||||
|
||||
$username_check_stmt = Database::prepare("SELECT * FROM `" . TABLE_FTP_USERS . "`
|
||||
@@ -297,12 +297,12 @@ if ($page == 'overview') {
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], '/');
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/');
|
||||
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domainlist = array();
|
||||
$domains = '';
|
||||
|
||||
@@ -397,7 +397,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
if (strpos($result['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$homedir = substr($result['homedir'], strlen($userinfo['documentroot']));
|
||||
@@ -406,9 +406,9 @@ if ($page == 'overview') {
|
||||
}
|
||||
$homedir = makeCorrectDir($homedir);
|
||||
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $homedir);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $homedir);
|
||||
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domains = '';
|
||||
|
||||
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
|
||||
@@ -24,7 +24,7 @@ if ($action == 'logout') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'logged out');
|
||||
|
||||
$params = array("customerid" => $userinfo['customerid']);
|
||||
if ($settings['session']['allow_multiple_login'] == '1') {
|
||||
if (Settings::Get('session.allow_multiple_login') == '1') {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :customerid
|
||||
AND `adminsession` = '0'
|
||||
@@ -79,10 +79,10 @@ if ($page == 'overview') {
|
||||
$yesterday = time() - (60 * 60 * 24);
|
||||
$month = date('M Y', $yesterday);
|
||||
|
||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains');
|
||||
|
||||
$services_enabled = "";
|
||||
@@ -167,7 +167,7 @@ if ($page == 'overview') {
|
||||
Database::pexecute($stmt, $params);
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
redirectTo($filename, array('s' => $s));
|
||||
}
|
||||
} else {
|
||||
eval("echo \"" . getTemplate('index/change_password') . "\";");
|
||||
@@ -191,9 +191,9 @@ if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
redirectTo($filename, array('s' => $s));
|
||||
} else {
|
||||
$default_lang = $settings['panel']['standardlanguage'];
|
||||
$default_lang = Settings::Get('panel.standardlanguage');
|
||||
if ($userinfo['def_language'] != '') {
|
||||
$default_lang = $userinfo['def_language'];
|
||||
}
|
||||
@@ -222,9 +222,9 @@ if ($page == 'overview') {
|
||||
Database::pexecute($stmt, array("theme" => $theme, "hash" => $s));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default theme to '" . $theme . "'");
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
redirectTo($filename, array('s' => $s));
|
||||
} else {
|
||||
$default_theme = $settings['panel']['default_theme'];
|
||||
$default_theme = Settings::Get('panel.default_theme');
|
||||
if ($userinfo['theme'] != '') {
|
||||
$default_theme = $userinfo['theme'];
|
||||
}
|
||||
@@ -238,14 +238,10 @@ if ($page == 'overview') {
|
||||
eval("echo \"" . getTemplate('index/change_theme') . "\";");
|
||||
}
|
||||
|
||||
} elseif ($page == 'send_error_report'
|
||||
&& $settings['system']['allow_error_report_customer'] == '1'
|
||||
) {
|
||||
} elseif ($page == 'send_error_report' && Settings::Get('system.allow_error_report_customer') == '1') {
|
||||
|
||||
// only show this if we really have an exception to report
|
||||
if (isset($_GET['errorid'])
|
||||
&& $_GET['errorid'] != ''
|
||||
) {
|
||||
if (isset($_GET['errorid']) && $_GET['errorid'] != '') {
|
||||
|
||||
$errid = $_GET['errorid'];
|
||||
// read error file
|
||||
|
||||
@@ -45,7 +45,7 @@ if ($page == 'overview') {
|
||||
'databasename' => $lng['mysql']['databasename'],
|
||||
'description' => $lng['mysql']['databasedescription']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_DATABASES, $fields);
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DATABASES . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
|
||||
);
|
||||
@@ -76,7 +76,7 @@ if ($page == 'overview') {
|
||||
);
|
||||
Database::pexecute($mbdata_stmt, array("table_schema" => $row['databasename']));
|
||||
$mbdata = $mbdata_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$row['size'] = size_readable($mbdata['MB'], 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$row['size'] = size_readable($mbdata['MB'], 'GiB', 'bi', '%01.' . (int)Settings::Get('panel.decimal_places') . 'f %s');
|
||||
eval("\$mysqls.=\"" . getTemplate('mysql/mysqls_database') . "\";");
|
||||
$count++;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ if ($page == 'overview') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// Begin root-session
|
||||
Database::needRoot(true, $result['dbserver']);
|
||||
$dbm = new DbManager($settings, $log);
|
||||
$dbm = new DbManager($log);
|
||||
$dbm->getManager()->deleteDatabase($result['databasename']);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted database '" . $result['databasename'] . "'");
|
||||
Database::needRoot(false);
|
||||
@@ -171,7 +171,7 @@ if ($page == 'overview') {
|
||||
$databasedescription = validate(trim($_POST['description']), 'description');
|
||||
|
||||
// create database, user, set permissions, etc.pp.
|
||||
$dbm = new DbManager($settings, $log);
|
||||
$dbm = new DbManager($log);
|
||||
$username = $dbm->createDatabase(
|
||||
$userinfo['loginname'],
|
||||
$password,
|
||||
@@ -199,8 +199,8 @@ if ($page == 'overview') {
|
||||
|
||||
if ($sendinfomail == 1) {
|
||||
$pma = $lng['admin']['notgiven'];
|
||||
if ($settings['panel']['phpmyadmin_url'] != '') {
|
||||
$pma = $settings['panel']['phpmyadmin_url'];
|
||||
if (Settings::Get('panel.phpmyadmin_url') != '') {
|
||||
$pma = Settings::Get('panel.phpmyadmin_url');
|
||||
}
|
||||
|
||||
Database::needRoot(true, $dbserver);
|
||||
@@ -262,7 +262,7 @@ if ($page == 'overview') {
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -309,7 +309,7 @@ if ($page == 'overview') {
|
||||
|
||||
// Begin root-session
|
||||
Database::needRoot(true);
|
||||
foreach (array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host) {
|
||||
foreach (array_map('trim', explode(',', Settings::Get('system.mysql_access_host'))) as $mysql_access_host) {
|
||||
$stmt = Database::prepare("SET PASSWORD FOR :dbname@:host = PASSWORD(:password)");
|
||||
$params = array(
|
||||
"dbname" => $result['databasename'],
|
||||
@@ -334,7 +334,7 @@ if ($page == 'overview') {
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($stmt, array("desc" => $databasedescription, "customerid" => $userinfo['customerid'], "id" => $id));
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
|
||||
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `".TABLE_PANEL_DATABASES."`");
|
||||
|
||||
@@ -48,7 +48,7 @@ if($page == 'overview') {
|
||||
'subject' => $lng['ticket']['subject'],
|
||||
'lastreplier' => $lng['ticket']['lastreplier']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_TICKETS, $fields);
|
||||
$stmt = Database::prepare('SELECT `main`.`id`, (SELECT COUNT(`sub`.`id`) FROM `' . TABLE_PANEL_TICKETS . '` `sub`
|
||||
WHERE `sub`.`answerto` = `main`.`id`) AS `ticket_answers`, `main`.`lastchange`, `main`.`subject`, `main`.`status`, `main`.`lastreplier`, `main`.`priority`
|
||||
FROM `' . TABLE_PANEL_TICKETS . '` as `main`
|
||||
@@ -106,22 +106,22 @@ if($page == 'overview') {
|
||||
$supportavailable = 0;
|
||||
$time = date("Hi", time());
|
||||
$day = date("w", time());
|
||||
$start = substr($settings['ticket']['worktime_begin'], 0, 2) . substr($settings['ticket']['worktime_begin'], 3, 2);
|
||||
$end = substr($settings['ticket']['worktime_end'], 0, 2) . substr($settings['ticket']['worktime_end'], 3, 2);
|
||||
$start = substr(Settings::Get('ticket.worktime_begin'), 0, 2) . substr(Settings::Get('ticket.worktime_begin'), 3, 2);
|
||||
$end = substr(Settings::Get('ticket.worktime_end'), 0, 2) . substr(Settings::Get('ticket.worktime_end'), 3, 2);
|
||||
|
||||
if ($time >= $start && $time <= $end) {
|
||||
$supportavailable = 1;
|
||||
}
|
||||
|
||||
if($settings['ticket']['worktime_sat'] == "0" && $day == "6") {
|
||||
if (Settings::Get('ticket.worktime_sat') == "0" && $day == "6") {
|
||||
$supportavailable = 0;
|
||||
}
|
||||
|
||||
if($settings['ticket']['worktime_sun'] == "0" && $day == "0") {
|
||||
if (Settings::Get('ticket.worktime_sun') == "0" && $day == "0") {
|
||||
$supportavailable = 0;
|
||||
}
|
||||
|
||||
if($settings['ticket']['worktime_all'] == "1") {
|
||||
if (Settings::Get('ticket.worktime_all') == "1") {
|
||||
$supportavailable = 1;
|
||||
}
|
||||
|
||||
@@ -133,8 +133,8 @@ if($page == 'overview') {
|
||||
);
|
||||
$opentickets = Database::pexecute_first($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
if($settings['ticket']['concurrently_open'] != - 1 && $settings['ticket']['concurrently_open'] != '') {
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
||||
if (Settings::Get('ticket.concurrently_open') != - 1 && Settings::Get('ticket.concurrently_open') != '') {
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => Settings::Get('ticket.concurrently_open')));
|
||||
} else {
|
||||
$notmorethanxopentickets = '';
|
||||
}
|
||||
@@ -145,7 +145,7 @@ if($page == 'overview') {
|
||||
} elseif ($action == 'new') {
|
||||
if ($userinfo['tickets_used'] < $userinfo['tickets'] || $userinfo['tickets'] == '-1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$newticket = ticket::getInstanceOf($userinfo, $settings, -1);
|
||||
$newticket = ticket::getInstanceOf($userinfo, -1);
|
||||
$newticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||
$newticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||
$newticket->Set('category', validate($_POST['category'], 'category'), true, false);
|
||||
@@ -203,9 +203,9 @@ if($page == 'overview') {
|
||||
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
||||
}
|
||||
|
||||
$priorities = makeoption($lng['ticket']['high'], '1', $settings['ticket']['default_priority']);
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2', $settings['ticket']['default_priority']);
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3', $settings['ticket']['default_priority']);
|
||||
$priorities = makeoption($lng['ticket']['high'], '1');
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2');
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3');
|
||||
$ticketsopen = 0;
|
||||
$opentickets_stmt = Database::prepare('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = :customerid
|
||||
@@ -214,10 +214,8 @@ if($page == 'overview') {
|
||||
);
|
||||
$opentickets = Database::pexecute_first($opentickets_stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
if ($settings['ticket']['concurrently_open'] != - 1
|
||||
&& $settings['ticket']['concurrently_open'] != ''
|
||||
) {
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
||||
if (Settings::Get('ticket.concurrently_open') != -1 && Settings::Get('ticket.concurrently_open') != '') {
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => Settings::Get('ticket.concurrently_open')));
|
||||
} else {
|
||||
$notmorethanxopentickets = '';
|
||||
}
|
||||
@@ -237,7 +235,7 @@ if($page == 'overview') {
|
||||
}
|
||||
} elseif ($action == 'answer' && $id != 0) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$replyticket = ticket::getInstanceOf($userinfo, $settings, -1);
|
||||
$replyticket = ticket::getInstanceOf($userinfo, -1);
|
||||
$replyticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||
$replyticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||
$replyticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
|
||||
@@ -255,7 +253,7 @@ if($page == 'overview') {
|
||||
$replyticket->Insert();
|
||||
|
||||
// Update priority if changed
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$id);
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
|
||||
if ($replyticket->Get('priority') != $mainticket->Get('priority')) {
|
||||
$mainticket->Set('priority', $replyticket->Get('priority'), true);
|
||||
@@ -267,11 +265,11 @@ if($page == 'overview') {
|
||||
$mainticket->Update();
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "answered support-ticket '" . $mainticket->Get('subject') . "'");
|
||||
$mainticket->sendMail(-1, 'new_reply_ticket_by_customer_subject', $lng['mails']['new_reply_ticket_by_customer']['subject'], 'new_reply_ticket_by_customer_mailbody', $lng['mails']['new_reply_ticket_by_customer']['mailbody']);
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$ticket_replies = '';
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$id);
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
|
||||
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
||||
|
||||
@@ -309,7 +307,7 @@ if($page == 'overview') {
|
||||
$numrows_andere = Database::num_rows();
|
||||
|
||||
while ($row2 = $andere_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$subticket = ticket::getInstanceOf($userinfo, $settings, (int)$row2['id']);
|
||||
$subticket = ticket::getInstanceOf($userinfo, (int)$row2['id']);
|
||||
$lastchange = date("d.m.Y H:i\h", $subticket->Get('lastchange'));
|
||||
|
||||
if ($subticket->Get('by') == '1') {
|
||||
@@ -341,15 +339,15 @@ if($page == 'overview') {
|
||||
} elseif ($action == 'close' && $id != 0) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$id);
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '0', true, true);
|
||||
$mainticket->Set('status', '3', true, true);
|
||||
$mainticket->Update();
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "closed support-ticket '" . $mainticket->Get('subject') . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$id);
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
ask_yesno('ticket_reallyclose', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||
}
|
||||
} elseif ($action == 'reopen' && $id != 0) {
|
||||
@@ -362,12 +360,12 @@ if($page == 'overview') {
|
||||
$opentickets = Database::pexecute_first($opentickets_stmt, array("customerid" => $userinfo['customerid']));
|
||||
$ticketsopen = (int)$opentickets['count'];
|
||||
|
||||
if($ticketsopen > $settings['ticket']['concurrently_open'] && $settings['ticket']['concurrently_open'] != - 1 && $settings['ticket']['concurrently_open'] != '') {
|
||||
standard_error('notmorethanxopentickets', $settings['ticket']['concurrently_open']);
|
||||
if ($ticketsopen > Settings::Get('ticket.concurrently_open') && Settings::Get('ticket.concurrently_open') != - 1 && Settings::Get('ticket.concurrently_open') != '') {
|
||||
standard_error('notmorethanxopentickets', Settings::Get('ticket.concurrently_open'));
|
||||
}
|
||||
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$id);
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '0', true, true);
|
||||
$mainticket->Set('status', '0', true, true);
|
||||
|
||||
@@ -79,30 +79,30 @@ if (!is_null($month) && !is_null($year)) {
|
||||
$traf['day'] = $row['day'] . '.';
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, $settings['panel']['decimal_places']) . " MiB up/ " . bcdiv($row['ftp_down'], 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MiB (Mail)";
|
||||
$traf['ftp'] = bcdiv($ftp, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['http'] = bcdiv($http, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024, $settings['panel']['decimal_places']);
|
||||
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($row['ftp_down'], 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['ftp'] = bcdiv($ftp, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['http'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024, Settings::Get('panel.decimal_places'));
|
||||
} else {
|
||||
$traf['ftptext'] = round($row['ftp_up'] / 1024, $settings['panel']['decimal_places']) . " MiB up/ " . round($row['ftp_down'] / 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MiB (Mail)";
|
||||
$traf['http'] = round($http, $settings['panel']['decimal_places']);
|
||||
$traf['ftp'] = round($ftp, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = round($mail, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = round($traf['byte'] / 1024, $settings['panel']['decimal_places']);
|
||||
$traf['ftptext'] = round($row['ftp_up'] / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($row['ftp_down'] / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['http'] = round($http, Settings::Get('panel.decimal_places'));
|
||||
$traf['ftp'] = round($ftp, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = round($mail, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = round($traf['byte'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
}
|
||||
|
||||
eval("\$traffic.=\"" . getTemplate('traffic/traffic_month') . "\";");
|
||||
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
|
||||
}
|
||||
|
||||
$traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
|
||||
eval("echo \"" . getTemplate('traffic/traffic_details') . "\";");
|
||||
} else {
|
||||
@@ -132,29 +132,29 @@ if (!is_null($month) && !is_null($year)) {
|
||||
$traf['byte'] = $http + $ftp_up + $ftp_down + $mail;
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traf['ftptext'] = bcdiv($ftp_up, 1024, $settings['panel']['decimal_places']) . " MiB up/ " . bcdiv($ftp_down, 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MiB (Mail)";
|
||||
$traf['ftp'] = bcdiv(($ftp_up + $ftp_down), 1024, $settings['panel']['decimal_places']);
|
||||
$traf['http'] = bcdiv($http, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||
$traf['ftptext'] = bcdiv($ftp_up, 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($ftp_down, 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['ftp'] = bcdiv(($ftp_up + $ftp_down), 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['http'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024 * 1024, Settings::Get('panel.decimal_places'));
|
||||
} else {
|
||||
$traf['ftptext'] = round($ftp_up / 1024, $settings['panel']['decimal_places']) . " MiB up/ " . round($ftp_down / 1024, $settings['panel']['decimal_places']) . " MiB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MiB (Mail)";
|
||||
$traf['ftp'] = round(($ftp_up + $ftp_down) / 1024, $settings['panel']['decimal_places']);
|
||||
$traf['http'] = round($http / 1024, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = round($mail / 1024, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = round($traf['byte'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$traf['ftptext'] = round($ftp_up / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($ftp_down / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['ftp'] = round(($ftp_up + $ftp_down) / 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['http'] = round($http / 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = round($mail / 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = round($traf['byte'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
}
|
||||
|
||||
eval("\$traffic.=\"" . getTemplate('traffic/traffic_traffic') . "\";");
|
||||
}
|
||||
|
||||
$traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
|
||||
eval("echo \"" . getTemplate('traffic/traffic') . "\";");
|
||||
}
|
||||
|
||||
52
index.php
52
index.php
@@ -42,8 +42,8 @@ if ($action == 'login') {
|
||||
$is_admin = false;
|
||||
} else {
|
||||
$is_admin = true;
|
||||
if ((int)$settings['login']['domain_login'] == 1) {
|
||||
$domainname = $idna_convert->encode(preg_replace(Array('/\:(\d)+$/', '/^https?\:\/\//'), '', $loginname));
|
||||
if ((int)Settings::Get('login.domain_login') == 1) {
|
||||
$domainname = $idna_convert->encode(preg_replace(array('/\:(\d)+$/', '/^https?\:\/\//'), '', $loginname));
|
||||
$stmt = Database::prepare("SELECT `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `domain` = :domain"
|
||||
);
|
||||
@@ -101,10 +101,10 @@ if ($action == 'login') {
|
||||
$adminsession = '1';
|
||||
} else {
|
||||
// Log failed login
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']), $settings);
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']));
|
||||
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "Unknown user '" . $loginname . "' tried to login.");
|
||||
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
redirectTo('index.php', array('showmessage' => '2'), true);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -115,8 +115,8 @@ if ($action == 'login') {
|
||||
Database::pexecute($userinfo_stmt, array("loginname" => $loginname));
|
||||
$userinfo = $userinfo_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($userinfo['loginfail_count'] >= $settings['login']['maxloginattempts'] && $userinfo['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])) {
|
||||
redirectTo('index.php', Array('showmessage' => '3'), true);
|
||||
if ($userinfo['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $userinfo['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) {
|
||||
redirectTo('index.php', array('showmessage' => '3'), true);
|
||||
exit;
|
||||
} elseif ($userinfo['password'] == md5($password)) {
|
||||
// login correct
|
||||
@@ -137,11 +137,11 @@ if ($action == 'login') {
|
||||
Database::pexecute($stmt, array("lastlogin_fail" => time(), "uid" => $userinfo[$uid]));
|
||||
|
||||
// Log failed login
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']), $settings);
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']));
|
||||
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to login with wrong password.");
|
||||
|
||||
unset($userinfo);
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
redirectTo('index.php', array('showmessage' => '2'), true);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -153,19 +153,19 @@ if ($action == 'login') {
|
||||
if ($language == 'profile') {
|
||||
$language = $userinfo['def_language'];
|
||||
} elseif (!isset($languages[$language])) {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
$language = Settings::Get('panel.standardlanguage');
|
||||
}
|
||||
} else {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
$language = Settings::Get('panel.standardlanguage');
|
||||
}
|
||||
|
||||
if (isset($userinfo['theme']) && $userinfo['theme'] != '') {
|
||||
$theme = $userinfo['theme'];
|
||||
} else {
|
||||
$theme = $settings['panel']['default_theme'];
|
||||
$theme = Settings::Get('panel.default_theme');
|
||||
}
|
||||
|
||||
if ($settings['session']['allow_multiple_login'] != '1') {
|
||||
if (Settings::Get('session.allow_multiple_login') != '1') {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :uid
|
||||
AND `adminsession` = :adminsession"
|
||||
@@ -209,15 +209,15 @@ if ($action == 'login') {
|
||||
|
||||
if ($userinfo['adminsession'] == '1') {
|
||||
if (hasUpdates($version)) {
|
||||
redirectTo('admin_updates.php', Array('s' => $s), true);
|
||||
redirectTo('admin_updates.php', array('s' => $s), true);
|
||||
} else {
|
||||
redirectTo('admin_index.php', Array('s' => $s), true);
|
||||
redirectTo('admin_index.php', array('s' => $s), true);
|
||||
}
|
||||
} else {
|
||||
redirectTo('customer_index.php', Array('s' => $s), true);
|
||||
redirectTo('customer_index.php', array('s' => $s), true);
|
||||
}
|
||||
} else {
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
redirectTo('index.php', array('showmessage' => '2'), true);
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
@@ -240,7 +240,7 @@ if ($action == 'login') {
|
||||
$message = $lng['error']['login'];
|
||||
break;
|
||||
case 3:
|
||||
$message = sprintf($lng['error']['login_blocked'],$settings['login']['deactivatetime']);
|
||||
$message = sprintf($lng['error']['login_blocked'], Settings::Get('login.deactivatetime'));
|
||||
break;
|
||||
case 4:
|
||||
$cmail = isset($_GET['customermail']) ? $_GET['customermail'] : 'unknown';
|
||||
@@ -299,10 +299,10 @@ if ($action == 'forgotpwd') {
|
||||
/* Check whether user is banned */
|
||||
if ($user['deactivated']) {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
redirectTo('index.php', Array('showmessage' => '5'), true);
|
||||
redirectTo('index.php', array('showmessage' => '5'), true);
|
||||
}
|
||||
|
||||
if (($adminchecked && $settings['panel']['allow_preset_admin'] == '1') || $adminchecked == false) {
|
||||
if (($adminchecked && Settings::Get('panel.allow_preset_admin') == '1') || $adminchecked == false) {
|
||||
if ($user !== false) {
|
||||
// build a activation code
|
||||
$timestamp = time();
|
||||
@@ -334,7 +334,7 @@ if ($action == 'forgotpwd') {
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $settings);
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $user['loginname'] . "' requested a link for setting a new password.");
|
||||
|
||||
// Set together our activation link
|
||||
@@ -352,7 +352,7 @@ if ($action == 'forgotpwd') {
|
||||
|
||||
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%a' => $activationlink));
|
||||
|
||||
$def_language = ($user['def_language'] != '') ? $user['def_language'] : $settings['panel']['standardlanguage'];
|
||||
$def_language = ($user['def_language'] != '') ? $user['def_language'] : Settings::Get('panel.standardlanguage');
|
||||
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
||||
WHERE `adminid`= :adminid
|
||||
AND `language`= :lang
|
||||
@@ -389,7 +389,7 @@ if ($action == 'forgotpwd') {
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $settings);
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||
redirectTo('index.php', array('showmessage' => '4', 'customermail' => $user['email']), true);
|
||||
exit;
|
||||
@@ -399,7 +399,7 @@ if ($action == 'forgotpwd') {
|
||||
redirectTo('index.php', array('showmessage' => '1'), true);
|
||||
exit;
|
||||
} else {
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $settings);
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $loginname . "' requested to set a new password, but was not found in database!");
|
||||
$message = $lng['login']['combination_not_found'];
|
||||
}
|
||||
@@ -412,12 +412,12 @@ if ($action == 'forgotpwd') {
|
||||
}
|
||||
|
||||
if ($adminchecked) {
|
||||
if ($settings['panel']['allow_preset_admin'] != '1') {
|
||||
if (Settings::Get('panel.allow_preset_admin') != '1') {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
unset ($adminchecked);
|
||||
}
|
||||
} else {
|
||||
if ($settings['panel']['allow_preset'] != '1') {
|
||||
if (Settings::Get('panel.allow_preset') != '1') {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
}
|
||||
}
|
||||
@@ -478,7 +478,7 @@ if ($action == 'resetpwd') {
|
||||
}
|
||||
Database::pexecute($stmt, array("newpassword" => md5($new_password), "userid" => $result['userid']));
|
||||
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $settings);
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(USR_ACTION, LOG_NOTICE, "changed password using password reset.");
|
||||
|
||||
// Remove activation code from DB
|
||||
|
||||
Reference in New Issue
Block a user