/**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->session->has('lastActivityTime')) {
         $this->session->put('lastActivityTime', time());
     } else {
         if (time() - $this->session->get('lastActivityTime') > $this->getTimeOut()) {
             $this->session->forget('lastActivityTime');
             Auth::logout();
             return redirect($this->getRedirectUrl())->with([$this->getSessionLabel() => 'You have been inactive for ' . $this->timeout / 60 . ' minutes ago.']);
         }
     }
     $this->session->put('lastActivityTime', time());
     return $next($request);
 }
Beispiel #2
0
 /**
  * Handle filter request for creating propel query.
  *
  * @param  array  $filter_request
  * @param  string   $filter_name
  * @return bool
  */
 public function handleFilterRequest($filter_request, $filter_name)
 {
     if (session($filter_name)) {
         $filter = session($filter_name);
     } else {
         $filter = array();
     }
     if (isset($filter_request['reset'])) {
         session::forget($filter_name);
         $filter = array();
         $this->createQuery($filter, false);
     } else {
         if (isset($filter_request['search'])) {
             $this->createQuery($filter_request, true);
         } else {
             $this->createQuery($filter, false);
         }
     }
 }
Beispiel #3
0
 /**
  * Returning Customer Form Processing. (This will redirect them back to the front end, which should have all of there information!
  */
 public function ReturningCustomerForm()
 {
     $lastname = Input::get('lastname');
     $email = Input::get('email');
     $capche_key = '6LdI9wATAAAAANT_6rPnIaMpVXhAGO8AhOu7H_eV';
     $capche_secret = '6LdI9wATAAAAAGAb9tN6ugLnTWFfHUtb3XCc8YdQ';
     $response = Input::get('g-recaptcha-response');
     //check if the y are correct
     $results = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $capche_secret . '&response=' . $response . '&remoteip=' . $_SERVER['REMOTE_ADDR']);
     $response = json_decode($results);
     if (isset($response->success) && $response->success) {
         $solved_capache = true;
     } else {
         $messages = new Illuminate\Support\MessageBag();
         $messages->add('You must prove you are human ', " <b>Capache Error</b>");
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         return Redirect::to('/')->withErrors($messages);
     }
     $this->TranslateOrderFromStatus("false", $ordered_cpn, $ordered_repayment_promisory_note, $ordered_pslf, $ordered_forebearance);
     Session::put('ordered_cpn', $ordered_cpn);
     Session::put('ordered_repayment_promisory_note', $ordered_repayment_promisory_note);
     Session::put('ordered_pslf', $ordered_pslf);
     Session::put('ordered_forebearance', $ordered_forebearance);
     session::forget('Step3Completed');
     //		$ssn = str_replace('-', '', $ssn); // remove any dashes.
     //		$ssn = substr($ssn,0,3) .'-'.substr($ssn,3,2).'-'.substr($ssn,5);
     //find out if they have anything matching.
     //		$search = $this->leadtracapi->FindClientByLastNameAndSSN($lastname, $ssn);
     $search = $this->leadtracapi->FindClientByLastNameAndEmail($lastname, $email);
     if (!$search) {
         //Show the page & add errors!
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         Session::forget('fileNumber');
     } else {
         Session::put('fileNumber', $search);
         // lets see if they are upgrading/updating their profile (see if they have paid for anything.)
         $client = $this->leadtracapi->GetClient($search, array('FirstName', 'LastName', 'Loan_Program'));
         $upgrade = array('100% Payments Received', 'Process Payments');
         session::forget('Step3Completed');
         $this->TranslateOrderFromStatus($client->Status->Sales, $ordered_cpn, $ordered_repayment_promisory_note, $ordered_pslf, $ordered_forebearance);
         Session::put('ordered_cpn', $ordered_cpn);
         Session::put('ordered_repayment_promisory_note', $ordered_repayment_promisory_note);
         Session::put('ordered_pslf', $ordered_pslf);
         Session::put('ordered_forebearance', $ordered_forebearance);
         if (isset($client->Status->Accounting) && in_array($client->Status->Accounting, $upgrade)) {
             Session::put('ClientUpgrade', true);
         } else {
             Session::put('ClientUpgrade', false);
         }
     }
     return Redirect::to('/');
 }
Beispiel #4
0
 /**
  * Returning Customer Form Processing. (This will redirect them back to the front end, which should have all of there information!
  */
 public function ReturningCustomerForm()
 {
     $lastname = Input::get('lastname');
     $email = Input::get('email');
     $capche_key = '6LdI9wATAAAAANT_6rPnIaMpVXhAGO8AhOu7H_eV';
     $capche_secret = '6LdI9wATAAAAAGAb9tN6ugLnTWFfHUtb3XCc8YdQ';
     $response = Input::get('g-recaptcha-response');
     //check if the y are correct
     $results = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $capche_secret . '&response=' . $response . '&remoteip=' . $_SERVER['REMOTE_ADDR']);
     $response = json_decode($results);
     $response->success = true;
     # PRZ ReturningCustomerForm()
     if (isset($response->success) && $response->success) {
         $solved_capache = true;
     } else {
         $messages = new Illuminate\Support\MessageBag();
         $messages->add('You must prove you are human ', " <b>Capache Error</b>");
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         return Redirect::to('/')->withErrors($messages);
     }
     session::forget('Step3Completed');
     $search = $this->leadtracapi->FindClientByLastNameAndEmail($lastname, $email);
     if (!$search) {
         //Show the page & add errors!
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         Session::forget('fileNumber');
     } else {
         Session::put('fileNumber', $search);
         // lets see if they are upgrading/updating their profile (see if they have paid for anything.)
         $client = $this->GetClientFromSession(true);
         $upgrade = array('100% Payments Received', 'Process Payments');
         session::put('Step3Completed', true);
     }
     // register their browser id so that this is the primary one editing the file
     $this->System_Register_With_Clients_BrowserID();
     // run step 1, step 2.
     Session::flash('dont_auto_logout', true);
     return Redirect::to('/');
 }