File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 5353 $ data_file = $ data_dir .'/admincount ' ;
5454 //get number of admins
5555 $ tmp = $ app ->db ->queryOneRecord ("SELECT count(userid) AS number FROM sys_user WHERE typ = 'admin' " );
56- $ admin_user_count_new = intval ($ tmp ['number ' ]);
57-
58- if (is_file ($ data_file )) {
59- $ admin_user_count_old = intval (file_get_contents ($ data_file ));
60- if ($ admin_user_count_new != $ admin_user_count_old ) {
61- $ alert .= "The number of ISPConfig administrator users has changed. Old: $ admin_user_count_old New: $ admin_user_count_new \n" ;
56+ if ($ tmp ) {
57+ $ admin_user_count_new = intval ($ tmp ['number ' ]);
58+
59+ if (is_file ($ data_file )) {
60+ $ admin_user_count_old = intval (file_get_contents ($ data_file ));
61+ if ($ admin_user_count_new != $ admin_user_count_old ) {
62+ $ alert .= "The number of ISPConfig administrator users has changed. Old: $ admin_user_count_old New: $ admin_user_count_new \n" ;
63+ file_put_contents ($ data_file ,$ admin_user_count_new );
64+ }
65+ } else {
66+ // first run, so we save the current count
6267 file_put_contents ($ data_file ,$ admin_user_count_new );
68+ chmod ($ data_file ,0700 );
6369 }
64- } else {
65- // first run, so we save the current count
66- file_put_contents ($ data_file ,$ admin_user_count_new );
67- chmod ($ data_file ,0700 );
6870 }
6971}
7072
You can’t perform that action at this time.
0 commit comments