本文整理汇总了PHP中runtime_hook类的典型用法代码示例。如果您正苦于以下问题:PHP runtime_hook类的具体用法?PHP runtime_hook怎么用?PHP runtime_hook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了runtime_hook类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: SendEmail
/**
* Sends the email with the contents of the object (Body etc. set using the parant calls in phpMailer!)
* @author Bobby Allen ([email protected])
* @return boolean
*/
public function SendEmail()
{
$this->Mailer = ctrl_options::GetSystemOption('mailer_type');
$this->From = ctrl_options::GetSystemOption('email_from_address');
$this->FromName = ctrl_options::GetSystemOption('email_from_name');
if (ctrl_options::GetSystemOption('email_smtp') != 'false') {
$this->IsSMTP();
if (ctrl_options::GetSystemOption('smtp_auth') != 'false') {
$this->SMTPAuth = true;
$this->Username = ctrl_options::GetSystemOption('smtp_username');
$this->Password = ctrl_options::GetSystemOption('smtp_password');
}
if (ctrl_options::GetSystemOption('smtp_secure') != 'false') {
$this->SMTPSecure = ctrl_options::GetSystemOption('smtp_secure');
}
$this->Host = ctrl_options::GetSystemOption('smtp_server');
$this->Port = ctrl_options::GetSystemOption('smtp_port');
}
ob_start();
$send_resault = $this->Send();
$error = ob_get_contents();
ob_clean();
if ($send_resault) {
runtime_hook::Execute('OnSuccessfulSendEmail');
return true;
} else {
$logger = new debug_logger();
$logger->method = ctrl_options::GetSystemOption('logmode');
$logger->logcode = "061";
$logger->detail = 'Error sending email (using sys_email): ' . $error . '';
$logger->writeLog();
runtime_hook::Execute('OnFailedSendEmail');
return false;
}
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:40,代码来源:email.class.php
示例2: CheckServerAPIKey
/**
* Checks that the Server API given in the webservice request XML is valid and matches the one stored in the x_settings table.
* @author Bobby Allen ([email protected])
* @return boolean
*/
public function CheckServerAPIKey()
{
if ($this->wsdataarray['apikey'] != ctrl_options::GetSystemOption('apikey')) {
runtime_hook::Execute('OnBadAPIKeyAuth');
return false;
} else {
runtime_hook::Execute('OnGoodAPIKeyAuth');
return true;
}
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:15,代码来源:xmws.class.php
示例3: CompileFunctions
/**
* Runs though the functions array and loads the relivent function compiler
* @author Sam Mottley ([email protected])
*/
static function CompileFunctions($data)
{
$temp = $data;
runtime_hook::Execute('OnBeforeTemplateProcessor');
foreach (ui_templateparser::$Functions as $Tag => $pattern) {
$temp = call_user_func_array('ui_templateparser::Compile' . $Tag, array($pattern, $temp));
}
runtime_hook::Execute('OnAfterTemplateProcessor');
return $temp;
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:14,代码来源:templateparser.class.php
示例4: PortStatus
/**
* Reports on whether a TCP or UDP port is listening for connections.
* @author Bobby Allen ([email protected])
* @param int $port The port number of which to check (eg. 25 for SMTP).
* @param boolean $udp Port is a UDP port as opposed to a TCP port.
* @return boolean
* @change P.Peyremorte
* - added port close if open successes
*/
static function PortStatus($port, $udp = false)
{
$timeout = ctrl_options::GetSystemOption('servicechk_to');
$ip = $udp ? 'udp://' . $_SERVER['SERVER_ADDR'] : $_SERVER['SERVER_ADDR'];
$fp = @fsockopen($ip, $port, $errno, $errstr, $timeout);
if (!$fp) {
runtime_hook::Execute('OnPortStatusDown');
return false;
}
fclose($fp);
runtime_hook::Execute('OnPortStatusUp');
return true;
}
开发者ID:Boter,项目名称:madmin-core,代码行数:22,代码来源:monitoring.class.php
示例5: doUpdateAccountSettings
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;
}
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:18,代码来源:controller.ext.php
示例6: PortStatus
/**
* Reports on whether a TCP or UDP port is listening for connections.
* @author Bobby Allen ([email protected])
* @param int $port The port number of which to check (eg. 25 for SMTP).
* @param boolean $udp Port is a UDP port as opposed to a TCP port.
* @return boolean
*/
static function PortStatus($port, $udp = false)
{
$timeout = ctrl_options::GetSystemOption('servicechk_to');
if ($udp) {
$ip = 'udp://' . $_SERVER['SERVER_ADDR'];
} else {
$ip = $_SERVER['SERVER_ADDR'];
}
$fp = @fsockopen($ip, $port, $errno, $errstr, $timeout);
if (!$fp) {
runtime_hook::Execute('OnPortStatusDown');
$retval = false;
} else {
runtime_hook::Execute('OnPortStatusUp');
$retval = true;
}
return $retval;
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:25,代码来源:monitoring.class.php
示例7: SetSystemOption
/**
* The main 'setter' class used to write/update system options.
* @author Bobby Allen ([email protected])
* @global db_driver $zdbh The ZPX database handle.
* @param string $name The name of the system option (eg. zpanel_root)
* @param string $value The value to set.
* @param bool $create Instead of update the system option, create it instead?
* @return bool
*/
static function SetSystemOption($name, $value, $create = false)
{
global $zdbh;
if ($create == false) {
$bindArray = array(':name' => $name, ':value' => $value);
if ($zdbh->bindQuery("UPDATE x_settings SET so_value_tx = :value WHERE so_name_vc = :name", $bindArray)) {
return true;
} else {
return false;
}
} else {
$bindArray = array(':name' => $name, ':value' => $value);
if ($zdbh->bindQuery("INSERT INTO x_settings (so_name_vc, so_value_tx) VALUES (:name, :value)", $bindArray)) {
return true;
} else {
return false;
}
}
runtime_hook::Execute('OnSetSystemOption');
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:29,代码来源:options.class.php
示例8: writeLog
/**
* Writes the log infomation out to a predefined logging medium (from $this->method)
* @author Bobby Allen ([email protected])
* @global db_driver $zdbh The ZPX database handle.
* @return boolean
*/
function writeLog()
{
global $zdbh;
runtime_hook::Execute('OnWriteErrorLog');
if ($this->method == "screen") {
die($this->logcode . ' - ' . $this->detail);
} elseif ($this->method == "file") {
fs_filehandler::AddTextToFile(ctrl_options::GetSystemOption('logfile'), date('c') . ' - ' . $this->logcode . ' - ' . $this->detail, 1);
} elseif ($this->method == "email") {
$email_log = new sys_email();
$email_log->Subject = "Sentora Error Log";
$email_log->Body = "" . date('c') . ' - ' . $this->logcode . ' - ' . $this->detail . "";
$email_log->AddAddress(ctrl_options::GetSystemOption('email_from_address'));
$email_log->SendEmail();
} elseif ($this->method == "db") {
$statement = "INSERT INTO x_logs (lg_user_fk, lg_code_vc, lg_module_vc, lg_detail_tx, lg_stack_tx) VALUES (0, '" . $this->logcode . "', 'NA', '" . $this->detail . "', '" . $this->mextra . "')";
if ($zdbh->exec($statement)) {
$retval = true;
} else {
$retval = false;
}
try {
$statement = "INSERT INTO x_logs (lg_user_fk, lg_code_vc, lg_module_vc, lg_detail_tx, lg_stack_tx, lg_when_ts) VALUES (0, '" . $this->logcode . "', 'NA', '" . $this->detail . "', '" . $this->mextra . "','" . time() . "')";
if ($zdbh->exec($statement) > 0) {
$retval = true;
} else {
$retval = false;
}
} catch (Exception $e) {
$temp_log_obj->method = "text";
$temp_log_obj->logcode = "012";
$temp_log_obj->detail = "Unable to log infomation to the required place (in the database)";
$temp_log_obj->mextra = $e;
$temp_log_obj->writeLog();
}
return true;
} else {
echo $this->logcode . " - " . $this->detail . " - " . $this->mextra;
}
return;
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:47,代码来源:logger.class.php
示例9: shout
/**
* Show HTML Alert Messages
* Jason Davis ([email protected])
* @param string $message The message to output to the screen.
* @param string $class The CSS class name to use on the DIV.
* @param string $title An Optional Heading/Title Message
* @param string $closeBtn Optional TRUE or FALSE to show a Close button or not
*
* @return string The generated HTML source code.
*/
static function shout($message, $class = "zannounce", $title = '', $closeBtn = true)
{
// Convert Sentora CSS Class to Bootstrap Class
switch ($class) {
case 'zannounce':
case 'zannounceinfo':
case 'alert-info':
$class = 'alert-info';
break;
case 'zannounceerror':
case 'alert-error':
$class = 'alert-danger';
break;
case 'zannouncesuccess':
case 'alert-success':
case 'zannounceok':
$class = 'alert-success';
break;
case 'zannounceprimary':
case 'alert-primary':
$class = 'alert-primary';
break;
case 'notice':
$class = 'alert-info notice-manager-alert hidden';
break;
default:
$class = 'alert-info';
}
runtime_hook::Execute('OnBeforeSysMessageShout');
$line = '<div class="alert alert-block ' . $class . '">';
$heading = $title ? '<h4>' . $title . '</h4>' : '';
$closeBtn = $closeBtn ? '<button type="button" class="close" data-dismiss="alert">×</button>' : '';
$line .= $closeBtn . $heading . '<p>' . $message . '</p></div>';
runtime_hook::Execute('OnAfterSysMessageShout');
return $line;
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:46,代码来源:sysmessage.class.php
示例10: ExecuteDeleteForwarder
static function ExecuteDeleteForwarder($fw_id_pk)
{
global $zdbh;
global $controller;
runtime_hook::Execute('OnBeforeDeleteForwarer');
//$rowforwarder = $zdbh->query("SELECT * FROM x_forwarders WHERE fw_id_pk=" . $fw_id_pk . "")->fetch();
$numrows = $zdbh->prepare("SELECT * FROM x_forwarders WHERE fw_id_pk=:fw_id_pk");
$numrows->bindParam(':fw_id_pk', $fw_id_pk);
$numrows->execute();
$rowforwarder = $numrows->fetch();
self::$delete = 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_forwarders SET fw_deleted_ts=:time WHERE fw_id_pk=:fw_id_pk";
$sql = $zdbh->prepare($sql);
$sql->bindParam(':fw_id_pk', $fw_id_pk);
$sql->bindParam(':time', time());
$sql->execute();
runtime_hook::Execute('OnAfterDeleteForwarder');
self::$ok = true;
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:24,代码来源:controller.ext.php
示例11: ExecuteDeleteFTP
static function ExecuteDeleteFTP($ft_id_pk, $uid)
{
global $zdbh;
global $controller;
// Verify if Current user can Edit FTP Account.
$currentuser = ctrl_users::GetUserDetail($uid);
$sql = "SELECT * FROM x_ftpaccounts WHERE ft_acc_fk=:userid AND ft_id_pk=:editedUsrID AND ft_deleted_ts IS NULL";
$numrows = $zdbh->prepare($sql);
$numrows->bindParam(':userid', $currentuser['userid']);
$numrows->bindParam(':editedUsrID', $ft_id_pk);
$numrows->execute();
if ($numrows->rowCount() == 0) {
return;
}
// Delete User
runtime_hook::Execute('OnBeforeDeleteFTPAccount');
$rowftpsql = "SELECT * FROM x_ftpaccounts WHERE ft_id_pk=:ftIdPk";
$rowftpfind = $zdbh->prepare($rowftpsql);
$rowftpfind->bindParam(':ftIdPk', $ft_id_pk);
$rowftpfind->execute();
$rowftp = $rowftpfind->fetch();
$sql = $zdbh->prepare("UPDATE x_ftpaccounts SET ft_deleted_ts=:time WHERE ft_id_pk=:ftpid");
$sql->bindParam(':ftpid', $ft_id_pk);
$sql->bindParam(':time', $ft_id_pk);
$sql->execute();
self::$delete = true;
// Include FTP server specific file here.
$FtpModuleFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('ftp_php');
if (file_exists($FtpModuleFile)) {
include $FtpModuleFile;
}
$retval = TRUE;
runtime_hook::Execute('OnAfterDeleteFTPAccount');
return $retval;
}
开发者ID:Boter,项目名称:madmin-core,代码行数:35,代码来源:controller.ext.php
示例12: ExecuteUpdateClient
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;
}
开发者ID:nmsde,项目名称:sentora-whmcs,代码行数:58,代码来源:controller.ext.php
示例13: OutputControllerDebug
/**
* Displays Controller debug infomation (mainly for module development and debugging)
* @author Bobby Allen ([email protected])
* @global string $script_memory The current amount of memory that the script it using.
* @global int $starttime The microtime of when the script started executing.
* @return string HTML output of the debug infomation.
*/
public function OutputControllerDebug()
{
global $script_memory;
global $starttime;
if (isset($this->vars_get[0]['debug'])) {
ob_start();
var_dump($this->GetAllControllerRequests('URL'));
$set_urls = ob_get_contents();
ob_end_clean();
ob_start();
var_dump($this->GetAllControllerRequests('FORM'));
$set_forms = ob_get_contents();
ob_end_clean();
ob_start();
var_dump($this->GetAllControllerRequests('USER'));
$set_sessions = ob_get_contents();
ob_end_clean();
ob_start();
var_dump($this->GetAllControllerRequests('COOKIE'));
$set_cookies = ob_get_contents();
ob_end_clean();
$classes_loaded = debug_execution::GetLoadedClasses();
ob_start();
print_r($classes_loaded);
$classes_array = ob_get_contents();
ob_end_clean();
$sql_queries = debug_execution::GetSQLQueriesExecuted();
ob_start();
print_r($sql_queries);
$sql_array = ob_get_contents();
ob_end_clean();
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = $endtime - $starttime;
runtime_hook::Execute('OnDisplayRuntimeDebug');
return "<h1>Controller Debug Mode</h1><strong>PHP Script Memory Usage:</strong> " . debug_execution::ScriptMemoryUsage($script_memory) . "<br><strong>Script Execution Time: </strong> " . $totaltime . "<br><br><strong>URL Variables set:</strong><br><pre>" . $set_urls . "</pre><strong>POST Variables set:</strong><br><pre>" . $set_forms . "</pre><strong>SESSION Variables set:</strong><br><pre>" . $set_sessions . "</pre><strong>COOKIE Variables set:</strong><br><pre>" . $set_cookies . "</pre><br><br><strong>Loaded classes (Total: " . count($classes_loaded) . "):</strong><pre>" . $classes_array . "</pre><br><br><strong>SQL queries executed (Total: " . count($sql_queries) . "):</strong><pre>" . $sql_array . "</pre>";
} else {
return false;
}
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:49,代码来源:controller.class.php
示例14: ExecuteCreateClient
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;
}
开发者ID:Boter,项目名称:madmin-core,代码行数:85,代码来源:controller.ext.php
示例15: ExecuteResetPassword
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;
}
开发者ID:caglaroflazoglu,项目名称:sentora-core,代码行数:36,代码来源:controller.ext.php
示例16: ModuleInfoToDB
/**
* Gathers module infomation from the modules XML file and adds the details to the DB.
* @author Bobby Allen ([email protected])
* @param string $module The name of the module (folder) of which to import the module infomation in for.
* @return boolean
*/
static function ModuleInfoToDB($module)
{
global $zdbh;
global $zlo;
runtime_hook::Execute('OnBeforeModuleInfoToDB');
$mod_xml = "modules/{$module}/module.xml";
try {
$mod_config = new xml_reader(fs_filehandler::ReadFileContents($mod_xml));
$mod_config->Parse();
$module_name = $mod_config->document->name[0]->tagData;
$module_version = $mod_config->document->version[0]->tagData;
$module_description = $mod_config->document->desc[0]->tagData;
$module_defaultcat = $mod_config->document->defaultcat[0]->tagData;
$module_type = $mod_config->document->type[0]->tagData;
if ($module_type != ("user" || "system" || "modadmin")) {
$module_type = "user";
}
$sql = $zdbh->prepare("SELECT mc_id_pk FROM x_modcats WHERE mc_name_vc = :module_defaultcat");
$sql->bindParam(':module_defaultcat', $module_defaultcat);
$status = $sql->execute();
$result = $sql->fetch();
if ($result) {
$cat_fk = $result['mc_id_pk'];
} else {
$cat_fk = 2;
}
$sql = $zdbh->prepare("INSERT INTO x_modules (mo_name_vc, mo_category_fk, mo_version_in, mo_folder_vc, mo_installed_ts, mo_type_en, mo_desc_tx) VALUES (:module_name, :cat_fk, :module_version, :module, " . time() . ", :module_type, :module_description)");
$sql->bindParam(':module_name', $module_name);
$sql->bindParam(':cat_fk', $cat_fk);
$sql->bindParam(':module_version', $module_version);
$sql->bindParam(':module', $module);
$sql->bindParam(':module_type', $module_type);
$sql->bindParam(':module_description', $module_description);
$sql->execute();
return true;
} catch (Exception $e) {
return false;
}
runtime_hook::Execute('OnAfterModuleInfoToDB');
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:46,代码来源:module.class.php
示例17: ExecuteDeleteDatabase
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;
}
开发者ID:caglaroflazoglu,项目名称:sentora-core,代码行数:29,代码来源:controller.ext.php
示例18: SetFileSystemPermissions
/**
* Sets file/directory permissions on a given path.
* @author Bobby Allen ([email protected])
* @param string $path The full path of the file or folder on which to set the permissions on.
* @param int $mode The UNIX permissions octal (eg. 0777 or 777)
* @return boolean
*/
static function SetFileSystemPermissions($path, $mode)
{
if (file_exists($path)) {
runtime_hook::Execute('OnBeforeSetFileSystemPerms');
@chmod($path, $mode);
runtime_hook::Execute('OnAfterSetFileSystemPerms');
$retval = true;
} else {
$retval = false;
}
return $retval;
}
开发者ID:Boter,项目名称:madmin-core,代码行数:19,代码来源:director.class.php
示例19: ExecuteUpdatePackage
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;
}
开发者ID:Boter,项目名称:madmin-core,代码行数:37,代码来源:controller.ext.php
示例20: ExecuteAddParkedDomain
public function ExecuteAddParkedDomain($uid, $domain)
{
global $zdbh;
$retval = FALSE;
runtime_hook::Execute('OnBeforeAddParkedDomain');
$currentuser = ctrl_users::GetUserDetail($uid);
$domain = strtolower(str_replace(' ', '', $domain));
if (!fs_director::CheckForEmptyValue(self::CheckCreateForErrors($domain))) {
// If all has gone well we need to now create the domain in the database...
$sql = $zdbh->prepare("INSERT INTO x_vhosts (vh_acc_fk,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t vh_name_vc,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t vh_directory_vc,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t vh_type_in,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t vh_created_ts) VALUES (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t :userid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t :domain,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t :time)");
$sql->bindParam(':userid', $currentuser['userid']);
$sql->bindParam(':domain', $domain);
$time = time();
$sql->bindParam(':time', $time);
$sql->execute();
# Only run if the Server platform is Windows.
if (sys_versions::ShowOSPlatformVersion() == 'Windows') {
if (ctrl_options::GetSystemOption('disable_hostsen') == 'false') {
# Lets add the hostname to the HOSTS file so that the server can view the domain immediately...
@exec("C:/zpanel/bin/zpss/setroute.exe " . $domain . "");
@exec("C:/zpanel/bin/zpss/setroute.exe www." . $domain . "");
}
}
self::SetWriteApacheConfigTrue();
$retval = TRUE;
runtime_hook::Execute('OnAfterAddParkedDomain');
return $retval;
}
}
开发者ID:caglaroflazoglu,项目名称:sentora-core,代码行数:29,代码来源:controller.ext.php
注:本文中的runtime_hook类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论