Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
merged eremit's, CHTEKK's, !EleRas's branch into trunk
Browse files Browse the repository at this point in the history
This merge contains the following changesets:

 * eremit
   * [251] fixed #10: 401 error pages still no longer show up in "path options" 
   * [262] the vhost.conf filename can now be changed in the adminpanel (closes #14) 
   * [263] the domains in the customerpanel should now be sorted correctly, thx to fabi (closes #7) 
   * [264] fixed a typo in changeset:262, the file was called vhosts.conf not vhost.conf
   * [264] added the correct setting to syscp.sql 
 * CHTEKK
   * [252] Fix cronscript.php error in filename output.
   * [252] Fix issues with the Apache password-protection.
   * [252] Change ordering of tasks to be by ID rather than by TYPE and make taks 1 and 4 be unique and at the end of a series of tasks, always.
   * [253] Fix possible password issues with addslash'ing them before crypting them.
   * [254] Add lastcronrun data, fix ticket #9.
   * [255] Fix id and add the required SQL update lines. 
 * EleRas
   * [266] Added paging for several lists (fixes ticket #3)
   * [267] Fixed problem with Umlauts in german languagefile 

'''Remember to UPGRADE your branches'''

git-svn-id: file:///var/svn/trunk/syscp@279 45fdb5c4-e40b-0410-b369-9aab4fe9a275
  • Loading branch information
Martin Burchert committed Feb 9, 2006
1 parent d04d333 commit 763eff8
Show file tree
Hide file tree
Showing 25 changed files with 455 additions and 43 deletions.
49 changes: 49 additions & 0 deletions admin_admins.php
Expand Up @@ -56,6 +56,55 @@

$admins='';
$result=$db->query("SELECT * FROM `".TABLE_PANEL_ADMINS."` ORDER BY `$sortby` $sortorder");
$rows = $db->num_rows($result);
if ($settings['panel']['paging'] > 0)
{
$pages = intval($rows / $settings['panel']['paging']);
}
else
{
$pages = 0;
}
if ($pages != 0)
{
if(isset($_GET['no']))
{
$pageno = intval($_GET['no']);
}
else
{
$pageno = 1;
}
if ($pageno > $pages)
{
$pageno = $pages + 1;
}
elseif ($pageno < 1)
{
$pageno = 1;
}
$pagestart = ($pageno - 1) * $settings['panel']['paging'];
$result=$db->query(
"SELECT * FROM `".TABLE_PANEL_ADMINS."` ORDER BY `$sortby` $sortorder " .
"LIMIT $pagestart , ".$settings['panel']['paging'].";"
);
$paging = '';
for ($count = 1; $count <= $pages+1; $count++)
{
if ($count == $pageno)
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\"><b>$count</b></a>&nbsp;";
}
else
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\">$count</a>&nbsp;";
}
}
}
else
{
$paging = "";
}
while($row=$db->fetch_array($result))
{
$row['traffic_used']=round($row['traffic_used']/(1024*1024),4);
Expand Down
63 changes: 62 additions & 1 deletion admin_customers.php
Expand Up @@ -60,6 +60,58 @@
"FROM `".TABLE_PANEL_CUSTOMERS."` `c`, `".TABLE_PANEL_ADMINS."` `a` " .
"WHERE ".( $userinfo['customers_see_all'] ? '' : " `c`.`adminid` = '{$userinfo['adminid']}' AND " )."`c`.`adminid`=`a`.`adminid` " .
"ORDER BY `c`.`$sortby` $sortorder");
$rows = $db->num_rows($result);
if ($settings['panel']['paging'] > 0)
{
$pages = intval($rows / $settings['panel']['paging']);
}
else
{
$pages = 0;
}
if ($pages != 0)
{
if(isset($_GET['no']))
{
$pageno = intval($_GET['no']);
}
else
{
$pageno = 1;
}
if ($pageno > $pages)
{
$pageno = $pages + 1;
}
elseif ($pageno < 1)
{
$pageno = 1;
}
$pagestart = ($pageno - 1) * $settings['panel']['paging'];
$result=$db->query(
"SELECT `c`.`customerid`, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`traffic`, `c`.`traffic_used`, `c`.`mysqls`, `c`.`mysqls_used`, `c`.`emails`, `c`.`emails_used`, `c`.`email_accounts`, `c`.`email_accounts_used`, `c`.`deactivated`, `c`.`ftps`, `c`.`ftps_used`, `c`.`subdomains`, `c`.`subdomains_used`, `c`.`email_forwarders`, `c`.`email_forwarders_used`, `c`.`standardsubdomain`, `a`.`loginname` AS `adminname` " .
"FROM `".TABLE_PANEL_CUSTOMERS."` `c`, `".TABLE_PANEL_ADMINS."` `a` " .
"WHERE ".( $userinfo['customers_see_all'] ? '' : " `c`.`adminid` = '{$userinfo['adminid']}' AND " )."`c`.`adminid`=`a`.`adminid` " .
"ORDER BY `c`.`$sortby` $sortorder " .
"LIMIT $pagestart , ".$settings['panel']['paging'].";"
);
$paging = '';
for ($count = 1; $count <= $pages+1; $count++)
{
if ($count == $pageno)
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\"><b>$count</b></a>&nbsp;";
}
else
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\">$count</a>&nbsp;";
}
}
}
else
{
$paging = "";
}
while($row=$db->fetch_array($result))
{
$domains=$db->query_first(
Expand Down Expand Up @@ -337,10 +389,19 @@

// Add htpasswd for the webalizer stats
$path = $documentroot . '/webalizer/' ;
if ( CRYPT_STD_DES == 1 )
{
$saltfordescrypt = substr(md5(uniqid(microtime(),1)),4,2);
$password = crypt($password, $saltfordescrypt);
}
else
{
$password = crypt($password);
}
$db->query(
"INSERT INTO `".TABLE_PANEL_HTPASSWDS."` " .
"(`customerid`, `username`, `password`, `path`) " .
"VALUES ('$customerid', '$loginname', '".crypt($password)."', '$path')"
"VALUES ('$customerid', '$loginname', '$password', '$path')"
);
inserttask('3',$path);

Expand Down
54 changes: 54 additions & 0 deletions admin_domains.php
Expand Up @@ -63,6 +63,60 @@
"WHERE `d`.`parentdomainid`='0' ".( $userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '{$userinfo['adminid']}' ")."" .
"ORDER BY `$sortby` $sortorder"
);
$rows = $db->num_rows($result);
if ($settings['panel']['paging'] > 0)
{
$pages = intval($rows / $settings['panel']['paging']);
}
else
{
$pages = 0;
}
if ($pages != 0)
{
if(isset($_GET['no']))
{
$pageno = intval($_GET['no']);
}
else
{
$pageno = 1;
}
if ($pageno > $pages)
{
$pageno = $pages + 1;
}
elseif ($pageno < 1)
{
$pageno = 1;
}
$pagestart = ($pageno - 1) * $settings['panel']['paging'];
$result=$db->query(
"SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`documentroot`, `d`.`zonefile`, `d`.`openbasedir`, `d`.`safemode`, `d`.`isemaildomain`, `d`.`parentdomainid`, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `ad`.`domain` AS `alias` " .
"FROM `".TABLE_PANEL_DOMAINS."` `d` " .
"LEFT JOIN `".TABLE_PANEL_CUSTOMERS."` `c` USING(`customerid`) " .
"LEFT JOIN `".TABLE_PANEL_DOMAINS."` `ad` ON `d`.`aliasdomain`=`ad`.`id` " .
"WHERE `d`.`parentdomainid`='0' ".( $userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '{$userinfo['adminid']}' ")."" .
"ORDER BY `$sortby` $sortorder " .
"LIMIT $pagestart , ".$settings['panel']['paging'].";"
);
$paging = '';
for ($count = 1; $count <= $pages+1; $count++)
{
if ($count == $pageno)
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\"><b>$count</b></a>&nbsp;";
}
else
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\">$count</a>&nbsp;";
}
}
}
else
{
$paging = "";
}
$domain_array=array();
while($row=$db->fetch_array($result))
{
Expand Down
2 changes: 2 additions & 0 deletions admin_index.php
Expand Up @@ -89,6 +89,8 @@
$userinfo['traffic_used']=round($userinfo['traffic_used']/(1024*1024),4);

$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders ftps subdomains');

$cronlastrun = date("d.m.Y H:i:s", $settings['system']['lastcronrun']);
eval("echo \"".getTemplate("index/index")."\";");
}

Expand Down
9 changes: 9 additions & 0 deletions admin_settings.php
Expand Up @@ -219,6 +219,15 @@
$db->query("UPDATE `".TABLE_PANEL_SETTINGS."` SET `value`='$value' WHERE `settinggroup`='panel' AND `varname`='adminmail'");
}

