File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
server/lib/classes/cron.d Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ public function render() {
322322 // Maintenance mode - show message when people try to log in and also when people are forcedly logged off
323323 if ($ maintenance_mode_error != '' ) $ error = '<strong> ' .$ maintenance_mode_error .'</strong><br><br> ' .$ error ;
324324 if ($ error != '' ){
325- $ error = '<div class="box box_error"><h1>Error</h1> ' .$ error .'</div> ' ;
325+ $ error = '<div class="box box_error"> ' .$ error .'</div> ' ;
326326 }
327327
328328 $ app ->load ('getconf ' );
@@ -335,6 +335,8 @@ public function render() {
335335 }
336336
337337 $ app ->tpl ->setVar ('error ' , $ error );
338+ $ app ->tpl ->setVar ('error_txt ' , $ app ->lng ('error_txt ' ));
339+ $ app ->tpl ->setVar ('login_txt ' , $ app ->lng ('login_txt ' ));
338340 $ app ->tpl ->setVar ('pw_lost_txt ' , $ app ->lng ('pw_lost_txt ' ));
339341 $ app ->tpl ->setVar ('username_txt ' , $ app ->lng ('username_txt ' ));
340342 $ app ->tpl ->setVar ('password_txt ' , $ app ->lng ('password_txt ' ));
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ <h1><tmpl_var name="login_txt"></h1>
99 < div id ="OKMsg "> < p > < tmpl _var name ="msg "> </ p > </ div >
1010 </ tmpl _if>
1111 < tmpl _if name ="error ">
12- < div id ="errorMsg "> < h3 > ERROR </ h3 > < ol > < li > < tmpl _var name ="error "> </ li > </ ol > < br /> < a href ="# " data-load-content ="login/password_reset.php "> {tmpl_var name='pw_lost_txt'}</ a > </ div >
12+ < div id ="errorMsg "> < h3 > {tmpl_var name='error_txt'} </ h3 > < ol > < li > < tmpl _var name ="error "> </ li > </ ol > < br /> < a href ="# " data-load-content ="login/password_reset.php "> {tmpl_var name='pw_lost_txt'}</ a > </ div >
1313 </ tmpl _if>
1414
1515 < div class ="pnl_formsarea ">
16- < legend > {tmpl_var name='login_txt'}Login </ legend >
16+ < legend > {tmpl_var name='login_txt'}</ legend >
1717 < div class ="form-group ">
1818 < label for ="username " class ="col-sm-3 control-label "> {tmpl_var name='username_txt'}</ label >
1919 < div class ="col-sm-9 "> < input type ="text " name ="username " id ="username " value ="" class ="form-control " onkeypress ="if (event.keyCode && event.keyCode == 13) {ISPConfig.submitLoginForm('pageForm'); return false;}; " /> </ div > </ div >
Original file line number Diff line number Diff line change @@ -363,6 +363,27 @@ public function onRunJob() {
363363 }
364364 }
365365 }
366+
367+ // delete files from backup download dir (/var/www/example.com/backup)
368+ unset($ records , $ entry , $ files );
369+ $ sql = "SELECT * FROM web_domain WHERE server_id = ? AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND active = 'y' " ;
370+ $ records = $ app ->db ->queryAllRecords ($ sql , $ conf ['server_id ' ]);
371+ if (is_array ($ records )) {
372+ foreach ($ records as $ rec ) {
373+ $ backup_download_dir = $ rec ['document_root ' ].'/backup ' ;
374+ if (is_dir ($ backup_download_dir )){
375+ $ dir_handle = dir ($ backup_download_dir );
376+ $ files = array ();
377+ while (false !== ($ entry = $ dir_handle ->read ())) {
378+ if ($ entry != '. ' && $ entry != '.. ' && is_file ($ backup_download_dir .'/ ' .$ entry )) {
379+ // delete files older than 3 days
380+ if (time () - filemtime ($ backup_download_dir .'/ ' .$ entry ) >= 60 *60 *24 *3 ) @unlink ($ backup_download_dir .'/ ' .$ entry );
381+ }
382+ }
383+ $ dir_handle ->close ();
384+ }
385+ }
386+ }
366387
367388 parent ::onRunJob ();
368389 }
You can’t perform that action at this time.
0 commit comments