Example #1
0
 public function testFlush()
 {
     $this->target->set('bindable.dummy.xyzzy', 'hogefuga');
     $this->target->bind($this->bindable);
     \Phake::when($this->bindable)->getSessionContent()->thenReturn(array('hoge' => 'hogehoge', 'xyzzy' => 'piyopiyo'));
     $this->target->flush();
     $this->assertEquals(array('HOGE' => 1, 'FUGA' => 2, 'PIYO' => array('FIZZ' => 'BUZZ'), 'bindable' => array('dummy' => array('hoge' => 'hogehoge', 'xyzzy' => 'piyopiyo'))), $_SESSION);
 }
 public function logout()
 {
     Auth::logout();
     // log the user out of our application
     Session::flush();
     return Redirect::to('login');
 }
 public function get_logout()
 {
     //GET LOGOUT
     Auth::logout();
     Session::flush();
     return Redirect::to_action('cms::login');
 }
Example #4
0
 public function logout()
 {
     Auth::logout();
     Session::flush();
     //delete the session
     return Redirect::to('admin/login');
 }
 /**
  * @param Router $router
  */
 public function map(Router $router)
 {
     $router->group(['namespace' => $this->namespace, 'prefix' => 'backend', 'middleware' => ['web', 'theme:backend', 'lang', 'configure:backend']], function (Router $router) {
         $router->get('/', function () {
             return redirect(url('backend/c/dashboard'));
         });
         $router->group(['middleware' => 'guest'], function (Router $router) {
             $router->get('login', 'Auth\\AuthController@getLogin');
             $router->post('login', 'Auth\\AuthController@postLogin');
             $router->get('forgot-password', 'Auth\\PasswordController@getEmail');
             $router->post('forgot-password', 'Auth\\PasswordController@postEmail');
             $router->get('reset-password/{code}', 'Auth\\PasswordController@getReset');
             $router->post('reset-password', 'Auth\\PasswordController@postReset');
         });
         $router->group(['middleware' => 'auth:admin'], function (Router $router) {
             $router->get('logout', function () {
                 \Auth::logout();
                 \Session::flush();
                 return redirect('/backend/login');
             });
             $router->any('c/{controller}', function (Request $request, $controller) {
                 return app()->call($this->namespace . '\\' . ucfirst($controller) . 'Controller@' . ucfirst(strtolower($request->method())) . 'Index');
             });
             $router->any('c/{controller}/a/{action}', function (Request $request, $controller, $action) {
                 return app()->call($this->namespace . '\\' . ucfirst($controller) . 'Controller@' . ucfirst(strtolower($request->method())) . ucfirst(strtolower($action)));
             });
         });
     });
 }
 public function logout()
 {
     Auth::logout();
     LoggedInUser::remove();
     Session::flush();
     return Redirect::route('home');
 }
 public static function checkEligibility($unit, $data = [])
 {
     $ret = application_requirement::ok($unit, $data);
     if (!$ret) {
         Session::flush('not-eligible', Messages::notEligible());
     }
 }
Example #8
0
 public function postLogin()
 {
     include app_path() . "/include/cifrado.php";
     $errores = new Errores();
     $empresas = new Empresa();
     $data = Input::all();
     $empresa = $empresas->getEmpresabyEmail($data['email']);
     if (!$empresa) {
         $errores->addError('Usuario o contraseña incorrectos');
         return Redirect::action('Empresa_EmpresaController@getLogin')->with('errores', $errores->all());
     }
     $pass = $empresa->password;
     if (descifrar($data['password'], $pass)) {
         Session::flush();
         Session::put('ip_address', $_SERVER['REMOTE_ADDR']);
         Session::put('logged_empresa', true);
         Session::put('id_empresa', $empresa->id);
         $empresa->accesos_erroneos = 0;
         $empresa->save();
         //return Redirect::action('Empresa_EmpresaController@getIndex');
         return Redirect::intended('empresa/index');
     } else {
         $accesos = $empresa->accesos_erroneos;
         $empresa->accesos_erroneos++;
         $empresa->save();
         Session::flush();
         $errores->addError('Usuario o contraseña incorrectos');
         return Redirect::action('Empresa_EmpresaController@getLogin')->with('errores', $errores->all());
     }
 }
 /**
  * Display listing of the resource
  *
  * @return Response
  */
 public function login()
 {
     //set the user array to gather data from user form
     $userdata = array('username' => Input::get('username'), 'password' => Input::get('password'));
     /*
     $hashpassword = Hash::Make(Input::get('password'));
     var_dump($hashpassword);
     die();
     */
     if (Auth::check()) {
         return Redirect::to('/');
     }
     if (Auth::attempt($userdata)) {
         // cauta userul in baza de date
         $user = UserModel::find(Auth::user()->id);
         if ($user->active == 0) {
             //daca userul nu este activ
             Auth::logout();
             Session::flush();
             return Redirect::to('login')->with('message', FlashMessage::DisplayAlert('Login successful', 'success'));
         }
         //if($user->active == '0')
         //daca userul este activ
         Session::put('current_user', Input::get('username'));
         Session::put('user_access', $user->access);
         Session::put('user_id', $user->id);
         return Redirect::to('/');
     } else {
         return Redirect::to('login')->with('message', FlashMessage::DisplayAlert('Incorrect username or password', 'danger'));
     }
     //else if Auth
 }
 public static function logout()
 {
     if (Session::has('eid')) {
         Session::flush();
         return Redirect::to('/');
     }
 }
