static function doUpdateConfig() { global $zdbh; global $controller; runtime_csfr::Protect(); $sql = "SELECT * FROM x_settings WHERE so_module_vc=:name AND so_usereditable_en = 'true'"; //$numrows = $zdbh->query($sql); $name = ui_module::GetModuleName(); $numrows = $zdbh->prepare($sql); $numrows->bindParam(':name', $name); $numrows->execute(); if ($numrows->fetchColumn() != 0) { $sql = $zdbh->prepare($sql); $sql->bindParam(':name', $name); $sql->execute(); while ($row = $sql->fetch()) { if (!fs_director::CheckForEmptyValue($controller->GetControllerRequest('FORM', $row['so_name_vc']))) { $updatesql = $zdbh->prepare("UPDATE x_settings SET so_value_tx = :name2 WHERE so_name_vc = :so_name_vc"); $name2 = $controller->GetControllerRequest('FORM', $row['so_name_vc']); $updatesql->bindParam(':name2', $name2); $updatesql->bindParam(':so_name_vc', $row['so_name_vc']); $updatesql->execute(); } } } self::$ok = true; }
static function doUpdateAccountSettings() { global $zdbh; global $controller; runtime_csfr::Protect(); $currentuser = ctrl_users::GetUserDetail(); $userid = $currentuser['userid']; $email = $controller->GetControllerRequest('FORM', 'inEmail'); $fullname = $controller->GetControllerRequest('FORM', 'inFullname'); $language = $controller->GetControllerRequest('FORM', 'inLanguage'); $phone = $controller->GetControllerRequest('FORM', 'inPhone'); $address = $controller->GetControllerRequest('FORM', 'inAddress'); $postalCode = $controller->GetControllerRequest('FORM', 'inPostalCode'); if (!fs_director::CheckForEmptyValue(self::ExecuteUpdateAccountSettings($userid, $email, $fullname, $language, $phone, $address, $postalCode))) { runtime_hook::Execute('OnAfterUpdateMyAccount'); self::$ok = true; } }
static function doDeleteDomain() { global $controller; runtime_csfr::Protect(); $formvars = $controller->GetAllControllerRequests('FORM'); if (isset($formvars['inDelete'])) { if (self::ExecuteDeleteDomain($formvars['inDelete'])) { self::$ok = TRUE; return true; } } return false; }
static function doDeleteParkedDomain() { global $controller; runtime_csfr::Protect(); // $currentuser = ctrl_users::GetUserDetail(); $formvars = $controller->GetAllControllerRequests('FORM'); if (isset($formvars['inDelete'])) { if (self::ExecuteDeleteParkedDomain($formvars['inDelete'])) { self::$ok = TRUE; return true; } } return false; }
static function doInstallModule() { self::$error_message = ""; self::$error = false; if ($_FILES['modulefile']['error'] > 0) { self::$error_message = "Couldn't upload the file, " . $_FILES['modulefile']['error'] . ""; } else { $archive_ext = fs_director::GetFileExtension($_FILES['modulefile']['name']); $module_folder = fs_director::GetFileNameNoExtentsion($_FILES['modulefile']['name']); $module_dir = ctrl_options::GetSystemOption('sentora_root') . 'modules/' . $module_folder; if (!fs_director::CheckFolderExists($module_dir)) { if ($archive_ext != 'zpp') { self::$error_message = "Package type was not detected as a .zpp (Sentora Package) archive."; } else { if (fs_director::CreateDirectory($module_dir)) { if (sys_archive::Unzip($_FILES['modulefile']['tmp_name'], $module_dir . '/')) { if (!fs_director::CheckFileExists($module_dir . '/module.xml')) { self::$error_message = "No module.xml file found in the unzipped archive."; } else { ui_module::ModuleInfoToDB($module_folder); $extra_config = $module_dir . "/deploy/install.run"; if (fs_director::CheckFileExists($extra_config)) { exec(ctrl_options::GetSystemOption('php_exer') . " " . $extra_config . ""); } self::$ok = true; } } else { self::$error_message = "Couldn't unzip the archive (" . $_FILES['modulefile']['tmp_name'] . ") to " . $module_dir . '/'; } } else { self::$error_message = "Couldn't create module folder in " . $module_dir; } } } else { self::$error_message = "The module " . $module_folder . " is already installed on this server!"; } } return; }
/** * Webinterface sudo methods. */ static function doCreateAlias() { global $controller; runtime_csfr::Protect(); $currentuser = ctrl_users::GetUserDetail(); $formvars = $controller->GetAllControllerRequests('FORM'); if (self::ExecuteCreateAlias($currentuser['userid'], $formvars['inAddress'], $formvars['inDomain'], $formvars['inDestination'])) { self::$ok = true; } return true; }
static function ExecuteDelete($delid, $table, $column, $delNullCol) { global $zdbh; $sql = $zdbh->prepare("\n\t\t\tDELETE FROM " . $table . "\n\t\t\tWHERE " . $column . " = :delid AND " . $delNullCol . " IS NOT NULL"); $sql->bindParam(':delid', $delid); $sql->execute(); // add delete code to remove user's profile also (if is-user-account, del profile too) self::$ok = true; return true; }
static function ExecuteCreateClient($uid, $username, $packageid, $groupid, $fullname, $email, $address, $post, $phone, $password, $sendemail, $emailsubject, $emailbody) { global $zdbh; // Check for spaces and remove if found... $username = strtolower(str_replace(' ', '', $username)); $reseller = ctrl_users::GetUserDetail($uid); // Check for errors before we continue... if (fs_director::CheckForEmptyValue(self::CheckCreateForErrors($username, $packageid, $groupid, $email, $password))) { return false; } runtime_hook::Execute('OnBeforeCreateClient'); $crypto = new runtime_hash(); $crypto->SetPassword($password); $randomsalt = $crypto->RandomSalt(); $crypto->SetSalt($randomsalt); $secure_password = $crypto->CryptParts($crypto->Crypt())->Hash; // No errors found, so we can add the user to the database... $sql = $zdbh->prepare("INSERT INTO x_accounts (ac_user_vc, ac_pass_vc, ac_passsalt_vc, ac_email_vc, ac_package_fk, ac_group_fk, ac_usertheme_vc, ac_usercss_vc, ac_reseller_fk, ac_created_ts) VALUES (\n :username, :password, :passsalt, :email, :packageid, :groupid, :resellertheme, :resellercss, :uid, :time)"); $sql->bindParam(':uid', $uid); $time = time(); $sql->bindParam(':time', $time); $sql->bindParam(':username', $username); $sql->bindParam(':password', $secure_password); $sql->bindParam(':passsalt', $randomsalt); $sql->bindParam(':email', $email); $sql->bindParam(':packageid', $packageid); $sql->bindParam(':groupid', $groupid); $sql->bindParam(':resellertheme', $reseller['usertheme']); $sql->bindParam(':resellercss', $reseller['usercss']); $sql->execute(); // Now lets pull back the client ID so that we can add their personal address details etc... //$client = $zdbh->query("SELECT * FROM x_accounts WHERE ac_reseller_fk=" . $uid . " ORDER BY ac_id_pk DESC")->Fetch(); $numrows = $zdbh->prepare("SELECT * FROM x_accounts WHERE ac_reseller_fk=:uid ORDER BY ac_id_pk DESC"); $numrows->bindParam(':uid', $uid); $numrows->execute(); $client = $numrows->fetch(); $sql = $zdbh->prepare("INSERT INTO x_profiles (ud_user_fk, ud_fullname_vc, ud_group_fk, ud_package_fk, ud_address_tx, ud_postcode_vc, ud_phone_vc, ud_created_ts) VALUES (:userid, :fullname, :packageid, :groupid, :address, :postcode, :phone, :time)"); $sql->bindParam(':userid', $client['ac_id_pk']); $sql->bindParam(':fullname', $fullname); $sql->bindParam(':packageid', $packageid); $sql->bindParam(':groupid', $groupid); $sql->bindParam(':address', $address); $sql->bindParam(':postcode', $post); $sql->bindParam(':phone', $phone); $time = time(); $sql->bindParam(':time', $time); $sql->execute(); // Now we add an entry into the bandwidth table, for the user for the upcoming month. $sql = $zdbh->prepare("INSERT INTO x_bandwidth (bd_acc_fk, bd_month_in, bd_transamount_bi, bd_diskamount_bi) VALUES (:ac_id_pk, :date, 0, 0)"); $date = date("Ym", time()); $sql->bindParam(':date', $date); $sql->bindParam(':ac_id_pk', $client['ac_id_pk']); $sql->execute(); // Lets create the client diectories fs_director::CreateDirectory(ctrl_options::GetSystemOption('hosted_dir') . $username); fs_director::SetFileSystemPermissions(ctrl_options::GetSystemOption('hosted_dir') . $username, 0777); fs_director::CreateDirectory(ctrl_options::GetSystemOption('hosted_dir') . $username . "/public_html"); fs_director::SetFileSystemPermissions(ctrl_options::GetSystemOption('hosted_dir') . $username . "/public_html", 0777); fs_director::CreateDirectory(ctrl_options::GetSystemOption('hosted_dir') . $username . "/backups"); fs_director::SetFileSystemPermissions(ctrl_options::GetSystemOption('hosted_dir') . $username . "/backups", 0777); // Send the user account details via. email (if requested)... if ($sendemail != 0) { if (isset($_SERVER['HTTPS'])) { $protocol = 'https://'; } else { $protocol = 'http://'; } $emailsubject = str_replace("{{username}}", $username, $emailsubject); $emailsubject = str_replace("{{password}}", $password, $emailsubject); $emailsubject = str_replace("{{fullname}}", $fullname, $emailsubject); $emailbody = str_replace("{{username}}", $username, $emailbody); $emailbody = str_replace("{{password}}", $password, $emailbody); $emailbody = str_replace("{{fullname}}", $fullname, $emailbody); $emailbody = str_replace('{{controlpanelurl}}', $protocol . ctrl_options::GetSystemOption('MADmin_domain'), $emailbody); $phpmailer = new sys_email(); $phpmailer->Subject = $emailsubject; $phpmailer->Body = $emailbody; $phpmailer->AddAddress($email); $phpmailer->SendEmail(); } runtime_hook::Execute('OnAfterCreateClient'); self::$resetform = true; self::$ok = true; return true; }
static function doUpdateMailbox() { global $controller; runtime_csfr::Protect(); $currentuser = ctrl_users::GetUserDetail(); $formvars = $controller->GetAllControllerRequests('FORM'); $enabled = isset($formvars['inEnabled']) ? fs_director::GetCheckboxValue($formvars['inEnabled']) : 0; if (self::ExecuteUpdateMailbox($formvars['inSave'], $formvars['inPassword'], $enabled)) { self::$ok = true; } return true; }
static function ExecuteUpdateClient($clientid, $package, $enabled, $group, $fullname, $email, $address, $post, $phone, $newpass) { global $zdbh; runtime_hook::Execute('OnBeforeUpdateClient'); //convert package to numerical id if needed if (!is_numeric($package)) { $package = self::getPackageIdFix($package); } if ($enabled == 0) { runtime_hook::Execute('OnBeforeDisableClient'); } if ($enabled == 1) { runtime_hook::Execute('OnBeforeEnableClient'); } if ($newpass != "") { // Check for password length... if (strlen($newpass) < ctrl_options::GetSystemOption('password_minlength')) { self::$badpassword = true; return false; } $crypto = new runtime_hash(); $crypto->SetPassword($newpass); $randomsalt = $crypto->RandomSalt(); $crypto->SetSalt($randomsalt); $secure_password = $crypto->CryptParts($crypto->Crypt())->Hash; $sql = $zdbh->prepare("UPDATE x_accounts SET ac_pass_vc= :newpass, ac_passsalt_vc= :passsalt WHERE ac_id_pk= :clientid"); $sql->bindParam(':clientid', $clientid); $sql->bindParam(':newpass', $secure_password); $sql->bindParam(':passsalt', $randomsalt); $sql->execute(); } $sql = $zdbh->prepare("UPDATE x_accounts SET ac_email_vc= :email, ac_package_fk= :package, ac_enabled_in= :isenabled, ac_group_fk= :group WHERE ac_id_pk = :clientid"); $sql->bindParam(':email', $email); $sql->bindParam(':package', $package); $sql->bindParam(':isenabled', $enabled); $sql->bindParam(':group', $group); $sql->bindParam(':clientid', $clientid); //$sql->bindParam(':accountid', $clientid); $sql->execute(); $sql = $zdbh->prepare("UPDATE x_profiles SET ud_fullname_vc= :fullname, ud_group_fk= :group, ud_package_fk= :package, ud_address_tx= :address,ud_postcode_vc= :postcode, ud_phone_vc= :phone WHERE ud_user_fk=:accountid"); $sql->bindParam(':fullname', $fullname); $sql->bindParam(':group', $group); $sql->bindParam(':package', $package); $sql->bindParam(':address', $address); $sql->bindParam(':postcode', $post); $sql->bindParam(':phone', $phone); $sql->bindParam(':accountid', $clientid); $sql->execute(); if ($enabled == 0) { runtime_hook::Execute('OnAfterDisableClient'); } if ($enabled == 1) { runtime_hook::Execute('OnAfterEnableClient'); } runtime_hook::Execute('OnAfterUpdateClient'); self::$ok = true; return true; }
static function ExecuteAddFaq($question, $answer, $userid, $global) { global $zdbh; if ($question != "" && $answer != "") { $sql = "INSERT INTO x_faqs (fq_acc_fk, fq_question_tx, fq_answer_tx, fq_global_in, fq_created_ts) VALUES (:userid, :question, :answer, :global, :time)"; $sql = $zdbh->prepare($sql); $sql->bindParam(':userid', $userid); $sql->bindParam(':question', $question); $sql->bindParam(':answer', $answer); $sql->bindParam(':global', $global); $time = time(); $sql->bindParam(':time', $time); $sql->execute(); self::$ok = true; return true; } else { self::$error = true; return false; } }
static function ExecuteDeleteDatabase($my_id_pk) { global $zdbh; runtime_hook::Execute('OnBeforeDeleteDatabase'); $numrows = $zdbh->prepare("SELECT my_name_vc FROM x_mysql_databases WHERE my_id_pk=:my_id_pk"); $numrows->bindParam(':my_id_pk', $my_id_pk); $numrows->execute(); $rowmysql = $numrows->fetch(); try { $my_name_vc = $zdbh->mysqlRealEscapeString($rowmysql['my_name_vc']); $sql = $zdbh->prepare("DROP DATABASE IF EXISTS `{$my_name_vc}`;"); //$sql->bindParam(':my_name_vc', $rowmysql['my_name_vc'], PDO::PARAM_STR); $sql->execute(); $sql = $zdbh->prepare("FLUSH PRIVILEGES"); $sql->execute(); $sql = $zdbh->prepare("UPDATE x_mysql_databases SET my_deleted_ts = :time WHERE my_id_pk = :my_id_pk"); $sql->bindParam(':time', time()); $sql->bindParam(':my_id_pk', $my_id_pk); $sql->execute(); $sql = $zdbh->prepare("DELETE FROM x_mysql_dbmap WHERE mm_database_fk=:my_id_pk"); $sql->bindParam(':my_id_pk', $my_id_pk); $sql->execute(); } catch (PDOException $e) { return false; } runtime_hook::Execute('OnAfterDeleteDatabase'); self::$ok = true; return true; }
static function ExecuteUpdatePackage($uid, $pid, $packagename, $EnablePHP, $Domains, $SubDomains, $ParkedDomains, $Mailboxes, $Fowarders, $DistLists, $FTPAccounts, $MySQL, $DiskQuota, $BandQuota) { global $zdbh; if (fs_director::CheckForEmptyValue(self::CheckNumeric($EnablePHP, $Domains, $SubDomains, $ParkedDomains, $Mailboxes, $Fowarders, $DistLists, $FTPAccounts, $MySQL, $DiskQuota, $BandQuota))) { return false; } $packagename = str_replace(' ', '', $packagename); // Check for errors before we continue... if (fs_director::CheckForEmptyValue(self::CheckCreateForErrors($packagename, $uid, $pid))) { return false; } runtime_hook::Execute('OnBeforeUpdatePackage'); $sql = $zdbh->prepare("UPDATE x_packages SET pk_name_vc=:packagename,\n\t\t\t\t\t\t\t\tpk_enablephp_in = :php\n\t\t\t\t\t\t\t\tWHERE pk_id_pk = :pid"); $php = fs_director::GetCheckboxValue($EnablePHP); $sql->bindParam(':php', $php); $sql->bindParam(':pid', $pid); $sql->bindParam(':packagename', $packagename); $sql->execute(); $sql = $zdbh->prepare("UPDATE x_quotas SET qt_domains_in = :Domains,\n\t\t\t\t\t\t\t\tqt_parkeddomains_in = :ParkedDomains,\n\t\t\t\t\t\t\t\tqt_ftpaccounts_in = :FTPAccounts,\n\t\t\t\t\t\t\t\tqt_subdomains_in = :SubDomains,\n\t\t\t\t\t\t\t\tqt_mailboxes_in = :Mailboxes,\n\t\t\t\t\t\t\t\tqt_fowarders_in = :Fowarders,\n\t\t\t\t\t\t\t\tqt_distlists_in = :DistLists,\n\t\t\t\t\t\t\t\tqt_diskspace_bi = :DiskQuotaFinal,\n\t\t\t\t\t\t\t\tqt_bandwidth_bi = :BandQuotaFinal,\n\t\t\t\t\t\t\t\tqt_mysql_in = :MySQL\n WHERE qt_package_fk = :pid"); $DiskQuotaFinal = $DiskQuota * 1024000; $BandQuotaFinal = $BandQuota * 1024000; $sql->bindParam(':DiskQuotaFinal', $DiskQuotaFinal); $sql->bindParam(':BandQuotaFinal', $BandQuotaFinal); $sql->bindParam(':MySQL', $MySQL); $sql->bindParam(':DistLists', $DistLists); $sql->bindParam(':Fowarders', $Fowarders); $sql->bindParam(':Mailboxes', $Mailboxes); $sql->bindParam(':SubDomains', $SubDomains); $sql->bindParam(':FTPAccounts', $FTPAccounts); $sql->bindParam(':ParkedDomains', $ParkedDomains); $sql->bindParam(':Domains', $Domains); $sql->bindParam(':pid', $pid); $sql->execute(); runtime_hook::Execute('OnAfterUpdatePackage'); self::$ok = true; return true; }
static function doDeleteCron() { global $zdbh; global $controller; runtime_csfr::Protect(); $currentuser = ctrl_users::GetUserDetail(); $sql = "SELECT COUNT(*) FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL"; $numrows = $zdbh->prepare($sql); $numrows->bindParam(':userid', $currentuser['userid']); if ($numrows->execute()) { if ($numrows->fetchColumn() != 0) { $sql = $zdbh->prepare("SELECT * FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL"); $sql->bindParam(':userid', $currentuser['userid']); $sql->execute(); while ($rowcrons = $sql->fetch()) { if (!fs_director::CheckForEmptyValue($controller->GetControllerRequest('FORM', 'inDelete_' . $rowcrons['ct_id_pk'] . ''))) { $sql2 = $zdbh->prepare("UPDATE x_cronjobs SET ct_deleted_ts=:time WHERE ct_id_pk=:cronid"); $sql2->bindParam(':cronid', $rowcrons['ct_id_pk']); $sql2->bindParam(':time', time()); $sql2->execute(); (new Cronfile())->writeToFile(); self::$ok = TRUE; return; } } } } self::$error = TRUE; return; }
static function ExecuteDeleteDistListUser($du_id_pk) { global $zdbh; global $controller; $numrows = $zdbh->prepare("SELECT * FROM x_distlistusers WHERE du_id_pk=:du_id_pk AND du_deleted_ts IS NULL"); $numrows->bindParam(':du_id_pk', $du_id_pk); $numrows->execute(); $rowdlu = $numrows->fetch(); //WARNING : $rowdlu is used in mail server specific file $numrows = $zdbh->prepare("SELECT * FROM x_distlists WHERE dl_id_pk=:du_distlist_fk AND dl_deleted_ts IS NULL"); $numrows->bindParam(':du_distlist_fk', $rowdlu['du_distlist_fk']); $numrows->execute(); $rowdl = $numrows->fetch(); $dladdress = $rowdl['dl_address_vc']; //WARNING : $dladdress is used in mail server specific file runtime_hook::Execute('OnBeforeDeleteDistListUser'); self::$deleteuser = true; // Include mail server specific file here. $MailServerFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('mailserver_php'); if (file_exists($MailServerFile)) { include $MailServerFile; } $sql = "UPDATE x_distlistusers SET du_deleted_ts=:time WHERE du_id_pk=:du_id_pk"; $sql = $zdbh->prepare($sql); $time = time(); $sql->bindParam(':time', $time); $sql->bindParam(':du_id_pk', $du_id_pk); $sql->execute(); runtime_hook::Execute('OnAfterDeleteDistListUser'); self::$ok = true; return true; }
/** * Webinterface sudo methods. */ static function doCreateForwarder() { global $controller; runtime_csfr::Protect(); $currentuser = ctrl_users::GetUserDetail(); $formvars = $controller->GetAllControllerRequests('FORM'); $keepmessage = isset($formvars['inKeepMessage']) ? fs_director::GetCheckboxValue($formvars['inKeepMessage']) : 0; if (self::ExecuteCreateForwarder($currentuser['userid'], $formvars['inAddress'], $formvars['inDestinationName'], $formvars['inDestinationDomain'], $keepmessage)) { self::$ok = true; } return true; }
static function doForceDaemon() { global $zdbh; global $controller; runtime_csfr::Protect(); $formvars = $controller->GetAllControllerRequests('FORM'); if (isset($formvars['inForceFull'])) { $sql = $zdbh->prepare("UPDATE x_settings set so_value_tx = '0' WHERE so_name_vc = 'daemon_lastrun'"); $sql->execute(); $sql = $zdbh->prepare("UPDATE x_settings set so_value_tx = '0' WHERE so_name_vc = 'daemon_dayrun'"); $sql->execute(); $sql = $zdbh->prepare("UPDATE x_settings set so_value_tx = '0' WHERE so_name_vc = 'daemon_weekrun'"); $sql->execute(); $sql = $zdbh->prepare("UPDATE x_settings set so_value_tx = '0' WHERE so_name_vc = 'daemon_monthrun'"); $sql->execute(); } self::$ok = true; }
static function doResetPassword() { global $controller; runtime_csfr::Protect(); $formvars = $controller->GetAllControllerRequests('FORM'); if (self::ExecuteResetPassword($formvars['inReset'], $formvars['inPassword'])) { self::$ok = true; } return true; }
static function ExecuteResetPassword($myuserid, $password) { global $zdbh; runtime_hook::Execute('OnBeforeResetDatabasePassword'); //$rowuser = $zdbh->query("SELECT * FROM x_mysql_users WHERE mu_id_pk=" . $myuserid . " AND mu_deleted_ts IS NULL")->fetch(); $numrows = $zdbh->prepare("SELECT * FROM x_mysql_users WHERE mu_id_pk=:myuserid AND mu_deleted_ts IS NULL"); $numrows->bindParam(':myuserid', $myuserid); $numrows->execute(); $rowuser = $numrows->fetch(); // If errors are found, then exit before resetting password... if (fs_director::CheckForEmptyValue(self::CheckPasswordForErrors($password))) { return false; } $sql = "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = :mu_name_vc)"; $numrows = $zdbh->prepare($sql); $numrows->bindParam(':mu_name_vc', $rowuser['mu_name_vc']); if ($numrows->execute()) { if ($numrows->fetchColumn() != 0) { // Set MySQL password for new user... $sql = $zdbh->prepare("SET PASSWORD FOR :mu_name_vc@:mu_access_vc=PASSWORD(:password)"); $sql->bindParam(':mu_name_vc', $rowuser['mu_name_vc']); $sql->bindParam(':mu_access_vc', $rowuser['mu_access_vc']); $sql->bindParam(':password', $password); $sql->execute(); $sql = $zdbh->prepare("FLUSH PRIVILEGES"); $sql->execute(); $sql = $zdbh->prepare("UPDATE x_mysql_users SET mu_pass_vc=:password WHERE mu_id_pk=:myuserid"); $sql->bindParam(':password', $password); $sql->bindParam(':myuserid', $myuserid); $sql->execute(); } } runtime_hook::Execute('OnAfterResetDatabasePassword'); self::$ok = true; return true; }
static function ResetDomain($dn_vhost_fk) { global $zdbh; //Delete current records self::DeleteDomainRecords($dn_vhost_fk); //Create Default Records self::CreateDefaultRecords($dn_vhost_fk); self::$ok = true; }
static function doSaveVhost() { global $zdbh; global $controller; runtime_csfr::Protect(); $port = $controller->GetControllerRequest('FORM', 'vh_custom_port_in'); if (empty($port)) { $port = NULL; } else { $port = $controller->GetControllerRequest('FORM', 'vh_custom_port_in'); } $ip = $controller->GetControllerRequest('FORM', 'vh_custom_ip_vc'); if (empty($ip)) { $ip = NULL; } else { $ip = $controller->GetControllerRequest('FORM', 'vh_custom_ip_vc'); } $sql = $zdbh->prepare("UPDATE x_vhosts SET\n\t\t\tvh_enabled_in = ?,\n\t\t\tvh_suhosin_in = ?,\n\t\t\tvh_obasedir_in = ?,\n\t\t\tvh_custom_port_in = ?,\n vh_portforward_in = ?,\n vh_custom_ip_vc = ?,\n\t\t\tvh_custom_tx = ?\n\t\t\tWHERE\n\t\t\tvh_id_pk = ?\n\t\t\tAND vh_deleted_ts IS NULL"); $sql->execute(array(fs_director::GetCheckboxValue($controller->GetControllerRequest('FORM', 'vh_enabled_in')), fs_director::GetCheckboxValue($controller->GetControllerRequest('FORM', 'vh_suhosin_in')), fs_director::GetCheckboxValue($controller->GetControllerRequest('FORM', 'vh_obasedir_in')), $port, fs_director::GetCheckboxValue($controller->GetControllerRequest('FORM', 'vh_portforward_in')), $ip, $controller->GetControllerRequest('FORM', 'vh_custom_tx'), $controller->GetControllerRequest('FORM', 'vh_id_pk'))); self::SetWriteApacheConfigTrue(); self::$ok = true; return true; }