本文整理汇总了PHP中runtime_hook::Execute方法的典型用法代码示例。如果您正苦于以下问题:PHP runtime_hook::Execute方法的具体用法?PHP runtime_hook::Execute怎么用?PHP runtime_hook::Execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类runtime_hook
的用法示例。
在下文中一共展示了runtime_hook::Execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SendEmail
/**
* Sends the email with the contents of the object (Body etc. set using the parant calls in phpMailer!)
* @author Bobby Allen (ballen@bobbyallen.me)
* @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;
}
}
示例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 (ballen@bobbyallen.me)
* @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;
}
}
示例3: CompileFunctions
/**
* Runs though the functions array and loads the relivent function compiler
* @author Sam Mottley (smottley@sentora.org)
*/
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;
}
示例4: PortStatus
/**
* Reports on whether a TCP or UDP port is listening for connections.
* @author Bobby Allen (ballen@bobbyallen.me)
* @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;
}
示例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;
}
}
示例6: PortStatus
/**
* Reports on whether a TCP or UDP port is listening for connections.
* @author Bobby Allen (ballen@bobbyallen.me)
* @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;
}
示例7: SetSystemOption
/**
* The main 'setter' class used to write/update system options.
* @author Bobby Allen (ballen@bobbyallen.me)
* @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');
}
示例8: writeLog
/**
* Writes the log infomation out to a predefined logging medium (from $this->method)
* @author Bobby Allen (ballen@bobbyallen.me)
* @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;
}
示例9: shout
/**
* Show HTML Alert Messages
* Jason Davis (jason.davis.fl@gmail.com)
* @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;
}
示例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;
}
示例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;
}
示例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;
}
示例13: OutputControllerDebug
/**
* Displays Controller debug infomation (mainly for module development and debugging)
* @author Bobby Allen (ballen@bobbyallen.me)
* @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;
}
}
示例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;
}
示例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;
}