public function activeUser($sKeys = '', $sDelimiter = ' ')
    {
        //  Only look for a value if we're logged in
        if (!$this->isLoggedIn()) {
            return false;
        }

        // --------------------------------------------------------------------------

        //  If $sKeys is false just return the user object in its entirety
        if (empty($sKeys)) {
            return $this->activeUser;
        }

        // --------------------------------------------------------------------------

        //  If only one key is being requested then don't do anything fancy
        if (strpos($sKeys, ',') === false) {

            $val = isset($this->activeUser->{trim($sKeys)}) ? $this->activeUser->{trim($sKeys)} : null;

        } else {

            //  More than one key
            $aKeys = explode(',', $sKeys);
            $aKeys = array_filter($aKeys);
            $aOut  = [];

            foreach ($aKeys as $sKey) {

                //  If something is found, use that.
                if (isset($this->activeUser->{trim($sKey)})) {
                    $aOut[] = $this->activeUser->{trim($sKey)};
                }
            }

            //  If nothing was found, just return null
            if (empty($aOut)) {
                $val = null;
            } else {
                $val = implode($sDelimiter, $aOut);
            }
        }

        return $val;
    }
public function activeUser($sKeys = '', $sDelimiter = ' ')
    {
        //  Only look for a value if we're logged in
        if (!$this->isLoggedIn()) {
            return false;
        }

        // --------------------------------------------------------------------------

        //  If $sKeys is false just return the user object in its entirety
        if (empty($sKeys)) {
            return $this->activeUser;
        }

        // --------------------------------------------------------------------------

        //  If only one key is being requested then don't do anything fancy
        if (strpos($sKeys, ',') === false) {

            $val = isset($this->activeUser->{trim($sKeys)}) ? $this->activeUser->{trim($sKeys)} : null;

        } else {

            //  More than one key
            $aKeys = explode(',', $sKeys);
            $aKeys = array_filter($aKeys);
            $aOut  = [];

            foreach ($aKeys as $sKey) {

                //  If something is found, use that.
                if (isset($this->activeUser->{trim($sKey)})) {
                    $aOut[] = $this->activeUser->{trim($sKey)};
                }
            }

            //  If nothing was found, just return null
            if (empty($aOut)) {
                $val = null;
            } else {
                $val = implode($sDelimiter, $aOut);
            }
        }

        return $val;
    }
public function activeUser ( $ sKeys = '' , $ sDelimiter = ' ' ) { //  Only look for a value if we're logged in if ( ! $ this -> isLoggedIn ( ) ) { return false ; } // -------------------------------------------------------------------------- //  If $sKeys is false just return the user object in its entirety if ( empty ( $ sKeys ) ) { return $ this -> activeUser ; } // -------------------------------------------------------------------------- //  If only one key is being requested then don't do anything fancy if ( strpos ( $ sKeys , ',' ) === false ) { $ val = isset ( $ this -> activeUser -> { trim ( $ sKeys ) } ) ? $ this -> activeUser -> { trim ( $ sKeys ) } : null ; } else { //  More than one key $ aKeys = explode ( ',' , $ sKeys ) ; $ aKeys = array_filter ( $ aKeys ) ; $ aOut = [ ] ; foreach ( $ aKeys as $ sKey ) { //  If something is found, use that. if ( isset ( $ this -> activeUser -> { trim ( $ sKey ) } ) ) { $ aOut [ ] = $ this -> activeUser -> { trim ( $ sKey ) } ; } } //  If nothing was found, just return null if ( empty ( $ aOut ) ) { $ val = null ; } else { $ val = implode ( $ sDelimiter , $ aOut ) ; } } return $ val ; }
Fetches a value from the active user's session data

@param string $sKeys      The key to look up in activeUser
@param string $sDelimiter If multiple fields are requested they'll be joined by this string

@return mixed
Fetches a value from the active user s session data