* 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/>. * */ include 'conf/zcnf.php'; include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; include 'inc/zAccountDetails.php'; $sql = "SELECT * FROM z_ftpaccounts WHERE ft_acc_fk=" . $useraccount['ac_id_pk'] . " AND ft_deleted_ts IS NULL"; $listftpaccounts = DataExchange("r", $z_db_name, $sql); $rowftpaccounts = mysql_fetch_assoc($listftpaccounts); $totalftpaccounts = DataExchange("t", $z_db_name, $sql); echo $lang['208'] . "<br>"; if (isset($_GET['r']) && $_GET['r'] == 'ok') { echo "<br><div class=\"zannouce\">" . $lang['212'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'exists') { echo "<br><div class=\"zannouce\">" . $lang['211'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'blank') { echo "<br><div class=\"zannouce\">" . $lang['295'] . "</div>"; } echo "<br><h2>" . $lang['205'] . "</h2>"; if ($totalftpaccounts > 0) { ?> <form id="frmFTPAccounts" name="frmFTPAccounts" method="post" action="runner.php?load=obj_ftpaccounts"> <table class="zgrid">
* * 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/>. * */ include 'conf/zcnf.php'; include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; include 'inc/zAccountDetails.php'; # Grab a list of the system settings... $sql = "SELECT * FROM z_settings WHERE st_editable_in=1"; $listoptions = DataExchange("r", $z_db_name, $sql); $rowoptions = mysql_fetch_assoc($listoptions); echo $lang['74'] . "<br>"; if (isset($_GET['r']) && $_GET['r'] == 'ok') { echo "<br><div class=\"zannouce\">" . $lang['75'] . "</div>"; } echo "<br><h2>" . $lang['198'] . "</h2>"; echo "<form action=\"runner.php?load=obj_zpconfig\" method=\"post\" name=\"frmZPConfig\" id=\"frmZPConfig\">"; echo "<table class=\"zgrid\">"; do { echo "<tr>\r\n \t\t\t<th>" . $lang[$rowoptions['st_label_vc']] . "</th>\r\n \t\t\t<td><input type=\"text\" name=\"" . $rowoptions['st_name_vc'] . "\" value=\"" . $rowoptions['st_value_tx'] . "\"></td>\r\n \t\t</tr>"; } while ($rowoptions = mysql_fetch_assoc($listoptions)); echo "<tr><td><input type=\"hidden\" name=\"inReturn\" value=\"" . GetFullURL() . "\"><input type=\"submit\" name=\"inSaveSystem\"value=\"" . $lang['18'] . "\"></td><td></td></tr>"; echo "</table></form>"; echo "<br><h2>" . $lang['199'] . "</h2>"; echo "<form action=\"runner.php?load=obj_zpconfig\" method=\"post\" name=\"frmZPConfig\" id=\"frmZPConfig\">";
<input type="submit" name="inSubmit" id="inSubmit" value="<?php echo $lang['128']; ?> " /></th> </tr> </table> </form><?php } else { echo $lang['234']; } } # Check the see if the user wants to edit the dist list in queston... if (isset($_GET['edit'])) { # Get a list of the dist list users.... $sql = "SELECT * FROM z_distlists WHERE dl_acc_fk=" . $useraccount['ac_id_pk'] . " AND dl_address_vc='" . Cleaner('i', $_GET['edit']) . "' AND dl_deleted_ts IS NULL"; $listdistlist = DataExchange("r", $z_db_name, $sql); $rowdistlist = mysql_fetch_assoc($listdistlist); $totaldistlist = DataExchange("t", $z_db_name, $sql); $sql = "SELECT * FROM z_distlistusers WHERE du_distlist_fk=" . $rowdistlist['dl_id_pk'] . " AND du_deleted_ts IS NULL"; $listdistlistusers = DataExchange("r", $z_db_name, $sql); $rowdistlistusers = mysql_fetch_assoc($listdistlistusers); $totaldistlistusers = DataExchange("t", $z_db_name, $sql); echo "<br><h2>Edit distrubution list</h2>"; echo "<form id=\"frmNewDistListUser\" name=\"frmNewDistListUser\" method=\"post\" action=\"runner.php?load=obj_mail\">\r\n\t<table class=\"zform\">\r\n\t<tr>\r\n <th colspan=\"3\">" . $rowdistlist['dl_address_vc'] . "</th>\r\n \t</tr>\r\n\t <tr>\r\n <th> </th>\r\n <td> </td>\r\n\t<td> </td>\r\n </tr>"; if ($rowdistlistusers > 0) { do { echo "<tr>\r\n <th>Email Address:</th><td>" . $rowdistlistusers['du_address_vc'] . "</td>\r\n <td><input type=\"submit\" name=\"inDelete_" . $rowdistlistusers['du_id_pk'] . "\" id=\"inDelete_" . $rowforwarders['du_id_pk'] . "\" value=\"" . $lang['84'] . "\" /></td>\r\n </tr>"; } while ($rowdistlistusers = mysql_fetch_assoc($listdistlistusers)); } echo "\r\n <tr>\r\n <th> </th>\r\n <td> </td>\r\n\t<td> </td>\r\n </tr>\r\n <tr>\r\n <th>Add new address:</th>\r\n <td><input type=\"text\" name=\"inDistListAddress\" id=\"inDistListAddress\" /></td><td> </td>\r\n </tr>\r\n <tr>\r\n <th colspan=\"3\" align=\"right\"><input type=\"hidden\" name=\"inReturn\" value=\"" . GetFullURL() . "\" />\r\n <input type=\"hidden\" name=\"inAction\" value=\"edit_distlists\" />\r\n\t\t <input type=\"hidden\" name=\"inDLID\" value=\"" . $rowdistlist['dl_id_pk'] . "\" />\r\n <input type=\"submit\" name=\"inSubmit\" id=\"inSubmit\" value=\"" . $lang['128'] . "\" /></th>\r\n </tr>\r\n</table>"; }
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)) { header("location: " . GetNormalModuleURL($returnurl) . "&r=hmautherror&mb=" . $Usermailbox . ""); exit;
$sql = "SELECT * FROM hm_accounts WHERE accountaddress='" . Cleaner('o', $rowmailboxes['mb_address_vc']) . "'"; $listhmaccount = DataExchange("r", $hmaildatabase, $sql); $rowhmaccount = mysql_fetch_assoc($listhmaccount); if ($rowhmaccount['accountactive'] == '1') { $status = $lang['251']; $statuscolor = "green"; } else { $status = $lang['253']; $statuscolor = "red"; } } else { #################### POSIX # Platform is POSIX, we use Postfix $postfixdatabase = GetSystemOption('hmailserver_db'); $sql = "SELECT * FROM mailbox WHERE username='******'o', $rowmailboxes['mb_address_vc']) . "'"; $listhmaccount = DataExchange("r", $postfixdatabase, $sql); $rowhmaccount = mysql_fetch_assoc($listhmaccount); if ($rowhmaccount['active'] == '1') { $status = $lang['251']; $statuscolor = "green"; } else { $status = $lang['253']; $statuscolor = "red"; } } ###################################### ENDIF #a little update to filter domain results if (isset($_GET['rfilter']) && $_GET['rfilter'] != '') { $rfilter = $_GET['rfilter']; $isfilter = strstr($rowmailboxes['mb_address_vc'], $rfilter); if ($isfilter) {
" /><input type="hidden" name="inAction" value="new" /><input type="submit" name="inSubmit" id="inSubmit" value="<?php echo $lang['101']; ?> " /></th> </tr> </table> </form> <?php } else { # Package is to edit... $sql = "SELECT * FROM z_packages WHERE pk_id_pk=" . $_GET['edit'] . " AND pk_deleted_ts IS NULL AND pk_reseller_fk=" . $useraccount['ac_id_pk'] . ""; $listpackage = DataExchange("r", $z_db_name, $sql); $rowpackage = mysql_fetch_assoc($listpackage); # Get the list of quotas for the packages... $sql = "SELECT * FROM z_quotas WHERE qt_package_fk=" . $_GET['edit'] . ""; $listquotas = DataExchange("r", $z_db_name, $sql); $rowquotas = mysql_fetch_assoc($listquotas); ?> <br><h2><?php echo $lang['103']; ?> </h2> <form id="frmEditPackage" name="frmEditPackage" method="post" action="runner.php?load=obj_packages"> <table class="zform"> <tr> <th><?php echo $lang['77']; ?> :</th> <td> <?php
} 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);
* * 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/>. * */ include 'conf/zcnf.php'; include_once 'inc/zDataExchange.php'; if (isset($_SESSION['zUserID'])) { # User is logged in, lets gather account details for the account. $useraccount = DataExchange("l", $z_db_name, "SELECT * FROM z_accounts WHERE ac_id_pk=" . $_SESSION['zUserID'] . " AND ac_deleted_ts IS NULL"); # Gather package infomation for the account. $packageinfo = DataExchange("l", $z_db_name, "SELECT * FROM z_packages WHERE pk_id_pk=" . $useraccount['ac_package_fk'] . ""); # Gather quota infomation for the account. $quotainfo = DataExchange("l", $z_db_name, "SELECT * FROM z_quotas WHERE qt_package_fk=" . $useraccount['ac_package_fk'] . ""); # Gather personal infomation for the account. $personalinfo = DataExchange("l", $z_db_name, "SELECT * FROM z_personal WHERE ap_acc_fk=" . $useraccount['ac_id_pk'] . ""); # Gather permissions for the account. $permissionset = DataExchange("l", $z_db_name, "SELECT * FROM z_permissions WHERE pr_package_fk=" . $useraccount['ac_package_fk'] . ""); } else { # Event for when user is not logged in! }
</th> <th><?php echo $lang['111']; ?> </th> <th><?php echo $lang['112']; ?> </th> <th> </th> </tr> <?php do { # Get package infomation for the user... $sql = "SELECT pk_name_vc FROM z_packages WHERE pk_id_pk=" . $rowclients['ac_package_fk'] . ""; $package = DataExchange("l", $z_db_name, $sql); ?> <tr> <td><?php echo Cleaner('o', $rowclients['ac_user_vc']); ?> </td> <td><?php echo $package['pk_name_vc']; ?> </td> <td><?php echo FormatFileSize(GetQuotaUsages('diskspace', $rowclients['ac_id_pk'])); ?> </td> <td><?php
function GetQuotaUsages($a, $b = 0) { # DESCRIPTION: Returns the current usage of a particular resource. # FUNCTION RELEASE: 5.0.0 # FUNCTION AUTHOR: Bobby Allen (ballen@zpanel.co.uk) $resource = $a; $acc_key = $b; include 'conf/zcnf.php'; if ($resource == 'domains') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_vhosts WHERE vh_acc_fk=" . $acc_key . " AND vh_type_in=1 AND vh_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'subdomains') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_vhosts WHERE vh_acc_fk=" . $acc_key . " AND vh_type_in=2 AND vh_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'parkeddomains') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_vhosts WHERE vh_acc_fk=" . $acc_key . " AND vh_type_in=3 AND vh_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'mailboxes') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_mailboxes WHERE mb_acc_fk=" . $acc_key . " AND mb_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'forwarders') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_forwarders WHERE fw_acc_fk=" . $acc_key . " AND fw_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'distlists') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_distlists WHERE dl_acc_fk=" . $acc_key . " AND dl_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'ftpaccounts') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_ftpaccounts WHERE ft_acc_fk=" . $acc_key . " AND ft_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'mysql') { $fretval = DataExchange("l", $z_db_name, "SELECT COUNT(*) AS amount FROM z_mysql WHERE my_acc_fk=" . $acc_key . " AND my_deleted_ts IS NULL"); $fretval = $fretval['amount']; } if ($resource == 'diskspace') { $fretval = DataExchange("l", $z_db_name, "SELECT bd_diskamount_bi FROM z_bandwidth WHERE bd_acc_fk=" . $acc_key . " AND bd_month_in=" . date("Ym", time()) . ""); $fretval = $fretval['bd_diskamount_bi']; } if ($resource == 'bandwidth') { $fretval = DataExchange("l", $z_db_name, "SELECT bd_transamount_bi FROM z_bandwidth WHERE bd_acc_fk=" . $acc_key . " AND bd_month_in=" . date("Ym", time()) . ""); $fretval = $fretval['bd_transamount_bi']; } return $fretval; }
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"); exit; }
* 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']; $returnurl = Cleaner('o', $_POST['inReturn']); # Lets get database ID's for all accounts. if ($permissionset['pr_admin_in'] == 1) { $sql = "SELECT * FROM z_accounts WHERE ac_deleted_ts IS NULL"; } else { $sql = "SELECT * FROM z_accounts WHERE ac_reseller_fk=" . $useraccount['ac_id_pk'] . " AND ac_deleted_ts IS NULL"; } $listclients = DataExchange("r", $z_db_name, $sql); $rowclients = mysql_fetch_assoc($listclients); $totalRows_clients = DataExchange("t", $z_db_name, $sql); if ($totalRows_clients > 0) { # We now need to check which client we are going to shadow... do { # See if this client has been selected to be shadowed... if (isset($_POST['inShadow_' . $rowclients['ac_id_pk']])) { # Call the API! zapi_shadow_user($rowclients['ac_user_vc'], $rowclients['ac_id_pk'], $useraccount['ac_user_vc']); } } while ($rowclients = mysql_fetch_assoc($listclients)); } header("location: " . GetNormalModuleURL($returnurl) . ""); exit;
include 'inc/zAccountDetails.php'; // Check if all used variables are assigned. If not, NULL them. (added by Triple_nothing to fix unset variable issues when PHP is in Strict reporting mode) if (!isset($useraccount['ac_user_vc'])) { $useraccount['ac_user_vc'] = NULL; } if (!isset($_POST['upatehtaccess'])) { $_POST['upatehtaccess'] = NULL; } if (!isset($ht_id_pk)) { $ht_id_pk = NULL; } if (!isset($user)) { $user = NULL; } $sql = "SELECT * FROM z_mysql WHERE my_acc_fk=" . $useraccount['ac_id_pk'] . " AND my_deleted_ts IS NULL"; $listmysql = DataExchange("r", $z_db_name, $sql); $rowmysql = mysql_fetch_assoc($listmysql); $path = GetSystemOption('hosted_dir') . $_SESSION['zUsername'] . "/"; $userreturnpath = trim(substr($_POST['returnpath'], strlen(GetSystemOption('hosted_dir')), strlen($_POST['returnpath']))); if (isset($_POST['deletehtaccess'])) { deletehtaccess($useraccount['ac_id_pk'], $_POST['deletehtaccess'], $_POST['upatereturnpath']); } if (isset($_POST['deleteuser'])) { deleteuser($_POST['ht_id_pk'], $_POST['deleteuser']); } if (isset($_POST['addhtaccess'])) { addhtaccess($useraccount['ac_id_pk'], $_POST['ht_user_vc'], $_POST['ht_dir_vc'], $_POST['htusername'], $_POST['htpassword1'], $_POST['htpassword2'], $_POST['AuthName']); } if (isset($_POST['adduser'])) { adduser($useraccount['ac_id_pk'], $_POST['ht_user_vc'], $_POST['ht_dir_vc'], $_POST['htusername'], $_POST['htpassword1'], $_POST['htpassword2']); }
* 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']; $returnurl = Cleaner('o', $_POST['inReturn']); # Now we turn the values that are avaliable to be saved... $sql = "SELECT * FROM z_settings WHERE st_editable_in=1"; $listoptions = DataExchange("r", $z_db_name, $sql); $rowoptions = mysql_fetch_assoc($listoptions); if (isset($_POST['inSaveSystem'])) { do { # Now we simply update the account details based on the current session. DataExchange("w", $z_db_name, "UPDATE z_settings SET st_value_tx='" . Cleaner('o', $_POST['' . $rowoptions['st_name_vc'] . '']) . "' WHERE st_name_vc = '" . $rowoptions['st_name_vc'] . "'"); } while ($rowoptions = mysql_fetch_assoc($listoptions)); } if (isset($_POST['inSaveTemplate'])) { DataExchange("w", $z_db_name, "UPDATE z_settings SET st_value_tx='" . Cleaner('o', $_POST['inTemplate']) . "' WHERE st_name_vc = 'zpanel_template'"); DataExchange("w", $z_db_name, "UPDATE z_settings SET st_value_tx='" . Cleaner('o', str_replace(".php", "", $_POST['inTranslation'])) . "' WHERE st_name_vc = 'zpanel_lang'"); } if (isset($_POST['inSaveWelcome'])) { DataExchange("w", $z_db_name, "UPDATE z_settings SET st_value_tx='" . htmlentities($_POST['inWelcome']) . "' WHERE st_name_vc = 'zpanel_welcome'"); } $returnurl = GetNormalModuleURL($returnurl) . "&r=ok"; header("location: " . $returnurl . ""); exit;
<input type="submit" name="inSubmit" id="inSubmit" value="<?php echo $lang['101']; ?> " /></th> </tr> </table> </form> <?php } else { # Client to edit.. $sql = "SELECT * FROM z_accounts WHERE ac_id_pk=" . $_GET['edit'] . " AND ac_deleted_ts IS NULL AND ac_reseller_fk=" . $useraccount['ac_id_pk'] . ""; $listclient = DataExchange("r", $z_db_name, $sql); $rowclient = mysql_fetch_assoc($listclient); # Get the client's personal data... $sql = "SELECT * FROM z_personal WHERE ap_acc_fk=" . $rowclient['ac_id_pk'] . ""; $listpersonal = DataExchange("r", $z_db_name, $sql); $rowpersonal = mysql_fetch_assoc($listpersonal); ?> <br><h2><?php echo $lang['115']; ?> </h2> <form id="frmClients" name="frmClients" method="post" action="runner.php?load=obj_clients"> <table class="zform"> <tr> <th><?php echo $lang['109']; ?> :</th> <td><input name="inUserName" type="text" disabled="disabled" maxlength="10" id="inUserName" value="<?php echo Cleaner('o', $rowclient['ac_user_vc']);
* 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/>. * */ 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 AND vh_type_in=3"; $listdomains = DataExchange("r", $z_db_name, $sql); $rowdomains = mysql_fetch_assoc($listdomains); $totaldomains = DataExchange("t", $z_db_name, $sql); echo $lang['170'] . "<br>"; if (isset($_GET['r']) && $_GET['r'] == 'ok') { echo "<br><div class=\"zannouce\">" . $lang['156'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'alreadyexists') { echo "<br><div class=\"zannouce\">" . $lang['157'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'error') { echo "<br><div class=\"zannouce\">" . $lang['291'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'exists') { echo "<br><div class=\"zannouce\">" . $lang['157'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'blank') { echo "<br><div class=\"zannouce\">" . $lang['292'] . "</div>";
* @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']; $fullname = Cleaner("i", $_POST['inFullname']); $email_address = Cleaner("i", $_POST['inEmail']); $postal_address = Cleaner("i", $_POST['inAddress']); $postal_code = Cleaner("i", $_POST['inPostalCode']); $phone = Cleaner("i", $_POST['inPhone']); $returnurl = $_POST['inReturnURL']; $language = $_POST['inTranslation']; # Now we simply update the account details based on the current session. DataExchange("w", $z_db_name, "UPDATE z_personal SET ap_fullname_vc='" . $fullname . "', ap_email_vc='" . $email_address . "', ap_address_tx='" . $postal_address . "', ap_postcode_vc='" . $postal_code . "', ap_phone_vc='" . $phone . "', ap_language_vc='" . $language . "' WHERE ap_acc_fk=" . $acc_fk . ""); $returnurl = GetNormalModuleURL($returnurl) . "&r=ok"; header("location: " . $returnurl . ""); exit;
<form id="frmNewForwarder" name="frmNewForwarder" method="post" action="runner.php?load=obj_mail"> <table class="zform"> <tr> <th><?php echo $lang['14']; ?> </th> <td><select name="inAddress" id="inAddress"> <option value="">-- <?php echo $lang['245']; ?> --</option> <?php do { $sql = "SELECT fw_address_vc FROM z_forwarders WHERE fw_address_vc='" . $rowexdomains['mb_address_vc'] . "' AND fw_deleted_ts IS NULL"; $checkmailbox = DataExchange("r", $z_db_name, $sql); $rowcheckmailbox = mysql_fetch_assoc($checkmailbox); if ($rowcheckmailbox['fw_address_vc'] != $rowexdomains['mb_address_vc']) { echo "<option value=\"" . $rowexdomains['mb_address_vc'] . "\">" . $rowexdomains['mb_address_vc'] . "</option>"; } } while ($rowexdomains = mysql_fetch_assoc($listexdomains)); ?> </select></td> </tr> <tr> <th><?php echo $lang['185']; ?> :</th> <td><input name="inDestinationName" type="text" id="inDestinationName"/> @ <input name="inDestinationDomain" type="text" id="inDestinationDomain"/></td> </tr>
function TriggerLog($a = 0, $b = "No details.") { # DESCRIPTION: Logs an event, for debugging or audit purposes in the 'z_logs' table. # FUNCTION RELEASE: 5.0.0 # FUNCTION AUTHOR: Bobby Allen (ballen@zpanel.co.uk) global $zpanel_db_conf; $acc_key = $a; $log_details = $b; include $zpanel_db_conf; $sql = "INSERT INTO z_logs (lg_acc_fk, lg_when_ts, lg_ipaddress_vc, lg_details_tx) VALUES (" . $acc_key . ", '" . time() . "', '" . $_SERVER['HTTP_X_FORWARDED_FOR'] . "', '" . $log_details . "')"; DataExchange("w", $z_db_name, $sql); return; }
# Lets grab and archive the user's web data.... $homedir = GetSystemOption('hosted_dir') . $useraccount['ac_user_vc']; $backupname = $useraccount['ac_user_vc'] . "_" . date("dmy_Gi", time()); $dbstamp = date("dmy_Gi", time()); # We now see what the OS is before we work out what compression command to use.. if (ShowServerPlatform() == "Windows") { $resault = exec(ChangeSafeSlashesToWin(GetSystemOption('7z_exe') . " a -tzip -y-r " . GetSystemOption('temp_dir') . $backupname . ".zip " . $homedir . "")); } else { $resault = exec(GetSystemOption('7z_exe') . " -r9 " . GetSystemOption('temp_dir') . $backupname . " " . $homedir . "/*"); @chmod(GetSystemOption('temp_dir') . $backupname . ".zip", 0777); } # Now lets backup all MySQL datbases for the user and add them to the archive... $sql = "SELECT * FROM z_mysql WHERE my_acc_fk=" . $useraccount['ac_id_pk'] . " AND my_deleted_ts IS NULL"; $mysql = DataExchange("r", $z_db_name, $sql); $row_mysql = mysql_fetch_assoc($mysql); $totalmysql = DataExchange("t", $z_db_name, $sql); if ($totalmysql > 0) { do { $bkcommand = GetSystemOption('mysqldump_exe') . " -h " . $z_db_host . " -u " . $z_db_user . " -p" . $z_db_pass . " --no-create-db " . $row_mysql['my_name_vc'] . " > " . GetSystemOption('temp_dir') . $row_mysql['my_name_vc'] . "_" . $dbstamp . ".sql"; passthru($bkcommand); # Add it to the ZIP archive... if (ShowServerPlatform() == "Windows") { $resault = exec(ChangeSafeSlashesToWin(GetSystemOption('7z_exe') . " u " . GetSystemOption('temp_dir') . $backupname . ".zip " . GetSystemOption('temp_dir') . $row_mysql['my_name_vc'] . "_" . $dbstamp . ".sql")); } else { $resault = exec(GetSystemOption('7z_exe') . " " . GetSystemOption('temp_dir') . $backupname . " " . GetSystemOption('temp_dir') . $row_mysql['my_name_vc'] . "_" . $dbstamp . ".sql"); } unlink(GetSystemOption('temp_dir') . $row_mysql['my_name_vc'] . "_" . $dbstamp . ".sql"); } while ($row_mysql = mysql_fetch_assoc($mysql)); } TriggerLog($useraccount['ac_id_pk'], "User full hosting account backup was created."); if (ShowServerPlatform() == "Windows") {
* * 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']; $returnurl = $_POST['inReturn']; # Now we simply update the account details based on the current session. DataExchange("w", $z_db_name, "UPDATE z_resellers SET rc_company_vc='" . Cleaner('i', $_POST['inCompanyName']) . "' WHERE rc_acc_fk=" . $acc_fk . ""); $returnurl = GetNormalModuleURL($returnurl) . "&r=ok"; header("location: " . $returnurl . ""); exit;
* 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/>. * */ include 'conf/zcnf.php'; include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; include 'inc/zAccountDetails.php'; $sql = "SELECT * FROM z_cronjobs WHERE ct_acc_fk=" . $useraccount['ac_id_pk'] . " AND ct_deleted_ts IS NULL"; $listtasks = DataExchange("r", $z_db_name, $sql); $rowtasks = mysql_fetch_assoc($listtasks); $totaltasks = DataExchange("t", $z_db_name, $sql); echo $lang['120'] . "<br>"; if (isset($_GET['r']) && $_GET['r'] == 'ok') { echo "<br><div class=\"zannouce\">" . $lang['394'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'blank') { echo "<br><div class=\"zannouce\">" . $lang['300'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'noexists') { echo "<br><div class=\"zannouce\">" . $lang['301'] . " " . $useraccount['ac_user_vc'] . "</div>"; } if (isset($_GET['r']) && $_GET['r'] == 'error') { echo "<br><div class=\"zannouce\">" . $lang['395'] . "</div>"; } echo "<br><h2>" . $lang['121'] . "</h2>"; if ($totaltasks > 0) {
* (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/>. * */ include 'conf/zcnf.php'; include 'lang/' . GetPrefdLang($personalinfo['ap_language_vc']) . '.php'; #Get a list of the FAQ's from the database $sql = "SELECT * FROM z_faqs WHERE fq_queston_tx IS NOT NULL"; $listfaqs = DataExchange("r", $z_db_name, $sql); $rowfaqs = mysql_fetch_assoc($listfaqs); echo $lang['50']; echo "<br><br>"; ?> <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'none') e.style.display = 'block'; else e.style.display = 'none'; } //--> </script>