Example #1
0
 function handle_valid($remember_me = 0, $next = null)
 {
     global $lr_session;
     $status = $lr_session->attr_get('status');
     // New users may be treated as active, if the right setting is on
     if ($lr_session->user->is_active()) {
         $status = 'active';
     }
     switch ($status) {
         case 'new':
             return $this->login_form("Login Denied.  Account creation is awaiting approval.");
         case 'locked':
             return $this->login_form("Login Denied.  Account has been locked by administrator.");
         case 'inactive':
             /* Inactive.  Send this person to the revalidation page(s) */
             local_redirect(url("person/activate"));
             break;
         case 'active':
             /* These accounts are active and can continue */
             /*
              * If the user wants to be remembered, set the proper cookie
              * such that the session won't expire.
              */
             $path = ini_get('session.cookie_path');
             if (!$path) {
                 $path = '/';
             }
             $domain = ini_get('session.cookie_domain');
             if ($remember_me) {
                 setcookie(session_name(), session_id(), time() + 3600 * 24 * 365, $path, $domain);
             } else {
                 setcookie(session_name(), session_id(), FALSE, $path, $domain);
             }
             if ($next) {
                 local_redirect(queryUnpickle($next));
             } else {
                 local_redirect(url("home"));
             }
             break;
     }
     return true;
 }
Example #2
0
 function process()
 {
     $edit = $_POST['edit'];
     $next = $_POST['next'];
     if (is_null($next)) {
         $next = $_GET['next'];
         if (is_null($next)) {
             $next = queryPickle('home');
         }
     }
     switch ($edit['step']) {
         case 'perform':
             $this->perform($edit);
             local_redirect(queryUnpickle($next));
         default:
             $this->template_name = 'pages/person/waiver.tpl';
             $this->smarty->assign('next_page', $next);
             $this->smarty->assign('waiver_text', $this->waiver_text);
             $rc = true;
     }
     return $rc;
 }