Checks if active page is register guest page.

@return bool
485985
protected function ActivePageIsRegisterAfterShopping()
    {
        $bActivePageIsRegisterAfterShopping = false;
        $oURLData = TCMSSmartURLData::GetActive();
        $oShop = TdbShop::GetInstance($oURLData->iPortalId);
        $sNodeId = $oShop->GetSystemPageNodeId('register-after-shopping');
        $oActivePage = $this->getActivePageService()->getActivePage();
        if ($oActivePage && $sNodeId == $oActivePage->GetMainTreeId()) {
            $bActivePageIsRegisterAfterShopping = true;
        }

        return $bActivePageIsRegisterAfterShopping;
    }
785845
def active_page?(pages = {})
      is_active = pages.include?(params[:controller])
      is_active = pages[params[:controller]].include?(params[:action]) if is_active && !pages[params[:controller]].empty?
      is_active
    end
1199239
public function active($per_page)
	{
		$per_page = is_numeric($per_page) ? $per_page : 5;

		return Post::with(array('tags', 'user'))
			->where('active', 1)
			->where('publish_date', '<=', new DateTime)
			->orderBy('publish_date', 'desc')
			->paginate($per_page);
	}
43172
public function isCacheActiveForTheCurrentUser(): bool
    {
        $active = true;

        // test the cache, with this GET-parameter
        if ($this->disableCacheGetParameter) {
            $testCache = isset($_GET[$this->disableCacheGetParameter]) ? (int) $_GET[$this->disableCacheGetParameter] : 0;
        } else {
            $testCache = 0;
        }

        if ($testCache !== 1) {
            if (
                // admin session is active
                (
                    $this->useCheckForAdminSession
                    &&
                    $this->isAdminSession
                )
                ||
                // server == client
                (
                    $this->useCheckForServerIpIsClientIp
                    &&
                    isset($_SERVER['SERVER_ADDR'])
                    &&
                    $_SERVER['SERVER_ADDR'] === $this->getClientIp()
                )
                ||
                // user is a dev
                (
                    $this->useCheckForDev
                    &&
                    $this->checkForDev()
                )
            ) {
                $active = false;
            }
        }

        return $active;
    }
235269
public function hasEnabledInvitationRegistration()
    {
        if ($this->invitationRegistrationClass === false || !is_string($this->invitationRegistrationClass) || !class_exists($this->invitationRegistrationClass)) {
            return false;
        }
        return true;
    }
902088
private static function __isPageLogin() {
		$params = Router::getParams();

		return (
			!empty($params['controller']) && 'users' == $params['controller']
			&& !empty($params['action']) && 'login' == $params['action']
		);
	}
515740
public function isGuestAllowed()
    {
        if (null === $user = $this['repo.users']->findByLogin(User::USER_GUEST)) {
            return false;
        }

        return count($this->getAclForUser($user)->get_granted_base()) > 0;
    }
1115178
public function isactive() {
        global $PAGE;

        if ($this->is_section()) {
            $active = $PAGE->navigation->find_active_node();
            while ($active = $active->parent) {
                if ($active->key == $this->key && $active->type == $this->type) {
                    return true;
                }
            }
        }
        return $this->isactive;
    }
161839
public static function is_loggedin() {
	if (self::is_active() == false) {
		return false;
	}
	if (self::get_user_id() == false) {
		return false;
	}
	
	return true;
}
599817
private static function __isPageFront() {
		$params = Router::getParams();

		return (
			!empty($params['controller']) && 'pages' == $params['controller']
			&& !empty($params['action']) && 'display' == $params['action']
			&& !empty($params['pass']) && in_array('home', (array) $params['pass'])
		);
	}
904018
public function isLogged()
    {
        return self::$is_logged || self::$is_logged = (bool)(
                isset($_SESSION['admin_logged'], $_SESSION['admin_id'], $_SESSION['admin_sid'])
                && $_SESSION['admin_logged'] && $_SESSION['admin_id']
                && $this->checkSession($_SESSION['admin_id'], $_SESSION['admin_sid'], true)
            );
    }
695020
private static function is_site_active( $blog_id ) {
            global $wpdb;

            $blog_info = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d", $blog_id ) );

            if ( ! is_object( $blog_info ) ) {
                return false;
            }

            return (
                true == $blog_info->public &&
                false == $blog_info->archived &&
                false == $blog_info->mature &&
                false == $blog_info->spam &&
                false == $blog_info->deleted
            );
        }
