Pop\Web\Mobile::isMobileDevice PHP Метод

isMobileDevice() публичный статический Метод

Static method to only detect a mobile device or not.
public static isMobileDevice ( ) : boolean
Результат boolean
    public static function isMobileDevice()
    {
        $mob = new static();
        return $mob->isMobile();
    }

Usage Example

Пример #1
0
 /**
  * Get Auth result
  *
  * @param  \Phire\Table\UserTypes $type
  * @return string
  */
 public function getAuthResult($type)
 {
     $result = null;
     if (!$this->isValid()) {
         $result = $this->getResultMessage();
     } else {
         $user = $this->getUser();
         $session = Table\UserSessions::findBy(array('user_id' => $user['id']));
         if (!$type->multiple_sessions && isset($session->id)) {
             $result = 'Multiple sessions are not allowed. Someone is already logged on from ' . $session->ip . '.';
         } else {
             if (!$type->mobile_access && \Pop\Web\Mobile::isMobileDevice()) {
                 $result = 'Mobile access is not allowed.';
             } else {
                 if (!$user['verified']) {
                     $result = 'The user is not verified.';
                 } else {
                     if ($type->id != $user['type_id']) {
                         $userType = Table\UserTypes::findById($user['type_id']);
                         if (isset($userType->id) && !$userType->global_access) {
                             $result = 'The user is not allowed in this area.';
                         }
                     }
                 }
             }
         }
     }
     return $result;
 }
All Usage Examples Of Pop\Web\Mobile::isMobileDevice