示例#1
0
         } else {
             $template_file = 'userpanel_404.tpl';
         }
     }
 } else {
     if (isset($webMasterID, $dns) and $ui->st('d', 'get') == 'ri' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['ws']))) {
         $id = $ui->id('id', 10, 'get');
         // Nothing submitted yet, display the delete form
         if (!$ui->st('action', 'post')) {
             // Check if we could find an entry and if not display 404 page
             $template_file = 'userpanel_web_vhost_ri.tpl';
             // User submitted remove the entry
         } else {
             if ($ui->st('action', 'post') == 'ri') {
                 $vhostObject = new HttpdManagement($webMasterID, $reseller_id);
                 if ($vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect()) {
                     $vhostObject->vhostReinstall($id);
                     $vhostObject->restartHttpdServer();
                     $template_file = $spracheResponse->table_del;
                     $loguseraction = '%ri% %webvhost% ' . $dns;
                     $insertlog->execute();
                 } else {
                     $template_file = $spracheResponse->error_table;
                 }
                 // Request did not add up. Display 404 error.
             } else {
                 $template_file = 'userpanel_404.tpl';
             }
         }
     } else {
         if (isset($dns) and $ui->st('d', 'get') == 'if' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['ws']))) {
示例#2
0
 *
 * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
 * Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
 */
$query = $sql->prepare("SELECT `hostID`,`resellerID` FROM `jobs` WHERE (`status` IS NULL OR `status`='1') AND `type`='wv' GROUP BY `hostID`");
$query2 = $sql->prepare("SELECT * FROM `jobs` WHERE (`status` IS NULL OR `status`='1') AND `type`='wv' AND `hostID`=?");
$query3 = $sql->prepare("DELETE FROM `webVhost` WHERE `webVhostID`=? LIMIT 1");
$query4 = $sql->prepare("SELECT `active` FROM `webVhost` WHERE `webVhostID`=? LIMIT 1");
$query5 = $sql->prepare("UPDATE `jobs` SET `status`='3' WHERE `jobID`=? LIMIT 1");
$query6 = $sql->prepare("UPDATE `webVhost` SET `jobPending`='N' WHERE `webVhostID`=? LIMIT 1");
$query7 = $sql->prepare("UPDATE `jobs` SET `status`='1' WHERE (`status` IS NULL OR `status`='1') AND `type`='wv' AND `hostID`=?");
$query8 = $sql->prepare("UPDATE `jobs` SET `action`='dl' WHERE `hostID`=? AND `type`='wv'");
$query->execute();
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
    $vhostObject = new HttpdManagement($row['hostID'], $row['resellerID']);
    if ($vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect() or $vhostObject->masterNotfound) {
        if ($vhostObject->masterNotfound) {
            $query8->execute(array($row['hostID']));
        }
        $query2->execute(array($row['hostID']));
        while ($row2 = $query2->fetch(PDO::FETCH_ASSOC)) {
            $extraData = @json_decode($row2['extraData']);
            if ($row2['action'] == 'dl') {
                if (!$vhostObject->masterNotfound) {
                    $vhostObject->vhostDelete($row2['affectedID']);
                }
                $query3->execute(array($row2['affectedID']));
            } else {
                if ($row2['action'] == 'ad') {
                    $vhostObject->vhostCreate($row2['affectedID']);
                } else {