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


PHP getPassword函数代码示例

本文整理汇总了PHP中getPassword函数的典型用法代码示例。如果您正苦于以下问题:PHP getPassword函数的具体用法?PHP getPassword怎么用?PHP getPassword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getPassword函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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