Skip to content
Snippets Groups Projects
Commit cd50a4c3 authored by Marius Burkard's avatar Marius Burkard
Browse files

- don't change admin count in security check on failed query

parent c795dfd6
No related branches found
No related tags found
Loading
...@@ -53,18 +53,20 @@ if($security_config['warn_new_admin'] == 'yes') { ...@@ -53,18 +53,20 @@ if($security_config['warn_new_admin'] == 'yes') {
$data_file = $data_dir.'/admincount'; $data_file = $data_dir.'/admincount';
//get number of admins //get number of admins
$tmp = $app->db->queryOneRecord("SELECT count(userid) AS number FROM sys_user WHERE typ = 'admin'"); $tmp = $app->db->queryOneRecord("SELECT count(userid) AS number FROM sys_user WHERE typ = 'admin'");
$admin_user_count_new = intval($tmp['number']); if($tmp) {
$admin_user_count_new = intval($tmp['number']);
if(is_file($data_file)) {
$admin_user_count_old = intval(file_get_contents($data_file)); if(is_file($data_file)) {
if($admin_user_count_new != $admin_user_count_old) { $admin_user_count_old = intval(file_get_contents($data_file));
$alert .= "The number of ISPConfig administrator users has changed. Old: $admin_user_count_old New: $admin_user_count_new \n"; if($admin_user_count_new != $admin_user_count_old) {
$alert .= "The number of ISPConfig administrator users has changed. Old: $admin_user_count_old New: $admin_user_count_new \n";
file_put_contents($data_file,$admin_user_count_new);
}
} else {
// first run, so we save the current count
file_put_contents($data_file,$admin_user_count_new); file_put_contents($data_file,$admin_user_count_new);
chmod($data_file,0700);
} }
} else {
// first run, so we save the current count
file_put_contents($data_file,$admin_user_count_new);
chmod($data_file,0700);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment