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


PHP Person::setNode方法代码示例

本文整理汇总了PHP中app\models\Person::setNode方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::setNode方法的具体用法?PHP Person::setNode怎么用?PHP Person::setNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Person的用法示例。


在下文中一共展示了Person::setNode方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

 public function login(Request $request)
 {
     if (!empty($request->input('email'))) {
         $email = $request->input('email');
         $password = $request->input('password');
         $user_node = $this->users->getUser($email);
         // Create the Person model
         $user = new Person();
         $user->setNode($user_node);
         if (!empty($user_node)) {
             // Check password and verification
             if (!$user->verified) {
                 $message_bag = new MessageBag();
                 return redirect()->back()->with('errors', $message_bag->add('email', 'Dit emailadres is nog niet geverifieerd.'));
             } elseif (Hash::check($password, $user->password)) {
                 Auth::login($user);
                 // Register the event to Piwik
                 $this->registerPiwikEvent($user->email, 'Login');
                 return redirect($this->redirectTo);
             } else {
                 $message_bag = new MessageBag();
                 return redirect()->back()->with('errors', $message_bag->add('password', 'Het wachtwoord is incorrect.'));
             }
         } else {
             $message_bag = new MessageBag();
             return redirect()->back()->with('errors', $message_bag->add('email', 'Het emailadres werd niet gevonden.'));
         }
     } else {
         $message_bag = new MessageBag();
         return redirect()->back()->with('errors', $message_bag->add('email', 'Het emailadres werd niet gevonden.'));
     }
 }
开发者ID:weopendata,项目名称:medea,代码行数:32,代码来源:AuthController.php

示例2: denyRegistration

 /**
  * Deny a user's registration
  *
  * @param  string $token
  * @return mixed
  */
 public function denyRegistration($token, AppMailer $mailer)
 {
     $user = $this->users->denyUser($token);
     if (!empty($user)) {
         $person = new Person();
         $person->setNode($user);
         // Send an email to the user that his email has been confirmed
         $mailer->sendRegistrationDenial($person);
     }
     return redirect('/persons');
 }
开发者ID:weopendata,项目名称:medea,代码行数:17,代码来源:RegistrationController.php

示例3: removeAllUsers

 private function removeAllUsers()
 {
     $count = 0;
     $userNodes = $this->users->getAll();
     $bar = $this->output->createProgressBar(count($userNodes));
     foreach ($userNodes as $userNode) {
         $person = new Person();
         $person->setNode($userNode);
         $person->delete();
         $bar->advance();
         $count++;
     }
     $this->info("");
     $this->info("Removed {$count} Person nodes.");
 }
开发者ID:weopendata,项目名称:medea,代码行数:15,代码来源:DataManagement.php

示例4: retrieveByCredentials

 /**
  * Retrieve a user by the given credentials.
  *
  * @param  array  $credentials
  * @return \Illuminate\Contracts\Auth\Authenticatable|null
  */
 public function retrieveByCredentials(array $credentials)
 {
     $users = $this->person_label->getNodes('email', $user->email);
     if ($users->count() > 0) {
         $user_node = $users[0];
         $person = new Person();
         $person->setNode($user_node);
         return $person;
     }
     return user;
 }
开发者ID:weopendata,项目名称:medea,代码行数:17,代码来源:Neo4jUserProvider.php

示例5: userSettings

 /**
  * Administrator can view settings of a certain user
  *
  * @param integer $userId
  * @param Request $request
  *
  * @return
  */
 public function userSettings($userId, Request $request)
 {
     if (empty($request->user()) || !$request->user()->hasRole('administrator')) {
         return redirect('/');
     }
     $user = $this->users->getById($userId);
     if (empty($user)) {
         abort(404);
     }
     // The person to view the profile of
     $person = new Person();
     $person->setNode($user);
     $fullUser = $user->getProperties();
     unset($fullUser['created_at']);
     unset($fullUser['MEDEA_UUID']);
     unset($fullUser['password']);
     unset($fullUser['remember_token']);
     unset($fullUser['token']);
     unset($fullUser['updated_at']);
     unset($fullUser['verified']);
     $fullUser['id'] = $userId;
     return view('pages.settings', ['accessLevels' => $this->getProfileAccessLevels(), 'roles' => $person->getRoles(), 'user' => $fullUser]);
 }
开发者ID:weopendata,项目名称:medea,代码行数:31,代码来源:UserController.php

示例6: show

 /**
  * Display the specified resource.
  *
  * @param ShowFindRequest $request
  *
  * @return \Illuminate\Http\Response
  */
 public function show(ShowFindRequest $request)
 {
     $find = $request->getFind();
     // If the user is not owner of the find and not a researcher, obscure the location to 1km accuracy
     if (empty($user) || !empty($find['person']['identifier']) && $find['person']['identifier'] != $user->id && !in_array('onderzoeker', $user->getRoles())) {
         if (!empty($find['findSpot']['location']['lat'])) {
             $find['findSpot']['location']['lat'] = round($find['findSpot']['location']['lat'] / 2, 2) * 2;
             $find['findSpot']['location']['lng'] = round($find['findSpot']['location']['lng'] / 2, 2) * 2;
         }
     }
     $users = new UserRepository();
     // Check if the user of the find allows their name to be displayed on the find details
     $findUser = $users->getById($find['person']['identifier']);
     $publicUserInfo = [];
     if (!empty($findUser)) {
         $person = new Person();
         $person->setNode($findUser);
         if ($person->showNameOnPublicFinds) {
             $publicUserInfo['name'] = $person->lastName . ' ' . $person->firstName;
         }
         // Should there be a link to the profile page
         if ($person->profileAccessLevel == 4 || !empty($request->user()) && ($request->user()->id == $person->id || $request->user()->hasRole($person->getProfileAllowedRoles()))) {
             $publicUserInfo['id'] = $person->id;
         }
     }
     return view('pages.finds-detail', ['fields' => $this->list_values->getFindTemplate(), 'find' => $find, 'publicUserInfo' => $publicUserInfo]);
 }
开发者ID:weopendata,项目名称:medea,代码行数:34,代码来源:FindController.php

示例7: getAllWithRoles

 /**
  * Get all the bare nodes of a findEvent
  *
  * @param integer $limit
  * @param integer $offset
  *
  * @return array
  */
 public function getAllWithRoles()
 {
     $client = $this->getClient();
     $findLabel = $client->makeLabel($this->label);
     $findNodes = $findLabel->getNodes();
     $data = [];
     foreach ($findNodes as $findNode) {
         $person = new Person();
         $person->setNode($findNode);
         $personData = array_only($findNode->getProperties(), ['firstName', 'lastName', 'verified']);
         $personData['id'] = $findNode->getId();
         $personData['personType'] = $person->getRoles();
         $data[] = $personData;
     }
     return $data;
 }
开发者ID:weopendata,项目名称:medea,代码行数:24,代码来源:UserRepository.php

示例8: resetPassword

 /**
  * Reset the given user's password.
  *
  * @param  Node  $user
  * @param  string  $password
  * @return void
  */
 protected function resetPassword($user, $password)
 {
     $person = new Person();
     $person->setNode($user);
     $person->setPassword($password);
     $person->setPasswordResetToken('');
     Auth::guard($this->getGuard())->login($person);
 }
开发者ID:weopendata,项目名称:medea,代码行数:15,代码来源:PasswordController.php


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