Пример #1
0
    $logsubuser = $admin_id;
} else {
    if (isset($subuser_id)) {
        $logsubuser = $subuser_id;
    } else {
        $logsubuser = 0;
    }
}
if ($ui->st('d', 'get') == 'ud' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['gs']))) {
    $id = (int) $ui->id('id', 10, 'get');
    $query = $sql->prepare("SELECT g.`rootID`,g.`masterfdl`,g.`mfdldata`,g.`serverip`,g.`port`,u.`fdlpath` FROM `gsswitch` AS g INNER JOIN `userdata` AS u ON g.`userid`=u.`id` WHERE g.`active`='Y' AND g.`id`=? AND g.`resellerid`=? LIMIT 1");
    $query->execute(array($id, $resellerLockupID));
    while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
        $appServer = new AppServer($row['rootID']);
        $appServer->getAppServerDetails($id);
        $appServer->fastDLSync($row['masterfdl'] == 'Y' ? $row['fdlpath'] : $row['mfdldata']);
        $appServer->execute();
        $template_file = $sprache->fdlstarted;
        if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
            $template_file .= '<br><pre>' . implode("\r\n", $appServer->debug()) . '</pre>';
        }
        $loguseraction = '%start% %fastdl% ' . $row['serverip'] . ':' . $row['port'];
        $insertlog->execute();
    }
} else {
    if ($ui->st('d', 'get') == 'es' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['gs']))) {
        $errors = array();
        $id = (int) $ui->id('id', 10, 'get');
        $masterfdl = $ui->active('masterfdl', 'post');
        if (!$ui->smallletters('action', 2, 'post')) {
            $query = $sql->prepare("SELECT `serverip`,`port`,`mfdldata`,`masterfdl` FROM `gsswitch` WHERE `active`='Y' AND `id`=? AND `resellerid`=? LIMIT 1");