예제 #1
0
     translator_add($option, $task);
     break;
 case 'save_lang_apply':
 case 'save_lang':
 case 'edit_lang':
     translator_edit($option, $task);
     break;
 case 'del_lang':
 case 'lang':
     translator($option);
     break;
 case 'refresh':
     generateBackuprefresh($cid, $option, $_REQUEST['backup']);
     break;
 case 'generate':
     generateBackup($cid, $option);
     break;
 case 'confirm':
     confirmBackup($option);
     break;
 case 'download':
     downloadBackup($_REQUEST[file]);
     break;
 case 'cron':
     HTML_cloner::Cron();
     break;
 case 'about':
 case 'credits':
     showHelp($option);
     break;
 case 'restore':
예제 #2
0
    $alltables = full_query("SHOW TABLES");
    while ($table = mysql_fetch_assoc($alltables)) {
        foreach ($table as $db => $tablename) {
            full_query("OPTIMIZE TABLE '" . $tablename . "'");
        }
    }
    infoBox($aInt->lang("system", "optcomplete"), $aInt->lang("system", "optcompleteinfo"));
}
if ($dlbackup) {
    check_token("WHMCS.admin.default");
    $db_name = "";
    require ROOTDIR . "/configuration.php";
    set_time_limit(0);
    header("Content-type: application/octet-stream");
    header("Content-disposition: attachment; filename=" . $db_name . "_backup_" . date("Ymd_His") . ".zip");
    echo generateBackup();
}
ob_start();
echo $infobox;
echo "\n<table width=760 align=center cellspacing=0 cellpadding=0><tr><td width=380 valign=top>\n\n<table bgcolor=#cccccc cellspacing=1 width=370 align=center>\n<tr style=\"text-align:center;font-weight:bold;background-color:#efefef\"><td>";
echo $aInt->lang("fields", "name");
echo "</td><td>";
echo $aInt->lang("fields", "rows");
echo "</td><td>";
echo $aInt->lang("fields", "size");
echo "</td></tr>\n";
$query = "SHOW TABLE STATUS";
$result = full_query($query);
$i = 0;
while ($data = mysql_fetch_array($result)) {
    $name = $data['Name'];
예제 #3
0
    $_REQUEST[dbbackup] = 0;
    logxx("Creating a files only backup");
    $msg = 'file backup';
}
if ($_CONFIG['cron_btype'] == 2) {
    $_REQUEST[dbbackup] = 1;
    #for ($i=0, $n=count($excludedFolders); $i < $n; $i++) {
    $_CONFIG['cron_exclude'] = $_CONFIG['backup_path'];
    $GLOBALS['_CONFIG'] = $_CONFIG;
    $_REQUEST[cron_dbonly] = 1;
    #}
    logxx("Creating an sql only backup");
    $msg = "database backup";
}
logxx("Generating Backup ...");
$file = generateBackup($excludedFolders, 'nohtml');
logxx("Backup Done");
$source_file = $clonerPath . "/" . $file;
logxx("Backup file: " . $source_file);
$bsize = getFileSizeText(filesize($source_file));
if ($_CONFIG['cron_send'] == 1) {
    ######################################STARTING FTP TRANSFER##################
    $source_files[] = $source_file;
    $destination_files[] = $_CONFIG[cron_ftp_path] . "/" . $file;
    // set up basic connection details
    list($fhost, $fport) = explode(":", $_CONFIG[cron_ftp_server]);
    if ($fport == "") {
        $fport = '21';
    }
    $ftp_timeout = '3600';
    logxx("Starting ftp transfer:");
예제 #4
0
파일: cron.php 프로젝트: billyprice1/whmcs
        update_query("tblclients", array("status" => "Active"), array("id" => $userid));
    }
    $cron->logActivity("Done", true);
}
$query = "UPDATE tbldomains SET status='Expired' WHERE expirydate<'" . date("Y-m-d") . "' AND expirydate!='00000000' AND status='Active'";
$result = full_query($query);
$cron->logActivity("Completed");
$cron->emailReport();
run_hook("DailyCronJob", array());
$cron->log("Cron Job Hooks Run...");
if ($cron->isScheduled("backups")) {
    $backupdata = $db_name = "";
    require ROOTDIR . "/configuration.php";
    if ($CONFIG['DailyEmailBackup'] || $CONFIG['FTPBackupHostname']) {
        $cron->logActivity("Starting Backup Generation");
        $backupdata = generateBackup();
        $cron->logActivity("Backup Generation Completed");
    }
    if ($CONFIG['DailyEmailBackup']) {
        $whmcs->load_class("phpmailer");
        $mail = new PHPMailer();
        $mail->From = $CONFIG['SystemEmailsFromEmail'];
        $mail->FromName = html_entity_decode($CONFIG['SystemEmailsFromName'], ENT_QUOTES);
        $mail->Subject = "WHMCS Database Backup";
        if ($CONFIG['MailType'] == "mail") {
            $mail->Mailer = "mail";
        } else {
            if ($CONFIG['MailType'] == "smtp") {
                $mail->IsSMTP();
                $mail->Host = $CONFIG['SMTPHost'];
                $mail->Port = $CONFIG['SMTPPort'];