本文整理汇总了PHP中Application_Model_User::getPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_User::getPassword方法的具体用法?PHP Application_Model_User::getPassword怎么用?PHP Application_Model_User::getPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_User
的用法示例。
在下文中一共展示了Application_Model_User::getPassword方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(Application_Model_User $user)
{
$data = array('password' => $user->getPassword(), 'username' => $user->getUserName());
if (null === ($id = $user->getId())) {
unset($data['id']);
$this->getDbTable()->insert($data);
} else {
$this->getDbTable()->update($data, array('id = ?' => $id));
}
}
示例2: save
public function save(Application_Model_User $user)
{
$password = sha1($user->getPassword());
$data = array('confirmed' => $user->getConfirmed(), 'created' => $user->getCreated(), 'email' => $user->getEmail(), 'id' => $user->getId(), 'name' => $user->getName(), 'password' => $password);
if (null === ($id = $user->getId())) {
unset($data['id']);
return $this->getDbTable()->insert($data);
} else {
$this->getDbTable()->update($data, array('id = ?' => $id));
}
}
示例3: save
/**
* @param Application_Model_User $user The user to save.
* @return int Either uid of new user or -1
*/
public function save(Application_Model_User $user)
{
$data = array('uid' => $user->getUid(), 'uname' => $user->getUname(), 'publicKey' => $user->getPublicKey(), 'password' => hash('sha256', $user->getPassword()));
if (($uid = $user->getUid()) <= 0) {
unset($data['uid']);
$uid = $this->getDbTable()->insert($data);
return $uid;
} else {
$this->getDbTable()->update($data, array('uid = ?' => $uid));
return -1;
}
}
示例4: sendRecoverEmail
private function sendRecoverEmail(Application_Model_User $user)
{
$mail = new Zend_Mail();
$mail->setFrom('noreply@winsandwants.com', 'Wins and Wants');
$mail->addTo($user->getEmail());
$mail->setSubject('Account Details');
$txt = "Your account details are as follows Username: " . $user->getName() . " Password: " . $user->getPassword();
$mail->setBodyText($txt, 'UTF-8');
$mail->send();
}
示例5: checkLiveStreamAuthAction
public function checkLiveStreamAuthAction()
{
$request = $this->getRequest();
$username = $request->getParam('username');
$password = $request->getParam('password');
$djtype = $request->getParam('djtype');
if ($djtype == 'master') {
//check against master
if ($username == Application_Model_Preference::GetLiveStreamMasterUsername() && $password == Application_Model_Preference::GetLiveStreamMasterPassword()) {
$this->view->msg = true;
} else {
$this->view->msg = false;
}
} elseif ($djtype == "dj") {
//check against show dj auth
$showInfo = Application_Model_Show::getCurrentShow();
// there is current playing show
if (isset($showInfo[0]['id'])) {
$current_show_id = $showInfo[0]['id'];
$CcShow = CcShowQuery::create()->findPK($current_show_id);
// get custom pass info from the show
$custom_user = $CcShow->getDbLiveStreamUser();
$custom_pass = $CcShow->getDbLiveStreamPass();
// get hosts ids
$show = new Application_Model_Show($current_show_id);
$hosts_ids = $show->getHostsIds();
// check against hosts auth
if ($CcShow->getDbLiveStreamUsingAirtimeAuth()) {
foreach ($hosts_ids as $host) {
$h = new Application_Model_User($host['subjs_id']);
if ($username == $h->getLogin() && md5($password) == $h->getPassword()) {
$this->view->msg = true;
return;
}
}
}
// check against custom auth
if ($CcShow->getDbLiveStreamUsingCustomAuth()) {
if ($username == $custom_user && $password == $custom_pass) {
$this->view->msg = true;
} else {
$this->view->msg = false;
}
} else {
$this->view->msg = false;
}
} else {
// no show is currently playing
$this->view->msg = false;
}
}
}
示例6: doFacebookLogin
public function doFacebookLogin()
{
$view = new Zend_view();
$view->addHelperPath('Base/View/Helper/', 'Base_View_Helper');
$facebook = $view->facebook();
$session = $facebook->getSession();
if ($session) {
try {
$Auth = new Base_Auth_Auth();
$uid = $facebook->getUser();
$user = new Application_Model_User();
$where = "facebook_id='{$uid}'";
$user = $user->fetchRow($where);
if (false === $user) {
//create new user
$me = $facebook->api('/me');
$password = md5($Auth->passwordGenerator());
$user = new Application_Model_User();
if ($me['email'] != "") {
$where = "email='{$me['email']}'";
$user = $user->fetchRow($where);
if (false === $user) {
//insertex
$user = new Application_Model_User();
$user->setEmail($me['email']);
$user->setUsername($me['id']);
$user->setPassword($password);
$user->setfirstName($me['first_name']);
$user->setLastName($me['last_name']);
$user->setSex($me['gender']);
$user->setGapperOrFriend('gapper');
$user->setFacebookId($me['id']);
$user->setStatus('active');
$user->setDob('0000-00-00');
$user->setUserLevelId(1);
} else {
//update
$user->setFacebookId($me['id']);
}
} else {
$user = new Application_Model_User();
$user->setEmail($me['email']);
$user->setUsername($me['id']);
$user->setPassword($password);
$user->setfirstName($me['first_name']);
$user->setLastName($me['last_name']);
$user->setSex($me['gender']);
$user->setGapperOrFriend('gapper');
$user->setFacebookId($me['id']);
$user->setStatus('active');
$user->setDob('0000-00-00');
$user->setUserLevelId(1);
}
$user_id = $user->save();
if ($user_id > 0) {
$user->setDefaultPermissions($user_id);
if ($params['email'] != "") {
//send registration mail
}
}
}
//--do login --
$params['email'] = $user->getEmail();
//$params['username']=$user->getUsername();
$params['password'] = $user->getPassword();
$params['md5'] = "false";
$Auth->doLogout();
$loginStatus = true;
if ($params['email'] != "") {
$loginStatus = $Auth->doLogin($params, 'email');
} else {
$params['email'] = $user->getUsername();
$loginStatus = $Auth->doLogin($params, 'username');
}
if ($user->getEmail() == "" || is_null($user->getEmail())) {
//echo "<a href='/gapper/update-your-email' >Click here</a>";
//$this->_helper->redirector('update-your-email','gapper');
$result['email'] = "no";
return $result;
}
if ($loginStatus) {
$result['email'] = "ok";
return $result;
//echo "<a href='/gapper/where-i-am' >Click here</a>";
//$this->_helper->redirector('where-i-am','gapper');
} else {
if ($user->getStatus() == "inactive") {
exit("Please activate your account. <br><a href='#' onclick='window.close();'>Close</a>");
} else {
if ($user->getStatus() == "deleted") {
exit("Your account status is deleted. Please contact administrator.");
} else {
exit("error while login");
}
}
}
} catch (FacebookApiException $e) {
error_log($e);
}
}
//.........这里部分代码省略.........