From c00543dceb39a7b32892d9d284147272dbf3e649 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 6 Jan 2021 13:52:33 +0800 Subject: [PATCH] enable statick access to getAuthUser --- Pman.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) 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: -- 2.39.2