function TemplateReplace($content, $bodycontent, $template_path, $useraccount, $packageinfo, $quotainfo, $permissionset, $personalinfo) { include 'conf/zcnf.php'; include 'lang/' . GetSystemOption('zpanel_lang') . '.php'; $fileContents = str_replace('{{usage:domains}}', GetQuotaUsages('domains', $useraccount['ac_id_pk']), $content); $fileContents = str_replace('{{usage:subdomains}}', GetQuotaUsages('subdomains', $useraccount['ac_id_pk']), $fileContents); $fileContents = str_replace('{{usage:parkeddomains}}', GetQuotaUsages('parkeddomains', $useraccount['ac_id_pk']), $fileContents); $fileContents = str_replace('{{usage:mailboxes}}', GetQuotaUsages('mailboxes', $useraccount['ac_id_pk']), $fileContents); $fileContents = str_replace('{{usage:forwarders}}', GetQuotaUsages('forwarders', $useraccount['ac_id_pk']), $fileContents); $fileContents = str_replace('{{usage:distlists}}', GetQuotaUsages('distlists', $useraccount['ac_id_pk']), $fileContents); $fileContents = str_replace('{{usage:ftpaccounts}}', GetQuotaUsages('ftpaccounts', $useraccount['ac_id_pk']), $fileContents); $fileContents = str_replace('{{usage:mysql}}', GetQuotaUsages('mysql', $useraccount['ac_id_pk']), $fileContents); $fileContents = str_replace('{{usage:diskspace}}', FormatFileSize(GetQuotaUsages('diskspace', $useraccount['ac_id_pk'])), $fileContents); $fileContents = str_replace('{{usage:bandwidth}}', FormatFileSize(GetQuotaUsages('bandwidth', $useraccount['ac_id_pk'])), $fileContents); $fileContents = str_replace('{{quota:domains}}', $quotainfo['qt_domains_in'], $fileContents); $fileContents = str_replace('{{quota:subdomains}}', $quotainfo['qt_subdomains_in'], $fileContents); $fileContents = str_replace('{{quota:parkeddomains}}', $quotainfo['qt_parkeddomains_in'], $fileContents); $fileContents = str_replace('{{quota:mailboxes}}', $quotainfo['qt_mailboxes_in'], $fileContents); $fileContents = str_replace('{{quota:forwarders}}', $quotainfo['qt_fowarders_in'], $fileContents); $fileContents = str_replace('{{quota:distlists}}', $quotainfo['qt_distlists_in'], $fileContents); $fileContents = str_replace('{{quota:ftpaccounts}}', $quotainfo['qt_ftpaccounts_in'], $fileContents); $fileContents = str_replace('{{quota:mysql}}', $quotainfo['qt_mysql_in'], $fileContents); $fileContents = str_replace('{{quota:diskspace}}', FormatFileSize($quotainfo['qt_diskspace_bi']), $fileContents); $fileContents = str_replace('{{quota:bandwidth}}', FormatFileSize($quotainfo['qt_bandwidth_bi']), $fileContents); $fileContents = str_replace('{{progbar:diskspace}}', "<img src=\"inc/zProgressBar.php?used=" . GetQuotaUsages('diskspace', $useraccount['ac_id_pk']) . "&total=" . $quotainfo['qt_diskspace_bi'] . "\">", $fileContents); $fileContents = str_replace('{{progbar:bandwidth}}', "<img src=\"inc/zProgressBar.php?used=" . GetQuotaUsages('bandwidth', $useraccount['ac_id_pk']) . "&total=" . $quotainfo['qt_bandwidth_bi'] . "\">", $fileContents); $fileContents = str_replace('{{server:company}}', GetSystemOption('sever_company'), $fileContents); $fileContents = str_replace('{{server:serverip}}', $_SERVER['SERVER_ADDR'], $fileContents); $fileContents = str_replace('{{server:userip}}', $_SERVER['REMOTE_ADDR'], $fileContents); $fileContents = str_replace('{{server:uptime}}', GetServerUptime(), $fileContents); $fileContents = str_replace('{{server:verapache}}', ShowApacheVersion(), $fileContents); $fileContents = str_replace('{{server:verphp}}', ShowPHPVersion(), $fileContents); $fileContents = str_replace('{{server:verkernal}}', ShowKernelVersion(ShowServerPlatform()), $fileContents); $fileContents = str_replace('{{server:vermysql}}', ShowMySQLVersion(), $fileContents); $fileContents = str_replace('{{server:veros}}', ShowServerPlatform(), $fileContents); $fileContents = str_replace('{{server:osname}}', ShowServerOSName(), $fileContents); $fileContents = str_replace('{{server:oslogo}}', "<img src=\"lib/emblems/os_icons/" . ShowServerOSName() . ".png\" title=\"This server is running " . ShowServerOSName() . "\">", $fileContents); $fileContents = str_replace('{{server:verzpanel}}', GetSystemOption('zpanel_version'), $fileContents); $fileContents = str_replace('{{link:home}}', "<a href=\"./\">" . $lang['215'] . "</a>", $fileContents); $fileContents = str_replace('{{link:logout}}', "<a href=\"./login.php?logout\">" . $lang['216'] . "</a>", $fileContents); $fileContents = str_replace('{{zp:templatepath}}', $template_path, $fileContents); $fileContents = str_replace('{{account:username}}', $useraccount['ac_user_vc'], $fileContents); $fileContents = str_replace('{{account:email}}', $personalinfo['ap_email_vc'], $fileContents); $fileContents = str_replace('{{account:created}}', date(GetSystemOption('zpanel_df'), $useraccount['ac_created_ts']), $fileContents); $fileContents = str_replace('{{account:fullname}}', $personalinfo['ap_fullname_vc'], $fileContents); $fileContents = str_replace('{{package:name}}', $packageinfo['pk_name_vc'], $fileContents); $fileContents = str_replace('{{account:type}}', ShowAccountType($permissionset), $fileContents); $fileContents = str_replace('{{zp:content}}', $bodycontent, $fileContents); return $fileContents; }
function restartApache() { if (IsWindows() == true) { $last_line = exec("C:\\ZPanel\\bin\\apache\\bin\\httpd.exe -k restart -n \"Apache\"", $return); TriggerLog(1, $b = "Usage Limiter - Apache restart returned : " . print_r($return) . " : " . $last_line); } else { $last_line = system("/etc/zpanel/bin/zsudo service " . GetSystemOption('lsn_apache') . " graceful"); TriggerLog(1, $b = "Usage Limiter - Apache graceful returned : " . $last_line); } }
* */ include 'conf/zcnf.php'; include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; include 'inc/zAccountDetails.php'; $sql = "SELECT * FROM z_vhosts WHERE vh_acc_fk=" . $useraccount['ac_id_pk'] . " AND vh_deleted_ts IS NULL"; $listdomains = DataExchange("r", $z_db_name, $sql); $rowdomains = mysql_fetch_assoc($listdomains); $totaldomains = DataExchange("t", $z_db_name, $sql); if (isset($_GET['a'])) { if ($_GET['a'] == 'show') { $report_to_show1 = GetSystemOption('webalizer_sd') . $useraccount['ac_user_vc'] . "/" . $_POST['inDomain'] . "/index.html"; if (!file_exists($report_to_show1)) { $report_to_show = "static/nowebstats/index.html"; } else { $report_to_show = GetSystemOption('webalizer_sd') . $useraccount['ac_user_vc'] . "/" . $_POST['inDomain'] . "/index.html"; } } } echo "" . $lang['27'] . "<br><br><h2>" . $lang['29'] . "</h2>"; if ($totaldomains > 0) { echo "<form action=\"" . GetNormalModuleURL(GetFullURL()) . "&a=show\" method=\"post\" name=\"frmStats\" id=\"frmStats\">\r\n<table class=\"zform\">\r\n<tr>\r\n<td><strong>" . $lang['28'] . "</strong></td>\r\n<td><select name=\"inDomain\" id=\"inDomain\">\r\n<option value=\"\">-- " . $lang['29'] . " --</option>"; do { echo "<option value=\"" . $rowdomains['vh_name_vc'] . "\">" . $rowdomains['vh_name_vc'] . "</option>"; } while ($rowdomains = mysql_fetch_assoc($listdomains)); echo "</select></td>\r\n<td><input type=\"submit\" name=\"Submit\" value=\"" . $lang['30'] . "\"></td>\r\n</tr>\r\n</table>\r\n</form>"; if (isset($_GET['a']) && $_GET['a'] == "show") { echo "<br><h2>" . $lang['31'] . "</h2><iframe height=\"400\" width=\"100%\" allowtransparency=\"\" src=\"" . $report_to_show . "\" title=\"" . $lang['31'] . "\" frameborder=\"0\" scrolling=\"auto\"></iframe>"; } } else { echo $lang['32'];
<?php /** * * ZPanel - A Cross-Platform Open-Source Web Hosting Control panel. * * @package ZPanel * @version $Id$ * @author Bobby Allen - ballen@zpanelcp.com * @copyright (c) 2008-2011 ZPanel Group - http://www.zpanelcp.com/ * @license http://opensource.org/licenses/gpl-3.0.html GNU Public License v3 * * This program (ZPanel) 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. * * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * */ # Now we need to declare and cleanup some variables $acc_fk = $useraccount['ac_id_pk']; zapi_version_check(GetSystemOption('zpanel_version'));
* You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ include 'inc/zAccountDetails.php'; include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; echo $lang['2']; echo "<br><br>"; if (isset($_GET['r']) && $_GET['r'] == 'ok') { echo "<br><br><div class=\"zannouce\">" . $lang['61'] . "</div>"; echo "<br><br>"; } echo "<form id=\"frmPersonalDetails\" name=\"frmPersonalDetails\" method=\"post\" action=\"runner.php?load=obj_personal\">\r\n <table class=\"zform\">\r\n <tr>\r\n <th>" . $lang['13'] . "</th>\r\n <td><input name=\"inFullname\" type=\"text\" id=\"inFullname\" size=\"40\" value=\"" . Cleaner("o", $personalinfo['ap_fullname_vc']) . "\" /></td>\r\n </tr>\r\n <tr>\r\n <th>" . $lang['14'] . "</th>\r\n <td><input name=\"inEmail\" type=\"text\" id=\"inEmail\" size=\"40\" value=\"" . Cleaner("o", $personalinfo['ap_email_vc']) . "\" /></td>\r\n </tr>\r\n <tr>\r\n <th>" . $lang['17'] . "</th>\r\n <td><input name=\"inPhone\" type=\"text\" id=\"inPhone\" size=\"20\" value=\"" . Cleaner("o", $personalinfo['ap_phone_vc']) . "\" /></td>\r\n </tr>\r\n <tr>\r\n <th>Choose Language</th>\r\n <td>"; echo "<select name=\"inTranslation\" id=\"inTranslation\">"; $handle = @opendir(GetSystemOption('zpanel_root') . "lang"); $chkdir = GetSystemOption('zpanel_root') . "lang/"; if (!$handle) { # Log an error as the folder cannot be opened... TriggerLog($useraccount['ac_id_pk'], $b = "Was unable to read the Language packs in (" . $chkdir . "), please ensure this folder exists."); } else { while ($file = readdir($handle)) { if ($file != "." && $file != ".." && strstr($file, '.php') && !strstr($file, '_override')) { if (str_replace(".php", "", $file) == $personalinfo['ap_language_vc']) { echo "<option value=" . str_replace(".php", "", $file) . " selected=selected>" . str_replace(".php", "", $file) . "</option>\n"; } else { echo "<option value=" . str_replace(".php", "", $file) . ">" . str_replace(".php", "", $file) . "</option>\n"; } } } closedir($handle); }
unlink(GetSystemOption('temp_dir') . $backupname . ".zip "); exit; } else { # Now we send the output (POSIX)... $file = GetSystemOption('temp_dir') . $backupname . ".zip"; header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private', false); header('Content-Description: File Transfer'); header('Content-Transfer-Encoding: binary'); header('Content-Type: application/force-download'); header('Content-Length: ' . filesize($file)); header('Content-Disposition: attachment; filename=' . $backupname . '.zip'); readfile_chunked($file); unlink(GetSystemOption('temp_dir') . $backupname . ".zip "); function readfile_chunked($filename) { $chunksize = 1 * (1024 * 1024); $buffer = ''; $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); print $buffer; } return fclose($handle); } }
<th><?php echo $lang['163']; ?> </th> <th></th> </tr> <?php do { ?> <tr> <td><?php echo Cleaner('o', $rowdomains['vh_name_vc']); ?> </td> <td><?php echo date(GetSystemOption('zpanel_df'), $rowdomains['vh_created_ts']); ?> </td> <td><?php if ($rowdomains['vh_active_in'] == 1) { echo "<font color=\"green\">Live</font>"; } else { echo "<font color=\"orange\">Pending</font>"; } ?> </td> <td><input type="submit" name="inDelete_<?php echo $rowdomains['vh_id_pk']; ?> " id="inDelete_<?php echo $rowdomains['vh_id_pk'];
} } closedir($handle); } echo "</select></td></tr>"; echo "<tr><td ><input type=\"hidden\" name=\"inReturn\" value=\"" . GetFullURL() . "\"><input type=\"submit\" name=\"inSaveTemplate\"value=\"" . $lang['18'] . "\"></td><td></td></tr>"; echo "</table></form>"; ?> <h2><?php echo $lang['422']; ?> </h2> <form method="post" action="runner.php?load=obj_zpconfig" name="ZPWelcomeMessage" id="ZPWelcomeMessage"> <table class="zgrid"> <tr> <td> <textarea cols="55" rows="10" id="inWelcome" name="inWelcome"><?php echo GetSystemOption('zpanel_welcome'); ?> </textarea> </td> </tr> <tr><td><input type="hidden" name="inReturn" value="<?php echo GetFullURL(); ?> "><input type="submit" name="inSaveWelcome" value="<?php echo $lang['18']; ?> "></td></tr> </table> </form>
function deletehtaccess() { include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; if (file_exists(GetSystemOption('zpanel_root') . "apps/phpsysinfo/.htaccess")) { unlink(GetSystemOption('zpanel_root') . "apps/phpsysinfo/.htaccess"); } if (file_exists(GetSystemOption('zpanel_root') . "apps/phpsysinfo/phpsysinfo.htpasswd")) { unlink(GetSystemOption('zpanel_root') . "apps/phpsysinfo/phpsysinfo.htpasswd"); } echo '<div class="zannouce">' . $lang['348'] . '</div><br>'; }
function adduser($ht_acc_fk, $ht_user_vc, $ht_dir_vc, $htusername, $htpassword1, $htpassword2) { include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; if (!empty($htpassword1) && !empty($htpassword2) && $htpassword1 == $htpassword2) { $result = mysql_query("SELECT * FROM `z_htaccess` WHERE `ht_acc_fk` ='" . $ht_acc_fk . "' AND `ht_dir_vc` = '" . $ht_dir_vc . "'"); $row = mysql_fetch_assoc($result); system(GetSystemOption('htpasswd_exe') . " -b -m " . GetSystemOption('zpanel_root') . "/modules/advanced/htpasswd/files/" . $row['ht_id_pk'] . ".htpasswd " . $htusername . " " . $htpassword1 . ""); echo '<div class="zannouce">' . $lang['335'] . trim(substr($ht_dir_vc, strlen(GetSystemOption('hosted_dir')), strlen($ht_dir_vc))) . '</div><br>'; } else { echo '<div class="zannouce">' . $lang['336'] . '</div><br>'; } }
text-align: center; font-weight: bold; } --> </style></head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="login_panel"> <?php # Load the HTML login screen.... include "static/login_template/login.html"; ?> </td> </tr> <tr> <td class="poweredbox"><p><strong>Powered by <a href="http://www.zpanelcp.com/" target="_blank" title="ZPanel - Taking hosting to the next level!">ZPanel</a></strong><br> This server is running: ZPanel <?php echo GetSystemOption('zpanel_version'); ?> <br> </p></td> </tr> </table> <script language="javascript"> document.frmZLogin.inUsername.focus(); </script> </body> </html>
TriggerLog($useraccount['ac_id_pk'], $b = "Was unable to write to the crontab file (" . GetSystemOption('cron_file') . "), check that the file is not read-only and that the file path in the ZPanel settings is correct."); header("location: " . GetNormalModuleURL($returnurl) . "&r=error"); exit; } # Now we add some infomation to the system log. TriggerLog($useraccount['ac_id_pk'], $b = "New cron job has been added by user (" . Cleaner('i', $_POST['inScript']) . ")\rDescription:-\r" . Cleaner('i', $_POST['inDescription']) . ""); header("location: " . GetNormalModuleURL($returnurl) . "&r=ok"); exit; } if ($_POST['inAction'] == 'delete') { # User has choosen to delete the task... do { if (isset($_POST['inDelete_' . $rowtasks['ct_id_pk']])) { # Call the API function! $api_resault = zapi_cronjob_remove(GetSystemOption('cron_file'), $rowtasks['ct_id_pk']); if ($api_resault == false) { # The cronjob was not deleted for some reason! TriggerLog($useraccount['ac_id_pk'], $b = "Was unable to write to the crontab file (" . GetSystemOption('cron_file') . "), check that the file is not read-only and that the file path in the ZPanel settings is correct."); header("location: " . GetNormalModuleURL($returnurl) . "&r=error"); exit; } # Do all other account deleted related stuff here!!! $sql = "UPDATE z_cronjobs SET ct_deleted_ts=" . time() . " WHERE ct_id_pk=" . $rowtasks['ct_id_pk'] . ""; DataExchange("w", $z_db_name, $sql); # Log the action in the database... TriggerLog($useraccount['ac_id_pk'], $b = "User cron job ID: " . $rowtasks['ct_id_pk'] . " was deleted."); } } while ($rowtasks = mysql_fetch_assoc($listtasks)); header("location: " . GetNormalModuleURL($returnurl) . "&r=ok"); exit; }
foreach ($modfilearray as $modfile) { if (is_dir($path . '/' . $file . '/' . $modfile)) { if (file_exists($path . '/' . $file . '/' . $modfile . '/modinfo.zp.php')) { require_once $path . '/' . $file . '/' . $modfile . '/modinfo.zp.php'; if (isset($thismod['title']) && isset($thismod['icon'])) { if ($colcount == 1) { echo "</td>\n</tr>\n<tr>\n<td align=\"left\">\n<table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n"; } $cleanname = str_replace(" ", "<br />", $thismod['title']); #Icon overrides $getmodicon = explode('.', $thismod['icon']); if (file_exists($path . '/' . $file . '/' . $modfile . '/' . $getmodicon[0] . '_override.' . $getmodicon[1])) { $iconpath = 'modules/' . $file . '/' . $modfile . '/'; $modicon = $getmodicon[0] . '_override.' . $getmodicon[1]; } elseif (file_exists(GetSystemOption('zpanel_root') . 'templates/' . GetSystemOption('zpanel_template') . '/icons/' . $modfile . '/' . $thismod['icon'])) { $iconpath = 'templates/' . GetSystemOption('zpanel_template') . '/icons/' . $modfile . '/'; $modicon = $thismod['icon']; } else { $iconpath = 'modules/' . $file . '/' . $modfile . '/'; $modicon = $thismod['icon']; } echo "<td style=\"text-align:center;\" align=\"left\"><a href=\"?c={$file}&p={$modfile}\" title=\"" . $thismod['title'] . "\"><img src=\"" . $iconpath . $modicon . "\" border=\"0\" /></a><br /><a href=\"./?c={$file}&p={$modfile}\">" . $cleanname . "</a></td>\n"; if ($colcount == $coldisplay) { $colcount = 1; $tableopen = 0; echo " </tr>\n</table>\n"; } else { $colcount = $colcount + 1; $tableopen = 1; } }
# Lets now go and try removing the domain from hMailServer (if configured in the ZPanel system settings:- $hmaildatabase = GetSystemOption('hmailserver_db'); if (GetSystemOption('hmailserver_db') != "") { # Lets delete all hMailServer accounts... $sql = "SELECT domainid FROM hm_domains WHERE domainname='" . $rowdomains['vh_name_vc'] . "'"; $hmdomainid = DataExchange("l", $hmaildatabase, $sql); $hmisdomain = DataExchange("t", $hmaildatabase, $sql); $domain_id = $hmdomainid['domainid']; # Lets delete the domain (if it exists in the hMailServer database.... if ($hmisdomain > 0) { # Delete the domain now... $sql = "DELETE FROM hm_domains WHERE domainid=" . $domain_id . ""; DataExchange("w", $hmaildatabase, $sql); zapi_filesystem_remove("C:/Zpanel/bin/hmailserver/Data/" . $rowdomains['vh_name_vc'] . "/"); zapi_filesystem_remove("C:/Program Files/hMailServer/Data/" . $rowdomains['vh_name_vc'] . "/"); } } } else { # Now we delete the domain from the Postfix database. $postfixdatabase = GetSystemOption('hmailserver_db'); $sql = "DELETE FROM domain WHERE domain = '" . $rowdomains['vh_name_vc'] . "'"; DataExchange("w", $postfixdatabase, $sql); } # Remove the domain from the MySQL database now.. $sql = "UPDATE z_vhosts SET vh_deleted_ts=" . time() . " WHERE vh_id_pk=" . $rowdomains['vh_id_pk'] . ""; DataExchange("w", $z_db_name, $sql); } } while ($rowdomains = mysql_fetch_assoc($listdomains)); header("location: " . GetNormalModuleURL($returnurl) . "&r=ok"); exit; }
$ExMessageOption = $ExMessageOption2; } if ($ExMessageOption == "") { $ExMessageOption = '0'; } if ($ExMessageSSL == "" or !is_numeric($ExMessageSSL)) { $ExMessageSSL = '0'; } if ($ExMessageMIME == "" or !is_numeric($ExMessageMIME)) { $ExMessageMIME = '0'; } if (!is_numeric($ExMessagePort)) { $ExMessagePort = '110'; } #Get the hmail domain id for the users mailbox $hmaildatabase = GetSystemOption('hmailserver_db'); $sql = "SELECT accountdomainid FROM hm_accounts WHERE accountid='" . $faaccountid . "'"; $listaccountdomainid = DataExchange("r", $hmaildatabase, $sql); $rowaccountdomainid = mysql_fetch_assoc($listaccountdomainid); $faadomainid = $rowaccountdomainid['accountdomainid']; #we try to connect to the hmailserver $obBaseApp = new COM("hMailServer.Application"); if (!$obBaseApp) { header("location: " . GetNormalModuleURL($returnurl) . "&r=hmcomerror"); exit; } #connection established, now we authenticate $obBaseApp->Connect(); // Authenticate the user $obBaseApp->Authenticate($Usermailbox, $ExMessageAuth); if (!$obBaseApp->Authenticate($Usermailbox, $ExMessageAuth)) {
function zapi_version_check($version) { $updateurl = "http://api.zpanelcp.com/api/version.php?sv=" . GetSystemOption('zpanel_version') . ""; $handle = @file_get_contents($updateurl); $content = $handle; if ($content == '') { $content = "Unable to connect to the ZPanel Version Checker Service at this time."; } else { $content = $handle; } echo $content; return; }
<?php echo $lang['164']; ?> </td> </tr> <tr> <th> </th> <td><?php echo $lang['165']; ?> : <select name="inDestination" id="inDestination"> <option value="">/ (Default)</option> <?php $handle = @opendir(GetSystemOption('hosted_dir') . $useraccount['ac_user_vc']); $chkdir = GetSystemOption('hosted_dir') . $useraccount['ac_user_vc'] . "/"; if (!$handle) { # Log an error as the folder cannot be opened... TriggerLog($useraccount['ac_id_pk'], $b = "Was unable to read the folders in (" . $chkdir . "), please ensure this folder exists."); } else { while ($file = readdir($handle)) { if ($file != "." && $file != "..") { if (is_dir($chkdir . $file)) { echo "<option value=" . $file . ">/" . $file . "</option>\n"; } } } closedir($handle); } ?> </select></td>
} header("location: " . GetNormalModuleURL($returnurl) . "&r=ok"); exit; } if ($_POST['inAction'] == 'delete') { # User has choosen to delete the task... do { #Check to make sure this isnt a password reset... if (isset($_POST['inReset_' . $rowftpaccounts['ft_id_pk']])) { header("location: " . GetNormalModuleURL($returnurl) . "&reset=" . $rowftpaccounts['ft_user_vc'] . ""); exit; } # Ok so lets just go and delete the FTP account now... if (isset($_POST['inDelete_' . $rowftpaccounts['ft_id_pk']])) { # Call the API! $api_resault = zapi_ftpaccount_remove(GetSystemOption('filezilla_root'), $rowftpaccounts['ft_user_vc']); if ($api_resault == false) { # The cronjob was not added for some reason! TriggerLog($useraccount['ac_id_pk'], $b = "FTP user (" . $rowftpaccounts['ft_user_vc'] . ") could not be fully deleted."); } else { TriggerLog($useraccount['ac_id_pk'], $b = "FTP user (" . $rowftpaccounts['ft_user_vc'] . ") has been deleted."); $reboot = system($filezilla_reload); } # Remove the FTP account from the MySQL database now.. $sql = "UPDATE z_ftpaccounts SET ft_deleted_ts=" . time() . " WHERE ft_id_pk=" . $rowftpaccounts['ft_id_pk'] . ""; DataExchange("w", $z_db_name, $sql); # Log the action in the database... TriggerLog($useraccount['ac_id_pk'], $b = "User FTP account ID: " . $rowftpaccounts['ft_id_pk'] . " was deleted."); } } while ($rowftpaccounts = mysql_fetch_assoc($listftpaccounts)); header("location: " . GetNormalModuleURL($returnurl) . "&r=ok");
* * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ include 'conf/zcnf.php'; include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; include 'inc/zAccountDetails.php'; # Set the default infomation submitted in the bug form $returnurl = GetFullURL() . "&ok"; $zpanelurl = $_SERVER['SERVER_NAME']; $serversoft = $_SERVER['SERVER_SOFTWARE']; $phpversion = ShowPHPVersion(); $mysqlversion = ShowMySQLVersion(); $apacheversion = ShowApacheVersion(); $zpanelversion = GetSystemOption('zpanel_version'); echo $lang['55']; if (isset($_GET['r']) && $_GET['r'] == 'ok') { echo $lang['60']; } echo "<br><br>"; ?> <form name="frmReport" id="frmReport" target="_blank" method="post" action="http://api.zpanelcp.com/api/bugapi.php?secure=<?php echo base64_encode("" . $returnurl . "|||" . $zpanelurl . "|||" . $serversoft . "|||" . $apacheversion . "|||" . $phpversion . "|||" . $mysqlversion . "|||" . $zpanelversion . ""); ?> "> <table class="zform"> <tbody><tr> <th><?php echo $lang['56']; ?>
function GetPrefdLang($langsetting) { # DESCRIPTION: Get preferred language. # FUNCTION RELEASE: 6.0.0 # FUNCTION AUTHOR: Bobby Allen (ballen@zpanel.co.uk) if (!empty($langsetting)) { if (file_exists(GetSystemOption('zpanel_root') . 'lang/' . $langsetting . '_override.php')) { $language = $langsetting . '_override'; } else { $language = $langsetting; } } else { if (file_exists(GetSystemOption('zpanel_root') . 'lang/' . GetSystemOption('zpanel_lang') . '_override.php')) { $language = GetSystemOption('zpanel_lang') . '_override'; } else { $language = GetSystemOption('zpanel_lang'); } } return $language; }
<?php } ?> <?php } #a little update to filter domain results if (!isset($_GET['rfilter']) or $_GET['rfilter'] == '') { ?> <tr> <td><?php echo Cleaner('o', $rowmailboxes['mb_address_vc']); ?> </td> <td><?php echo date(GetSystemOption('zpanel_df'), $rowmailboxes['mb_created_ts']); ?> </td> <td><font color="<?php echo $statuscolor; ?> "><?php echo $status; ?> </font></td> <td> <input type="submit" name="inEdit_<?php echo $rowmailboxes['mb_id_pk']; ?> " id="inEdit_<?php echo $rowmailboxes['mb_id_pk'];
} else { TriggerLog($useraccount['ac_id_pk'], $b = "FTP user (" . $rowftpaccounts['ft_user_vc'] . ") has been deleted."); #$reboot = system($filezilla_reload); } $total_deleted = $total_deleted + 1; } while ($rowftpaccounts = mysql_fetch_assoc($listftpaccounts)); # Then obviously we should go and reload FileZilla's configuration.... Due to removal of FTP accounts! } $sql = "UPDATE z_ftpaccounts SET ft_deleted_ts=" . time() . " WHERE ft_acc_fk=" . $rowclients['ac_id_pk'] . " AND ft_deleted_ts IS NULL"; DataExchange("w", $z_db_name, $sql); TriggerLog($useraccount['ac_id_pk'], $b = "User account ID: " . $rowclients['ac_id_pk'] . " (" . $total_deleted . "x FTP accounts) has been deleted!"); # Delete the user's home directory! zapi_filesystem_remove(GetSystemOption('hosted_dir') . $rowclients['ac_user_vc'] . "/"); TriggerLog($useraccount['ac_id_pk'], $b = "User account ID: " . $rowclients['ac_id_pk'] . " (Home directory and contents for \"" . $rowclients['ac_user_vc'] . "\") has been deleted!"); # Delete the user's ZPanel login account $sql = "UPDATE z_accounts SET ac_deleted_ts=" . time() . " WHERE ac_id_pk=" . $rowclients['ac_id_pk'] . ""; $packageid = DataExchange("w", $z_db_name, $sql); TriggerLog($useraccount['ac_id_pk'], $b = "User account ID: " . $rowclients['ac_id_pk'] . " (ZPanel login account \"" . $rowclients['ac_user_vc'] . "\") has been deleted!"); TriggerLog($useraccount['ac_id_pk'], $b = "User account ID: " . $rowclients['ac_id_pk'] . " has been deleted!"); } } while ($rowclients = mysql_fetch_assoc($listclients)); header("location: " . GetNormalModuleURL($returnurl) . "&r=ok"); exit; } # We reload the FTP server here as there will be the requirement to do so... if (ShowServerPlatform() == "Windows") { $filezilla_reload = GetSystemOption('filezilla_root') . "FileZilla server.exe /reload-config"; } else { $filezilla_reload = "/etc/zpanel/bin/zsudo service " . GetSystemOption('lsn_proftpd') . " reload"; } $reboot = system($filezilla_reload);
</th> <th> </th> </tr> <?php do { # Lets get the total number of clients using the packages... $sql = "SELECT * FROM z_accounts WHERE ac_package_fk=" . $rowpackages['pk_id_pk'] . ""; $totalclients = DataExchange("t", $z_db_name, $sql); ?> <tr> <td scope="row"><?php echo Cleaner('o', $rowpackages['pk_name_vc']); ?> </td> <td><?php echo date(GetSystemOption('zpanel_df'), $rowpackages['pk_created_ts']); ?> </td> <td><?php echo $totalclients; ?> </td> <td><input type="submit" name="inEdit_<?php echo $rowpackages['pk_id_pk']; ?> " id="inEdit_<?php echo $rowpackages['pk_id_pk']; ?> " value="<?php echo $lang['85']; ?>
$inUseBT = "On"; } else { $inUseBT = "Off"; } if ($inUseFT == 1) { $inUseFT = "On"; } else { $inUseFT = "Off"; } if (!file_exists(GetSystemOption('mod_bw') . "mod_bw/")) { mkdir(GetSystemOption('mod_bw') . "mod_bw/", 0777); if (ShowServerPlatform() != "Windows") { @chmod(GetSystemOption('mod_bw') . "mod_bw/", 0777); } } $file = GetSystemOption('mod_bw') . "mod_bw/mod_bw_" . $rowpackages['pk_name_vc'] . ".conf"; if ($inUseFT == "On") { $body = "BandwidthModule " . $inUseBT . "\r\nForceBandWidthModule " . $inUseBT . "\r\nBandwidth all " . $inMaxBW . "\r\nMinBandwidth all " . $inMinBW . "\r\nMaxConnection all " . $inMaxCon . "\r\nLargeFileLimit * " . $inDLsize . " " . $inDLspeed . "\r\nBandWidthError 510"; } else { $body = "BandwidthModule " . $inUseBT . "\r\nForceBandWidthModule " . $inUseBT . "\r\nBandwidth all " . $inMaxBW . "\r\nMinBandwidth all " . $inMinBW . "\r\nMaxConnection all " . $inMaxCon . "\r\nBandWidthError 510"; } $fp = @fopen($file, 'w'); fwrite($fp, $body); fclose($fp); if (ShowServerPlatform() != "Windows") { @chmod($file, 0777); } # Log the package as modified so the daemon will make changes to vhosts. $sql = "UPDATE z_quotas SET qt_modified_in = 1 WHERE qt_id_pk = " . $inQuotaID . ""; DataExchange("w", $z_db_name, $sql); # Now we add some infomation to the system log.