当前位置: 首页>>代码示例>>PHP>>正文


PHP KTUtil::getSystemIdentifier方法代码示例

本文整理汇总了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;
}
开发者ID:5haman,项目名称:knowledgetree,代码行数:8,代码来源:system_info.php

示例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.');
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:32,代码来源:loginResetDispatcher.php


注:本文中的KTUtil::getSystemIdentifier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。