$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); } } # Send email saying that domain has been removed due to note exsistent document root. # Email user if they are over their storage limit and BCC server admin in! $messagesubject = $lang['217']; $messagebody = $lang['218']; $messagebody = str_replace("{{username}}", $row_domains['ac_user_vc'], $messagebody); $messagebody = str_replace("{{domain}}", $row_domains['vh_name_vc'], $messagebody); $sent = SendAccountMail($row_domains['ac_email_vc'], $messagesubject, $messagebody); if ($sent == 1) { TriggerLog(1, $b = "> Domain '" . $row_domains['vh_name_vc'] . "' was removed, invalid home directory, Email sent to user!"); } else { TriggerLog(1, $b = "> Domain '" . $row_domains['vh_name_vc'] . "' was removed, invalid home directory, Unable to send user email!"); } } } while ($row_domains = mysql_fetch_assoc($domains)); } else { echo "No Apache VHOSTs are currently configured on this server!"; } ##################################################################################################################################### # New 'reload apache implementation, added in Zpanel 4.0.3) # ##################################################################################################################################### if (IsWindows() == true) { system("C:\\ZPanel\\bin\\apache\\bin\\httpd.exe -k restart -n \"Apache\"");
# Now we add some infomation to the system log. TriggerLog($useraccount['ac_id_pk'], $b = "> New FTP account has been created for the new user (" . Cleaner('i', $username) . ")."); } else { TriggerLog($useraccount['ac_id_pk'], $b = "> Could not auto create new FTP user (" . Cleaner('i', $username) . ") as a duplicate account exists on the server."); } } # Send the user account details via. email (if requested)... if ($_POST['inSWE'] == 1) { if ($_POST['inEmailAddress'] != '') { include "lang/" . GetSystemOption('zpanel_lang') . ".php"; $messagesubject = $lang['225']; $messagebody = GetSystemOption('zpanel_welcome'); $messagebody = str_replace("{{username}}", $username, $messagebody); $messagebody = str_replace("{{password}}", $_POST['inPassword'], $messagebody); $messagebody = str_replace("{{fullname}}", $_POST['inFullName'], $messagebody); if (SendAccountMail($_POST['inEmailAddress'], $messagesubject, $messagebody) == 1) { TriggerLog(1, "> Welcome email was sent to the user successfully!"); } else { TriggerLog(1, "> Welcome email failed to send to the recipient.\r\rError was:\r\rCheck that you are running an SMTP server and that you can send from this address, likely to be that the SMTP server requires outgoing authentication!"); } } } TriggerLog($useraccount['ac_id_pk'], $b = "User account ID: " . $clientid['ac_id_pk'] . " (" . Cleaner('i', $username) . ") was created."); header("location: " . $returnurl . "&r=ok"); exit; } if ($_POST['inAction'] == 'edit') { # If the user submitted an 'edit' request then we will simply update the accounts and personal tables in the database... # Get the old package id to check if it has changed. $sql = "SELECT * FROM z_accounts WHERE ac_id_pk=" . $_POST['inClientID'] . ""; $listoldpackage = DataExchange("r", $z_db_name, $sql);