Exemplo n.º 1
0
 public function postLogin(Request $request)
 {
     # Get Form Input
     $userName = $request->input('user-name');
     $password = $request->input('password');
     #Flush any session data before logging in.
     $request->session()->flush();
     if (!\Auth::attempt(['user_name' => $userName, 'password' => $password])) {
         return \Redirect::back()->withInput()->withErrors(['credentials' => 'This user name and password combination are invalid. Please try again.']);
     }
     # Log the user in and load their feeds into their session
     $user = \Auth::user();
     $user->last_login = \Carbon\Carbon::now()->toDateTimeString();
     $user->save();
     # Load this user's feeds into a session variable for efficiency.
     \p4\User::setSessionFeeds($user->id);
     return \Redirect::to('/Home');
 }
Exemplo n.º 2
0
 public function getRemoveTag(Request $request, $tag_id)
 {
     $user_id = \Auth::user()->id;
     \p4\Tag::where('id', '=', $tag_id)->where('user_id', '=', $user_id)->delete();
     \p4\User::setSessionFeeds($user_id);
     return \Redirect::to('/ManageTags');
 }