#375 Collect and display webspace quota usage

This commit is contained in:
Ulrich Block 2014-04-12 15:40:14 +02:00
parent e6f7bd50e5
commit 54deedb7fb
15 changed files with 105 additions and 12 deletions

View File

@ -14,6 +14,7 @@
<ftpPasswordRepeat>FTP Passwort wiederholen</ftpPasswordRepeat>
<ftpPort>FTP Port</ftpPort>
<hdd>Speicherplatz</hdd>
<hddUsage>Belegter Speicherplatz</hddUsage>
<help_blocksize>Bei den meisten Systemen beträgt die Block Größe 4096. D.h. ein Block enthält 4096 Byte an Daten.</help_blocksize>
<help_fdl_attention>Achtung! Es wird empfohlen, dass man je Spiel einen eigenen Unterordner wie cod4, cstrike, css, etc. erstellt und den Ordner in der Config mit angibt.</help_fdl_attention>
<help_fdl_hl>Half-Life 1 (CS 1.6, TFC, DOD, etc.) und Half-Life 2 (CSS, CSGO, DODS, L4D2, TF2, etc.) basierende Server brauchen folgenden Eintrag in der server.cfg</help_fdl_hl>
@ -33,6 +34,7 @@
<quotaCmd>Quota Befehl</quotaCmd>
<quotaWarning>Achtung! Ohne Quotas kann der User unbegrenzt Dateien hochladen!</quotaWarning>
<recreate>Wiederherstellen</recreate>
<repquotaCmd>Repquota Befehl</repquotaCmd>
<serverType>Servertyp</serverType>
<usage>Belegung</usage>
<usageType>Vhostgebrauch</usageType>

View File

@ -14,6 +14,7 @@
<ftpPasswordRepeat>Repeat FTP Password</ftpPasswordRepeat>
<ftpPort>FTP Port</ftpPort>
<hdd>Diskspace</hdd>
<hddUsage>Used Diskspace</hddUsage>
<help_blocksize>Most filesystems are configured with a blocksize of 4096. This means one block contains 4096 Byte data.</help_blocksize>
<help_fdl_attention>Warning! Recommended method is to create a subfolder for each game. Naming could be like cod4, cstrike, css, etc.</help_fdl_attention>
<help_fdl_hl>Half-Life 1 (CS 1.6, TFC, DOD, etc.) and Half-Life 2 (CSS, CSGO, DODS, L4D2, TF2, etc.) based servers need entries like this at the server.cfg</help_fdl_hl>
@ -33,6 +34,7 @@
<quotaCmd>Quota Command</quotaCmd>
<quotaWarning>Warning! Whithout Quotas user can upload data until the disk is full!</quotaWarning>
<recreate>Recreate</recreate>
<repquotaCmd>Repquota Command</repquotaCmd>
<serverType>Servertype</serverType>
<usage>Usage</usage>
<usageType>Vhost Usage</usageType>

View File

