Marius Cramer
2015-04-15 d19abd5cf6237561faf11fcd5873d460f68ed583
- ported some patches
3 files modified
29 ■■■■ changed files
interface/web/login/index.php 4 ●●● patch | view | raw | blame | history
interface/web/login/templates/index.htm 4 ●●●● patch | view | raw | blame | history
server/lib/classes/cron.d/500-backup.inc.php 21 ●●●●● patch | view | raw | blame | history
interface/web/login/index.php
@@ -322,7 +322,7 @@
        // 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 @@
        }
        
        $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'));
interface/web/login/templates/index.htm
@@ -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>
server/lib/classes/cron.d/500-backup.inc.php
@@ -363,6 +363,27 @@
                }
            }
        }
        // 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();
    }