Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moeglichkeit hinzugefuegt, dass man auch unendlich Ressourcen an eine…

…n Kunden verteilen kann (einfach -1 eintragen).

git-svn-id: file:///var/svn/trunk/syscp@7 45fdb5c4-e40b-0410-b369-9aab4fe9a275
  • Loading branch information...
commit d2386081d670b2a3ae9af3d3983c58c4af3df90c 1 parent eff2851
Florian Lippert authored
6 admin_customers.php
View
@@ -65,7 +65,7 @@
$row['deactivated'] = str_replace('0', $lng['panel']['yes'], $row['deactivated']);
$row['deactivated'] = str_replace('1', $lng['panel']['no'], $row['deactivated']);
- if($row['traffic_used']>$row['traffic'])
+ if($row['traffic_used'] > $row['traffic'] && $row['traffic'] != '-1')
{
$row['traffic_color']='red';
}
@@ -74,7 +74,7 @@
$row['traffic_color']='';
}
- if($row['diskspace_used']>$row['diskspace'])
+ if($row['diskspace_used'] > $row['diskspace'] && $row['diskspace'] != '-1')
{
$row['diskspace_color']='red';
}
@@ -83,6 +83,8 @@
$row['diskspace_color']='';
}
+ $row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_forwarders ftps subdomains');
+
eval("\$customers.=\"".getTemplate("customers/customers_customer")."\";");
}
eval("echo \"".getTemplate("customers/customers")."\";");
11 customer_domains.php
View
@@ -48,8 +48,12 @@
$row['documentroot']=str_replace($userinfo['documentroot'],'',$row['documentroot']);
eval("\$domains.=\"".getTemplate("domains/domains_domain")."\";");
}
- if($userinfo['subdomains_used']<$userinfo['subdomains'])
+ if($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1')
{
+ if($db->num_rows($result) > 15)
+ {
+ eval("\$domains=\"".getTemplate("domains/domains_adddomain")."\".\$domains;");
+ }
eval("\$domains.=\"".getTemplate("domains/domains_adddomain")."\";");
}
eval("echo \"".getTemplate("domains/domainlist")."\";");
@@ -79,7 +83,7 @@
elseif($action=='add')
{
- if($userinfo['subdomains_used']<$userinfo['subdomains'])
+ if($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1')
{
if(isset($_POST['send']) && $_POST['send']=='send')
{
@@ -176,7 +180,6 @@
}
}
}
-
-
}
+
?>
16 customer_email.php
View
@@ -48,8 +48,12 @@
{
eval("\$accounts.=\"".getTemplate("email/pop_account")."\";");
}
- if($userinfo['emails_used']<$userinfo['emails'])
+ if($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1')
{
+ if($db->num_rows($result) > 15)
+ {
+ eval("\$accounts=\"".getTemplate("email/pop_addaccount")."\".\$accounts;");
+ }
eval("\$accounts.=\"".getTemplate("email/pop_addaccount")."\";");
}
eval("echo \"".getTemplate("email/pop")."\";");
@@ -75,7 +79,7 @@
elseif($action=='add')
{
- if($userinfo['emails_used']<$userinfo['emails'])
+ if($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1')
{
if(isset($_POST['send']) && $_POST['send']=='send')
{
@@ -161,8 +165,12 @@
}
eval("\$accounts.=\"".getTemplate("email/forwarders_forwarder")."\";");
}
- if($userinfo['email_forwarders_used']<$userinfo['email_forwarders'])
+ if($userinfo['email_forwarders_used'] < $userinfo['email_forwarders'] || $userinfo['email_forwarders'] == '-1')
{
+ if($db->num_rows($result) > 15)
+ {
+ eval("\$accounts=\"".getTemplate("email/forwarders_addforwarder")."\".\$accounts;");
+ }
eval("\$accounts.=\"".getTemplate("email/forwarders_addforwarder")."\";");
}
eval("echo \"".getTemplate("email/forwarders")."\";");
@@ -187,7 +195,7 @@
elseif($action=='add')
{
- if($userinfo['email_forwarders_used']<$userinfo['email_forwarders'])
+ if($userinfo['email_forwarders_used'] < $userinfo['email_forwarders'] || $userinfo['email_forwarders'] == '-1')
{
if(isset($_POST['send']) && $_POST['send']=='send')
{
12 customer_ftp.php
View
@@ -48,8 +48,12 @@
$row['documentroot']=str_replace($userinfo['documentroot'],'',$row['homedir']);
eval("\$accounts.=\"".getTemplate("ftp/accounts_account")."\";");
}
- if($userinfo['ftps_used']<$userinfo['ftps'])
+ if($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1')
{
+ if($db->num_rows($result) > 15)
+ {
+ eval("\$accounts=\"".getTemplate("ftp/accounts_addaccount")."\".\$accounts;");
+ }
eval("\$accounts.=\"".getTemplate("ftp/accounts_addaccount")."\";");
}
eval("echo \"".getTemplate("ftp/accounts")."\";");
@@ -69,6 +73,10 @@
{
$resetaccnumber=" , `ftp_lastaccountnumber`='0'";
}
+ else
+ {
+ $resetaccnumber='';
+ }
$result=$db->query("UPDATE `".TABLE_PANEL_CUSTOMERS."` SET `ftps_used`=`ftps_used`-1 $resetaccnumber WHERE `customerid`='".$userinfo['customerid']."'");
header("Location: $filename?page=$page&s=$s");
}
@@ -84,7 +92,7 @@
elseif($action=='add')
{
- if($userinfo['ftps_used']<$userinfo['ftps'])
+ if($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1')
{
if(isset($_POST['send']) && $_POST['send']=='send')
{
10 customer_index.php
View
@@ -44,10 +44,12 @@
/* $traffic=$db->query_first("SELECT SUM(http) AS http_sum, SUM(ftp_up) AS ftp_up_sum, SUM(ftp_down) AS ftp_down_sum, SUM(mail) AS mail_sum FROM ".TABLE_PANEL_TRAFFIC." WHERE year='".date('Y')."' AND month='".date('m')."' AND day<='".date('d')."' AND customerid='".$userinfo['customerid']."'");
$userinfo['traffic_used']=$traffic['http_sum']+$traffic['ftp_up_sum']+$traffic['ftp_down_sum']+$traffic['mail_sum'];*/
- $userinfo['diskspace']=round($userinfo['diskspace']/1024,4).' MB';
- $userinfo['diskspace_used']=round($userinfo['diskspace_used']/1024,4).' MB';
- $userinfo['traffic']=round($userinfo['traffic']/(1024*1024),4).' GB';
- $userinfo['traffic_used']=round($userinfo['traffic_used']/(1024*1024),4).' GB';
+ $userinfo['diskspace']=round($userinfo['diskspace']/1024,4);
+ $userinfo['diskspace_used']=round($userinfo['diskspace_used']/1024,4);
+ $userinfo['traffic']=round($userinfo['traffic']/(1024*1024),4);
+ $userinfo['traffic_used']=round($userinfo['traffic_used']/(1024*1024),4);
+
+ $userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_forwarders ftps subdomains');
eval("echo \"".getTemplate("index/index")."\";");
}
12 customer_mysql.php
View
@@ -48,8 +48,12 @@
{
eval("\$mysqls.=\"".getTemplate("mysql/mysqls_database")."\";");
}
- if($userinfo['mysqls_used']<$userinfo['mysqls'])
+ if($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1')
{
+ if($db->num_rows($result) > 15)
+ {
+ eval("\$mysqls=\"".getTemplate("mysql/mysqls_adddatabase")."\".\$mysqls;");
+ }
eval("\$mysqls.=\"".getTemplate("mysql/mysqls_adddatabase")."\";");
}
eval("echo \"".getTemplate("mysql/mysqls")."\";");
@@ -75,6 +79,10 @@
{
$resetaccnumber=" , `mysql_lastaccountnumber`='0'";
}
+ else
+ {
+ $resetaccnumber='';
+ }
$result=$db->query("UPDATE ".TABLE_PANEL_CUSTOMERS." SET `mysqls_used`=`mysqls_used`-1 $resetaccnumber WHERE `customerid`='".$userinfo['customerid']."'");
header("Location: $filename?page=$page&s=$s");
}
@@ -86,7 +94,7 @@
elseif($action=='add')
{
- if($userinfo['mysqls_used']<$userinfo['mysqls'])
+ if($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1')
{
if(isset($_POST['send']) && $_POST['send']=='send')
{
36 lib/functions.php
View
@@ -183,6 +183,42 @@ function array_trim($source)
}
/**
+ * Replaces Strings in an array, with the advantage that you can select which fields should be str_replace'd
+ *
+ * @param mixed String or array of strings to search for
+ * @param mixed String or array to replace with
+ * @param array The subject array
+ * @param string The fields which should be checked for, seperated by spaces
+ * @return array The str_replace'd array
+ */
+ function str_replace_array($search, $replace, $subject, $fields = '')
+ {
+ if(is_array($subject))
+ {
+ $fields = explode(' ', $fields);
+ if(is_array($fields) && !empty($fields))
+ {
+ while(list(,$field)=each($fields))
+ {
+ if($field != '')
+ {
+ $subject[$field] = str_replace($search, $replace, $subject[$field]);
+ }
+ }
+ }
+ else
+ {
+ $subject = str_replace($search, $replace, $subject);
+ }
+ }
+ else
+ {
+ $subject = str_replace($search, $replace, $subject);
+ }
+ return $subject;
+ }
+
+ /**
* Returns if an emailaddress is in correct format or not
*
* @param string The email address to check
10 lib/init.php
View
@@ -65,8 +65,10 @@
$remote_addr = htmlspecialchars($_SERVER['REMOTE_ADDR']);
$http_user_agent = htmlspecialchars($_SERVER['HTTP_USER_AGENT']);
$nosession = 0;
- unset($customerinfo);
+ unset($userinfo);
+ unset($userid);
unset($customerid);
+ unset($adminid);
unset($s);
if(isset($_POST['s']))
@@ -121,7 +123,7 @@
*/
$languages = Array( 'german' => 'Deutsch' , 'english' => 'English' ) ;
$standardlanguage = 'german';
- if(!isset($customerinfo['language']) || !isset($languages[$customerinfo['language']]))
+ if(!isset($userinfo['language']) || !isset($languages[$userinfo['language']]))
{
if(isset($_GET['language']) && isset($languages[$_GET['language']]))
{
@@ -134,7 +136,7 @@
}
else
{
- $language = $customerinfo['language'];
+ $language = $userinfo['language'];
}
if(file_exists('./lng/'.$language.'.lng.php'))
@@ -150,7 +152,7 @@
*/
if($nosession == 1 && AREA != 'login')
{
- unset($customerinfo);
+ unset($userinfo);
header('Location: ./index.php');
}
1  lng/english.lng.php
View
@@ -63,6 +63,7 @@
$lng['customer']['ftps'] = 'FTP-Accounts';
$lng['customer']['subdomains'] = 'Sub-Domain(s)';
$lng['customer']['domains'] = 'Domain(s)';
+$lng['customer']['unlimited'] = 'unlimited';
/**
* Customermenue
1  lng/german.lng.php
View
@@ -63,6 +63,7 @@
$lng['customer']['ftps'] = 'FTP-Accounts';
$lng['customer']['subdomains'] = 'Sub-Domain(s)';
$lng['customer']['domains'] = 'Domain(s)';
+$lng['customer']['unlimited'] = 'unendlich';
/**
* Customermenue
Please sign in to comment.
Something went wrong with that request. Please try again.