public function index()
 {
     // this is bit of a kludge in that since we are logging out, we don't want to make the template
     // ready, until AFTER the logout has occurred otherwise, menu options will still be created and displayed
     // as though the user is still logged in.... because technically he would be at that point.
     $mgr = new v6_manager();
     $mgr->logout();
     // now we can do everything we normally do...
     appMakeTemplateReady($this->template);
     $this->template->message = 'You have been logged out';
     $this->template->show('login.form');
 }
 public function index()
 {
     // if they click on signup, make sure they aren't logged in
     // this is bit of a kludge in that since we are logging out, we don't want to make the template
     // ready, until AFTER the logout has occurred otherwise, menu options will still be created and displayed
     // as though the user is still logged in.... because technically he would be at that point.
     $mgr = new v6_manager();
     $mgr->logout();
     // now we can do everything we normally do...
     appMakeTemplateReady($this->template);
     // this test is so the url doesn't get funky...
     //  ie: if you come here as a get, then the form is shown and if you come here as a post, I try to authenticate you
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->_process();
     } else {
         $this->template->mgr->logout();
         // if they are logging in, then make sure they are logged out as of now
         $this->template->show('signup.form');
     }
 }
示例#3
0
 function delete_record($table_name, $var_name, $reqd_admin_level = 0, $must_be_logged_id = false)
 {
     global $registry;
     // start fresh
     $this->data = array();
     $this->data['status'] = AJAX_NO_ERROR;
     $this->data['message'] = '';
     if (isset($this->record) == true) {
         unset($this->record);
     }
     $mgr = new v6_manager();
     $mgr->UserIsLoggedIn(false);
     if (isset($must_be_logged_id) && $must_be_logged_id == true && $mgr->IsLoggedIn == false) {
         $this->data['status'] = AJAX_ACCESS_DENIED;
         $this->data['message'] = 'Access Denied (ADR-1)';
         return $this->data['status'];
     }
     if ($reqd_admin_level == 2 && $mgr->is_almighty == false) {
         $this->data['status'] = AJAX_ACCESS_DENIED;
         $this->data['message'] = 'Access Denied (ADR-2)';
         return $this->data['status'];
     }
     if ($reqd_admin_level == 1 && ($mgr->is_almighty == false && $mgr->is_admin == false)) {
         $this->data['status'] = AJAX_ACCESS_DENIED;
         $this->data['message'] = 'Access Denied (ADR-3)';
         return $this->data['status'];
     }
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         $this->data['status'] = AJAX_ACCESS_DENIED;
         $this->data['message'] = 'Access Denied (ADR-4)';
         return $this->data['status'];
     }
     $registry->helper->load('v6_validator');
     $validator = new v6_validator($_POST);
     // make sure the querystring is a valid number...
     $validator->CheckNumber($var_name, 'Id', 0, 999999);
     $message = $validator->message;
     if (empty($message) == false) {
         $this->data['status'] = AJAX_VALIDATION_FAILURE;
         $this->data['message'] = $message;
         return $this->data['status'];
     }
     $this->record = new v6_table($table_name);
     $this->record->delete_by_id($_POST[$var_name]);
     $this->data['status'] = AJAX_RECORD_DELETED;
     $this->data['message'] = 'Record Deleted';
     return $this->data['status'];
 }