} else { if ($ui->smallletters('d', 16, 'get') == 'tsdnsmasterusage' and isset($admin_id) and $pa['voiceserver']) { require_once EASYWIDIR . '/stuff/ajax/tsdns_master_usage.php'; die; } else { if (isset($admin_id) and $ui->smallletters('d', 16, 'get') == 'mysqlmasterusage' and $pa['mysql']) { if ($ui->id('id', 10, 'get')) { require_once EASYWIDIR . '/stuff/ajax/mysql_master_usage.php'; } die; } else { if (isset($admin_id) and $pa['dedicatedServer'] and $ui->smallletters('d', 7, 'get') == 'freeips' and $reseller_id == 0) { if ($ui->id('userID', 10, 'get')) { $query = $sql->prepare("SELECT `resellerid` FROM `userdata` WHERE `id`=? LIMIT 1"); $query->execute(array($ui->id('userID', 10, 'get'))); $ipsAvailable = freeips($query->fetchColumn()); } else { $ipsAvailable = array(); } require_once IncludeTemplate($template_to_use, 'ajax_admin_roots_ips.tpl', 'ajax'); die; } else { if (isset($admin_id) and $pa['fastdl'] and $ui->smallletters('d', 9, 'get') == 'webmaster' and $ui->id('id', 10, 'get')) { require_once EASYWIDIR . '/stuff/ajax/web_master_usage.php'; die; } else { if (isset($user_id) and $pa['usertickets'] and $ui->w('d', 20, 'get') == 'userTicketCategories' and $ui->id('topicName', 10, 'get')) { require_once EASYWIDIR . '/stuff/ajax/userpanel_ticket_category.php'; die; } else { if (isset($user_id) and $pa['usertickets'] and $ui->w('d', 24, 'get') == 'resellerTicketCategories' and $ui->id('topicName', 10, 'get')) {
$usedservers = $row['usedservers']; if ($usedservers > '0') { $useduserram = $row['usedram'] - $oldminram + $minram; $usedusercpu = $row['usedcpu'] - $oldminmhz * $oldcores + $minmhz * $cores; } else { $useduserram = 0 - $oldminram + $minram; $usedusercpu = 0 - $oldminmhz * $oldcores + $minmhz * $cores; } } if ($useduserram >= $maxuserram or $usedusercpu >= $maxusermhz) { $fail = 1; $template_file .= "Reseller Limits"; } } if (isip($ui->post['ip'], 'all') and isset($oldip)) { $freeips = $reseller_id == 0 ? freeips($reseller_id) : freeips($userid); $checked_ips = array(); if (isips($ui->post['ips'])) { $postedips = ipstoarray($ui->post['ips']); if (is_array($postedips)) { foreach ($postedips as $postedip) { if (in_array($postedip, $freeips)) { $checked_ips[] = $postedip; } } } foreach ($checked_ips as $checked_ip) { if (isset($ips)) { $ips .= "\r\n" . $checked_ip; } else { $ips = $checked_ip;
} $i2++; } foreach ($hdd as $mountpoint) { $freespace[$mountpoint] = $mountsize[$mountpoint] - $mountunused[$mountpoint] * ($percent / 100); } natsort($freespace); $freespace = array_reverse($freespace); foreach ($freespace as $mountpoint => $free) { $best_hdd[] = $mountpoint; } } require_once IncludeTemplate($template_to_use, 'ajax_admin_vserver_allocation.tpl', 'ajax'); } else { if ($ui->st('d', 'get') == "ui" and $ui->id('id', 19, 'get')) { foreach (freeips($ui->id('id', 19, 'get')) as $ip) { echo $ip . "<br />"; } } else { if ($ui->st('d', 'get') == "my" and $ui->id('id', 19, 'get')) { $query = $sql->prepare("SELECT s.`ip`,s.`max_databases`,COUNT(d.`id`) AS `installed` FROM `mysql_external_servers` s LEFT JOIN `mysql_external_dbs` d ON s.`id`=d.`sid` WHERE s.`id`=? AND s.`active`='Y' AND s.`resellerid`=? LIMIT 1"); $query->execute(array($ui->id('id', 19, 'get'), $reseller_id)); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $installed = $row['installed']; $max_databases = $row['max_databases']; } if (!isset($installed)) { $installed = 0; $max_databases = 0; } require_once IncludeTemplate($template_to_use, 'ajax_admin_mysql_server.tpl', 'ajax');
} else { if ($ui->st('action', 'post') == 'ad' and $ui->ip('ip', 'post')) { $query = $sql->prepare("SELECT 1 FROM `rootsDedicated` WHERE `ip`=? AND `resellerID`=? LIMIT 1"); $query->execute(array($ip, $reseller_id)); } else { if ($ui->st('action', 'post') == 'md' and $ui->ip('ip', 'post')) { $query = $sql->prepare("SELECT 1 FROM `rootsDedicated` WHERE `dedicatedID`!=? AND `ip`=? AND `resellerID`=? LIMIT 1"); $query->execute(array($id, $ip, $reseller_id)); } } if ($query->rowCount() > 0) { $errors['ip'] = $sprache->ip; } else { $query = $sql->prepare("SELECT `resellerid` FROM `userdata` WHERE `id`=? LIMIT 1"); $query->execute(array($userID)); if (!in_array($ip, freeips($query->fetchColumn()))) { $errors['ip'] = $sprache->ip; } } } if (!$ui->w('restart', 1, 'post')) { $errors['restart'] = $sprache->restart; } // Submitted values are OK if (count($errors) == 0) { // Make the inserts or updates define the log entry and get the affected rows from insert if ($ui->st('action', 'post') == 'ad') { $query = $sql->prepare("INSERT INTO `rootsDedicated` (`active`,`userID`,`description`,`ip`,`ips`,`restart`,`apiRequestType`,`apiRequestRestart`,`apiRequestStop`,`apiURL`,`https`,`mac`,`useDHCP`,`usePXE`,`externalID`,`resellerID`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $query->execute(array($active, $userID, $description, $ip, $ips, $restart, $apiRequestType, $apiRequestRestart, $apiRequestStop, $apiURL, $https, $mac, $useDHCP, $usePXE, $externalID, $reseller_id)); $rowCount = $query->rowCount(); $loguseraction = '%add% ' . $gsprache->dedicated . $ip;