Exemplo n.º 1
0
 private function getImageServer()
 {
     global $sql;
     $query = $sql->prepare("SELECT `imageserver` FROM `settings` WHERE `resellerid`=? LIMIT 1");
     $query->execute(array($this->resellerID));
     $splitImageservers = preg_split('/\\r\\n/', $query->fetchColumn(), -1, PREG_SPLIT_NO_EMPTY);
     $rsyncServers = array();
     $ftpServers = array();
     foreach ($splitImageservers as $server) {
         if (isurl($server)) {
             $ftpServers[] = $server;
         } else {
             if (isRsync($server)) {
                 $rsyncServers[] = $server;
             }
         }
     }
     $preferedServer = array();
     if ($this->os == 'L' and count($rsyncServers) > 0) {
         foreach ($rsyncServers as $server) {
             $imageServer = $this->checkIfImageServerIsInSameSubnet('rsync', $server);
             if ($imageServer) {
                 $preferedServer[] = $imageServer;
             }
         }
         $imageServer = $this->getPreferdImageServer($preferedServer, $rsyncServers);
     }
     if (!isset($imageServer) and count($ftpServers) > 0) {
         foreach ($ftpServers as $server) {
             $imageServer = $this->checkIfImageServerIsInSameSubnet('ftp', $server);
             if ($imageServer) {
                 $preferedServer[] = $imageServer;
             }
         }
         $imageServer = $this->getPreferdImageServer($preferedServer, $ftpServers);
     }
     if (!isset($imageServer) or !$imageServer) {
         $imageServer = 'easywi';
     }
     if ($this->updates == 2) {
         $imageServer = 'none';
     }
     $this->imageserver = $imageServer;
 }
Exemplo n.º 2
0
     $supportnumber = $ui->description('supportnumber', 'post');
     $noservertag = $ui->id('noservertag', 1, 'post');
     $nopassword = $ui->id('nopassword', 1, 'post');
     $tohighslots = $ui->id('tohighslots', 1, 'post');
     $cronjobIPs = $ui->ips('cronjobIPs', 'post');
     $headerIcon = $ui->config('headerIcon', 'post');
     $headerText = $ui->escaped('headerText', 'post');
     $headerHref = $ui->url('headerHref', 'post');
     $template = $ui->folder('template', 'post') ? $ui->folder('template', 'post') : 'default';
     $lastCronWarnStatus = $ui->active('lastCronWarnStatus', 'post') ? $ui->active('lastCronWarnStatus', 'post') : 'Y';
     $lastCronWarnReboot = $ui->active('lastCronWarnReboot', 'post') ? $ui->active('lastCronWarnReboot', 'post') : 'Y';
     $lastCronWarnUpdates = $ui->active('lastCronWarnUpdates', 'post') ? $ui->active('lastCronWarnUpdates', 'post') : 'Y';
     $lastCronWarnJobs = $ui->active('lastCronWarnJobs', 'post') ? $ui->active('lastCronWarnJobs', 'post') : 'Y';
     $lastCronWarnCloud = $ui->active('lastCronWarnCloud', 'post') ? $ui->active('lastCronWarnCloud', 'post') : 'Y';
     foreach (preg_split('/\\r\\n/', $ui->escaped('imageserver', 'post'), -1, PREG_SPLIT_NO_EMPTY) as $imgserver) {
         if (isurl($imgserver) or isRsync($imgserver)) {
             $imageserver .= $imgserver . "\r\n";
         }
     }
     $query = $sql->prepare("UPDATE `settings` SET `header_icon`=?,`header_text`=?,`header_href`=?,`cronjob_ips`=?,`template`=?,`voice_autobackup`=?,`voice_autobackup_intervall`=?,`voice_maxbackup`=?,`language`=?,`imageserver`=?,`master`=?,`prefix1`=?,`prefix2`=?,`faillogins`=?,`brandname`=?,`timezone`=?,`supportnumber`=?,`noservertag`=?,`nopassword`=?,`tohighslots`=?,`down_checks`=?,`lastCronWarnStatus`=?,`lastCronWarnReboot`=?,`lastCronWarnUpdates`=?,`lastCronWarnJobs`=?,`lastCronWarnCloud`=? WHERE `resellerid`=? LIMIT 1");
     $query->execute(array($headerIcon, $headerText, $headerHref, $cronjobIPs, $template, $voice_autobackup, $voice_autobackup_intervall, $voice_maxbackup, $language, $imageserver, $master, $prefix1, $prefix2, $faillogins, $brandname, $timezone, $supportnumber, $noservertag, $nopassword, $tohighslots, $down_checks, $lastCronWarnStatus, $lastCronWarnReboot, $lastCronWarnUpdates, $lastCronWarnJobs, $lastCronWarnCloud, $reseller_id));
     if ($query->rowCount() > 0) {
         $loguseraction = "%mod% %settings%";
         $insertlog->execute();
         $template_file = $spracheResponse->table_add;
     } else {
         $template_file = $spracheResponse->error_table;
     }
 } else {
     $template_file = 'admin_404.tpl';
 }