當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ParseUser::setPassword方法代碼示例

本文整理匯總了PHP中Parse\ParseUser::setPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP ParseUser::setPassword方法的具體用法?PHP ParseUser::setPassword怎麽用?PHP ParseUser::setPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Parse\ParseUser的用法示例。


在下文中一共展示了ParseUser::setPassword方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createUser

 public function createUser($params)
 {
     $user = new ParseUser();
     $user->setUsername($params['login']);
     $user->setPassword($params['passwd']);
     try {
         $user->signUp();
     } catch (ParseException $ex) {
         die("Exception: " . $ex->getMessage());
     }
     return $user;
 }
開發者ID:robinraintama,項目名稱:parse-php-cms,代碼行數:12,代碼來源:Cms.php

示例2: testRevocableSession

 public function testRevocableSession()
 {
     ParseClient::enableRevocableSessions();
     $user = new ParseUser();
     $user->setUsername("username");
     $user->setPassword("password");
     $user->signUp();
     $session = ParseSession::getCurrentSession();
     $this->assertEquals($user->getSessionToken(), $session->getSessionToken());
     $this->assertTrue($session->isCurrentSessionRevocable());
     ParseUser::logOut();
     ParseUser::logIn("username", "password");
     $session = ParseSession::getCurrentSession();
     $this->assertEquals(ParseUser::getCurrentUser()->getSessionToken(), $session->getSessionToken());
     $this->assertTrue($session->isCurrentSessionRevocable());
     $sessionToken = $session->getSessionToken();
     ParseUser::logOut();
     $this->setExpectedException('Parse\\ParseException', 'invalid session token');
     ParseUser::become($sessionToken);
 }
開發者ID:louk,項目名稱:https---github.com-soninod-Hello,代碼行數:20,代碼來源:ParseSessionTest.php

示例3: signupAction

 /**
  * Expects a post with email / password (or the form is just shown). Creates a new user (if possible) then redirects
  * to the app controller on success, or itself (PRG) with a flash message on error.
  */
 public function signupAction()
 {
     if (!$this->request instanceof Request or !$this->request->isPost()) {
         return;
         //nothing to do
     }
     $email = $this->request->getPost('email');
     $password = $this->request->getPost('password');
     $user = new ParseUser();
     $user->setUsername($email);
     $user->setPassword($password);
     try {
         $user->signUp();
         $_SESSION['todo']['user'] = $user->getUsername();
         $this->redirect()->toRoute('app');
     } catch (ParseException $e) {
         $this->flashMessenger()->addErrorMessage($e->getMessage());
         $this->redirect()->toRoute('auth', ['action' => 'signup']);
     }
 }
開發者ID:mkhuramj,項目名稱:ToDo-Web,代碼行數:24,代碼來源:AuthController.php

示例4: getIndex

 /**
  * Show the profile for the given user.
  *
  * @param  int  $id
  * @return Response
  */
 public function getIndex()
 {
     ParseClient::initialize(env('PARSE_APP_ID'), env('ARSE_REST_KEY'), env('PARSE_MASTER_KEY'));
     $user = new ParseUser();
     $user->setUsername("foo");
     $user->setPassword("Q2w#4!o)df");
     try {
         $user->signUp();
         dd(1112);
     } catch (ParseException $ex) {
         echo $ex->getMessage() . "<br>";
     }
     // Login
     try {
         $user = ParseUser::logIn("foo", "Q2w#4!o)df");
     } catch (ParseException $ex) {
         echo $ex->getMessage();
     }
     // Current user
     $user = ParseUser::getCurrentUser();
     dd($user);
 }
開發者ID:varyan,項目名稱:tratesTrates,代碼行數:28,代碼來源:TestController.php

示例5: createUser

 public function createUser($username)
 {
     $user = new ParseUser();
     $user->setUsername($username);
     $user->setPassword($username);
     return $user;
 }
開發者ID:khangaikh,項目名稱:golocal,代碼行數:7,代碼來源:ParseRoleTest.php

示例6: dtestCurrentUserIsNotDirty

 public function dtestCurrentUserIsNotDirty()
 {
     $user = new ParseUser();
     $user->setUsername('asdf');
     $user->setPassword('zxcv');
     $user->set('bleep', 'bloop');
     $user->signUp();
     $this->assertFalse($user->isKeyDirty('bleep'));
     $userAgain = ParseUser::getCurrentUser();
     $this->assertFalse($userAgain->isKeyDirty('bleep'));
 }
開發者ID:nidalb,項目名稱:baas,代碼行數:11,代碼來源:ParseUserTest.php

示例7: testACLModifyingAfterLoad

 public function testACLModifyingAfterLoad()
 {
     $user = new ParseUser();
     $user->setUsername('alice');
     $user->setPassword('wonderland');
     $user->signUp();
     $object = ParseObject::create('Object');
     $acl = ParseACL::createACLWithUser($user);
     $object->setACL($acl);
     $object->save();
     $this->assertTrue($object->getACL()->getUserReadAccess($user));
     $this->assertTrue($object->getACL()->getUserWriteAccess($user));
     $this->assertFalse($object->getACL()->getPublicReadAccess());
     $this->assertFalse($object->getACL()->getPublicWriteAccess());
     $query = new ParseQuery('Object');
     $objectAgain = $query->get($object->getObjectId());
     $objectAgain->getACL()->setPublicReadAccess(true);
     $this->assertTrue($objectAgain->getACL()->getUserReadAccess($user));
     $this->assertTrue($objectAgain->getACL()->getUserWriteAccess($user));
     $this->assertTrue($objectAgain->getACL()->getPublicReadAccess());
     $this->assertFalse($objectAgain->getACL()->getPublicWriteAccess());
 }
開發者ID:rvdavid,項目名稱:parse-php-sdk,代碼行數:22,代碼來源:ParseACLTest.php

示例8: setcookie

        /* Redirect browser */
        exit;
    }
    //Will remove any numbers, thus if it is all numbers the length will be 0
    if (preg_match('/[a-zA-Z]/', $pass) == 0) {
        setcookie("regError", "Password must contain letters");
        header("Location: index.php");
        /* Redirect browser */
        exit;
    }
    /* set session storage */
    ParseClient::setStorage(new ParseSessionStorage());
    try {
        $user->setUsername($_POST["username"]);
        $user->setEmail($_POST["username"]);
        $user->setPassword($_POST["password"]);
        $user->set("friendlyName", $_POST["friendly"]);
        $user->set("isAdmin", TRUE);
        $user->signUp();
        $_SESSION["username"] = ParseUser::getCurrentUser()->get("username");
        $_SESSION["friendlyName"] = ParseUser::getCurrentUser()->get("friendlyName");
    } catch (ParseException $ex) {
        // error in $ex->getMessage();
        setcookie("regError", $ex->getMessage());
    }
} else {
    setcookie("regError", "Username, Password, and Chat Name are required");
}
header("Location: index.php");
/* Redirect browser */
exit;
開發者ID:CDMayberry,項目名稱:PingITWeb,代碼行數:31,代碼來源:register.php


注:本文中的Parse\ParseUser::setPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。