if($_POST['panel_paging']!=$settings['panel']['paging'])
{
$value=intval($_POST['panel_paging']);
if ($value < 0) {
$value = 0;
}
$db->query("UPDATE `".TABLE_PANEL_SETTINGS."` SET `value`='$value' WHERE `settinggroup`='panel' AND `varname`='paging'");
}

if($_POST['panel_standardlanguage']!=$settings['panel']['standardlanguage'])
{
$value = addslashes ( htmlentities ( _html_entity_decode ( $_POST['panel_standardlanguage'] ) ) ) ;
Expand Down
86 changes: 85 additions & 1 deletion customer_domains.php
Expand Up @@ -57,6 +57,67 @@
" AND `d`.`id` <> ".$userinfo['standardsubdomain']
);
$domains='';
$rows = $db->num_rows($result);
if ($settings['panel']['paging'] > 0)
{
$pages = intval($rows / $settings['panel']['paging']);
}
else
{
$pages = 0;
}
if ($pages != 0)
{
if(isset($_GET['no']))
{
$pageno = intval($_GET['no']);
}
else
{
$pageno = 1;
}
if ($pageno > $pages)
{
$pageno = $pages + 1;
}
elseif ($pageno < 1)
{
$pageno = 1;
}
$pagestart = ($pageno - 1) * $settings['panel']['paging'];
$result=$db->query(
"SELECT `d`.`id`, " .
" `d`.`customerid`, " .
" `d`.`domain`, " .
" `d`.`documentroot`, " .
" `d`.`isemaildomain`, " .
" `d`.`caneditdomain`, " .
" `d`.`iswildcarddomain`, " .
" `d`.`parentdomainid`, " .
" `ad`.`domain` AS `aliasdomain` " .
"FROM `".TABLE_PANEL_DOMAINS."` `d` " .
"LEFT JOIN `".TABLE_PANEL_DOMAINS."` `ad` ON `d`.`aliasdomain`=`ad`.`id` " .
"WHERE `d`.`customerid`='".$userinfo['customerid']."' " .
" AND `d`.`id` <> ".$userinfo['standardsubdomain'] .
" LIMIT $pagestart , ".$settings['panel']['paging'].";"
);
$paging = '';
for ($count = 1; $count <= $pages+1; $count++)
{
if ($count == $pageno)
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\"><b>$count</b></a>&nbsp;";
}
else
{
$paging .= "<a href=\"$filename?s=$s&page=$page&no=$count\">$count</a>&nbsp;";
}
}
}
else
{
$paging = "";
}
$parentdomains_count=0;
$domains_count=0;
$domain_array=array();
Expand All @@ -72,7 +133,30 @@
}
$domain_array[$sortkey] = $row;
}
ksort($domain_array);
$domain_id_array=array();
foreach($domain_array as $sortkey => $row)
{
$domain_id_array[$row['id']] = $sortkey;
}
$domain_sort_array=array();
foreach($domain_array as $sortkey => $row)
{
if ($row['parentdomainid'] == 0)
{
$domain_sort_array[$sortkey]=array($sortkey=>$row);
}
else
{
$domain_sort_array[$domain_id_array[$row['parentdomainid']]][$sortkey] = $row;
}
}
$domain_array=array();
ksort($domain_sort_array);
foreach($domain_sort_array as $subarray)
{
ksort($subarray);
$domain_array=array_merge($domain_array,$subarray);
}
$parentdomainid = 0;
foreach($domain_array as $row)
{
Expand Down
20 changes: 18 additions & 2 deletions customer_extras.php
Expand Up @@ -78,7 +78,15 @@
$path=$userinfo['documentroot'].$path;
$username=addslashes($_POST['username']);
$username_path_check=$db->query_first("SELECT `id`, `username`, `path` FROM `".TABLE_PANEL_HTPASSWDS."` WHERE `username`='$username' AND `path`='$path' AND `customerid`='".$userinfo['customerid']."'");
$password=crypt(addslashes($_POST['password']));
if ( CRYPT_STD_DES == 1 )
{
$saltfordescrypt = substr(md5(uniqid(microtime(),1)),4,2);
$password = addslashes(crypt($_POST['password'], $saltfordescrypt));
}
else
{
$password = addslashes(crypt($_POST['password']));
}
$passwordtest=$_POST['password'];

if(!$_POST['path'])
Expand Down Expand Up @@ -127,7 +135,15 @@
{
if(isset($_POST['send']) && $_POST['send']=='send')
{
$password=crypt(addslashes($_POST['password']));
if ( CRYPT_STD_DES == 1 )
{
$saltfordescrypt = substr(md5(uniqid(microtime(),1)),4,2);
$password = addslashes(crypt($_POST['password'], $saltfordescrypt));
}
else
{
$password = addslashes(crypt($_POST['password']));
}
$passwordtest=$_POST['password'];
if ($passwordtest=='')
{
Expand Down

0 comments on commit 763eff8

Please sign in to comment.