예제 #1
0
파일: User.php 프로젝트: ajisantoso/Project
 public function activateAccount($code)
 {
     $user = User::where('activation_code', $code)->first();
     if ($user) {
         $user->update(['active' => 1, 'activation_code' => NULL]);
         \Auth::login($user);
         return true;
     }
 }
예제 #2
0
 /**
  * @param boolean $hasCode
  * @param AuthenticateUserListener $listener
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute($hasCode, AuthenticateUserListener $listener, $provider)
 {
     if (!$hasCode) {
         return $this->getAuthorizationFirst($provider);
     }
     $user = $this->users->findByEmailOrCreate($this->getSocialUser($provider));
     \Auth::login($user, true);
     return $listener->userHasLoggedIn($user);
 }
예제 #3
0
 public function activateAccount($code)
 {
     $doctor = Doctor::where('activation_code', $code)->first();
     if ($doctor) {
         $doctor->update(['verified' => 1, 'activation_code' => NULL]);
         Auth::login($doctor);
         return true;
     }
 }
예제 #4
0
 public function accountIsActive($code)
 {
     $user = User::where('activation_code', '=', $code)->first();
     $user->active = 1;
     $user->activation_code = '';
     if ($user->save()) {
         \Auth::login($user);
     }
     return true;
 }
예제 #5
0
 public function accountIsActive($code)
 {
     $user = User::where('activation_code', '=', $code)->first();
     $user->active = 1;
     $user->activation_code = '';
     //initial inserts right after account is activated
     DB::table('notes')->insert(['mynotes' => '', 'user_id' => $user->id]);
     DB::table('mytbd')->insert(['mytbd' => '', 'user_id' => $user->id]);
     DB::table('mywebsites')->insert(['mylink' => '', 'user_id' => $user->id]);
     if ($user->save()) {
         \Auth::login($user);
     }
     return true;
 }
 public function accountIsActive($code)
 {
     $user = User::where('activation_code', '=', $code)->first();
     if ($user) {
         $user->activation = 1;
         $user->activation_code = '';
         $user->type = 4;
         $user->save();
         if ($user->parent_user) {
             $teamMember = Team::where('member_id', '=', $user->id)->first();
             $teamMember->status = 2;
             if ($teamMember->save()) {
                 $teamInvaiteMember = TeamInvitation::where('accept_email', '=', $user->email)->first();
                 $teamInvaiteMember->delete();
             }
         }
         if ($user->save()) {
             \Auth::login($user);
         }
         return true;
     }
     return false;
 }