本文整理汇总了PHP中getPassword函数的典型用法代码示例。如果您正苦于以下问题:PHP getPassword函数的具体用法?PHP getPassword怎么用?PHP getPassword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPassword函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: PageCompMainCode
/**
* page code function
*/
function PageCompMainCode()
{
global $oTemplConfig;
global $logged;
$iId = (int) $_COOKIE['memberID'];
if ($iId > 0) {
$sPassword = getPassword($iId);
$bEnableRay = getParam('enable_ray') == 'on';
$check_res = checkAction($iId, ACTION_ID_USE_RAY_CHAT);
if ($bEnableRay && $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED) {
$ret .= getApplicationContent('chat', 'user', array('id' => $iId, 'password' => $sPassword));
} else {
// $ret .= '
// <center>
// <table width=100% height=100% cellpadding=0 cellspacing=0>
// <td align=center valign=center>
// <table width="90%" height="70" cellpadding="5" cellspacing="1" class="table">
// <tr>
// <td class="panel" width="100%" align="center" valign="middle">
// <div align="center" class="small">' . $check_res[CHECK_ACTION_MESSAGE] . '</div>
// </td>
// </tr>
// </table>
// </td>
// </table>
// </center>';
$ret .= MsgBox($check_res[CHECK_ACTION_MESSAGE]);
}
return DesignBoxContent(_t("_RAY_CHAT"), $ret, $oTemplConfig->PageCompThird_db_num);
} else {
return DesignBoxContent(_t('_LOGIN_ERROR'), MsgBox(_t('_Please login before using Ray chat')), 1);
}
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:36,代码来源:chat.php
示例2: add
public function add()
{
if ($this->request->is('post')) {
$this->User->create();
$this->request->data['Group']['Group'][] = (int) Configure::read('Settings.Company.DefaultGroupId');
$this->request->data['User']['date_joined'] = gmdate('Y-m-d H:i:s');
$password = getPassword();
$this->request->data['User']['password'] = $password;
$signature = substr(MD5($this->request->data['User']['email'] . $this->request->data['User']['date_joined']), 0, 7);
$this->request->data['User']['signature'] = $signature;
if ($this->User->save($this->request->data)) {
//save Signature archive
$arrSignature = array();
$arrSignature['SignatureArchive']['user_id'] = $this->User->id;
$arrSignature['SignatureArchive']['signature'] = $signature;
$arrSignature['SignatureArchive']['user_modify'] = $this->Session->read('Auth.User.id');
$arrSignature['SignatureArchive']['date_from'] = gmdate('Y-m-d H:i:s');
$arrSignature['SignatureArchive']['date_till'] = gmdate('Y-m-d H:i:s');
$this->SignatureArchive->save($arrSignature);
$mail_content = "Account informations: \n\n" . "Name: " . $this->request->data['User']['name'] . "\n" . "Email login: " . $this->request->data['User']['email'] . "\n" . "Password: " . $password . "\n" . "Signature: " . $signature . "\n";
$arr_options = array('to' => array($this->request->data['User']['email']), 'viewVars' => array('content' => $mail_content));
$this->_sendEmail($arr_options);
$this->Session->setFlash(__('The user has been saved'));
return $this->redirect(array('action' => 'index'));
}
} else {
$companyid = $this->Session->read('company_id');
if ($companyid) {
$this->request->data['User']['company_id'] = $companyid;
}
}
$this->render('edit');
}
开发者ID:a0108393,项目名称:cms-system,代码行数:33,代码来源:UsersController.php
示例3: changeUserAction
/**
* This funciton will change user security fields of current user
*/
public function changeUserAction()
{
$username = $this->input->post('username');
$password = $this->input->post('password');
$new_username = trim($this->input->post('new_user'));
$new_password = trim($this->input->post('new_pass'));
if ($this->session->userdata["username"] == $username) {
$this->load->model('employee_model');
$this->load->helper('user');
$password = getPassword($username, $password);
$user = $this->employee_model->getUser($username, $password);
if ($user != false) {
$fields = array();
$fields['emp_id'] = $user['emp_id'];
if (strlen($new_username) > 0) {
$fields['emp_username'] = $new_username;
$fields['emp_username_chdt'] = date('Y-m-d H:i:s');
$fields['emp_username_chby'] = $this->session->userdata["user_id"];
} else {
$new_username = $user['emp_username'];
}
if (strlen($new_password) > 0) {
$fields['emp_password'] = getPassword($new_username, $new_password);
$fields['emp_password_chby'] = $this->session->userdata["user_id"];
$fields['emp_password_chdt'] = date('Y-m-d H:i:s');
}
echo $this->employee_model->update($fields) ? 0 : -1;
}
}
}
开发者ID:baharam000,项目名称:netg5,代码行数:33,代码来源:dashboard.php
示例4: LaunchRayChat
function LaunchRayChat()
{
global $site;
$iId = (int) $_COOKIE['memberID'];
$sPassword = getPassword($iId);
$aPostVals = array('module' => 'chat', 'app' => 'user', 'id' => $iId, 'password' => $sPassword);
Redirect($site['url'] . 'ray/index.php', $aPostVals, 'get', 'Ray chat');
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:8,代码来源:aemodule.php
示例5: auth
function auth()
{
$u = getUsername();
$p = getPassword();
if (!trim($u) || !trim($p)) {
return false;
}
return smfapi_authenticate(trim($u), trim($p), true);
}
开发者ID:rxadmin,项目名称:ufoai,代码行数:9,代码来源:apiauth.php
示例6: validatePassword
function validatePassword($username, $password)
{
$hash = getPassword($username);
$params = explode(":", $hash);
if (count($params) < HASH_SECTIONS) {
return false;
}
$pbkdf2 = base64_decode($params[HASH_PBKDF2_INDEX]);
return slow_equals($pbkdf2, pbkdf2($params[HASH_ALGORITHM_INDEX], $password, $params[HASH_SALT_INDEX], (int) $params[HASH_ITERATION_INDEX], strlen($pbkdf2), true));
}
开发者ID:Waverealm,项目名称:Projet_Plan-Cadre,代码行数:10,代码来源:password_functions.php
示例7: checkNickPassword
function checkNickPassword($nick, $password)
{
$truePassword = getPassword($nick);
if ($truePassword != null) {
if (strcmp($truePassword, $password) == 0) {
return true;
}
}
return false;
}
开发者ID:jagumiel,项目名称:bigou-Album,代码行数:10,代码来源:user_logic.php
示例8: wikiLogin
function wikiLogin()
{
global $login;
global $wikilogin;
global $snoopy;
global $wikiapi_url;
while (!$login) {
$wikilogin['action'] = 'login';
$wikilogin['lgname'] = trim(ask('wiki user name'));
$wikilogin['lgpassword'] = getPassword('wikis');
$wikilogin['format'] = 'php';
if (!$snoopy instanceof Snoopy) {
$snoopy = new Snoopy();
}
if (!$snoopy->submit($wikiapi_url, $wikilogin)) {
I2CE::raiseError("Could not log in to {$wikiapi_url}");
continue;
}
$res = unserialize($snoopy->results);
if (array_key_exists('error', $res)) {
I2CE::raiseError("Could not login:\n" . print_r($res['error'], true));
continue;
}
if (!array_key_exists('login', $res) || !is_array($res['login']) || !array_key_exists('result', $res['login'])) {
I2CE::raiseError("Error logging in:" . print_r($res, true));
continue;
}
if ($res['login']['result'] == 'NeedToken' && array_key_exists('token', $res['login']) && $res['login']['token']) {
$wikilogin['lgtoken'] = $res['login']['token'];
$snoopy->setcookies();
if (!$snoopy->submit($wikiapi_url, $wikilogin)) {
I2CE::raiseError("Could not log in to {$wikiapi_url}");
continue;
}
$res = unserialize($snoopy->results);
if (array_key_exists('error', $res)) {
I2CE::raiseError("Could not login:\n" . print_r($res['error'], true));
continue;
}
if (!array_key_exists('login', $res) || !is_array($res['login']) || !array_key_exists('result', $res['login'])) {
I2CE::raiseError("Error logging in");
continue;
}
}
if ($res['login']['result'] != 'Success') {
I2CE::raiseError("No success logging in:" . print_r($res, true));
continue;
}
I2CE::raiseError("Logged into {$wikiapi_url} as " . $wikilogin['lgname']);
$snoopy->setcookies();
$login = true;
}
return $login;
}
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:54,代码来源:wiki_base.php
示例9: checkNickPassword
function checkNickPassword($nick, $password)
{
$truePassword = getPassword($nick);
$hashedPassword = hash("sha256", $password, false);
if ($truePassword != null) {
if (strcmp($truePassword, $hashedPassword) == 0) {
return true;
}
}
return false;
}
开发者ID:jagumiel,项目名称:bigou-Album,代码行数:11,代码来源:user_logic.php
示例10: checkUserPassword
function checkUserPassword($username, $givenPassword)
{
$rep = false;
if (isset($username) && isset($givenPassword)) {
if (checkUserExists($username)) {
if (getPassword($username) == hashPassword($username, $givenPassword)) {
$rep = true;
}
}
}
return $rep;
}
开发者ID:vmizoules,项目名称:ZZTasksPHP,代码行数:12,代码来源:authentication.php
示例11: checkAuth
function checkAuth($username, $token)
{
if (empty($token)) {
return ['error' => 'Empty Token'];
}
$password = getPassword($username, $token);
if ($password == false) {
if (!getUser($username)) {
return ['error' => 'Invalid User'];
} else {
return ['error' => 'Invalid Token'];
}
}
return true;
}
开发者ID:CWMCDev,项目名称:Barend,代码行数:15,代码来源:auth.php
示例12: PageCompMainCode
/**
* page code function
*/
function PageCompMainCode()
{
global $oTemplConfig;
global $logged;
$iId = (int) $_COOKIE['memberID'];
if ($iId > 0) {
$sPassword = getPassword($iId);
$bEnableRay = getParam('enable_ray') == 'on';
$check_res = checkAction($iId, ACTION_ID_USE_RAY_CHAT);
if ($bEnableRay && $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED) {
$ret .= getApplicationContent('chat', 'user', array('id' => $iId, 'password' => $sPassword), true);
} else {
$ret .= MsgBox($check_res[CHECK_ACTION_MESSAGE]);
}
return DesignBoxContent(_t("_RAY_CHAT"), $ret, $oTemplConfig->PageCompThird_db_num);
} else {
return DesignBoxContent(_t('_LOGIN_ERROR'), MsgBox(_t('_Please login before using Ray chat')), 1);
}
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:22,代码来源:chat.php
示例13: updateUsersAction
public function updateUsersAction()
{
$this->load->model('employee_model');
$id = $this->input->post('emp_id');
$username = $this->input->post('username');
$password = $this->input->post('password');
$con_password = $this->input->post('con_password');
$department = $this->input->post('department');
$ranking = $this->input->post('designation');
$employee = $this->employee_model->getUserByName($username);
if (is_array($employee) && isset($employee['emp_username']) && $employee['emp_username'] == $username && $employee['emp_id'] !== $id) {
echo 2;
exit;
// echo 2 for if username is already exist;
} else {
$this->load->helper('user');
$date = date('Y-m-d H:i:s');
$data = array();
$data['emp_id'] = $id;
if (intval($department . $ranking) > 0 && strlen($department . $ranking) == 2) {
$data['emp_security_val'] = $department . $ranking;
}
if (isset($username) && strlen($username) > 5) {
$data['emp_username_chdt'] = $date;
$data['emp_username_chby'] = $this->session->userdata('user_id');
$data['emp_username'] = $username;
}
if (isset($password) && strlen($password) > 4) {
$pass = getPassword($username, $password);
$data['emp_password'] = $pass;
$data['emp_password_chby'] = $this->session->userdata('user_id');
$data['emp_password_chdt'] = $date;
}
if ($this->employee_model->update($data)) {
echo 0;
exit;
}
}
echo -1;
exit;
// echo 0 if all are okay
}
开发者ID:baharam000,项目名称:netg5,代码行数:42,代码来源:user.php
示例14: __construct
function __construct()
{
$this->sName = 'bottom';
$this->sDbTable = 'sys_menu_bottom';
$this->sCacheKey = 'sys_menu_bottom';
$this->aMenuInfo = array();
if (isMember()) {
$this->aMenuInfo['memberID'] = getLoggedId();
$this->aMenuInfo['memberNick'] = getNickName($this->aMenuInfo['memberID']);
$this->aMenuInfo['memberPass'] = getPassword($this->aMenuInfo['memberID']);
$this->aMenuInfo['memberLink'] = getProfileLink($this->aMenuInfo['memberID']);
$this->aMenuInfo['visible'] = 'memb';
} else {
$this->aMenuInfo['memberID'] = 0;
$this->aMenuInfo['memberNick'] = '';
$this->aMenuInfo['memberPass'] = '';
$this->aMenuInfo['memberLink'] = '';
$this->aMenuInfo['visible'] = 'non';
}
$this->aItems = array();
$this->oPermalinks = new BxDolPermalinks();
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:22,代码来源:BxDolMenuSimple.php
示例15: numecho2
?>
<br />
Total: <?php
echo numecho2($user->gold + $user->bank);
?>
<br />
<br />
<small>Deposit Fee <?php
echo $user->bankper;
?>
%</small>
<form name="<?php
echo getPassword(10);
?>
" method="post">
<input name="<? $_SESSION['depbox'] = getPassword(10); echo $_SESSION['depbox']; ?>" type="text" size="12" maxlength="17" value="<?php
echo numecho2($user->gold);
?>
" />
<? if($user->bankimg == 1) { ?>
<br />
<img src="imageclick.php?<?php
echo session_name() . '=' . session_id();
?>
" title="random characters" alt="random characters"><br />
<select name="turing">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
<option value="5">five</option>
开发者ID:Naddiseo,项目名称:WW2Game,代码行数:31,代码来源:treasury.tpl.php
示例16: registerMember
function registerMember()
{
$oPC = new BxDolProfilesController();
$oZ = new BxDolAlerts('profile', 'before_join', 0, 0, $this->aValues[0]);
$oZ->alert();
$aProfile1 = $this->oPF->getProfileFromValues($this->aValues[0]);
if (empty($aProfile1['NickName'])) {
$aProfile1['NickName'] = uriGenerate(empty($aProfile1['FirstName']) ? genRndPwd(10, false) : $aProfile1['FirstName'], 'Profiles', 'NickName');
}
list($iId1, $sStatus1) = $oPC->createProfile($aProfile1);
//--- check whether profile was created successfully or not
if (!$iId1) {
if (isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) {
@unlink($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']);
}
return array(false, 'Fail');
}
//--- check for couple profile
if ($this->bCouple) {
$aProfile2 = $this->oPF->getProfileFromValues($this->aValues[1]);
list($iId2, $sStatus2) = $oPC->createProfile($aProfile2, false, $iId1);
if (!$iId2) {
$oPC->deleteProfile($iId1);
return array(false, 'Fail');
}
}
//--- upload profile photo
if (isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) {
$sPass1 = getPassword($iId1);
bx_login($iId1);
check_logged();
BxDolService::call('avatar', 'set_image_for_cropping', array($iId1, $GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']));
if (BxDolRequest::serviceExists('photos', 'perform_photo_upload', 'Uploader')) {
$aFileInfo = array('medTitle' => _t('_sys_member_thumb_avatar'), 'medDesc' => _t('_sys_member_thumb_avatar'), 'medTags' => _t('_ProfilePhotos'), 'Categories' => array(_t('_ProfilePhotos')), 'album' => str_replace('{nickname}', getUsername($iId1), getParam('bx_photos_profile_album_name')), 'albumPrivacy' => BX_DOL_PG_ALL);
BxDolService::call('photos', 'perform_photo_upload', array($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto'], $aFileInfo, false), 'Uploader');
}
}
if (BxDolModule::getInstance('BxWmapModule')) {
BxDolService::call('wmap', 'response_entry_add', array('profiles', $iId1));
}
//--- create system event
bx_import('BxDolAlerts');
$oZ = new BxDolAlerts('profile', 'join', $iId1, 0, array('status_text' => &$sStatus1));
$oZ->alert();
return array($iId1, $sStatus1);
}
开发者ID:noormcs,项目名称:studoro,代码行数:46,代码来源:BxDolJoinProcessor.php
示例17: resetPassword
/**
* @Description : sales staff reset password
*
* @return : html
* @Author : tungpa - [email protected]
*/
public function resetPassword($id)
{
$this->autoRender = false;
$this->User->id = $id;
if (!$this->User->exists()) {
throw new NotFoundException(__('Invalid User'));
}
$data = $this->User->read(null, $id);
$password = getPassword();
$data['User']['password'] = $password;
if ($this->User->save($data)) {
$mail_content = "Account informations: \n\n" . "New password: " . $password . "\n";
$arr_options = array('to' => array($data['User']['email']), 'viewVars' => array('content' => $mail_content), 'subject' => __('Your password had been reset'));
$this->_sendEmail($arr_options);
$this->Session->setFlash(__('The user has been reset password'));
return $this->redirect(array('action' => 'index'));
}
}
开发者ID:a0108393,项目名称:cms-system,代码行数:24,代码来源:UsersController.php
示例18: bx_login
function bx_login($iId, $bRememberMe = false, $bAlert = true)
{
$sPassword = getPassword($iId);
$aUrl = parse_url($GLOBALS['site']['url']);
$sPath = isset($aUrl['path']) && !empty($aUrl['path']) ? $aUrl['path'] : '/';
$sHost = '';
$iCookieTime = $bRememberMe ? time() + 24 * 60 * 60 * 30 : 0;
setcookie("memberID", $iId, $iCookieTime, $sPath, $sHost);
$_COOKIE['memberID'] = $iId;
setcookie("memberPassword", $sPassword, $iCookieTime, $sPath, $sHost, false, true);
$_COOKIE['memberPassword'] = $sPassword;
db_res("UPDATE `Profiles` SET `DateLastLogin`=NOW(), `DateLastNav`=NOW() WHERE `ID`='" . $iId . "'");
createUserDataFile($iId);
if ($bAlert) {
require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php';
$oZ = new BxDolAlerts('profile', 'login', $iId);
$oZ->alert();
}
return getProfileInfo($iId);
}
开发者ID:bright-spark,项目名称:dolphin.pro,代码行数:20,代码来源:profiles.inc.php
示例19: resetPassword
public function resetPassword($user_id)
{
$plainTxtPassword = getNewPassword();
$password = getPassword($plainTxtPassword);
$stmt = $this->getDb()->prepare("update users set password=:password WHERE id=:user_id");
$stmt->bindValue(':password', $password, PDO::PARAM_STR);
$stmt->bindValue(':user_id', intval($user_id), PDO::PARAM_INT);
$stmt->execute();
if ($stmt->rowCount() > 0) {
return $plainTxtPassword;
} else {
return false;
}
}
开发者ID:grldchz,项目名称:grldservice,代码行数:14,代码来源:Forgot.php
示例20: get_member_menu_friends_list
/**
* Function will generate list of member's friends ;
*
* @param : $iMemberId (integer) - member's Id;
* @return : Html presentation data;
*/
function get_member_menu_friends_list($iMemberId = 0)
{
global $oFunctions;
$iMemberId = (int) $iMemberId;
$iOnlineTime = (int) getParam('member_online_time');
// define the member's menu position ;
$sExtraMenuPosition = isset($_COOKIE['menu_position']) ? $_COOKIE['menu_position'] : getParam('ext_nav_menu_top_position');
$aLanguageKeys = array('requests' => _t('_Friend Requests'), 'online' => _t('_Online Friends'));
// get all friends requests ;
$iFriendsRequests = getFriendRequests($iMemberId);
$iOnlineFriends = getFriendNumber($iMemberId, 1, $iOnlineTime);
// try to generate member's messages list ;
$sWhereParam = "AND p.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $iOnlineTime . " MINUTE)";
$aAllFriends = getMyFriendsEx($iMemberId, $sWhereParam, 'last_nav_desc', "LIMIT 5");
$oModuleDb = new BxDolModuleDb();
$sVideoMessengerImgPath = $GLOBALS['oSysTemplate']->getIconUrl('video.png');
$sMessengerTitle = _t('_Chat');
foreach ($aAllFriends as $iFriendID => $aFriendsPrm) {
$aMemberInfo = getProfileInfo($iFriendID);
$sThumb = $oFunctions->getMemberIcon($aMemberInfo['ID'], 'none');
$sHeadline = mb_strlen($aMemberInfo['UserStatusMessage']) > 40 ? mb_substr($aMemberInfo['UserStatusMessage'], 0, 40) . '...' : $aMemberInfo['UserStatusMessage'];
$aFriends[] = array('profile_link' => getProfileLink($iFriendID), 'profile_nick' => $aMemberInfo['NickName'], 'profile_id' => $iFriendID, 'thumbnail' => $sThumb, 'head_line' => $sHeadline, 'bx_if:video_messenger' => array('condition' => $oModuleDb->isModule('messenger'), 'content' => array('sender_id' => $iMemberId, 'sender_passw' => getPassword($iMemberId), 'recipient_id' => $iFriendID, 'video_img_src' => $sVideoMessengerImgPath, 'messenger_title' => $sMessengerTitle)));
}
$aExtraSection = array('friends_request' => $aLanguageKeys['requests'], 'request_count' => $iFriendsRequests, 'ID' => $iMemberId, 'online_friends' => $aLanguageKeys['online'], 'online_count' => $iOnlineFriends);
// fill array with needed keys ;
$aTemplateKeys = array('bx_if:menu_position_bottom' => array('condition' => $sExtraMenuPosition == 'bottom', 'content' => $aExtraSection), 'bx_if:menu_position_top' => array('condition' => $sExtraMenuPosition == 'top' || $sExtraMenuPosition == 'static', 'content' => $aExtraSection), 'bx_repeat:friend_list' => $aFriends);
$sOutputCode = $GLOBALS['oSysTemplate']->parseHtmlByName('view_friends_member_menu_friends_list.html', $aTemplateKeys);
return $sOutputCode;
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:35,代码来源:BxDolFriendsPageView.php
注:本文中的getPassword函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论