@ -50,7 +50,7 @@ if (isset($argv)) {
$args = array();
foreach ($argv as $a) {
if ($a == 'gs' or $a == 'vs' or $a == 'my') {
if ($a == 'gs' or $a == 'vs' or $a == 'vh' or $a == 'my') {
$checkTypeOfServer = $a;
} else if (is_numeric($a)) {
$sleep = $a;
@ -74,6 +74,7 @@ include(EASYWIDIR . '/stuff/methods/functions_ssh_exec.php');
include(EASYWIDIR . '/stuff/methods/class_ts3.php');
include(EASYWIDIR . '/third_party/gameq/GameQ.php');
include(EASYWIDIR . '/stuff/methods/class_mysql.php');
include(EASYWIDIR . '/stuff/methods/class_httpd.php');
include(EASYWIDIR . '/stuff/keyphrasefile.php');
set_time_limit($timelimit);
@ -86,6 +87,8 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
if (isset($checkTypeOfServer)) {
if ($checkTypeOfServer == 'gs') {
print 'Checking Gameserver' . "\r\n";
} else if ($checkTypeOfServer == 'vh') {
print 'Checking Web Quotas' . "\r\n";
} else if ($checkTypeOfServer == 'vs') {
print 'Checking Voiceserver' . "\r\n";
} else {
@ -93,7 +96,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
}
} else {
$checkTypeOfServer='all';
print 'Checking Gameserver and Voiceserver' . "\r\n";
print 'Checking Gameserver, Voiceserver MySQL DB sizes and Web Quotas' . "\r\n";
}
$dayAndHour=date('Y-m-d H:').'00:00';
@ -1139,6 +1142,20 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
}
}
flush();
# Web Quotas
if ($checkTypeOfServer == 'all' or $checkTypeOfServer == 'vh') {
$query = $sql->prepare("SELECT `webMasterID`,`resellerID` FROM `webMaster` WHERE `active`='Y'");
$query->execute();
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$httpd = new HttpdManagement($row['webMasterID'], $row['resellerID']);
$httpd->ssh2Connect();
$httpd->checkQuotaUsage();
}
}
$query = $sql->prepare("UPDATE `settings` SET `lastCronStatus`=UNIX_TIMESTAMP()");
$query->execute();

View File

@ -107,6 +107,7 @@ $maxHDD = ($ui->id('maxHDD', 10, 'post')) ? $ui->id('maxHDD', 10, 'post') : 1000
$defaultdns = strtolower($ui->domain('defaultdns', 'post'));
$quotaActive = ($ui->active('quotaActive', 'post')) ? $ui->active('quotaActive', 'post') : 'N';
$quotaCmd = ($ui->startparameter('quotaCmd', 'post')) ? $ui->startparameter('quotaCmd', 'post') : 'sudo /usr/sbin/setquota %cmd%';
$repquotaCmd = ($ui->startparameter('repquotaCmd', 'post')) ? $ui->startparameter('repquotaCmd', 'post') : 'sudo /usr/sbin/repquota %cmd%';
$blocksize = ($ui->id('blocksize', 10, 'post')) ? $ui->id('blocksize', 10, 'post') : 4096;
$inodeBlockRatio = ($ui->id('inodeBlockRatio', 10, 'post')) ? $ui->id('inodeBlockRatio', 10, 'post') : 4;
$httpdCmd = ($ui->startparameter('httpdCmd', 'post')) ? $ui->startparameter('httpdCmd', 'post') : $defaultRestartCMD;
@ -212,6 +213,7 @@ if ($ui->w('action',4, 'post') and !token(true)) {
$defaultdns = $row['defaultdns'];
$quotaActive = $row['quotaActive'];
$quotaCmd = $row['quotaCmd'];
$repquotaCmd = $row['repquotaCmd'];
$usageType = $row['usageType'];
$blocksize = $row['blocksize'];
$inodeBlockRatio = $row['inodeBlockRatio'];
@ -305,8 +307,8 @@ if ($ui->w('action',4, 'post') and !token(true)) {
// 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 `webMaster` (`externalID`,`active`,`ip`,`port`,`user`,`pass`,`publickey`,`keyname`,`ftpIP`,`ftpPort`,`maxVhost`,`maxHDD`,`defaultdns`,`httpdCmd`,`serverType`,`dirHttpd`,`dirLogs`,`vhostStoragePath`,`vhostConfigPath`,`vhostTemplate`,`quotaActive`,`quotaCmd`,`description`,`userGroup`,`userAddCmd`,`userModCmd`,`userDelCmd`,`usageType`,`blocksize`,`inodeBlockRatio`,`resellerID`) VALUES (:externalID,:active,:ip,:port,AES_ENCRYPT(:user,:aeskey),AES_ENCRYPT(:pass,:aeskey),:publickey,:keyname,:ftpIP,:ftpPort,:maxVhost,:maxHDD,:defaultdns,:httpdCmd,:serverType,:dirHttpd,:dirLogs,:vhostStoragePath,:vhostConfigPath,:vhostTemplate,:quotaActive,:quotaCmd,:description,:userGroup,:userAddCmd,:userModCmd,:userDelCmd,:usageType,:blocksize,:inodeBlockRatio,:resellerID)");
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':resellerID' => $resellerLockupID));
$query = $sql->prepare("INSERT INTO `webMaster` (`externalID`,`active`,`ip`,`port`,`user`,`pass`,`publickey`,`keyname`,`ftpIP`,`ftpPort`,`maxVhost`,`maxHDD`,`defaultdns`,`httpdCmd`,`serverType`,`dirHttpd`,`dirLogs`,`vhostStoragePath`,`vhostConfigPath`,`vhostTemplate`,`quotaActive`,`quotaCmd`,`repquotaCmd`,`description`,`userGroup`,`userAddCmd`,`userModCmd`,`userDelCmd`,`usageType`,`blocksize`,`inodeBlockRatio`,`resellerID`) VALUES (:externalID,:active,:ip,:port,AES_ENCRYPT(:user,:aeskey),AES_ENCRYPT(:pass,:aeskey),:publickey,:keyname,:ftpIP,:ftpPort,:maxVhost,:maxHDD,:defaultdns,:httpdCmd,:serverType,:dirHttpd,:dirLogs,:vhostStoragePath,:vhostConfigPath,:vhostTemplate,:quotaActive,:quotaCmd,:repquotaCmd,:description,:userGroup,:userAddCmd,:userModCmd,:userDelCmd,:usageType,:blocksize,:inodeBlockRatio,:resellerID)");
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':repquotaCmd' => $repquotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':resellerID' => $resellerLockupID));
$rowCount = $query->rowCount();
$loguseraction = '%add% %webmaster% ' . $ip;
@ -334,8 +336,8 @@ if ($ui->w('action',4, 'post') and !token(true)) {
$query->execute(array($active, $id, $resellerLockupID));
}
$query = $sql->prepare("UPDATE `webMaster` SET `externalID`=:externalID,`active`=:active,`ip`=:ip,`port`=:port,`user`=AES_ENCRYPT(:user,:aeskey),`pass`=AES_ENCRYPT(:pass,:aeskey),`publickey`=:publickey,`keyname`=:keyname,`ftpIP`=:ftpIP,`ftpPort`=:ftpPort,`maxVhost`=:maxVhost,`maxHDD`=:maxHDD,`defaultdns`=:defaultdns,`httpdCmd`=:httpdCmd,`serverType`=:serverType,`dirHttpd`=:dirHttpd,`dirLogs`=:dirLogs,`vhostStoragePath`=:vhostStoragePath,`vhostConfigPath`=:vhostConfigPath,`vhostTemplate`=:vhostTemplate,`quotaActive`=:quotaActive,`quotaCmd`=:quotaCmd,`description`=:description,`userGroup`=:userGroup,`userAddCmd`=:userAddCmd,`userModCmd`=:userModCmd,`userDelCmd`=:userDelCmd,`usageType`=:usageType,`blocksize`=:blocksize,`inodeBlockRatio`=:inodeBlockRatio WHERE `webMasterID`=:id AND `resellerID`=:resellerID LIMIT 1");
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':id' => $id, ':resellerID' => $resellerLockupID));
$query = $sql->prepare("UPDATE `webMaster` SET `externalID`=:externalID,`active`=:active,`ip`=:ip,`port`=:port,`user`=AES_ENCRYPT(:user,:aeskey),`pass`=AES_ENCRYPT(:pass,:aeskey),`publickey`=:publickey,`keyname`=:keyname,`ftpIP`=:ftpIP,`ftpPort`=:ftpPort,`maxVhost`=:maxVhost,`maxHDD`=:maxHDD,`defaultdns`=:defaultdns,`httpdCmd`=:httpdCmd,`serverType`=:serverType,`dirHttpd`=:dirHttpd,`dirLogs`=:dirLogs,`vhostStoragePath`=:vhostStoragePath,`vhostConfigPath`=:vhostConfigPath,`vhostTemplate`=:vhostTemplate,`quotaActive`=:quotaActive,`quotaCmd`=:quotaCmd,`repquotaCmd`=:repquotaCmd,`description`=:description,`userGroup`=:userGroup,`userAddCmd`=:userAddCmd,`userModCmd`=:userModCmd,`userDelCmd`=:userDelCmd,`usageType`=:usageType,`blocksize`=:blocksize,`inodeBlockRatio`=:inodeBlockRatio WHERE `webMasterID`=:id AND `resellerID`=:resellerID LIMIT 1");
$query->execute(array(':externalID' => $externalID, ':active' => $active, ':ip' => $ip, ':port' => $port, ':aeskey' => $aeskey, ':user' => $user, ':pass' => $pass, ':publickey' => $publickey, ':keyname' => $keyname, ':ftpIP' => $ftpIP, ':ftpPort' => $ftpPort, ':maxVhost' => $maxVhost, ':maxHDD' => $maxHDD, ':defaultdns' => $defaultdns, ':httpdCmd' => $httpdCmd, ':serverType' => $serverType, ':dirHttpd' => $dirHttpd, ':dirLogs' => $dirLogs, ':vhostStoragePath' => $vhostStoragePath, ':vhostConfigPath' => $vhostConfigPath, ':vhostTemplate' => $vhostTemplate, ':quotaActive' => $quotaActive, ':quotaCmd' => $quotaCmd, ':repquotaCmd' => $repquotaCmd, ':description' => $description, ':userGroup' => $userGroup, ':userAddCmd' => $userAddCmd, ':userModCmd' => $userModCmd, ':userDelCmd' => $userDelCmd, ':usageType' => $usageType, ':blocksize' => $blocksize, ':inodeBlockRatio' => $inodeBlockRatio, ':id' => $id, ':resellerID' => $resellerLockupID));
$rowCount = $query->rowCount();
$loguseraction = '%mod% %webmaster% ' . $ip;
@ -473,24 +475,26 @@ if ($ui->w('action',4, 'post') and !token(true)) {
}
$query = $sql->prepare("SELECT `active`,`webMasterID`,`ip`,`maxVhost`,`maxHDD`,`description` FROM `webMaster` WHERE `resellerID`=? ORDER BY " . $orderby);
$query2 = $sql->prepare("SELECT `webVhostID`,`active`,`dns`,`hdd` FROM `webVhost` WHERE `webMasterID`=? AND `resellerID`=?");
$query2 = $sql->prepare("SELECT `webVhostID`,`active`,`dns`,`hdd`,`hddUsage` FROM `webVhost` WHERE `webMasterID`=? AND `resellerID`=?");
$query->execute(array($resellerLockupID));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$table2 = array();
$hddSum = 0;
$hddUsage = 0;
$vhostCount = 0;
$query2->execute(array($row['webMasterID'], $resellerLockupID));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$hddSum += $row2['hdd'];
$hddUsage += $row2['hddUsage'];
$vhostCount++;
$table2[] = array('id' => $row2['webVhostID'], 'active' => $row2['active'], 'dns' => $row2['dns']);
}
$table[] = array('id' => $row['webMasterID'], 'active' => $row['active'], 'ip' => $row['ip'], 'description' => $row['description'], 'dns' => $table2, 'maxHDD' => $hddSum . '/' . $row['maxHDD'], 'maxVhost' => $vhostCount . '/' . $row['maxVhost']);
$table[] = array('id' => $row['webMasterID'], 'active' => $row['active'], 'ip' => $row['ip'], 'description' => $row['description'], 'dns' => $table2, 'hddUsage' => $hddUsage, 'maxHDD' => $hddSum . '/' . $row['maxHDD'], 'maxVhost' => $vhostCount . '/' . $row['maxVhost']);
}

View File

@ -157,6 +157,7 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
// Vhost data
$active = $row['active'];
$hdd = $row['hdd'];
$hddUsage = (int) $row['hddUsage'];
$dns = $row['dns'];
$ftpPassword = $row['decryptedFTPPass'];
$ownVhost = $row['ownVhost'];
@ -531,7 +532,7 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
$active = 'N';
}
$table[] = array('id' => $row['webVhostID'], 'active' => $row['active'], 'dns' => $row['dns'], 'hdd' => $row['hdd'], 'jobPending' => $jobPending, 'userID' => $row['userID'], 'cname' => $row['cname']);
$table[] = array('id' => $row['webVhostID'], 'active' => $row['active'], 'dns' => $row['dns'], 'hdd' => $row['hdd'], 'hddUsage' => $row['hddUsage'], 'jobPending' => $jobPending, 'userID' => $row['userID'], 'cname' => $row['cname']);
}
$pageamount = ceil($colcount / $amount);

View File

@ -98,6 +98,7 @@ class HttpdManagement {
if ($row['quotaActive'] == 'Y') {
$this->hostData['quotaCmd'] = $row['quotaCmd'];
$this->hostData['repquotaCmd'] = $row['repquotaCmd'];
}
@ -325,6 +326,45 @@ class HttpdManagement {
$cmd = 'r() {' . $this->hostData['httpdCmd'] . ' > /dev/null 2>&1; }; r&';
$this->ssh2Object->exec($cmd);
}
}
public function checkQuotaUsage () {
if ($this->ssh2Object != false and isset($this->hostData['repquotaCmd']) and strlen($this->hostData['repquotaCmd']) > 0) {
$cmd = 'for USER in `' . str_replace('%cmd%', '' ,$this->hostData['repquotaCmd']) . '-u / | grep \'web\' | awk \'{print $1":"$6}\'`; do USERS="$USERS;$USER"; done; echo $USERS';
$return = $this->ssh2Object->exec($cmd);
$splitIntoHosts = preg_split('/;/', $return, -1, PREG_SPLIT_NO_EMPTY);
$query = $this->sql->prepare("UPDATE `webVhost` SET `hddUsage`=? WHERE `webVhostID`=? LIMIT 1");
foreach ($splitIntoHosts as $ftpUser) {
unset($user, $usage, $webVhostID);
@list($user, $usage) = explode(':', $ftpUser);
@list($prefix, $webVhostID) = explode('-', $user);
if (isset($usage) and isset($webVhostID)) {
$usage = (int) $usage;
$webVhostID = (int) $webVhostID;
$query->execute(array($usage, $webVhostID));
if ($query->rowCount() > 0) {
print "Found and updated webhost with FTP user {$user}, webVhostID {$webVhostID} and a usage of {$usage} MB\r\n";
} else {
print "Cannot find or no update for webhost with FTP user {$user}, webVhostID {$webVhostID} which has a usage of {$usage} MB\r\n";
}
}
}
} else {
print "No SSH Connection or quota not allowed\r\n";
}
}
}

View File

@ -231,6 +231,7 @@ $query = "CREATE TABLE IF NOT EXISTS `webMaster` (
`dirLogs` text,
`quotaActive` enum('Y','N') DEFAULT 'Y',
`quotaCmd` varchar(255),
`repquotaCmd` varchar(255),
`blocksize` int(10) unsigned DEFAULT 4096,
`inodeBlockRatio` int(10) unsigned DEFAULT 4,
`userAddCmd` varchar(255),
@ -252,6 +253,7 @@ $query = "CREATE TABLE IF NOT EXISTS `webVhost` (
`active` enum('Y','N') DEFAULT 'Y',
`jobPending` enum('Y','N') DEFAULT 'N',
`hdd` int(10) unsigned DEFAULT 0,
`hddUsage` int(10) unsigned DEFAULT 0,
`dns` varchar(255),
`ftpUser` varchar(255),
`ftpPassword` blob,

View File

@ -277,6 +277,7 @@ $defined['webMaster'] = array(
'dirLogs' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
'quotaActive' => array("Type"=>"enum('Y','N')","Null"=>"YES","Key"=>"","Default"=>"Y","Extra"=>""),
'quotaCmd' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
'repquotaCmd' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
'blocksize' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"","Default"=>"4096","Extra"=>""),
'inodeBlockRatio' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"","Default"=>"4","Extra"=>""),
'userAddCmd' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
@ -295,6 +296,7 @@ $defined['webVhost'] = array(
'active' => array("Type"=>"enum('Y','N')","Null"=>"YES","Key"=>"","Default"=>"Y","Extra"=>""),
'jobPending' => array("Type"=>"enum('Y','N')","Null"=>"YES","Key"=>"","Default"=>"N","Extra"=>""),
'hdd' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"","Default"=>"0","Extra"=>""),
'hddUsage' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"","Default"=>"0","Extra"=>""),
'dns' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
'ftpUser' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
'ftpPassword' => array("Type"=>"blob","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),

View File

@ -177,11 +177,11 @@ set sv_wwwDownload "1"';
$table = array();
$query = $sql->prepare("SELECT v.`webVhostID`,v.`dns`,v.`hdd`,v.`ftpUser`,AES_DECRYPT(v.`ftpPassword`,?) AS `decryptedFTPPass`,m.`ip`,m.`ftpIP`,m.`ftpPort`,m.`quotaActive`,m.`usageType` FROM `webVhost` AS v INNER JOIN `webMaster` AS m ON m.`webMasterID`=v.`webMasterID` WHERE v.`userID`=? AND v.`resellerID`=? AND v.`active`='Y'");
$query = $sql->prepare("SELECT v.`webVhostID`,v.`dns`,v.`hdd`,v.`hddUsage`,v.`ftpUser`,AES_DECRYPT(v.`ftpPassword`,?) AS `decryptedFTPPass`,m.`ip`,m.`ftpIP`,m.`ftpPort`,m.`quotaActive`,m.`usageType` FROM `webVhost` AS v INNER JOIN `webMaster` AS m ON m.`webMasterID`=v.`webMasterID` WHERE v.`userID`=? AND v.`resellerID`=? AND v.`active`='Y'");
$query->execute(array($aeskey, $user_id, $reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
if (!isset($_SESSION['sID']) or in_array($row['webVhostID'], $substituteAccess['ws'])) {
$table[] = array('id' => $row['webVhostID'], 'dns' => $row['dns'], 'hdd' => $row['hdd'], 'quotaActive' => $row['quotaActive'], 'ftpIP' => (isip($row['ftpIP'], 'ip4')) ? $row['ftpIP'] : $row['ip'], 'ftpPort' => $row['ftpPort'], 'ftpUser' => $row['ftpUser'], 'ftpPass' => $row['decryptedFTPPass'], 'usageType' => $row['usageType']);
$table[] = array('id' => $row['webVhostID'], 'dns' => $row['dns'], 'hdd' => $row['hdd'], 'hddUsage' => $row['hddUsage'], 'quotaActive' => $row['quotaActive'], 'ftpIP' => (isip($row['ftpIP'], 'ip4')) ? $row['ftpIP'] : $row['ip'], 'ftpPort' => $row['ftpPort'], 'ftpUser' => $row['ftpUser'], 'ftpPass' => $row['decryptedFTPPass'], 'usageType' => $row['usageType']);
}
}

View File

@ -169,6 +169,10 @@
<label class="control-label" for="inputQuotaCmd"><?php echo $sprache->quotaCmd;?></label>
<div class="controls"><input id="inputQuotaCmd" class="span11" type="text" name="quotaCmd" value="<?php echo $quotaCmd;?>"></div>
</div>
<div class="Y switch2 control-group<?php if($quotaActive=='N') echo ' display_none';?>">
<label class="control-label" for="inputRepuotaCmd"><?php echo $sprache->repquotaCmd;?></label>
<div class="controls"><input id="inputRepuotaCmd" class="span11" type="text" name="repquotaCmd" value="<?php echo $repquotaCmd;?>"></div>
</div>
<div class="Y switch2 control-group<?php if($quotaActive=='N') echo ' display_none';?>">
<label class="control-label" for="inputBlocksize"><?php echo $sprache->blocksize;?></label>
<div class="controls"><input id="inputBlocksize" class="span11" type="number" name="blocksize" value="<?php echo $blocksize;?>"><span class="help-block alert alert-info"><?php echo $sprache->help_blocksize;?></span></div>

View File

@ -22,6 +22,7 @@
<th data-hide="phone"><a href="admin.php?w=wm&amp;o=<?php if ($o=='di') { echo 'ai'; } else { echo 'di'; } ?>">ID</a></th>
<th data-hide="phone"><a href="admin.php?w=wm&amp;o=<?php if ($o=='ad') { echo 'dd'; } else { echo 'ad'; } ?>"><?php echo $dedicatedLanguage->description;?></a></th>
<th data-hide="phone,tablet"><?php echo $sprache->installedVhost;?></th>
<th data-hide="phone,tablet"><?php echo $sprache->hddUsage;?></th>
<th data-hide="phone,tablet"><?php echo $sprache->installedHDD;?></th>
<th><?php echo $sprache->recreate;?></th>
<th><?php echo $gsprache->del;?></th>
@ -63,6 +64,7 @@
<td><?php echo $table_row['id'];?></td>
<td><?php echo $table_row['description'];?></td>
<td><?php echo $table_row['maxVhost'];?></td>
<td><?php echo $table_row['hddUsage'];?> MB</td>
<td><?php echo $table_row['maxHDD'];?> MB</td>
<td><a href="admin.php?w=wm&amp;d=ri&amp;id=<?php echo $table_row['id'];?>" ><span class="btn btn-mini btn-warning"><i class="fa fa-refresh"></i></span></a></td>
<td><a href="admin.php?w=wm&amp;d=dl&amp;id=<?php echo $table_row['id'];?>" ><span class="btn btn-mini btn-danger"><i class="fa fa-trash-o"></i></span></a></td>

View File

@ -170,6 +170,10 @@
<label class="control-label" for="inputQuotaCmd"><?php echo $sprache->quotaCmd;?></label>
<div class="controls"><input id="inputQuotaCmd" class="span11" type="text" name="quotaCmd" value="<?php echo $quotaCmd;?>"></div>
</div>
<div class="Y switch2 control-group<?php if($quotaActive=='N') echo ' display_none';?>">
<label class="control-label" for="inputRepuotaCmd"><?php echo $sprache->repquotaCmd;?></label>
<div class="controls"><input id="inputRepuotaCmd" class="span11" type="text" name="repquotaCmd" value="<?php echo $repquotaCmd;?>"></div>
</div>
<div class="Y switch2 control-group<?php if($quotaActive=='N') echo ' display_none';?>">
<label class="control-label" for="inputBlocksize"><?php echo $sprache->blocksize;?></label>
<div class="controls"><input id="inputBlocksize" class="span11" type="number" name="blocksize" value="<?php echo $blocksize;?>"><span class="help-block alert alert-info"><?php echo $sprache->help_blocksize;?></span></div>

View File

@ -33,6 +33,7 @@
<th data-hide="phone,tablet"><a href="admin.php?w=wv&amp;a=<?php echo $amount;?>&amp;p=<?php echo $start;?>&amp;o=<?php if ($o=='ai') { echo 'di'; } else { echo 'ai'; } ?>">ID</a></th>
<th data-hide="phone,tablet"><a href="admin.php?w=wv&amp;a=<?php echo $amount;?>&amp;p=<?php echo $start;?>&amp;o=<?php if ($o=='as') { echo 'ds'; } else { echo 'as'; } ?>"><?php echo $gsprache->status;?></a></th>
<th data-hide="phone,tablet"><a href="admin.php?w=wv&amp;a=<?php echo $amount;?>&amp;p=<?php echo $start;?>&amp;o=<?php if ($o=='ac') { echo 'dc'; } else { echo 'ac'; } ?>"><?php echo $dedicatedLanguage->user;?></a></th>
<th data-hide="phone,tablet"><?php echo $sprache->hddUsage;?></th>
<th data-hide="phone,tablet"><?php echo $gsprache->jobPending;?></th>
<th><?php echo $dedicatedLanguage->reinstall;?></th>
<th><?php echo $gsprache->del;?></th>
@ -46,6 +47,7 @@
<td><?php echo $table_row['id'];?></td>
<td><i class="<?php if($table_row['active']=='Y') echo 'fa fa-check'; else echo 'fa fa-ban';?>"></i></td>
<td><?php if(isid($table_row['userID'], 10)) { ?><a href="switch.php?id=<?php echo $table_row['userID'];?>"><?php echo $table_row['cname'];?></a><?php }?></td>
<td><?php echo $table_row['hddUsage'];?> MB</td>
<td><?php echo $table_row['jobPending'];?></td>
<td><a href="admin.php?w=wv&amp;d=ri&amp;id=<?php echo $table_row['id'];?>" ><span class="btn btn-mini btn-warning"><i class="fa fa-refresh"></i></span></a></td>
<td><a href="admin.php?w=wv&amp;d=dl&amp;id=<?php echo $table_row['id'];?>" ><span class="btn btn-mini btn-danger"><i class="fa fa-trash-o"></i></span></a></td>

View File

@ -31,6 +31,15 @@
</dl>
</div>
</div>
<div class="control-group">
<label class="control-label lead" for="displayServerInfo"><b><?php echo $gsprache->webspace;?></b></label>
<div class="controls">
<dl id="displayVhostInfo">
<dt><?php echo $sprache->hddUsage;?></dt>
<dd><?php echo $hddUsage.'/'.$hdd;?> MB</dd>
</dl>
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputFtpPassword"><?php echo $sprache->ftpPassword;?></label>
<div class="controls"><input id="inputFtpPassword" class="span11" type="text" name="ftpPassword" value="<?php echo $ftpPassword;?>" required></div>
@ -48,7 +57,7 @@
<div class="control-group<?php if(isset($errors['hdd'])) echo ' error';?>">
<label class="control-label" for="inputHDD"><?php echo $sprache->hdd;?></label>
<div class="controls">
<div class="input-append span12">
<div class="input-append span11">
<input id="inputHDD" class="span11" type="number" name="hdd" value="<?php echo $hdd;?>">
<span class="add-on">MB</span>
</div>

View File

@ -21,6 +21,8 @@
<div class="row-fluid">
<dl class="dl-horizontal">
<?php if($table_row['quotaActive']=='Y'){ ;?>
<dt><?php echo $sprache->usage;?></dt>
<dd><?php echo $table_row['hddUsage'];?>MB</dd>
<dt><?php echo $sprache->hdd;?></dt>
<dd><?php echo $table_row['hdd'];?>MB</dd>
<?php }?>