本文整理汇总了PHP中KTUtil::getSystemIdentifier方法的典型用法代码示例。如果您正苦于以下问题:PHP KTUtil::getSystemIdentifier方法的具体用法?PHP KTUtil::getSystemIdentifier怎么用?PHP KTUtil::getSystemIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KTUtil
的用法示例。
在下文中一共展示了KTUtil::getSystemIdentifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGuid
function getGuid()
{
$guid = KTUtil::getSystemIdentifier();
if (PEAR::isError($guid)) {
$guid = '-';
}
return $guid;
}
示例2: do_sendResetRequest
function do_sendResetRequest()
{
$email = $_REQUEST['email'];
$user = $_REQUEST['username'];
// Check that the user and email match up in the database
$sQuery = 'SELECT id FROM users WHERE username = ? AND email = ?';
$aParams = array($user, $email);
$id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id');
if (!is_numeric($id) || $id < 1) {
return _kt('Please check that you have entered a valid username and email address.');
}
// Generate a random key that expires after 24 hours
$expiryDate = time() + 86400;
$randomKey = rand(20000, 100000) . "_{$id}_" . KTUtil::getSystemIdentifier();
KTUtil::setSystemSetting('password_reset_expire-' . $id, $expiryDate);
KTUtil::setSystemSetting('password_reset_key-' . $id, $randomKey);
// Create the link to reset the password
$query = 'pword_reset=' . $randomKey;
$url = KTUtil::addQueryStringSelf($query);
// $url = KTUtil::kt_url() . '/login.php?' . $query;
$subject = APP_NAME . ': ' . _kt('password reset request');
$body = '<dd><p>';
$body .= _kt('You have requested to reset the password for your account. To confirm that the request was submitted by you
click on the link below, you will then be able to reset your password.');
$body .= "</p><p><a href = '{$url}'>" . _kt('Confirm password reset') . '</a></p></dd>';
$oEmail = new Email();
$res = $oEmail->send($email, $subject, $body);
if ($res === true) {
return _kt('A verification email has been sent to your email address.');
}
return _kt('An error occurred while sending the email, please try again or contact the System Administrator.');
}