Exemple #1
0
        $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'] = "******";
            $_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">
Exemple #2
0
 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());
 }
Exemple #3
0
 /**
  * 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());
 }