Example #11
0
 /**
  * function name : dologout
  * logout system
  * clear session data
  */
 public function dologout()
 {
     Session::flush();
     //delete the session
     return Redirect::to('/');
     // redirect the user to the login screen
 }
Example #12
0
 public function getLogout()
 {
     Session::flush();
     Cookie::forget('laravel_session');
     Auth::logout();
     return Redirect::to('/')->with('success_messages', 'Vuelve Pronto')->with('alert-class', 'alert-success');
 }
 public function inventory()
 {
     Session::flush();
     $items = Catalog::orderBy('created_at', 'desc')->get();
     $page = Page::where('type', '=', 3)->firstOrFail();
     return View::make('front.pages.inventory', compact('items', 'page'));
 }
Example #14
0
 public function getLolgout()
 {
     Auth::logout();
     $this->auth->logout();
     Session::flush();
     return redirect('/');
 }
Example #15
0
 public function getLogout()
 {
     \Auth::logout();
     \Session::flash('flash_message', 'You have been logged out.');
     \Session::flush();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
Example #16
0
 /**
  * Destroy user session
  * 
  * @return Response
  */
 public function destroy($id)
 {
     if (Session::get('user.token')) {
         Session::flush();
     }
     return array('logged' => false);
 }
 public function destroy()
 {
     General::storeevents(NGUOI_DUNG_LOGOUT);
     Session::flush();
     Auth::logout();
     return Redirect::route("login");
 }
 public function __construct()
 {
     /*		I just figured that I could've just checked for sessions here (constructor)
      * 		instead of checking it in each method of each class. 
      *		But I guess I've gone too far on this project that it'll be time wasting to change my codes.
      *		I'm gonna continue checking sessions per method per class on this project...
      *		But in my next projects, I'll do the non-specific session checking in the constructors <3
      *
      *		-Christian (Programmer)
      *		
     */
     if (Session::has('username')) {
         date_default_timezone_set("Asia/Manila");
         $user = User::where('username', '=', Session::get("username"))->first();
         if (!$user) {
             Session::flush();
             return Redirect::to("/");
         }
         Session::put('user_id', $user->id);
         Session::put('username', $user->username);
         Session::put('first_name', $user->first_name);
         Session::put('last_name', $user->last_name);
         Session::put('user_type', $user->user_type);
     }
 }
Example #19
0
 public function inicializarSession($usuario)
 {
     Session::flush();
     Session::put('usuario.username', $usuario->call->return->usuario->nombreUsuario);
     Session::put('usuario.nombre', $usuario->call->return->usuario->apellidos . ", " . $usuario->call->return->usuario->nombre);
     if (is_array($usuario->call->return->usuario->listGrupo)) {
         $listgrupo = $usuario->call->return->usuario->listGrupo;
         foreach ($listgrupo as $lg) {
             if (strpos($lg->nombre, "ra_admin") !== false) {
                 Session::put('usuario.perfil', $lg->nombre);
                 break;
             }
             //                if (strpos($lg->nombre, "ropc_digit") !== false) {
             //                    Session::put('usuario.perfil', $lg->nombre);
             //                    break;
             //                }
             //                if (strpos($lg->nombre, "ropc_gge") !== false) {
             //                    Session::put('usuario.perfil', $lg->nombre);
             //                    break;
             //                }
         }
     } else {
         Session::put('usuario.perfil', $usuario->call->return->usuario->listGrupo->nombre);
     }
     Session::put('usuario.idSesion', $usuario->call->return->usuario->idSesion);
     Session::put('usuario.contrasena', $usuario->call->return->usuario->contrasena);
     $codigo = User::getPk($usuario->call->return->usuario->nombreUsuario);
     Session::put('usuario.codigo', $codigo->usuario);
 }
 public function logout()
 {
     Session::flush();
     // removes all session data
     // Auth::logout();
     return Redirect::to('login');
 }
 public function getLogout()
 {
     \Session::flush();
     \Cache::flush();
     \Auth::logout();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
Example #22
0
 /**
  * 注销
  * @method logout
  * @return 重定向或者json字符
  */
 public function logoutAction()
 {
     Input::I('url', $url, FILTER_VALIDATE_URL, '/');
     Cookie::flush();
     Session::flush();
     $this->success('注销成功', $url);
 }
 /**
  * Log user out of system.
  */
 public function logout()
 {
     Auth::logout();
     Session::flush();
     // Clear *ALL* session data!
     return Redirect::to('login')->with('message', 'You have logged out.');
 }
Example #24
0
 public function getLogout()
 {
     Auth::logout();
     Session::flush();
     // Redirect to homepage
     return Redirect::to('/')->with('success', 'You have been successfully logged out');
 }
Example #25
0
 public function postpaso3()
 {
     // return Response::json(Input::all());
     //guardar informnacion y seguir con el siguiente paso XD
     //punto delicado con el id --> buscar otro metodo XD podria funcionar con la session ver este tema
     // $usuario = User::find(Session::get(''));
     if (Session::has('account_id')) {
         $usuario = User::find(Input::get('id'));
         $usuario->setAccountId(Session::get('account_id'));
         $usuario->setUsername(Input::get('username'));
         $usuario->setPassword(Input::get('password'), Input::get('password_confirm'));
         $usuario->setFirstName(Input::get('first_name'));
         $usuario->setLastName(Input::get('last_name'));
         $usuario->setEmail(Input::get('email'));
         $usuario->setPhone(Input::get('phone'));
         // return var_dump($usuario);
         if ($usuario->Guardar()) {
             //redireccionar con el mensaje a la siguiente vista
             Session::flash('message', $usuario->getErrorMessage());
             $account = Account::find(Session::get('account_id'));
             $account->op3 = true;
             //en caso de hacer una ventana de confirmacion antes de salir de la instalacion solo se tiene que usar el campo confirmed
             $account->confirmed = true;
             $account->save();
             Session::flush();
             return Redirect::to('inicio');
         }
         Session::flash('error', $usuario->getErrorMessage());
         return Redirect::to('paso/3');
     }
     return Redirect::to('/');
 }
 public function logout()
 {
     // Cierro la sesion del usuario
     Auth::logout();
     Session::flush();
     return Redirect::to('/');
 }
Example #27
0
 public function FuncionLogout()
 {
     if (Auth::check()) {
         Auth::logout();
         Session::flush();
         return Redirect::to('/login/login');
     }
 }
Example #28
0
 /**
  * post Login to Api
  *
  * @param  array  $data
  * @return \Illuminate\Contracts\Validation\Validator
  */
 public function getLogout()
 {
     $response = $this->call('/api/invalidate_token', 'get');
     if ($response['content']['message'] == 'The token has been blacklisted' || $response['content']['message'] == 'success') {
         \Session::flush();
     }
     return redirect('login');
 }
Example #29
0
 public function logout()
 {
     if (Session::has('user_id')) {
         Session::flush();
     }
     Auth::logout();
     return Redirect::to('/');
 }
Example #30
0
 public function logout()
 {
     $oauth = new \Hybrid_Auth(base_path() . '/app/config/fb_Auth.php');
     $oauth->logoutAllProviders();
     Session::flush();
     Auth::logout();
     return Redirect::to("home");
 }