From: edward Date: Wed, 30 Mar 2016 10:30:59 +0000 (+0800) Subject: RooTrait.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=19b401db854fe3dc887cc57d594f6d16173a67c6 RooTrait.php --- diff --git a/RooTrait.php b/RooTrait.php index c9de7c4c..26057e6d 100644 --- a/RooTrait.php +++ b/RooTrait.php @@ -366,8 +366,23 @@ trait Pman_Core_RooTrait { $e->onInsert(isset($_REQUEST) ? $_REQUEST : array() , $this); - return $e; } + + function getAuthUser() + { + if (!empty($this->authUser)) { + return $this->authUser; + } + $ff = HTML_FlexyFramework::get(); + $tbl = empty($ff->Pman['authTable']) ? 'Person' : $ff->Pman['authTable']; + + $u = DB_DataObject::factory( $tbl ); + if (!$u->isAuth()) { + return false; + } + $this->authUser =$u->getAuthUser(); + return $this->authUser ; + } }