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


PHP ParseUser::getObjectId方法代碼示例

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


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

示例1: ParseUser

        $user = new ParseUser();
        $user->set("username", $email);
        $user->set("password", $pass);
        $user->set("email", $email);
        $user->set("corporate", true);
        $user->set("name", $company_name);
        $user->set("logo", $file);
        $user->set("logo_url", $file->getURL());
        unlink($target_dir . $name);
        // try signup
        try {
            $user->signUp();
            // Hooray! Let them use the app now.
            $_SESSION['login'] = "1";
            $_SESSION['email'] = $email;
            $_SESSION['userid'] = $user->getObjectId();
            header("Location: index.php");
        } catch (ParseException $ex) {
            // Show the error message somewhere and let the user try again.
            echo "Error: " . $ex->getCode() . " " . $ex->getMessage();
        }
    }
}
echo include "assets/templates/header.php";
?>
<br>
<br>

    <div id="login-overlay" class="modal-dialog">
      <div class="modal-content">
          <div class="modal-header">
開發者ID:shubDhond,項目名稱:MarketBngWeb,代碼行數:31,代碼來源:register.php

示例2: dtestUserLoadedFromStorageFromLogIn

 public function dtestUserLoadedFromStorageFromLogIn()
 {
     ParseTestHelper::clearClass(ParseUser::$parseClassName);
     $fosco = new ParseUser();
     $fosco->setUsername('fosco');
     $fosco->setPassword('password');
     $fosco->signUp();
     $id = $fosco->getObjectId();
     $this->assertNotNull($id);
     ParseUser::logOut();
     ParseUser::_clearCurrentUserVariable();
     $current = ParseUser::getCurrentUser();
     $this->assertNull($current);
     ParseUser::logIn("fosco", "password");
     $current = ParseUser::getCurrentUser();
     $this->assertEquals($id, $current->getObjectId());
     ParseUser::_clearCurrentUserVariable();
     $current = ParseUser::getCurrentUser();
     $this->assertEquals($id, $current->getObjectId());
 }
開發者ID:nidalb,項目名稱:baas,代碼行數:20,代碼來源:ParseUserTest.php

示例3: getUserWriteAccess

 /**
  * Get whether the given user is *explicitly* allowed to write this object.
  * Even if this returns false, the user may still be able to access it if
  * getPublicWriteAccess returns true or a role that the user belongs to has
  * write access.
  *
  * @param ParseUser $user
  *
  * @throws \Exception
  *
  * @return bool
  */
 public function getUserWriteAccess($user)
 {
     if (!$user->getObjectId()) {
         throw new Exception('cannot getWriteAccess for a user with null id');
     }
     return $this->getWriteAccess($user->getObjectId());
 }
開發者ID:aglo35,項目名稱:vr_beta,代碼行數:19,代碼來源:ParseACL.php


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