52665
public function isGuest()
	{
		$pubkeyb64 = Config::get('jwt_pub_key', null);
		$env = substr(Config::get('application_env', ''), -5);

		// check for a jwt if user is not logged in
		if ($this->guest && array_key_exists('jwt', $_COOKIE) &&
			$env == 'cloud' && !is_null($pubkeyb64))
		{
			try
			{
				// decode public key and use it to check jwt signature
				$pubkey = base64_decode($pubkeyb64);
				$jwt = \Firebase\JWT\JWT::decode($_COOKIE['jwt'], $pubkey, array('RS512'));

				// if we have information for a user, populate the user variable
				if (isset($jwt->email) && isset($jwt->id) && isset($jwt->username) && isset($jwt->name) && isset($jwt->exp))
				{
					if ($jwt->exp < time())
					{
						setcookie('jwt', -86400, '', '/', '.' . \Hubzero\Utility\Dns::domain(), true, true);
						return $this->guest();
					}
					$jwtid = $jwt->id;
					$jwtemail = $jwt->email;
					$jwtuser = $jwt->username;
					$jwtname = $jwt->name;

					// check if we have a user by this email address
					$user = \User::oneByEmail($jwtemail);

					// this user does not exist
					// we should create this in the hub database
					if ($user->isNew())
					{
						// Using SQL here because the ORM does not currently support writing
						// new records with a specific primary key value
						$db = App::get('db');
						$query = "INSERT INTO `#__users` (`id`, `name`, `username`, `email`, `password`, `usertype`, `block`, " .
							"`approved`, `sendEmail`, `activation`, `params`, `access`, `usageAgreement`, `homeDirectory`, `loginShell`, `ftpShell`)
							VALUES (" . $db->quote($jwtid) . ", " . $db->quote($jwtname) . ", " . $db->quote($jwtuser) .
							", " . $db->quote($jwtemail) . ", " . $db->quote('') . ", " . $db->quote('') . ", " .
							$db->quote('0') . ", " . $db->quote('2') . ", " . $db->quote('0') . ", " . $db->quote('1') .
							", " . $db->quote('') . ", " . $db->quote('5') . ", " . $db->quote('1') . ", " .
							$db->quote('/home/' . $jwtuser) . ", " . $db->quote('/bin/bash') . ", " .
							$db->quote('/usr/lib/sftp-server') . ")";

						$db->setQuery($query);
						$result = $db->query();

						$usersConfig = Component::params('com_users');
						$newUsertype = $usersConfig->get('new_usertype', '2');
						$query = "INSERT INTO `#__user_usergroup_map` (`user_id`, `group_id`) VALUES (" . $db->quote($jwtid) . ", " . $db->quote($newUsertype) . ")";
						$db->setQuery($query);
						$result = $db->query();
						// Clear the session that was not logged in
						App::get('session')->restart();
					}

					// set up the user object to be logged in
					\User::set('id', $user->get('id'));
					\User::set('email', $jwtemail);
					\User::set('username', $jwtuser);
					\User::set('guest', false);
					\User::set('approved', 2);

					// set the user object in the session such that
					// next visit and other plugins that use the session
					// know what user is logged in
					App::get('session')->set('user', App::get('user')->getInstance());
					$this->guest = false;

					$data = App::get('user')->getInstance()->toArray();
					\Event::trigger('user.onUserLogin', array($data));
				}
			}
			catch (Exception $e)
			{
				// something likely went wrong with the jwt
			}
		}
		return $this->guest;
	}
1089947
public function checkRegistryRequestsAnswers()
    {
        if (! (($this->db instanceof \Zend_Db_Adapter_Abstract) && ($this->session instanceof \Zend_Session_Namespace))) {
            return false;
        }

        // Checks if this is the current user
        if (! $this->_vars instanceof \Zend_Session_Namespace) {
            $sessionStore = $this->session;

            $notCurrent = true;
            foreach (array('user_id', 'user_organization_id') as $key) {
                if ($sessionStore->__isset($key) && $this->_vars->offsetExists($key)) {
                    $notCurrent = $sessionStore->__get($key) != $this->_vars->offsetGet($key);
                } else {
                    $notCurrent = $sessionStore->__isset($key) || $this->_vars->offsetExists($key);
                }

                if ($notCurrent) {
                    break;
                }
            }
            if (! $notCurrent) {
                // When this is the case, use the \Zend_Session_Namespace object with the current set values
                // This way changes to this user object are reflected in the CurrentUser object and vice versa.
                $this->setAsCurrentUser();
            }
        }

        // Change a numeric role id to it's string value
        $this->_getRole('user_role');
        if ($this->_hasVar('current_user_role')) {
            $this->_getRole('current_user_role');
        }

        return (boolean) $this->acl && $this->userLoader;
    }
1168884
public function checkPageSubjectInTitle() {
        if ($this->checkPageSubjectDefined()) {
            if (preg_match('/' . preg_quote($this->owner->SEOPageSubject, '/') . '/i', $this->owner->MetaTitle)) {
                return true;
            } elseif (preg_match('/' . preg_quote($this->owner->SEOPageSubject, '/') . '/i', $this->owner->Title)) {
                return true;
            } else {
                return false;
            }
        }
        return false;
    }
1120754
public function is_wp_login()
    {
        $abs_path = \str_replace(['\\', '/'], DIRECTORY_SEPARATOR, ABSPATH);

        $files = \get_included_files();

        if (\in_array($abs_path . 'wp-login.php', $files) || \in_array($abs_path . 'wp-register.php', $files)) {
            return true;
        }

        if (isset($_GLOBALS['pagenow']) && $GLOBALS['pagenow'] === 'wp-login.php') {
            return true;
        }

        if (isset($_SERVER['PHP_SELF']) && $_SERVER['PHP_SELF'] == '/wp-login.php') {
            return true;
        }

        return false;
    }
1006105
public function getIsAdmin()
	{
		if(!\Yii::$app->user->isGuest)
		{
			if(\Yii::$app->user->identity->role < 2)
			{
				return true;
			}
		}
		return false;
	}