Commit d19abd5c authored by Marius Cramer's avatar Marius Cramer
Browse files

- ported some patches

parent 9e5a1137
......@@ -322,7 +322,7 @@ class login_index {
// Maintenance mode - show message when people try to log in and also when people are forcedly logged off
if($maintenance_mode_error != '') $error = '<strong>'.$maintenance_mode_error.'</strong><br><br>'.$error;
if($error != ''){
$error = '<div class="box box_error"><h1>Error</h1>'.$error.'</div>';
$error = '<div class="box box_error">'.$error.'</div>';
}
$app->load('getconf');
......@@ -335,6 +335,8 @@ class login_index {
}
$app->tpl->setVar('error', $error);
$app->tpl->setVar('error_txt', $app->lng('error_txt'));
$app->tpl->setVar('login_txt', $app->lng('login_txt'));
$app->tpl->setVar('pw_lost_txt', $app->lng('pw_lost_txt'));
$app->tpl->setVar('username_txt', $app->lng('username_txt'));
$app->tpl->setVar('password_txt', $app->lng('password_txt'));
......
......@@ -9,11 +9,11 @@
<div id="OKMsg"><p><tmpl_var name="msg"></p></div>
</tmpl_if>
<tmpl_if name="error">
<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>
<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>
</tmpl_if>
<div class="pnl_formsarea">
<legend>{tmpl_var name='login_txt'}Login</legend>
<legend>{tmpl_var name='login_txt'}</legend>
<div class="form-group">
<label for="username" class="col-sm-3 control-label">{tmpl_var name='username_txt'}</label>
<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>
......
......@@ -363,6 +363,27 @@ class cronjob_backup extends cronjob {
}
}
}
// delete files from backup download dir (/var/www/example.com/backup)
unset($records, $entry, $files);
$sql = "SELECT * FROM web_domain WHERE server_id = ? AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND active = 'y'";
$records = $app->db->queryAllRecords($sql, $conf['server_id']);
if(is_array($records)) {
foreach($records as $rec) {
$backup_download_dir = $rec['document_root'].'/backup';
if(is_dir($backup_download_dir)){
$dir_handle = dir($backup_download_dir);
$files = array();
while (false !== ($entry = $dir_handle->read())) {
if($entry != '.' && $entry != '..' && is_file($backup_download_dir.'/'.$entry)) {
// delete files older than 3 days
if(time() - filemtime($backup_download_dir.'/'.$entry) >= 60*60*24*3) @unlink($backup_download_dir.'/'.$entry);
}
}
$dir_handle->close();
}
}
}
parent::onRunJob();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment