mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
#353 Add FastDL webspace modul with quotas
This commit is contained in:
parent
81c169df38
commit
69a28a7198
@ -50,6 +50,7 @@ include(EASYWIDIR . '/stuff/methods/vorlage.php');
|
||||
include(EASYWIDIR . '/stuff/methods/class_validator.php');
|
||||
include(EASYWIDIR . '/stuff/methods/functions.php');
|
||||
include(EASYWIDIR . '/stuff/settings.php');
|
||||
include(EASYWIDIR . '/stuff/keyphrasefile.php');
|
||||
|
||||
if ($ui->ip4('REMOTE_ADDR', 'server') and $ui->names('user', 255, 'post')) {
|
||||
|
||||
@ -72,7 +73,7 @@ if ($ui->ip4('REMOTE_ADDR', 'server') and $ui->names('user', 255, 'post')) {
|
||||
die('403 Forbidden: No valid access data');
|
||||
}
|
||||
|
||||
if ($ui->smallletters('type', 10, 'post') and ($ui->smallletters('type', 4, 'post') == 'user' or $ui->smallletters('type', 5, 'post') == 'voice' or $ui->smallletters('type', 7, 'post') == 'gserver' or $ui->smallletters('type', 5, 'post') == 'mysql')) {
|
||||
if (in_array($ui->smallletters('type', 10, 'post'), array('gserver', 'mysql', 'user', 'voice', 'web'))) {
|
||||
$type = $ui->smallletters('type', 7, 'post');
|
||||
}
|
||||
|
||||
@ -138,6 +139,10 @@ if (isset($resellerIDs) and count($resellerIDs)==1 and passwordhash($ui->passwor
|
||||
|
||||
include(EASYWIDIR . '/stuff/api/api_users.php');
|
||||
|
||||
} else if ($type == 'web') {
|
||||
|
||||
include(EASYWIDIR . '/stuff/api/api_web.php');
|
||||
|
||||
} else if ($type == 'voice') {
|
||||
|
||||
if ($voModule == true) {
|
||||
|
33
web/jobs.php
33
web/jobs.php
@ -39,22 +39,32 @@
|
||||
*/
|
||||
|
||||
if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$timelimit = ini_get('max_execution_time') - 10;
|
||||
|
||||
} else {
|
||||
$timelimit = 600;
|
||||
}
|
||||
|
||||
$deamon = false;
|
||||
|
||||
if (isset($argv)) {
|
||||
|
||||
$args = array();
|
||||
|
||||
foreach ($argv as $a) {
|
||||
if ($a == 'deamon') {
|
||||
$deamon = true;
|
||||
} else if (is_numeric($a)) {
|
||||
$sleep = $a;
|
||||
} else {
|
||||
$e=explode(':',$a);
|
||||
if (isset($e[1])) $args[$e[0]] = $e[1];
|
||||
|
||||
$e = explode(':', $a);
|
||||
|
||||
if (isset($e[1])) {
|
||||
$args[$e[0]] = $e[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,15 +86,17 @@ include(EASYWIDIR . '/stuff/methods/vorlage.php');
|
||||
include(EASYWIDIR . '/stuff/methods/functions.php');
|
||||
include(EASYWIDIR . '/stuff/methods/class_validator.php');
|
||||
include(EASYWIDIR . '/stuff/methods/class_rootserver.php');
|
||||
include(EASYWIDIR . '/stuff/methods/class_httpd.php');
|
||||
include(EASYWIDIR . '/stuff/settings.php');
|
||||
include(EASYWIDIR . '/stuff/methods/functions_gs.php');
|
||||
include(EASYWIDIR . '/stuff/methods/functions_ssh_exec.php');
|
||||
include(EASYWIDIR . '/stuff/methods/class_ts3.php');
|
||||
include(EASYWIDIR . '/stuff/methods/functions_ts3.php');
|
||||
include(EASYWIDIR . '/stuff/methods/mysql_functions.php');
|
||||
include(EASYWIDIR . '/stuff/methods/class_mysql.php');
|
||||
include(EASYWIDIR . '/stuff/keyphrasefile.php');
|
||||
|
||||
if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip, ipstoarray($rSA['cronjob_ips']))) {
|
||||
|
||||
$gsprache = getlanguagefile('general', 'uk', 0);
|
||||
|
||||
class runGraph {
|
||||
@ -152,11 +164,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
|
||||
$runJobs = true;
|
||||
|
||||
if (isset($ip)) {
|
||||
$newLine = "\r\n";
|
||||
} else {
|
||||
$newLine = "\r";
|
||||
}
|
||||
$newLine = (isset($ip)) ? "\r\n" : "\r";
|
||||
|
||||
$counJobs = $sql->prepare("SELECT COUNT(`jobID`) AS `jobCount` FROM `jobs` WHERE `status` IS NULL OR `status`='1'");
|
||||
while ($runJobs == true) {
|
||||
@ -176,7 +184,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
$startTime = strtotime('now');
|
||||
$theOutput = new runGraph($jobCount,$newLine);
|
||||
|
||||
# us > vo > gs > my > vs
|
||||
# us > vo > gs > my > vs > wv
|
||||
include(EASYWIDIR . '/stuff/jobs/jobs_user.php');
|
||||
$counJobs->execute();
|
||||
$jobCount = $counJobs->rowCount();
|
||||
@ -218,6 +226,13 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
$theOutput->updateCount($jobCount);
|
||||
print "\r\n" . 'Total jobs open after root server jobs are done: ' . $jobCount . "\r\n";
|
||||
|
||||
print 'Executing Fastdownload jobs' . "\r\n";
|
||||
include(EASYWIDIR . '/stuff/jobs/jobs_webspace.php');
|
||||
$counJobs->execute();
|
||||
$jobCount = $counJobs->rowCount();
|
||||
$theOutput->updateCount($jobCount);
|
||||
print "\r\n" . 'Total jobs open after Fastdownload jobs are done: ' . $jobCount . "\r\n";
|
||||
|
||||
print 'Executing user remove jobs' . "\r\n";
|
||||
include(EASYWIDIR . '/stuff/jobs/jobs_user_rm.php');
|
||||
print "\n";
|
||||
|
@ -50,9 +50,6 @@ function loadServerSettings (serverType) {
|
||||
defaultVhostTemplate += ' access_log %vhostpath%/%user%/logs/access.log;\r\n';
|
||||
defaultVhostTemplate += ' error_log %vhostpath%/%user%/logs/error.log;\r\n';
|
||||
defaultVhostTemplate += ' root %vhostpath%/%user%/htdocs/;\r\n';
|
||||
defaultVhostTemplate += ' if ($http_user_agent != "Half-Life 2") {\r\n';
|
||||
defaultVhostTemplate += ' return 403;\r\n';
|
||||
defaultVhostTemplate += ' }\r\n';
|
||||
defaultVhostTemplate += ' location / {\r\n';
|
||||
defaultVhostTemplate += ' index index.html index.htm;\r\n';
|
||||
defaultVhostTemplate += ' }\r\n';
|
||||
|
@ -23,6 +23,7 @@
|
||||
<errors>Fehler</errors>
|
||||
<exec>Ausführen</exec>
|
||||
<export>Exportieren</export>
|
||||
<externalID>Externe ID</externalID>
|
||||
<fastdownload>Fastdownload</fastdownload>
|
||||
<feeds>Feeds</feeds>
|
||||
<file>Datei</file>
|
||||
|
@ -22,6 +22,7 @@
|
||||
<edit>Rediger</edit>
|
||||
<errors></errors>
|
||||
<exec></exec>
|
||||
<externalID></externalID>
|
||||
<fastdownload>Fastdownload</fastdownload>
|
||||
<game></game>
|
||||
<gameserver>Spilserver</gameserver>
|
||||
|
@ -23,6 +23,7 @@
|
||||
<errors>Error(s)</errors>
|
||||
<exec>Execute</exec>
|
||||
<export>Export</export>
|
||||
<externalID>External ID</externalID>
|
||||
<fastdownload>Fastdownload</fastdownload>
|
||||
<feeds>Feeds</feeds>
|
||||
<file>File</file>
|
||||
|
46
web/languages/default/uk/web.xml
Normal file
46
web/languages/default/uk/web.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<sprache>
|
||||
<blocksize>Blocksize</blocksize>
|
||||
<createDirs>Folders to be created</createDirs>
|
||||
<defaultdns>Default Domain</defaultdns>
|
||||
<dns>Domain</dns>
|
||||
<error_password_not_match>FTP passwords does not match</error_password_not_match>
|
||||
<error_password_not_set>FTP password not allowed, not set, or not repeated.</error_password_not_set>
|
||||
<fdlInfo>FastDL Info</fdlInfo>
|
||||
<ftpIP>FTP Address</ftpIP>
|
||||
<ftpPassword>FTP Password</ftpPassword>
|
||||
<ftpPasswordChanged>Change FTP Password</ftpPasswordChanged>
|
||||
<ftpPasswordRepeat>Repeat FTP Password</ftpPasswordRepeat>
|
||||
<ftpPort>FTP Port</ftpPort>
|
||||
<hdd>Diskspace</hdd>
|
||||
<help_blocksize>Most filesystems are configured with a blocksize of 4096. This means one block contains 4096 Byte data.</help_blocksize>
|
||||
<help_create_dirs>Semicolon separated list. Recommended method is to create folders once at /home/yourMasterUser/skel/.</help_create_dirs>
|
||||
<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>
|
||||
<help_fdl_cod>Call of Duty Server require eintries like this at the server.cfg</help_fdl_cod>
|
||||
<help_inode_block_ratio>Most systems have a ratio of 4. This means 4 blocks have one inode.</help_inode_block_ratio>
|
||||
<help_web_master>Warning, we recommend to use the host for fast download only. Other panels and software can cause issues or can be affected by the fastdownload. Typical fastdownload behaviour is to create traffic and load spikes which will create lags on other server deamons.</help_web_master>
|
||||
<httpdCmd>HTTPD Start/Reload Command</httpdCmd>
|
||||
<inodeBlockRatio>Block/Inode Ratio</inodeBlockRatio>
|
||||
<installedHDD>Assigned HDD</installedHDD>
|
||||
<installedVhost>Installed Vhosts</installedVhost>
|
||||
<maxHDD>Existing disk space</maxHDD>
|
||||
<maxVhost>Maximum Vhosts</maxVhost>
|
||||
<optional>(optional)</optional>
|
||||
<other>Other</other>
|
||||
<ownVhost>Own Vhost Template</ownVhost>
|
||||
<quotaActive>Activate Quotas</quotaActive>
|
||||
<quotaCmd>Quota Command</quotaCmd>
|
||||
<quotaWarning>Warning! Whithout Quotas user can upload data until the disk is full!</quotaWarning>
|
||||
<recreate>Recreate</recreate>
|
||||
<serverType>Servertype</serverType>
|
||||
<usage>Usage</usage>
|
||||
<usageType>Vhost Usage</usageType>
|
||||
<userGroup>Webserver Group</userGroup>
|
||||
<userAddCmd>Useradd Command</userAddCmd>
|
||||
<userDelCmd>Userdel Command</userDelCmd>
|
||||
<userModCmd>Usermod Command</userModCmd>
|
||||
<vhostConfigPath>Vhost Config Storagepath</vhostConfigPath>
|
||||
<vhostTemplate>Vhost Template</vhostTemplate>
|
||||
<vhostStoragePath>Vhost Storagepath</vhostStoragePath>
|
||||
</sprache>
|
@ -85,7 +85,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
|
||||
$o = $ui->st('o', 'get');
|
||||
|
||||
$type = array('de' => $gsprache->dedicated, 'ds' => 'TS3 DNS', 'gs' => $gsprache->gameserver, 'fd' => $gsprache->fastdownload, 'my' => 'MySQL', 'us' => $gsprache->user, 'vo' => $gsprache->voiceserver, 'vs' => $gsprache->virtual);
|
||||
$type = array('de' => $gsprache->dedicated, 'ds' => 'TS3 DNS', 'gs' => $gsprache->gameserver, 'wv' => $gsprache->webspace, 'my' => 'MySQL', 'us' => $gsprache->user, 'vo' => $gsprache->voiceserver, 'vs' => $gsprache->virtual);
|
||||
|
||||
if ($ui->st('o', 'get') == 'dn') {
|
||||
$orderby = '`name` DESC';
|
||||
|
@ -94,6 +94,7 @@ if ($serverType == 'N') {
|
||||
|
||||
}
|
||||
|
||||
$externalID = $ui->pregw('externalID', 255, 'post');
|
||||
$publickey = ($ui->w('publickey', 1, 'post')) ? $ui->w('publickey', 1, 'post') : 'N';
|
||||
$usageType = ($ui->w('usageType', 1, 'post')) ? $ui->w('usageType', 1, 'post') : 'F';
|
||||
$keyname = $ui->startparameter('keyname', 'post');
|
||||
@ -197,8 +198,9 @@ if ($ui->w('action',4, 'post') and !token(true)) {
|
||||
} else if ($ui->st('d', 'get') == 'md' and $id) {
|
||||
|
||||
$query = $sql->prepare("SELECT *,AES_DECRYPT(`user`,:aeskey) AS `decrypteduser`,AES_DECRYPT(`pass`,:aeskey) AS `decryptedpass` FROM `webMaster` WHERE `webMasterID`=:id AND `resellerID`=:reseller_id LIMIT 1");
|
||||
$query->execute(array(':aeskey' => $aeskey,':id' => $id,':reseller_id' => $resellerLockupID));
|
||||
$query->execute(array(':aeskey' => $aeskey, ':id' => $id, ':reseller_id' => $resellerLockupID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$externalID = $row['externalID'];
|
||||
$active = $row['active'];
|
||||
$ip = $row['ip'];
|
||||
$port = $row['port'];
|
||||
@ -308,8 +310,8 @@ if ($ui->w('action',4, 'post') and !token(true)) {
|
||||
|
||||
$serverType = $row['serverType'];
|
||||
$createDirs = $row['createDirs'];
|
||||
$query = $sql->prepare("INSERT INTO `webMaster` (`active`,`ip`,`port`,`user`,`pass`,`publickey`,`keyname`,`ftpIP`,`ftpPort`,`maxVhost`,`maxHDD`,`defaultdns`,`httpdCmd`,`serverType`,`createDirs`,`vhostStoragePath`,`vhostConfigPath`,`vhostTemplate`,`quotaActive`,`quotaCmd`,`description`,`userGroup`,`userAddCmd`,`userModCmd`,`userDelCmd`,`usageType`,`blocksize`,`inodeBlockRatio`,`resellerID`) VALUES (:active,:ip,:port,AES_ENCRYPT(:user,:aeskey),AES_ENCRYPT(:pass,:aeskey),:publickey,:keyname,:ftpIP,:ftpPort,:maxVhost,:maxHDD,:defaultdns,:httpdCmd,:serverType,:createDirs,:vhostStoragePath,:vhostConfigPath,:vhostTemplate,:quotaActive,:quotaCmd,:description,:userGroup,:userAddCmd,:userModCmd,:userDelCmd,:usageType,:blocksize,:inodeBlockRatio,:resellerID)");
|
||||
$query->execute(array(':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, ':createDirs' => $createDirs,':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`,`createDirs`,`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,:createDirs,: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, ':createDirs' => $createDirs, ':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));
|
||||
|
||||
$rowCount = $query->rowCount();
|
||||
$loguseraction = '%add% %webmaster% ' . $ip;
|
||||
@ -337,8 +339,8 @@ if ($ui->w('action',4, 'post') and !token(true)) {
|
||||
$query->execute(array($active, $id, $resellerLockupID));
|
||||
}
|
||||
|
||||
$query = $sql->prepare("UPDATE `webMaster` SET `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,`createDirs`=:createDirs,`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(':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, ':createDirs' => $createDirs,':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,`createDirs`=:createDirs,`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, ':createDirs' => $createDirs, ':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));
|
||||
|
||||
$rowCount = $query->rowCount();
|
||||
$loguseraction = '%mod% %webmaster% ' . $ip;
|
||||
|
@ -408,6 +408,45 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
$template_file = 'admin_404.tpl';
|
||||
}
|
||||
|
||||
} else if (!isset($tokenError) and $ui->st('d', 'get') == 'ri' and $id) {
|
||||
|
||||
$query = $sql->prepare("SELECT `dns`,`webMasterID` FROM `webVhost` WHERE`webVhostID`=? AND `resellerID`=? LIMIT 1");
|
||||
$query->execute(array($id, $resellerLockupID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$dns = $row['dns'];
|
||||
$webMasterID = $row['webMasterID'];
|
||||
}
|
||||
|
||||
|
||||
// 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 = ($query->rowCount() > 0) ? 'admin_web_vhost_ri.tpl' : 'admin_404.tpl';
|
||||
|
||||
// User submitted remove the entry
|
||||
} else if ($ui->st('action', 'post') == 'ri') {
|
||||
|
||||
$vhostObject = new HttpdManagement($webMasterID, $resellerLockupID);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// GET Request did not add up. Display 404 error.
|
||||
} else {
|
||||
$template_file = 'admin_404.tpl';
|
||||
}
|
||||
|
||||
// List the available entries
|
||||
} else {
|
||||
|
||||
@ -460,7 +499,7 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT v.*,u.`cname` FROM `webVhost` AS v LEFT JOIN `userdata` u ON v.`userID`=u.`id` WHERE v.`resellerID`=? ORDER BY " . $orderby . " LIMIT " . $start . "," . $amount);
|
||||
$query2 = $sql->prepare("SELECT `action`,`extraData` FROM `jobs` WHERE `affectedID`=? AND `type`='fd' AND (`status` IS NULL OR `status`=1 OR `status`=4) ORDER BY `jobID` DESC LIMIT 1");
|
||||
$query2 = $sql->prepare("SELECT `action`,`extraData` FROM `jobs` WHERE `affectedID`=? AND `type`='wv' AND (`status` IS NULL OR `status`=1 OR `status`=4) ORDER BY `jobID` DESC LIMIT 1");
|
||||
|
||||
$query->execute(array($resellerLockupID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
@ -468,7 +507,7 @@ if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {
|
||||
$jobPending = $gsprache->no;
|
||||
|
||||
if ($row['jobPending'] == 'Y') {
|
||||
$query2->execute(array($row['dedicatedID']));
|
||||
$query2->execute(array($row['webVhostID']));
|
||||
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
|
||||
|
||||
if ($row2['action'] == 'ad') {
|
||||
|
426
web/stuff/api/api_web.php
Normal file
426
web/stuff/api/api_web.php
Normal file
@ -0,0 +1,426 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* File: api_web.php.
|
||||
* Author: Ulrich Block
|
||||
* Date: 22.03.14
|
||||
* Contact: <ulrich.block@easy-wi.com>
|
||||
*
|
||||
* This file is part of Easy-WI.
|
||||
*
|
||||
* Easy-WI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Easy-WI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Easy-WI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Diese Datei ist Teil von Easy-WI.
|
||||
*
|
||||
* Easy-WI ist Freie Software: Sie koennen es unter den Bedingungen
|
||||
* der GNU General Public License, wie von der Free Software Foundation,
|
||||
* Version 3 der Lizenz oder (nach Ihrer Wahl) jeder spaeteren
|
||||
* veroeffentlichten Version, weiterverbreiten und/oder modifizieren.
|
||||
*
|
||||
* Easy-WI wird in der Hoffnung, dass es nuetzlich sein wird, aber
|
||||
* OHNE JEDE GEWAEHELEISTUNG, bereitgestellt; sogar ohne die implizite
|
||||
* Gewaehrleistung der MARKTFAEHIGKEIT oder EIGNUNG FUER EINEN BESTIMMTEN ZWECK.
|
||||
* Siehe die GNU General Public License fuer weitere Details.
|
||||
*
|
||||
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
|
||||
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
$minimumArray = array('action', 'identify_server_by', 'server_local_id', 'server_external_id');
|
||||
$editArray = array('active', 'identify_user_by', 'user_localid', 'user_externalid', 'username');
|
||||
|
||||
foreach ($minimumArray as $key) {
|
||||
if (!array_key_exists($key, $data)) {
|
||||
$success['false'][] = 'Data key does not exist: ' . $key;
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('action', $data)) {
|
||||
foreach ($editArray as $key) {
|
||||
if (!array_key_exists($key, $data)) {
|
||||
$success['false'][] = 'Data key does not exist: ' . $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$active = '';
|
||||
$identifyUserBy = '';
|
||||
$localUserID = '';
|
||||
$externalUserID = '';
|
||||
$email = '';
|
||||
$username = '';
|
||||
$identifyServerBy = '';
|
||||
$localServerID = '';
|
||||
$externalServerID = '';
|
||||
$hostExternalID = '';
|
||||
$webMasterID = '';
|
||||
$password = '';
|
||||
$dns = '';
|
||||
$hdd = '';
|
||||
$ownVhost = 'N';
|
||||
|
||||
if (!isset($success['false']) and array_value_exists('action', 'add', $data)) {
|
||||
|
||||
if (dataExist('identify_user_by', $data)) {
|
||||
|
||||
$from = array('user_localid' => 'id', 'username' => 'cname', 'user_externalid' => 'externalID', 'email' => 'mail');
|
||||
|
||||
$active = active_check($data['active']);
|
||||
$identifyUserBy = $data['identify_user_by'];
|
||||
$localUserID = isid($data['user_localid'], 10);
|
||||
$externalUserID = $data['user_externalid'];
|
||||
$username = wpreg_check($data['username'], 255);
|
||||
$identifyServerBy = $data['identify_server_by'];
|
||||
$localServerID = isid($data['server_local_id'], 10);
|
||||
$hdd = isid($data['hdd'], 10);
|
||||
$externalServerID = wpreg_check($data['server_external_id'], 255);
|
||||
$ownVhost = (isset($data['ownVhost']) and active_check($data['ownVhost'])) ? $data['ownVhost'] : 'N';
|
||||
$dns = (isset($data['dns']) and isdomain($data['dns'])) ? $data['dns'] : '';
|
||||
|
||||
$query = $sql->prepare("SELECT `id`,`cname` FROM `userdata` WHERE `" . $from[$data['identify_user_by']] . "`=? AND `resellerid`=?");
|
||||
$query->execute(array($data[$data['identify_user_by']], $resellerID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$localUserLookupID = $row['id'];
|
||||
$localUserCname = $row['cname'];
|
||||
}
|
||||
|
||||
if (!isset($localUserLookupID) or !isset($localUserCname)) {
|
||||
$success['false'][] = 'user does not exist';
|
||||
}
|
||||
|
||||
if (!isset($success['false']) and !in_array($externalServerID, $bad)) {
|
||||
|
||||
$query = $sql->prepare("SELECT COUNT(`webVhostID`) AS `amount` FROM `vhostTemplate` WHERE `externalID`=? LIMIT 1");
|
||||
$query->execute(array($externalServerID));
|
||||
|
||||
if ($query->fetchColumn() > 0) {
|
||||
$success['false'][] = 'server with external ID already exists';
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($success['false'])) {
|
||||
|
||||
if (isset($data['master_server_id']) and isid($data['master_server_id'], 10)) {
|
||||
|
||||
$query = $sql->prepare("SELECT m.`webMasterID`,m.`defaultdns`,(SELECT COUNT(v.`webVhostID`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`)/(m.`maxVhost`/100) AS `percentVhostUsage`,(SELECT SUM(v.`hdd`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`)/(m.`maxHDD`/100) AS `percentHDDUsage` FROM `webMaster` AS m WHERE m.`webMasterID`=? AND m.`resellerID`=? AND m.`active`='Y' GROUP BY m.`webMasterID` HAVING (`percentVhostUsage`<100 OR `percentVhostUsage`IS NULL) AND (`percentHDDUsage`<100 OR `percentHDDUsage`IS NULL) ORDER BY `percentHDDUsage` ASC,`percentVhostUsage` ASC");
|
||||
$query->execute(array($data['master_server_id'], $resellerID));
|
||||
|
||||
} else if (isset($data['master_server_external_id']) and wpreg_check($data['master_server_external_id'], 255)) {
|
||||
|
||||
$query = $sql->prepare("SELECT m.`webMasterID`,m.`defaultdns`,(SELECT COUNT(v.`webVhostID`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`)/(m.`maxVhost`/100) AS `percentVhostUsage`,(SELECT SUM(v.`hdd`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`)/(m.`maxHDD`/100) AS `percentHDDUsage` FROM `webMaster` AS m WHERE m.`externalID`=? AND m.`resellerID`=? AND m.`active`='Y' GROUP BY m.`webMasterID` HAVING (`percentVhostUsage`<100 OR `percentVhostUsage`IS NULL) AND (`percentHDDUsage`<100 OR `percentHDDUsage`IS NULL) ORDER BY `percentHDDUsage` ASC,`percentVhostUsage` ASC");
|
||||
$query->execute(array($data['master_server_external_id'], $resellerID));
|
||||
|
||||
} else {
|
||||
|
||||
$query = $sql->prepare("SELECT m.`webMasterID`,m.`defaultdns`,(SELECT COUNT(v.`webVhostID`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`)/(m.`maxVhost`/100) AS `percentVhostUsage`,(SELECT SUM(v.`hdd`) AS `a` FROM `webVhost` AS v WHERE v.`webMasterID`=m.`webMasterID`)/(m.`maxHDD`/100) AS `percentHDDUsage` FROM `webMaster` AS m WHERE m.`active`='Y' AND m.`resellerID`=? GROUP BY m.`webMasterID` HAVING (`percentVhostUsage`<100 OR `percentVhostUsage`IS NULL) AND (`percentHDDUsage`<100 OR `percentHDDUsage`IS NULL) ORDER BY `percentHDDUsage` ASC,`percentVhostUsage` ASC LIMIT 1");
|
||||
$query->execute(array($resellerID));
|
||||
|
||||
}
|
||||
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$webMasterID = $row['webMasterID'];
|
||||
$hostExternalID = $row['externalID'];
|
||||
$defaultdns = $row['defaultdns'];
|
||||
}
|
||||
|
||||
if (!isid($webMasterID, 10)) {
|
||||
$success['false'][] = 'No free host';
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($success['false'])) {
|
||||
|
||||
$password = (isset($data['password']) and strlen($data['password']) > 0) ? $data['password'] : passwordgenerate(10);
|
||||
|
||||
$query = $sql->prepare("INSERT INTO `webVhost` (`externalID`,`webMasterID`,`userID`,`active`,`hdd`,`ftpPassword`,`ownVhost`,`vhostTemplate`,`jobPending`,`resellerID`) VALUES (?,?,?,?,?,AES_ENCRYPT(?,?),?,?,'Y',?)");
|
||||
$query->execute(array($externalServerID, $webMasterID, $localUserLookupID, $active, $hdd, $password, $aeskey, $ownVhost, $vhostTemplate, $resellerID));
|
||||
|
||||
$localServerID = (int) $sql->lastInsertId();
|
||||
|
||||
$query = $sql->prepare("SELECT `defaultdns` FROM `webMaster` WHERE `webMasterID`=? AND `resellerID`=? LIMIT 1");
|
||||
$query->execute(array($webMasterID, $resellerID));
|
||||
$defaultDns = (string) $query->fetchColumn();
|
||||
|
||||
$localUserCname .= '-' . $localServerID;
|
||||
$ftpUser = 'web-' . $localServerID;
|
||||
|
||||
if ($defaultDns == $dns or $dns == '') {
|
||||
$dns = str_replace('..', '.', $localUserCname . '.' .$defaultDns);
|
||||
}
|
||||
|
||||
$query = $sql->prepare("UPDATE `webVhost` SET `dns`=?,`ftpUser`=? WHERE `webVhostID`=? AND `resellerID`=? LIMIT 1");
|
||||
$query->execute(array($dns, $ftpUser, $localServerID, $resellerID));
|
||||
|
||||
$query = $sql->prepare("INSERT INTO `jobs` (`api`,`type`,`affectedID`,`invoicedByID`,`hostID`,`userID`,`name`,`status`,`date`,`action`,`extraData`,`resellerid`) VALUES ('A','wv',?,?,?,?,?,NULL,NOW(),'ad','',?)");
|
||||
$query->execute(array($localServerID, $resellerID, $webMasterID, $localUserLookupID, $dns, $resellerID));
|
||||
}
|
||||
}
|
||||
|
||||
} else if (!isset($success['false']) and array_value_exists('action', 'mod', $data)) {
|
||||
|
||||
$identifyServerBy = $data['identify_server_by'];
|
||||
$localServerID = isid($data['server_local_id'], 10);
|
||||
$externalServerID = $data['server_external_id'];
|
||||
|
||||
$from = array('server_local_id' => 'webVhostID', 'server_external_id' => 'externalID');
|
||||
|
||||
if (dataExist('identify_server_by', $data)) {
|
||||
|
||||
$changedCount = 0;
|
||||
|
||||
$query = $sql->prepare("SELECT * FROM `webVhost` WHERE `" . $from[$data['identify_server_by']] . "`=? AND `resellerID`=?");
|
||||
$query->execute(array($data[$data['identify_server_by']], $resellerID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
$changedCount = 1;
|
||||
|
||||
$localServerID = $row['webVhostID'];
|
||||
$localUserLookupID = $row['userID'];
|
||||
$webMasterID = $row['webMasterID'];
|
||||
$externalServerID = $row['externalID'];
|
||||
$dns = $row['dns'];
|
||||
$userID = $row['userID'];
|
||||
|
||||
$query = $sql->prepare("SELECT COUNT(`jobID`) AS `amount` FROM `jobs` WHERE `affectedID`=? AND `type`='wv' AND `action`='dl' AND (`status` IS NULL OR `status`='1') LIMIT 1");
|
||||
$query->execute(array($localServerID));
|
||||
if ($query->fetchColumn() > 0) {
|
||||
$success['false'][] = 'Server is marked for deletion';
|
||||
}
|
||||
|
||||
$updateArray = array();
|
||||
$eventualUpdate = '';
|
||||
|
||||
if (isset($data['active']) and active_check($data['active'])) {
|
||||
$updateArray[] = $data['active'];
|
||||
$eventualUpdate .= ',`active`=?';
|
||||
$active = $data['active'];
|
||||
}
|
||||
|
||||
if (isset($data['dns']) and isdomain($data['dns'])) {
|
||||
$updateArray[] = $data['dns'];
|
||||
$eventualUpdate .= ',`dns`=?';
|
||||
$dns = $data['dns'];
|
||||
}
|
||||
|
||||
if (isset($data['password']) and is_password($data['password'], 255)) {
|
||||
$updateArray[] = $data['private'];
|
||||
$updateArray[] = $aeskey;
|
||||
$eventualUpdate .= ',`ftpPassword`=AES_ENCRYPT(?,?)';
|
||||
$private = $data['password'];
|
||||
}
|
||||
|
||||
if (isset($data['hdd']) and isid($data['hdd'], 10)) {
|
||||
$updateArray[] = $data['hdd'];
|
||||
$eventualUpdate .= ',`hdd`=?';
|
||||
$hdd = $data['hdd'];
|
||||
}
|
||||
|
||||
if (isset($data['ownVhost']) and active_check($data['ownVhost'])) {
|
||||
$updateArray[] = $data['ownVhost'];
|
||||
$eventualUpdate .= ',`ownVhost`=?';
|
||||
$ownVhost = $data['ownVhost'];
|
||||
}
|
||||
|
||||
if (count($updateArray) > 0) {
|
||||
|
||||
$eventualUpdate = trim($eventualUpdate,',');
|
||||
$eventualUpdate .= ',';
|
||||
|
||||
$updateArray[] = $localServerID;
|
||||
|
||||
$query = $sql->prepare("UPDATE `webVhost` SET $eventualUpdate `jobPending`='Y' WHERE `webVhostID`=? LIMIT 1");
|
||||
$query->execute($updateArray);
|
||||
|
||||
$query = $sql->prepare("UPDATE `jobs` SET `status`='2' WHERE `type`='wv' AND (`status` IS NULL OR `status`='1') AND `affectedID`=?");
|
||||
$query->execute(array($localServerID));
|
||||
|
||||
$query = $sql->prepare("INSERT INTO `jobs` (`api`,`type`,`hostID`,`invoicedByID`,`affectedID`,`userID`,`name`,`status`,`date`,`action`,`resellerID`) VALUES ('A','wv',?,?,?,?,?,NULL,NOW(),'md',?)");
|
||||
$query->execute(array($webMasterID, $resellerID, $localServerID, $userID, $dns, $resellerID));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($changedCount == 0) {
|
||||
$success['false'][] = 'No webspace can be found with the given ID';
|
||||
}
|
||||
|
||||
} else {
|
||||
$success['false'][] = 'No data for this method';
|
||||
}
|
||||
|
||||
} else if (!isset($success['false']) and array_value_exists('action', 'del', $data)) {
|
||||
|
||||
$identifyServerBy = $data['identify_server_by'];
|
||||
$localServerID = isid($data['server_local_id'], 10);
|
||||
$externalServerID = $data['server_external_id'];
|
||||
|
||||
$from = array('server_local_id' => 'webVhostID', 'server_external_id' => 'externalID');
|
||||
|
||||
if (dataExist('identify_server_by', $data)) {
|
||||
|
||||
$affectedCount = 0;
|
||||
|
||||
$query = $sql->prepare("SELECT `webVhostID`,`userID`,`webMasterID`,`dns` FROM `webVhost` WHERE `" . $from[$data['identify_server_by']] . "`=? AND `resellerID`=?");
|
||||
$query->execute(array($data[$data['identify_server_by']], $resellerID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
$localServerID = $row['webVhostID'];
|
||||
$localUserLookupID = $row['userID'];
|
||||
$dns = ($row['dns'] !== null) ? $row['dns'] : '';
|
||||
$webMasterID = $row['webMasterID'];
|
||||
|
||||
$query = $sql->prepare("UPDATE `webVhost` SET `jobPending`='Y' WHERE `webVhostID`=? LIMIT 1");
|
||||
$query->execute(array($localServerID));
|
||||
$affectedCount += $query->rowCount();
|
||||
|
||||
$query = $sql->prepare("UPDATE `jobs` SET `status`='2' WHERE `type`='wv' AND (`status` IS NULL OR `status`='1') AND `affectedID`=?");
|
||||
$query->execute(array($localServerID));
|
||||
$affectedCount += $query->rowCount();
|
||||
|
||||
$query = $sql->prepare("INSERT INTO `jobs` (`api`,`type`,`affectedID`,`invoicedByID`,`hostID`,`userID`,`name`,`status`,`date`,`action`,`extraData`,`resellerid`) VALUES ('A','wv',?,?,?,?,?,NULL,NOW(),'dl','',?)");
|
||||
$query->execute(array($localServerID, $resellerID, $webMasterID, $localUserLookupID, $dns, $resellerID));
|
||||
$affectedCount += $query->rowCount();
|
||||
}
|
||||
|
||||
if ($affectedCount == 0) {
|
||||
$success['false'][] = 'No webspace can be found with the given ID';
|
||||
}
|
||||
|
||||
} else {
|
||||
$success['false'][] = 'No data for this method';
|
||||
}
|
||||
|
||||
} else if (!isset($success['false']) and array_value_exists('action', 'read', $data)) {
|
||||
|
||||
$identifyServerBy = $data['identify_server_by'];
|
||||
$localServerID = isid($data['server_local_id'], 10);
|
||||
$externalServerID = $data['server_external_id'];
|
||||
|
||||
$from = array('server_local_id' => 'webVhostID', 'server_external_id' => 'externalID');
|
||||
|
||||
if (dataExist('identify_server_by', $data)) {
|
||||
|
||||
$query = $sql->prepare("SELECT v.*,u.`cname`,u.`mail`,u.`externalID` AS `userExternalID`,m.`externalID` AS `masterExternalID` FROM `webVhost` AS v INNER JOIN `webMaster` AS m ON m.`webMasterID`=v.`webMasterID` INNER JOIN `userdata` AS u ON u.`id`=v.`userID` WHERE v.`" . $from[$data['identify_server_by']] . "`=? AND v.`resellerID`=?");
|
||||
$query->execute(array($data[$data['identify_server_by']], $resellerID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
$localServerID = $row['webVhostID'];
|
||||
$localUserLookupID = $row['userID'];
|
||||
$webMasterID = $row['webMasterID'];
|
||||
$externalServerID = $row['externalID'];
|
||||
$active = $row['active'];
|
||||
$dns = $row['dns'];
|
||||
$hdd = $row['hdd'];
|
||||
$ownVhost = $row['ownVhost'];
|
||||
|
||||
$localUserID = $row['userID'];
|
||||
$externalUserID = $row['userExternalID'];
|
||||
$email = $row['mail'];
|
||||
$username = $row['cname'];
|
||||
|
||||
$hostExternalID = $row['masterExternalID'];
|
||||
}
|
||||
|
||||
if ($query->rowCount() == 0) {
|
||||
$success['false'][] = 'No webspace can be found with the given ID';
|
||||
}
|
||||
|
||||
} else {
|
||||
$success['false'][] = 'No data for this method';
|
||||
}
|
||||
|
||||
} else {
|
||||
$success['false'][] = 'Unknown method';
|
||||
}
|
||||
|
||||
if ($apiType == 'xml') {
|
||||
|
||||
if (isset($success['false'])) {
|
||||
$errors = implode(', ', $success['false']);
|
||||
$action = 'fail';
|
||||
} else {
|
||||
$errors = '';
|
||||
$action = 'success';
|
||||
}
|
||||
|
||||
header("Content-type: text/xml; charset=UTF-8");
|
||||
|
||||
$responsexml = new DOMDocument('1.0', 'utf-8');
|
||||
$element = $responsexml->createElement('web');
|
||||
|
||||
$server = $responsexml->createElement('action', $action);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('master_server_id', $webMasterID);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('master_server_external_id', $hostExternalID);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('identify_user_by', $identifyUserBy);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('username', $username);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('email', $email);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('user_localid', $localUserID);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('user_externalid', $externalUserID);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('password', $password);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('identify_server_by', $identifyServerBy);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('server_external_id', $externalServerID);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('server_local_id', $localServerID);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('active', $active);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('dns', $dns);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('hdd', $hdd);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('ownVhost', $ownVhost);
|
||||
$element->appendChild($server);
|
||||
|
||||
$server = $responsexml->createElement('errors', $errors);
|
||||
$element->appendChild($server);
|
||||
|
||||
$responsexml->appendChild($element);
|
||||
|
||||
$responsexml->formatOutput = true;
|
||||
|
||||
echo $responsexml->saveXML();
|
||||
|
||||
} else if ($apiType == 'json') {
|
||||
|
||||
} else {
|
||||
|
||||
header('HTTP/1.1 403 Forbidden');
|
||||
die('403 Forbidden');
|
||||
|
||||
}
|
@ -77,6 +77,13 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$insert->execute(array($row['invoicedByID'], $row2['id'], $row2['sid'], $row['affectedID'], $row2['dbname'], $row['action'], $row['extraData'], $row2['resellerid']));
|
||||
}
|
||||
|
||||
$query2 = $sql->prepare("SELECT `webVhostID`,`webMasterID`,`dns`,`resellerID` FROM `webVhost` WHERE `userID`=?");
|
||||
$query2->execute(array($row['affectedID']));
|
||||
$insert = $sql->prepare("INSERT INTO `jobs` (`api`,`type`,`invoicedByID`,`affectedID`,`hostID`,`userID`,`name`,`status`,`date`,`action`,`extraData`,`resellerid`) VALUES ('S','wv',?,?,?,?,?,NULL,NOW(),?,?,?)");
|
||||
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
|
||||
$insert->execute(array($row['invoicedByID'], $row2['webVhostID'], $row2['webMasterID'], $row['affectedID'], $row2['dns'], $row['action'], $row['extraData'], $row2['resellerid']));
|
||||
}
|
||||
|
||||
$update = $sql->prepare("UPDATE `jobs` SET `status`='4' WHERE `jobID`=? LIMIT 1");
|
||||
$update->execute(array($row['jobID']));
|
||||
|
||||
|
95
web/stuff/jobs/jobs_webspace.php
Normal file
95
web/stuff/jobs/jobs_webspace.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* File: jobs_webspace.php.
|
||||
* Author: Ulrich Block
|
||||
* Date: 09.03.14
|
||||
* Contact: <ulrich.block@easy-wi.com>
|
||||
*
|
||||
* This file is part of Easy-WI.
|
||||
*
|
||||
* Easy-WI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Easy-WI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Easy-WI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Diese Datei ist Teil von Easy-WI.
|
||||
*
|
||||
* Easy-WI ist Freie Software: Sie koennen es unter den Bedingungen
|
||||
* der GNU General Public License, wie von der Free Software Foundation,
|
||||
* Version 3 der Lizenz oder (nach Ihrer Wahl) jeder spaeteren
|
||||
* veroeffentlichten Version, weiterverbreiten und/oder modifizieren.
|
||||
*
|
||||
* Easy-WI wird in der Hoffnung, dass es nuetzlich sein wird, aber
|
||||
* OHNE JEDE GEWAEHELEISTUNG, bereitgestellt; sogar ohne die implizite
|
||||
* Gewaehrleistung der MARKTFAEHIGKEIT oder EIGNUNG FUER EINEN BESTIMMTEN ZWECK.
|
||||
* Siehe die GNU General Public License fuer weitere Details.
|
||||
*
|
||||
* 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') IS NULL AND `type`='wv' AND `hostID`=?");
|
||||
|
||||
$query->execute();
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
$vhostObject = new HttpdManagement($row['hostID'], $row['resellerID']);
|
||||
|
||||
if ($vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect()) {
|
||||
|
||||
$query2->execute(array($row['hostID']));
|
||||
foreach ($query2->fetchall(PDO::FETCH_ASSOC) as $row2) {
|
||||
|
||||
$extraData = @json_decode($row2['extraData']);
|
||||
|
||||
if ($row2['action'] == 'dl') {
|
||||
|
||||
$vhostObject->vhostDelete($row2['affectedID']);
|
||||
|
||||
$query3->execute(array($row2['affectedID']));
|
||||
|
||||
} else if ($row2['action'] == 'ad') {
|
||||
|
||||
$vhostObject->vhostCreate($row2['affectedID']);
|
||||
|
||||
} else if ($row2['action'] == 'md') {
|
||||
|
||||
$query4->execute(array($row2['affectedID']));
|
||||
|
||||
if ($query4->fetchColumn() == 'N') {
|
||||
$vhostObject->setInactive($row2['affectedID']);
|
||||
} else {
|
||||
$vhostObject->vhostMod($row2['affectedID']);
|
||||
}
|
||||
|
||||
} else if ($row2['action'] == 'ri') {
|
||||
|
||||
$vhostObject->vhostReinstall($row2['affectedID']);
|
||||
|
||||
}
|
||||
|
||||
$query5->execute(array($row2['jobID']));
|
||||
$query6->execute(array($row2['affectedID']));
|
||||
}
|
||||
|
||||
$vhostObject->restartHttpdServer();
|
||||
|
||||
} else {
|
||||
$query7->execute(array($row['hostID']));
|
||||
}
|
||||
}
|
@ -442,7 +442,7 @@ class EasyWiFTP {
|
||||
if ($this->loggedIn == true) {
|
||||
|
||||
foreach ($dirs as $dir) {
|
||||
ftp_mkdir($this->ftpConnection, $dir);
|
||||
@ftp_mkdir($this->ftpConnection, $dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,8 @@ if (!class_exists('EasyWiFTP')) {
|
||||
class HttpdManagement {
|
||||
|
||||
// Data
|
||||
private $sql, $aeskey, $resellerID, $hostID, $ssh2Pass, $hostData = array(), $ssh2Object = false, $sftpObject = false, $vhostData = false, $dataPrepared = false;
|
||||
private $sql, $aeskey, $resellerID, $hostID, $ssh2Pass, $hostData = array(), $vhostData = false, $dataPrepared = false;
|
||||
public $ssh2Object = false, $sftpObject = false;
|
||||
|
||||
public function __destruct() {
|
||||
unset($this->sql, $this->aeskey, $this->hostID, $this->sshConnection, $this->sftpConnection);
|
||||
@ -146,10 +147,6 @@ class HttpdManagement {
|
||||
$query->execute(array($this->aeskey, $vhostID, $this->resellerID));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
if ($row['active'] == 'N') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->vhostData['hdd'] = $row['hdd'];
|
||||
$this->vhostData['dns'] = $row['dns'];
|
||||
$this->vhostData['ftpUser'] = $row['ftpUser'];
|
||||
@ -172,7 +169,7 @@ class HttpdManagement {
|
||||
return false;
|
||||
}
|
||||
|
||||
private function addVhost ($vhostID, $fullAdd = true) {
|
||||
private function addVhost ($vhostID, $fullAdd = true, $reinstall = false) {
|
||||
|
||||
if ($this->getVhostData($vhostID) != false) {
|
||||
|
||||
@ -180,7 +177,13 @@ class HttpdManagement {
|
||||
|
||||
if ($fullAdd == true) {
|
||||
|
||||
$cmd = 'a() { ' . str_replace('%cmd%', ' -md ' . $this->vhostData['vhostHomeDir'] . ' -p `perl -e \'print crypt("' . $this->vhostData['ftpPassword'] . '","Sa")\'` -g ' . $this->hostData['userGroup'] . ' -s /bin/false -k ' . $this->hostData['skelDir'] . ' '. $this->vhostData['ftpUser'], $this->hostData['userAddCmd']) . ' > /dev/null 2>&1; }; a';
|
||||
$removeCmd = '';
|
||||
|
||||
if ($reinstall == true) {
|
||||
$removeCmd = str_replace('%cmd%', ' -fr ' . $this->vhostData['ftpUser'], $this->hostData['userDelCmd']) . ' > /dev/null 2>&1; ';
|
||||
}
|
||||
|
||||
$cmd = 'a() { ' . $removeCmd . str_replace('%cmd%', ' -md ' . $this->vhostData['vhostHomeDir'] . ' -p `perl -e \'print crypt("' . $this->vhostData['ftpPassword'] . '","Sa")\'` -g ' . $this->hostData['userGroup'] . ' -s /bin/false -k ' . $this->hostData['skelDir'] . ' '. $this->vhostData['ftpUser'], $this->hostData['userAddCmd']) . ' > /dev/null 2>&1; }; a';
|
||||
|
||||
$this->ssh2Object->exec($cmd);
|
||||
|
||||
@ -196,7 +199,7 @@ class HttpdManagement {
|
||||
// Quotatool is broken in Ubuntu and Debian
|
||||
#$cmd = 'q() { ' . str_replace('%cmd%', ' -u ' . $this->vhostData['ftpUser'] . ' -b -l ' . $this->vhostData['hdd'] . 'M /', $this->hostData['quotaCmd']) . ' > /dev/null 2>&1; }; q&';
|
||||
|
||||
// setquota works in kibibyte and inodes
|
||||
// setquota works with KibiByte and Inodes
|
||||
$sizeInKibiByte = $this->vhostData['hdd'] * 1024;
|
||||
$sizeInByte = $this->vhostData['hdd'] * 1048576;
|
||||
$blockAmount = round(($sizeInByte / $this->hostData['blocksize']));
|
||||
@ -317,6 +320,13 @@ class HttpdManagement {
|
||||
$this->vhostData = false;
|
||||
}
|
||||
|
||||
public function vhostReinstall ($vhostID) {
|
||||
|
||||
$this->addVhost($vhostID, true, true);
|
||||
|
||||
$this->vhostData = false;
|
||||
}
|
||||
|
||||
public function restartHttpdServer () {
|
||||
|
||||
if ($this->ssh2Object != false) {
|
||||
|
@ -237,8 +237,9 @@ $query = "CREATE TABLE IF NOT EXISTS `webMaster` (
|
||||
`userDelCmd` varchar(255),
|
||||
`description` text,
|
||||
`notified` int(10) unsigned,
|
||||
`externalID` varchar(255) DEFAULT NULL,
|
||||
`resellerID` int(10) unsigned DEFAULT 0,
|
||||
PRIMARY KEY (`webMasterID`),KEY(`resellerID`)
|
||||
PRIMARY KEY (`webMasterID`),KEY(`externalID`),KEY(`resellerID`)
|
||||
) ENGINE=InnoDB";
|
||||
$add = $sql->prepare($query);
|
||||
$add->execute();
|
||||
@ -257,7 +258,7 @@ $query = "CREATE TABLE IF NOT EXISTS `webVhost` (
|
||||
`vhostTemplate` text,
|
||||
`externalID` varchar(255) DEFAULT NULL,
|
||||
`resellerID` int(10) unsigned DEFAULT 0,
|
||||
PRIMARY KEY (`webVhostID`),KEY(`webMasterID`),KEY(`userID`),KEY(`resellerID`)
|
||||
PRIMARY KEY (`webVhostID`),KEY(`webMasterID`),KEY(`userID`),KEY(`externalID`),KEY(`resellerID`)
|
||||
) ENGINE=InnoDB";
|
||||
$add = $sql->prepare($query);
|
||||
$add->execute();
|
||||
|
@ -280,6 +280,7 @@ $defined['webMaster'] = array(
|
||||
'userDelCmd' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'description' => array("Type"=>"text","Null"=>"YES","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'notified' => array("Type"=>"int(11) unsigned","Null"=>"YES","Key"=>"","Default"=>"0","Extra"=>""),
|
||||
'externalID' => array("Type"=>"varchar(255)","Null"=>"YES","Key"=>"MUL","Default"=>"","Extra"=>""),
|
||||
'resellerID' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"MUL","Default"=>"0","Extra"=>"")
|
||||
);
|
||||
|
||||
|
@ -47,6 +47,8 @@ include(EASYWIDIR . '/stuff/methods/class_httpd.php');
|
||||
|
||||
$sprache = getlanguagefile('web', $user_language, $reseller_id);
|
||||
$gsSprache = getlanguagefile('gserver', $user_language, $reseller_id);
|
||||
$dedicatedLanguage = getlanguagefile('reseller', $user_language, $reseller_id);
|
||||
|
||||
$loguserid = $user_id;
|
||||
$logusername = getusername($user_id);
|
||||
$logusertype = 'user';
|
||||
@ -60,13 +62,17 @@ if (isset($admin_id)) {
|
||||
$logsubuser = 0;
|
||||
}
|
||||
|
||||
if ($ui->id('id', 10, 'get') and in_array($ui->st('d', 'get'), array('if', 'pw'))) {
|
||||
$query = $sql->prepare("SELECT `dns` FROM `webVhost` WHERE `webVhostID`=? AND `userID`=? AND `resellerID`=? AND `active`='Y'");
|
||||
if ($ui->id('id', 10, 'get') and in_array($ui->st('d', 'get'), array('if', 'pw', 'ri'))) {
|
||||
|
||||
$query = $sql->prepare("SELECT `dns`,`webMasterID` FROM `webVhost` WHERE `webVhostID`=? AND `userID`=? AND `resellerID`=? AND `active`='Y'");
|
||||
$query->execute(array($ui->id('id', 10, 'get'), $user_id, $reseller_id));
|
||||
$dns = $query->fetchColumn();
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$dns = $row['dns'];
|
||||
$webMasterID = $row['webMasterID'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($ui->st('d', 'get') == 'pw' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['ws']))) {
|
||||
if (isset($webMasterID) and $ui->st('d', 'get') == 'pw' 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');
|
||||
|
||||
@ -121,34 +127,61 @@ if ($ui->st('d', 'get') == 'pw' and $ui->id('id', 10, 'get') and (!isset($_SESSI
|
||||
$template_file = 'userpanel_web_vhost_pw.tpl';
|
||||
}
|
||||
|
||||
} else if ($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']))) {
|
||||
} 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']))) {
|
||||
|
||||
if ( ($query->rowCount() > 0)) {
|
||||
$id = $ui->id('id', 10, 'get');
|
||||
|
||||
$hlCfg = 'sv_downloadurl "http://' . $dns . '/"
|
||||
// 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;
|
||||
}
|
||||
|
||||
// GET 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']))) {
|
||||
|
||||
$hlCfg = 'sv_downloadurl "http://' . $dns . '/"
|
||||
sv_allowdownload "1"
|
||||
sv_allowupload "1"';
|
||||
|
||||
$codCfg = 'set sv_allowDownload "1"
|
||||
$codCfg = 'set sv_allowDownload "1"
|
||||
set sv_wwwBaseURL "http://' . $dns . '/"
|
||||
set sv_wwwDlDisconnected "0"
|
||||
set sv_wwwDownload "1"';
|
||||
|
||||
$template_file = 'userpanel_web_vhost_info.tpl';
|
||||
|
||||
} else {
|
||||
$template_file = 'userpanel_404.tpl';
|
||||
}
|
||||
$template_file = 'userpanel_web_vhost_info.tpl';
|
||||
|
||||
} else {
|
||||
|
||||
$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` 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.`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']);
|
||||
$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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,10 @@
|
||||
<form class="form-horizontal" action="admin.php?w=wm&d=ad&r=wm" onsubmit="return confirm('<?php echo $gsprache->sure; ?>');" method="post">
|
||||
<input type="hidden" name="token" value="<?php echo token();?>">
|
||||
<input type="hidden" name="action" value="ad">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputExternalID"><?php echo $gsprache->externalID;?></label>
|
||||
<div class="controls"><input id="inputExternalID" class="span11" type="text" name="externalID" value="<?php echo $externalID;?>" maxlength="255"></div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputUsageType"><?php echo $sprache->usageType;?></label>
|
||||
<div class="controls">
|
||||
|
@ -63,7 +63,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['maxHDD'];?></td>
|
||||
<td><?php echo $table_row['maxHDD'];?> MB</td>
|
||||
<td><a href="admin.php?w=wm&d=ri&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&d=dl&id=<?php echo $table_row['id'];?>" ><span class="btn btn-mini btn-danger"><i class="fa fa-trash-o"></i></span></a></td>
|
||||
<td><a href="admin.php?w=wm&d=md&id=<?php echo $table_row['id'];?>" ><span class="btn btn-mini btn-primary"><i class="icon-white icon-edit"></i></span></td>
|
||||
|
@ -23,6 +23,10 @@
|
||||
<form class="form-horizontal" action="admin.php?w=wm&d=md&id=<?php echo $id;?>&r=wm" onsubmit="return confirm('<?php echo $gsprache->sure; ?>');" method="post">
|
||||
<input type="hidden" name="token" value="<?php echo token();?>">
|
||||
<input type="hidden" name="action" value="md">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputExternalID"><?php echo $gsprache->externalID;?></label>
|
||||
<div class="controls"><input id="inputExternalID" class="span11" type="text" name="externalID" value="<?php echo $externalID;?>" maxlength="255"></div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputUsageType"><?php echo $sprache->usageType;?></label>
|
||||
<div class="controls">
|
||||
|
34
web/template/default/admin/admin_web_vhost_ri.tpl
Normal file
34
web/template/default/admin/admin_web_vhost_ri.tpl
Normal file
@ -0,0 +1,34 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="admin.php">Home</a> <span class="divider">/</span></li>
|
||||
<li><a href="admin.php?w=wv"><?php echo $gsprache->webspace;?> Vhost</a> <span class="divider">/</span></li>
|
||||
<li><?php echo $dedicatedLanguage->reinstall;?> <span class="divider">/</span></li>
|
||||
<li class="active"><?php echo $dns;?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><?php echo $sprache->dns?></dt>
|
||||
<dd><?php echo $dns;?></dd>
|
||||
<dt><?php echo $dedicatedLanguage->user?></dt>
|
||||
<dd><?php echo $user;?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<form class="form-horizontal" action="admin.php?w=wv&d=ri&id=<?php echo $id;?>&r=wv" onsubmit="return confirm('<?php echo $gsprache->sure; ?>');" method="post">
|
||||
<input type="hidden" name="token" value="<?php echo token();?>">
|
||||
<input type="hidden" name="action" value="ri">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputEdit"></label>
|
||||
<div class="controls">
|
||||
<button class="btn btn-primary" id="inputEdit" type="submit"><i class="fa fa-refresh"></i> <?php echo $dedicatedLanguage->reinstall;?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -13,7 +13,8 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12 btn-group-vertical">
|
||||
<a href="userpanel.php?w=wv&d=pw&id=<?php echo $table_row['id'];?>"><span class="btn btn-mini btn-primary"><i class="fa fa-lock"></i> <?php echo $sprache->ftpPassword;?></span></a>
|
||||
<a href="userpanel.php?w=wv&d=if&id=<?php echo $table_row['id'];?>"><button class="btn btn-mini btn-info"><i class="fa fa-info-circle"></i> <?php echo $sprache->fdlInfo;?></button></a>
|
||||
<?php if($table_row['usageType']=='F'){ ?><a href="userpanel.php?w=wv&d=if&id=<?php echo $table_row['id'];?>"><button class="btn btn-mini btn-info"><i class="fa fa-info-circle"></i> <?php echo $sprache->fdlInfo;?></button></a><?php }?>
|
||||
<a href="userpanel.php?w=wv&d=ri&id=<?php echo $table_row['id'];?>"><button class="btn btn-mini btn-warning"><i class="fa fa-refresh"></i> <?php echo $dedicatedLanguage->reinstall;?></button></a>
|
||||
<!--<a href="userpanel.php?w=wv&d=bu&id=<?php echo $table_row['id'];?>"><span class="btn btn-mini btn-primary"><i class="fa fa-floppy-o"></i> <?php echo $sprache->backup;?></span></a>-->
|
||||
</div>
|
||||
</div>
|
||||
|
32
web/template/default/user/userpanel_web_vhost_ri.tpl
Normal file
32
web/template/default/user/userpanel_web_vhost_ri.tpl
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="userpanel.php">Home</a> <span class="divider">/</span></li>
|
||||
<li><a href="userpanel.php?w=wv"><?php echo $gsprache->webspace;?> Vhost</a> <span class="divider">/</span></li>
|
||||
<li><?php echo $dedicatedLanguage->reinstall;?> <span class="divider">/</span></li>
|
||||
<li class="active"><?php echo $dns;?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><?php echo $sprache->dns?></dt>
|
||||
<dd><?php echo $dns;?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<form class="form-horizontal" action="userpanel.php?w=wv&d=ri&id=<?php echo $id;?>&r=wv" onsubmit="return confirm('<?php echo $gsprache->sure; ?>');" method="post">
|
||||
<input type="hidden" name="token" value="<?php echo token();?>">
|
||||
<input type="hidden" name="action" value="ri">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputEdit"></label>
|
||||
<div class="controls">
|
||||
<button class="btn btn-primary" id="inputEdit" type="submit"><i class="fa fa-refresh"></i> <?php echo $dedicatedLanguage->reinstall;?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user