From: Alan Knowles Date: Wed, 6 Jan 2021 05:52:33 +0000 (+0800) Subject: enable statick access to getAuthUser X-Git-Url: http://git.roojs.org/?p=Pman.Base;a=commitdiff_plain;h=c00543dceb39a7b32892d9d284147272dbf3e649 enable statick access to getAuthUser --- diff --git a/Pman.php b/Pman.php index a1a6170..ba45a32 100644 --- a/Pman.php +++ b/Pman.php @@ -255,17 +255,9 @@ class Pman extends HTML_FlexyFramework_Page } - - /** - * getAuthUser: - get the authenticated user.. - * - * @return {DB_DataObject} of type Pman[authTable] if authenticated. - */ - - function getAuthUser() - { - if (!empty($this->authUser)) { - return $this->authUser; + static function staticGetAuthUser($t) { + if (!empty($t->authUser)) { + return $t->authUser; } $ff = HTML_FlexyFramework::get(); $tbl = empty($ff->Pman['authTable']) ? 'core_person' : $ff->Pman['authTable']; @@ -275,8 +267,20 @@ class Pman extends HTML_FlexyFramework_Page if (is_a($u,'PEAR_Error') || !$u->isAuth()) { return false; } - $this->authUser =$u->getAuthUser(); - return $this->authUser ; + $t->authUser =$u->getAuthUser(); + return $t->authUser ; + + } + + /** + * getAuthUser: - get the authenticated user.. + * + * @return {DB_DataObject} of type Pman[authTable] if authenticated. + */ + + function getAuthUser() + { + return staticGetAuthUser($this); } /** * hasPerm: