]> Kevux Git Server - koopa/commitdiff
Bugfix: a few unhandled or improperly error cases
authorKevin Day <thekevinday@gmail.com>
Sat, 3 Feb 2018 01:51:57 +0000 (19:51 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 3 Feb 2018 01:51:57 +0000 (19:51 -0600)
common/standard/classes/standard_index.php
common/standard/classes/standard_path_user.php

index fc927511c4ee679c36868be9aa96b06793ab2503..fc405a3e08126090dc53ca6a3fc424001fa643d5 100644 (file)
@@ -416,7 +416,8 @@ class c_standard_index extends c_base_return {
       //        some errors the cookie should be deleted and others it should remain untouched.
 
       // also set the error on the session object.
-      $this->session->set_error($session_connection->get_error());
+      $errror = $session_connection->get_error();
+      $this->session->set_error($error);
       unset($session_connection);
 
       $this->session->set_session_id(NULL);
@@ -434,7 +435,8 @@ class c_standard_index extends c_base_return {
       //        some errors the cookie should be deleted and others it should remain untouched.
 
       // also set the error on the session object.
-      $this->session->set_error($session_loaded->get_error());
+      $error = $session_loaded->get_error();
+      $this->session->set_error($error);
       unset($session_loaded);
 
       $this->session->set_session_id(NULL);
index 8beff41263654fca3036f72635292701a1bf0bb8..23a140aef27b5ec9851c8a55db256c44d43ddf5d 100644 (file)
@@ -190,8 +190,19 @@ class c_standard_path_user extends c_standard_path {
     }
 
     if (is_null($this->path_user_id)) {
-      $this->path_user = $this->session->get_user_current();
-      $this->path_user_id = $this->path_user->get_id()->get_value_exact();
+      $path_user = $this->session->get_user_current();
+      if ($path_user instanceof c_base_users_user) {
+        $this->path_user = $path_user;
+        $this->path_user_id = $this->path_user->get_id()->get_value_exact();
+      }
+      else {
+        if ($path_user->has_error()) {
+          $executed->set_error($path_user->get_error());
+        }
+
+        $this->path_user = FALSE;
+      }
+      unset($path_user);
 
       // do not allow view access to reserved/special accounts.
       if ($this->path_user_id < static::ID_USER_MINIMUM) {