public function reset_new()
 {
     $linkData = $this->linkData($_POST['link']);
     if ($linkData['error'] > 0) {
         \ipinga\cookie::add('message_for_next_screen', $linkData['message']);
         header('location: /login');
     } else {
         $v = new \ipinga\validator($_POST, true);
         $v->checkPassword('passwd1', 'Password', 4, 20, true, false);
         $v->checkMatch('passwd1', 'passwd2', 'Passwords');
         if (empty($v->message) == false) {
             $this->template->message = 'Please fix input errors.';
             $this->template->user = $linkData['user'];
             $this->template->link = $_POST['link'];
             $this->template->show('password.reset.form');
         } else {
             /** @var \ipinga\userTable $u */
             $u = $linkData['user'];
             $u->passwd = $_POST['passwd1'];
             $u->save();
             \ipinga\cookie::add('message_for_next_screen', 'Your password has been changed.  You may now login.');
             header('location: /login');
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     \ipinga\acl::$userTableName = 'users';
     \ipinga\acl::$usernameFieldName = 'email';
     $mgr = \ipinga\ipinga::getInstance()->manager;
     $mgr->userIsLoggedIn(false);
     // determine if the user is logged in or not
     $this->template->logo_url = \ipinga\options::get('logo_url');
     $this->template->showLoginFormInTopBanner = false;
     $u = new \ipinga\table('users');
     if ($mgr->isLoggedIn == true) {
         $u->loadById($mgr->loggedInDetails['USER_ID']);
         $mgr->update($u->id);
     }
     $this->template->loggedInUser = $u;
     // will be a bunch of null data if the user isn't logged in
     $this->template->manager = $mgr;
     $this->template->menuHtml = '';
     if (\ipinga\cookie::keyExists('message_for_next_screen') == true) {
         $this->template->message_for_next_screen = \ipinga\cookie::keyValue('message_for_next_screen');
         \ipinga\cookie::drop('message_for_next_screen');
     }
     $this->template->title = \ipinga\options::get('site_title');
     $this->template->activePanel = 0;
     $this->template->skin = \ipinga\options::get('skin');
 }
Esempio n. 3
0
 private function shutdown()
 {
     \ipinga\cookie::add('loggedInDetails', $this->loggedInDetails);
 }
Esempio n. 4
0
 function ipinga_shutdown()
 {
     // v6_debug::dump();
     \ipinga\cookie::set();
     @ob_end_flush();
     $error = error_get_last();
     if ($error !== NULL && $error['type'] == 1) {
         //        ob_end_clean();   // silently discard the output buffer contents.
         //        appSendMsgToVern('Error has occurred',$error);
         //        header( 'location:/fatal_error' );
         @ob_end_flush();
         // output what is stored in the internal buffer  (may not want this here in production)
         \ipinga\log::info(var_export($error, true));
         echo '<pre>' . var_export($error, true);
         //    v6_BackTrace();
         die('handleShutdown(): Cannot continue!');
     } else {
         @ob_end_flush();
         // output what is stored in the internal buffer
     }
 }