isMobile() public method

Is the browser from a mobile device?
public isMobile ( ) : boolean
return boolean True if the browser is from a mobile device otherwise false
コード例 #1
0
 /**
  * Returns the stream URL for the media. A direct link will be returned if 
  * the user is on a mobile device or if the "singleFilePlaylist" setting 
  * is enabled, otherwise the media playlist URL will be returned
  * @return string the stream URL
  */
 protected function getStreamUrl()
 {
     if (count($this->_links) === 1 && (Setting::getBoolean('singleFilePlaylist') || (Browser::isMobile() || Browser::isTablet()))) {
         return $this->_links[0]->url;
     } else {
         return $this->getPlayListAction();
     }
 }
コード例 #2
0
ファイル: FeedBack.php プロジェクト: Michaeldgeek/NacossUnn
 private function initCanvas($data)
 {
     $data = json_decode($data);
     $this->ip = $this->validateInput($_SERVER['REMOTE_ADDR']);
     $this->message = filter_var($data->note, FILTER_SANITIZE_STRING);
     $browser = new Browser();
     $this->browser = "Name of browser " . $browser->getBrowser() . " Version " . $browser->getVersion();
     $this->isBrowserMobile = $browser->isMobile();
     $this->url = is_null($data->url) ? null : $data->url;
     if (!is_null($data->img)) {
         $this->img = $data->img;
     }
 }
コード例 #3
0
ファイル: yt_template.class.php プロジェクト: rodhoff/MNW
 function YtTemplate($template = null)
 {
     $this->_tpl = $template;
     $this->template = $template->template;
     $this->type = $this->getType();
     $this->browser = $this->browser();
     $_params_cookie = array('direction', 'fontsize', 'font_name', 'sitestyle', 'bgcolor', 'linkcolor', 'textcolor', 'header-bgimage', 'header-bgcolor', 'footer-bgcolor', 'footer-bgimage', 'default_main_layout', 'menustyle', 'googleWebFont');
     foreach ($_params_cookie as $k) {
         $this->_params_cookie[$k] = $this->_tpl->params->get($k);
     }
     $this->getUserSetting();
     //print_r($this->_params_cookie); die();
     $browser = new Browser();
     $this->is_mobile = $browser->isMobile();
     $this->float1 = $this->getParam('direction') == 'rtl' ? 'float:right' : 'float:left';
     $this->float2 = $this->getParam('direction') == 'rtl' ? 'float:left' : 'float:right';
 }
コード例 #4
0
ファイル: Login.php プロジェクト: romainneutron/Phraseanet
 public function generateAuthResponse(Application $app, \Browser $browser, $redirect)
 {
     if ($browser->isMobile()) {
         $response = $app->redirectPath('lightbox');
     } elseif ($redirect) {
         $response = new RedirectResponse('../' . ltrim($redirect, '/'));
     } elseif (true !== $browser->isNewGeneration()) {
         $response = $app->redirectPath('get_client');
     } else {
         $response = $app->redirectPath('prod');
     }
     $response->headers->clearCookie('postlog');
     $response->headers->clearCookie('last_act');
     return $response;
 }
コード例 #5
0
}
if (function_exists('ult_ms_getter')) {
    $prel = ult_ms_getter();
}
if ($layout) {
    // Get The Layout Info
    // Responsiveness check
    $ttable = $wpdb->prefix . 'ultimatum_themes';
    $sql = "SELECT * FROM {$ttable} WHERE id='" . $layout["theme"] . "'";
    $tfetch = $wpdb->get_row($sql, ARRAY_A);
    $ultimateresponsive = false;
    if ($tfetch['type'] == 1) {
        $ultimateresponsive = 'responsive';
    }
    // Check for mobility feature
    if ($browser->isMobile() && $tfetch['type'] != 2) {
        $browsing = $browser->getPlatform();
        // Get the Template for device
        $mtable = $wpdb->prefix . 'ultimatum_mobile';
        $mobilethemeq = "SELECT * FROM {$mtable} WHERE `device`='{$browsing}'";
        $mfetch = $wpdb->get_row($mobilethemeq, ARRAY_A);
        if ($mfetch) {
            $defql = "SELECT * FROM {$table} WHERE `default`=1 AND `theme`='" . $mfetch["theme"] . "'";
            $dfetch = $wpdb->get_row($defql, ARRAY_A);
            if ($dfetch) {
                $mobileapp = true;
                $layout = layoutValid($dfetch["id"]);
            }
        }
    }
    if (strlen($layout['before']) >= 1) {
コード例 #6
0
ファイル: Loader.php プロジェクト: krisldz/Gekosale2
    public function loadView()
    {
        $sql = 'SELECT
					V.idview,
					V.name as shopname,
					V.namespace,
					C.idcurrency, 
					C.currencysymbol,
					C.decimalseparator,
					C.decimalcount,
					C.thousandseparator,
					C.positivepreffix,
					C.positivesuffix,
					C.negativepreffix,
					C.negativesuffix,
					S.countryid,
					V.taxes,
					V.showtax,
					V.offline,
					cartredirect,
          terms,
					photoid,
					favicon,
					forcelogin,
					apikey,
					watermark,
					confirmregistration,
					enableregistration,
					invoicenumerationkind,
					V.pageschemeid,
					V.contactid,
					PS.templatefolder
				FROM view V
				LEFT JOIN viewcategory VC ON VC.viewid = V.idview
				LEFT JOIN store S ON V.storeid = S.idstore
				LEFT JOIN pagescheme PS ON PS.idpagescheme = V.pageschemeid
				LEFT JOIN currency C ON C.idcurrency = IF(:currencyid > 0, :currencyid, V.currencyid)
				WHERE V.idview = :viewid';
        $stmt = Db::getInstance()->prepare($sql);
        $stmt->bindValue('viewid', $this->determineViewId());
        $stmt->bindValue('currencyid', Session::getActiveCurrencyId());
        $stmt->execute();
        $rs = $stmt->fetch();
        if ($rs) {
            $this->layer = array('terms' => $rs['terms'], 'idview' => $rs['idview'], 'namespace' => $rs['namespace'], 'cartredirect' => $rs['cartredirect'], 'offline' => $rs['offline'], 'taxes' => $rs['taxes'], 'showtax' => $rs['showtax'], 'shopname' => $rs['shopname'], 'photoid' => $rs['photoid'], 'favicon' => $rs['favicon'], 'watermark' => $rs['watermark'], 'idcurrency' => $rs['idcurrency'], 'currencysymbol' => $rs['currencysymbol'], 'decimalseparator' => $rs['decimalseparator'], 'decimalcount' => $rs['decimalcount'], 'thousandseparator' => $rs['thousandseparator'], 'positivepreffix' => $rs['positivepreffix'], 'positivesuffix' => $rs['positivesuffix'], 'negativepreffix' => $rs['negativepreffix'], 'negativesuffix' => $rs['negativesuffix'], 'countryid' => $rs['countryid'], 'forcelogin' => $rs['forcelogin'], 'confirmregistration' => $rs['confirmregistration'], 'enableregistration' => $rs['enableregistration'], 'apikey' => $rs['apikey'], 'invoicenumerationkind' => $rs['invoicenumerationkind'], 'pageschemeid' => $rs['pageschemeid'], 'theme' => $rs['templatefolder'], 'pageschemeid' => $rs['pageschemeid'], 'contactid' => $rs['contactid']);
            Session::setActiveShopName($this->layer['shopname']);
            if (is_null($this->layer['photoid'])) {
                $this->layer['photoid'] = 'logo.png';
            }
            if (is_null($this->layer['favicon'])) {
                $this->layer['favicon'] = 'favicon.ico';
            }
            Session::setActiveShopCurrencyId($this->layer['idcurrency']);
            Session::setActiveForceLogin($this->layer['forcelogin']);
            if (Session::getActiveBrowserData() == NULL) {
                $browser = new Browser();
                $Data = array('browser' => $browser->getBrowser(), 'platform' => $browser->getPlatform(), 'ismobile' => $browser->isMobile(), 'isbot' => $browser->isRobot());
                Session::setActiveBrowserData($Data);
            }
        }
    }
コード例 #7
0
 function processattendanceAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $session = SessionWrapper::getInstance();
     $config = Zend_Registry::get("config");
     $this->_translate = Zend_Registry::get("translate");
     $validshift = false;
     $formvalues = $this->_getAllParams();
     /* $formvalues = array(
       	 "id" => "",
       			"successmessage" => "Check-In Successfull",
       			"datein" => "Apr 24, 2015",
       			"timein" => "8:40 PM",
       			"inremarks" => "",
       			"status" => "",
       			"userid" => "93"
       	); */
     // debugMessage($formvalues);  //  exit;
     $id = decode($formvalues['id']);
     $formvalues['id'] = $id;
     $timesheet = new Timesheet();
     $user = new UserAccount();
     $user->populate($formvalues['userid']);
     # no shift available at all on profile
     // validate that user is checking into right shift
     if (isEmptyString($id)) {
         $checkindate = date('Y-m-d', strtotime($formvalues['datein']));
         $checkintime = date('H:i:s', strtotime($formvalues['timein']));
         $checkinfulldate = $checkindate . ' ' . $checkintime;
         debugMessage('checkin: ' . $checkinfulldate);
         // if user is already checkin, throw exception
         if (isCheckedIn($formvalues['userid'], $checkindate)) {
             $message = "Check-In failed. Active session already exists";
             $session->setVar(ERROR_MESSAGE, $message);
             exit;
         }
         $hasshift = false;
         $scheduleentry = getSessionEntry($user->getID());
         // debugMessage($scheduleentry);
         if (!isEmptyString($scheduleentry['id']) && !isEmptyString($user->getShift()) && $scheduleentry['status'] == 1) {
             $hasshift = true;
         }
         if ($hasshift) {
             $shift = new ShiftSchedule();
             $shift->populate($scheduleentry['id']);
             // debugMessage($shift->toArray());
             $validstartdate = $checkindate;
             $validstarttime = !isEmptyString($shift->getStartTime()) ? $shift->getStartTime() : $shift->getSession()->getStartTime();
             $validfullstartdate = $validstartdate . ' ' . $validstarttime;
             debugMessage('startin: ' . $validfullstartdate);
             # compute end date and time
             $endtime = !isEmptyString($shift->getEndTime()) ? $shift->getEndTime() : $shift->getSession()->getEndTime();
             $endday = $checkindate;
             $starthr = date('H', strtotime($validstarttime));
             //debugMessage($starthr);
             $endhr = date('H', strtotime($endtime));
             //debugMessage($endhr);
             if ($endhr < $starthr) {
                 $nxtday = date('Y-m-d', strtotime($checkindate . " + 1 day"));
                 $endday = $nxtday;
             }
             $validenddate = $endday;
             $validendtime = $endtime;
             $validfullenddate = $validenddate . ' ' . $validendtime;
             debugMessage('ending: ' . $validfullenddate);
             // validate start and end dates for each session
             $rangevalid = false;
             if (strtotime($checkinfulldate) >= strtotime($shift->getStartDate() . ' 00:00:00')) {
                 $rangevalid = true;
                 if (!isEmptyString($shift->getEndDate())) {
                     $rangevalid = false;
                     if (strtotime($checkinfulldate) <= strtotime($shift->getEndDate() . ' 23:00:00')) {
                         $rangevalid = true;
                     }
                 }
             }
             // also check if the days of the week are in the valid range
             if ($rangevalid) {
                 $todaywkno = date('w', strtotime($checkinfulldate));
                 // debugMessage($todaywkno);
                 $wkdaysprofiled = $user->getDaysOfWeekArray();
                 // debugMessage($wkdaysprofiled);
                 if (!isEmptyString($scheduleentry['workingdays'])) {
                     $wkdaysprofiled = explode(',', preg_replace('!\\s+!', '', trim($scheduleentry['workingdays'])));
                     // debugMessage($wkdaysprofiled);
                 }
                 if (count($wkdaysprofiled) > 0) {
                     if (!in_array($todaywkno, $wkdaysprofiled)) {
                         $rangevalid = false;
                     }
                 }
             }
             // now validate the time within the session
             if ($rangevalid) {
                 if (strtotime($checkinfulldate) >= strtotime($validfullstartdate) && strtotime($checkinfulldate) < strtotime($validfullenddate)) {
                     $validshift = true;
                     $browser = new Browser();
                     $audit_values = $browser_session = array("browserdetails" => $browser->getBrowserDetailsForAudit(), "browser" => $browser->getBrowser(), "version" => $browser->getVersion(), "useragent" => $browser->getUserAgent(), "os" => $browser->getPlatform(), "ismobile" => $browser->isMobile() ? '1' : 0, "ipaddress" => $browser->getIPAddress());
                     $formvalues['sessionid'] = $scheduleentry['sessionid'];
                     $formvalues['ipaddress'] = $audit_values['ipaddress'];
                     $formvalues['browser_details'] = json_encode($audit_values);
                 }
             }
         }
     }
     /* if(!$validshift){
       		 debugMessage('shift fail');
       	} else {
       		debugMessage('shift passed');
       	}
       	debugMessage($formvalues);
       	exit; */
     if (isEmptyString($id)) {
         $formvalues['createdby'] = $session->getVar('userid');
         if (isArrayKeyAnEmptyString('isrequest', $formvalues)) {
             $formvalues['isrequest'] = 0;
             $formvalues['status'] = 0;
             $formvalues['timesheetdate'] = date('Y-m-d', strtotime($formvalues['datein']));
         } else {
             $formvalues['isrequest'] = 1;
             if (isArrayKeyAnEmptyString('status', $formvalues)) {
                 $formvalues['status'] = 2;
             }
         }
     }
     if (!isEmptyString($id)) {
         $timesheet->populate($id);
         $formvalues['lastupdatedby'] = $session->getVar('userid');
         if (isArrayKeyAnEmptyString('isrequest', $formvalues)) {
             if (isEmptyString($timesheet->getHours())) {
                 $timesheet->setHours($timesheet->getComputedHours());
             }
             $formvalues['isrequest'] = 0;
         } else {
             $formvalues['isrequest'] = 1;
         }
         $validshift = true;
     }
     if ($validshift) {
         $timesheet->processPost($formvalues);
         /* debugMessage($timesheet->toArray());
         		 debugMessage('error '.$timesheet->getErrorStackAsString()); exit(); */
         if ($timesheet->hasError()) {
             $session->setVar(ERROR_MESSAGE, $timesheet->getErrorStackAsString());
         } else {
             try {
                 $timesheet->save();
                 $session->setVar(SUCCESS_MESSAGE, $this->_translate->translate($this->_getParam(SUCCESS_MESSAGE)));
             } catch (Exception $e) {
                 $session->setVar(ERROR_MESSAGE, $e->getMessage());
             }
         }
     } else {
         $message = "Check-In failed. Invalid shift or session time detected. <br/> Contact admin for resolution.";
         $session->setVar('contactadmin', 1);
         if (isAdmin() || isCompanyAdmin()) {
             $session->setVar('contactadmin', '');
             $url = $this->view->baseUrl('config/shifts/tab/schedules/userid/' . $user->getID());
             $message = 'Check-In failed. Invalid shift or session time detected. <br/> <a href="' . $url . '">Click here</a> to update schedule for ' . $user->getName();
         }
         $session->setVar(ERROR_MESSAGE, $message);
     }
 }
コード例 #8
0
ファイル: common.php プロジェクト: ashanrupasinghe/slbcv2
 /**
  * Detect mobile device
  *
  * @return mixed   Mobile device name or false
  */
 public static function mobile_device_detect()
 {
     $ui = T3Parameter::_getParam('ui');
     if ($ui == 'desktop') {
         return false;
     }
     // Detect mobile
     if (!class_exists('Browser')) {
         t3import('core.libs.browser');
     }
     $browser = new Browser();
     // Bypass
     if ($browser->isRobot()) {
         return false;
     }
     // Consider ipad as normal browser
     if ($browser->getBrowser() == Browser::BROWSER_IPAD) {
         return false;
     }
     // Mobile
     if ($browser->isMobile()) {
         if (in_array($browser->getBrowser(), array(Browser::BROWSER_IPHONE, Browser::BROWSER_IPOD))) {
             $device = 'iphone';
         } elseif ($browser->getPlatform() == Browser::PLATFORM_ANDROID) {
             $device = 'android';
         } else {
             //$device = strtolower($browser->getBrowser());
             $device = 'handheld';
         }
         $layout = T3Parameter::_getParam($device . "_layout", '');
         if ($layout == -1) {
             return false;
         }
         //disable
         return $device;
         //return 'handheld';
     }
     // Not mobile
     if ($ui == 'mobile') {
         return 'iphone';
     }
     //default for mobile layout on desktop
     return false;
 }
コード例 #9
0
ファイル: browserwarning.php プロジェクト: kylephp/wright
<?php

/**
 * @package     Wright
 * @subpackage  Includes
 *
 * @copyright   Copyright (C) 2005 - 2015 Joomlashack. Meritage Assets.  All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
// Restrict Access to within Joomla
defined('_JEXEC') or die('Restricted access');
$browser = new Browser();
$isMobile = $browser->isMobile();
?>
 
<!-- Modal -->
<div id="wrightBCW" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="wrightBCWLabel" aria-hidden="true" data-controls-modal="wrightBCW" data-backdrop="static" data-keyboard="false">
	<div class="modal-header">
		<h3 id="wrightBCWLabel">
	    <?php 
echo JText::_('TPL_JS_WRIGHT_BROWSER_WARNING_TITLE');
?>
		</h3>
	</div>
	<div class="modal-body">
		<p>
		    <?php 
echo JText::_('TPL_JS_WRIGHT_BROWSER_WARNING_CONTENT');
?>
		</p>
		<p>
コード例 #10
0
ファイル: index.php プロジェクト: albatronic/agentescloud
    if ($charset != '') {
        $ops['charset'] = $charset;
    }
    $ops['autoescape'] = true;
    $loader = new Twig_Loader_Filesystem($config['twig']['templates_folder']);
    $twig = new Twig_Environment($loader, $ops);
    $twig->getExtension('core')->setNumberFormat(2, ',', '.');
} else {
    die("NO SE PUEDE ENCONTRAR EL MOTOR TWIG");
}
// ------------------------------------------------
// COMPROBAR DISPOSITIVO DE NAVEGACION
// ------------------------------------------------
if (!isset($_SESSION['browser'])) {
    $browser = new Browser();
    $_SESSION['browser'] = $browser->isMobile() ? "mobile" : "laptop";
    unset($browser);
}
// -------------------------------------------------------------------
// CARGAR LO QUE VIENE EN EL REQUEST Y ACTIVAR EL FORMATO DE LA MONEDA
// -------------------------------------------------------------------
$rq = new Request();
setlocale(LC_MONETARY, $rq->getLanguage());
// ----------------------------------------------------------------
// DETERMINAR ENTORNO DE DESARROLLO O DE PRODUCCION
// ----------------------------------------------------------------
$_SESSION['EntornoDesarrollo'] = $rq->isDevelopment();
if ($rq->isOldBrowser()) {
    $controller = 'OldBrowser';
    $action = 'Index';
} else {
コード例 #11
0
 function checkloginAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $session = SessionWrapper::getInstance();
     $formvalues = $this->_getAllParams();
     // debugMessage($formvalues);
     # check that an email has been provided
     if (isEmptyString(trim($this->_getParam("email")))) {
         $session->setVar(ERROR_MESSAGE, $this->_translate->translate("profile_email_error"));
         $session->setVar(FORM_VALUES, $this->_getAllParams());
         // return to the home page
         $this->_helper->redirector->gotoUrl(decode($this->_getParam(URL_FAILURE)));
     }
     if (isEmptyString(trim($this->_getParam("password")))) {
         $session->setVar(ERROR_MESSAGE, $this->_translate->translate("profile_password_error"));
         $session->setVar(FORM_VALUES, $this->_getAllParams());
         // return to the home page
         $this->_helper->redirector->gotoUrl(decode($this->_getParam(URL_FAILURE)));
     }
     # check which field user is using to login. default is username
     $credcolumn = "username";
     $login = (string) trim($this->_getParam("email"));
     // $password = encode(sha1(trim($this->_getParam("password"))));
     # check if credcolumn is emai
     $validator = new Zend_Validate_EmailAddress();
     if ($validator->isValid($login)) {
         $usertable = new UserAccount();
         if ($usertable->findByEmail($login)) {
             $credcolumn = 'email';
         }
     }
     if (stringContains('!@#', $login)) {
         $credcolumn = 'trx';
         $loginarray = explode('.', $login);
         // debugMessage($loginarray);
         $id = $loginarray[0];
     }
     // debugMessage($credcolumn); exit;
     $browser = new Browser();
     $audit_values = $browser_session = array("browserdetails" => $browser->getBrowserDetailsForAudit(), "browser" => $browser->getBrowser(), "version" => $browser->getVersion(), "useragent" => $browser->getUserAgent(), "os" => $browser->getPlatform(), "ismobile" => $browser->isMobile() ? '1' : 0, "ipaddress" => $browser->getIPAddress());
     // debugMessage($audit_values);
     if ($credcolumn == 'email' || $credcolumn == 'username') {
         $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Registry::get("dbAdapter"));
         // define the table, fields and additional rules to use for authentication
         $authAdapter->setTableName('useraccount');
         $authAdapter->setIdentityColumn($credcolumn);
         $authAdapter->setCredentialColumn('password');
         $authAdapter->setCredentialTreatment("sha1(?) AND status = '1' ");
         // set the credentials from the login form
         $authAdapter->setIdentity($login);
         $authAdapter->setCredential($this->_getParam("password"));
         // new class to audit the type of Browser and OS that the visitor is using
         if (!$authAdapter->authenticate()->isValid()) {
             // debugMessage('invalid'); exit;
             // add failed login to audit trail
             $audit_values['module'] = 1;
             $audit_values['usecase'] = '1.1';
             $audit_values['transactiontype'] = USER_LOGIN;
             $audit_values['status'] = "N";
             $audit_values['transactiondetails'] = "Login for user with id '" . $this->_getParam("email") . "' failed. Invalid username or password";
             // exit();
             $this->notify(new sfEvent($this, USER_LOGIN, $audit_values));
             // return to the home page
             if (!isArrayKeyAnEmptyString(URL_FAILURE, $formvalues)) {
                 $session->setVar(ERROR_MESSAGE, "Invalid Email or Username or Password. <br />Please Try Again.");
                 $this->_helper->redirector->gotoUrl(decode($this->_getParam(URL_FAILURE)));
             } else {
                 $session->setVar(ERROR_MESSAGE, "Invalid Email or Username or Password. <br />Please Try Again.");
                 $this->_helper->redirector->gotoSimple('login', "user");
             }
             return false;
         }
         // user is logged in sucessfully so add information to the session
         $user = $authAdapter->getResultRowObject();
         $useraccount = new UserAccount();
         $useraccount->populate($user->id);
     }
     // exit;
     # trx login
     if ($credcolumn == 'trx') {
         $useraccount = new UserAccount();
         $useraccount->populate($id);
         // debugMessage($result); exit();
         if (isEmptyString($useraccount->getID())) {
             // return to the home page
             if (!isArrayKeyAnEmptyString(URL_FAILURE, $formvalues)) {
                 $session->setVar(ERROR_MESSAGE, "Invalid Email or Username or Password. <br />Please Try Again.");
                 $this->_helper->redirector->gotoUrl(decode($this->_getParam(URL_FAILURE)));
             } else {
                 $session->setVar(ERROR_MESSAGE, "Invalid Email or Username or Password. <br />Please Try Again.");
                 $this->_helper->redirector->gotoSimple('login', "user");
             }
             return false;
         }
     }
     // debugMessage($useraccount->toArray()); exit();
     $session->setVar("userid", $useraccount->getID());
     $session->setVar("username", $useraccount->getUserName());
     $session->setVar("type", $useraccount->getType());
     $session->setVar("companyid", $useraccount->getCompanyID());
     $session->setVar("istimesheetuser", $useraccount->getIsTimesheetUser());
     $session->setVar("browseraudit", $browser_session);
     $session->setVar("user", json_encode($useraccount->toArray()));
     $session->setVar("company", json_encode($useraccount->getCompany()->toArray()));
     // clear user specific cache, before it is used again
     $this->clearUserCache();
     // Add successful login event to the audit trail
     $audit_values['module'] = 1;
     $audit_values['usecase'] = '1.1';
     $audit_values['transactiontype'] = USER_LOGIN;
     $audit_values['status'] = "Y";
     $audit_values['userid'] = $useraccount->getID();
     $audit_values['transactiondetails'] = "Login for user with id '" . $this->_getParam("email") . "' successful";
     // $this->notify(new sfEvent($this, USER_LOGIN, $audit_values));
     if (isEmptyString($this->_getParam("redirecturl"))) {
         # forward to the dashboard
         $this->_helper->redirector->gotoSimple("index", "dashboard");
     } else {
         # redirect to the page the user was coming from
         if (!isEmptyString($this->_getParam(SUCCESS_MESSAGE))) {
             $successmessage = decode($this->_getParam(SUCCESS_MESSAGE));
             $session->setVar(SUCCESS_MESSAGE, $successmessage);
         }
         $this->_helper->redirector->gotoUrl(decode($this->_getParam("redirecturl")));
     }
 }
コード例 #12
0
ファイル: routes.php プロジェクト: TahsinGokalp/L3-Sozluk
        return Response::error('500');
    }
});
Route::filter('auth', function () {
    if (Auth::guest()) {
        return Redirect::to('/');
    }
});
Route::filter('Sentry_auth', function () {
    if (Sentry::guest()) {
        return Redirect::to('/');
    }
});
Route::filter('ip', function () {
    // Create the Eloquent object Visit
    $visit = new Track();
    $browser = new Browser();
    $visit->location = Locate::get('city') . ', ' . Locate::get('state') . ', ' . Locate::get('country');
    $visit->ip_address = Request::ip();
    $visit->request = URI::current();
    if (Auth::check()) {
        $visit->user_id = Auth::user()->id;
    }
    // Browser stats
    $visit->browser = $browser->getBrowser();
    $visit->browser_version = $browser->getVersion();
    $visit->platform = $browser->getPlatform();
    $visit->mobile = $browser->isMobile();
    $visit->robot = $browser->isRobot();
    $visit->save();
});
コード例 #13
0
ファイル: mainfile.php プロジェクト: anhtunguyen/vietnamguide
}
// xac dinh co phai User_Agent cua NukeViet hay khong
if (NV_USER_AGENT == 'NUKEVIET CMS ' . $global_config['version'] . '. Developed by VINADES. Url: http://nukeviet.vn. Code: ' . md5($global_config['sitekey'])) {
    define('NV_IS_MY_USER_AGENT', true);
}
// Xac dinh borwser cua client
$browser = new Browser(NV_USER_AGENT);
$client_info['browser'] = array();
$client_info['browser']['key'] = $browser->getBrowserKey();
$client_info['browser']['name'] = $browser->getBrowser();
if (preg_match('/^([0-9]+)\\.(.*)$/', $browser->getVersion(), $matches)) {
    $client_info['browser']['version'] = (int) $matches[1];
} else {
    $client_info['browser']['version'] = 0;
}
$client_info['is_mobile'] = $browser->isMobile();
$client_info['is_tablet'] = $browser->isTablet();
$client_info['is_bot'] = $browser->isRobot();
$client_info['client_os'] = array('key' => $browser->getPlatformKey(), 'name' => $browser->getPlatform());
$is_mobile_tablet = $client_info['is_mobile'] . '-' . $client_info['is_tablet'];
if ($is_mobile_tablet != $nv_Request->get_string('is_mobile_tablet', 'session')) {
    $nv_Request->set_Session('is_mobile_tablet', $is_mobile_tablet);
    $nv_Request->unset_request('nv' . NV_LANG_DATA . 'themever', 'cookie');
}
// Ket noi voi class chong flood
if ($global_config['is_flood_blocker'] and !$nv_Request->isset_request('admin', 'session') and (!$nv_Request->isset_request('second', 'get') or $nv_Request->isset_request('second', 'get') and $client_info['is_myreferer'] != 1)) {
    require NV_ROOTDIR . '/includes/core/flood_blocker.php';
}
// Captcha
if ($nv_Request->isset_request('scaptcha', 'get')) {
    require NV_ROOTDIR . '/includes/core/captcha.php';
コード例 #14
0
 /**
  * Get status
  * Credits to @link(https://github.com/reduxframework/redux-framework/blob/master/ReduxCore/inc/class.redux_helpers.php#L367)
  *
  * @since  1.0.0
  * @global  $wpdb | WordPress database object
  * @param  boolean $output_as_json
  * @param  boolean $remote_checks
  * @return array
  */
 public static function get_status($output_as_json = false, $remote_checks = true)
 {
     global $wpdb;
     $data = array();
     // WordPress
     $data['home_url'] = home_url();
     $data['site_url'] = site_url();
     $data['wp_content_url'] = WP_CONTENT_URL;
     $data['wp_ver'] = get_bloginfo('version');
     $data['wp_multisite'] = is_multisite();
     $data['permalink_structure'] = get_option('permalink_structure') ? get_option('permalink_structure') : 'Default';
     $data['front_page_display'] = get_option('show_on_front');
     if ($data['front_page_display'] == 'page') {
         $front_page_id = get_option('page_on_front');
         $blog_page_id = get_option('page_for_posts');
         $data['front_page'] = $front_page_id != 0 ? get_the_title($front_page_id) . ' (#' . $front_page_id . ')' : 'Unset';
         $data['posts_page'] = $blog_page_id != 0 ? get_the_title($blog_page_id) . ' (#' . $blog_page_id . ')' : 'Unset';
     }
     $data['wp_mem_limit_raw'] = self::let_to_num(WP_MEMORY_LIMIT);
     $data['wp_mem_limit_size'] = size_format($data['wp_mem_limit_raw']);
     $data['db_table_prefix'] = 'Length: ' . strlen($wpdb->prefix) . ' - Status: ' . (strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable');
     $data['wp_debug'] = 'false';
     if (defined('WP_DEBUG') && WP_DEBUG) {
         $data['wp_debug'] = 'true';
     }
     $data['wp_lang'] = get_locale();
     // server
     $data['server_info'] = esc_html($_SERVER['SERVER_SOFTWARE']);
     $data['localhost'] = self::bool_to_string(self::is_local_host());
     $data['php_ver'] = function_exists('phpversion') ? esc_html(phpversion()) : 'phpversion() function does not exist.';
     $data['abspath'] = ABSPATH;
     if (function_exists('ini_get')) {
         $data['php_mem_limit'] = size_format(self::let_to_num(ini_get('memory_limit')));
         $data['php_post_max_size'] = size_format(self::let_to_num(ini_get('post_max_size')));
         $data['php_time_limit'] = ini_get('max_execution_time');
         $data['php_max_input_var'] = ini_get('max_input_vars');
         $data['php_display_errors'] = self::bool_to_string(ini_get('display_errors'));
     }
     $data['suhosin_installed'] = extension_loaded('suhosin');
     $data['mysql_ver'] = $wpdb->db_version();
     $data['max_upload_size'] = size_format(wp_max_upload_size());
     $data['def_tz_is_utc'] = 'true';
     if (date_default_timezone_get() !== 'UTC') {
         $data['def_tz_is_utc'] = 'false';
     }
     $data['fsockopen_curl'] = 'false';
     if (function_exists('fsockopen') || function_exists('curl_init')) {
         $data['fsockopen_curl'] = 'true';
     }
     // remote
     if ($remote_checks == true) {
         $response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', array('sslverify' => false, 'timeout' => 60, 'body' => array('cmd' => '_notify-validate')));
         if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
             $data['wp_remote_post'] = 'true';
             $data['wp_remote_post_error'] = '';
         } else {
             $data['wp_remote_post'] = 'false';
             $data['wp_remote_post_error'] = $response->get_error_message();
         }
     }
     // custom
     $custom_key = apply_filters('PWP_System_Status\\custom_key', 'custom');
     $custom_array = apply_filters('PWP_System_Status\\custom_array', array());
     $data[$custom_key] = $custom_array;
     // $data['redux_ver']      = esc_html( ReduxFramework::$_version );
     // $data['redux_data_dir'] = ReduxFramework::$_upload_dir;
     // Only is a file-write check
     // $f                         = 'fo' . 'pen';
     // $data['redux_data_writeable'] = self::bool_to_string( @$f( ReduxFramework::$_upload_dir . 'test-log.log', 'a' ) );
     // browser
     if (!class_exists('Browser')) {
         require_once __DIR__ . '/Browser.php';
         // require_once __DIR__ . '/vendor/cbschuld/browser.php/lib/Browser.php'; // @@todo \\
     }
     $browser = new Browser();
     $data['browser']['agent'] = $browser->getUserAgent();
     $data['browser']['browser'] = $browser->getBrowser();
     $data['browser']['version'] = $browser->getVersion();
     $data['browser']['platform'] = $browser->getPlatform();
     $data['browser']['mobile'] = $browser->isMobile() ? 'true' : 'false';
     // theme
     $active_theme = wp_get_theme();
     $data['theme']['name'] = $active_theme->Name;
     $data['theme']['version'] = $active_theme->Version;
     $data['theme']['author_uri'] = $active_theme->{'Author URI'};
     $data['theme']['is_child'] = self::bool_to_string(is_child_theme());
     if (is_child_theme()) {
         $parent_theme = wp_get_theme($active_theme->Template);
         $data['theme']['parent_name'] = $parent_theme->Name;
         $data['theme']['parent_version'] = $parent_theme->Version;
         $data['theme']['parent_author_uri'] = $parent_theme->{'Author URI'};
     }
     // plugins
     $active_plugins = (array) get_option('active_plugins', array());
     if (is_multisite()) {
         $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
     }
     $data['plugins'] = array();
     foreach ($active_plugins as $plugin) {
         $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
         $plugin_name = esc_html($plugin_data['Name']);
         $data['plugins'][$plugin_name] = $plugin_data;
     }
     return $data;
 }
コード例 #15
0
ファイル: common.php プロジェクト: rlee1962/diylegalcenter
 function mobile_device_detect()
 {
     $ui = T3Parameter::_getParam('ui');
     if ($ui == 'desktop') {
         return false;
     }
     //detect mobile
     t3import('core.libs.Browser');
     $browser = new Browser();
     //bypass
     if ($browser->isRobot()) {
         return false;
     }
     //consider ipad as normal browser
     if ($browser->getBrowser() == Browser::BROWSER_IPAD) {
         return false;
     }
     //mobile
     if ($browser->isMobile()) {
         if (in_array($browser->getBrowser(), array(Browser::BROWSER_IPHONE, Browser::BROWSER_IPOD))) {
             $device = 'iphone';
         } else {
             $device = strtolower($browser->getBrowser());
         }
         //$device = 'handheld';
         $layout = T3Parameter::get($device . "_layout", '');
         if ($layout == -1) {
             return false;
         }
         //disable
         return $device;
         //return 'handheld';
     }
     //Not mobile
     if ($ui == 'mobile') {
         return 'iphone';
     }
     //default for mobile layout on desktop
     return false;
 }
コード例 #16
0
ファイル: BrowserUtil.class.php プロジェクト: knzo/Fireball
 /**
  * Returns whether the given user agent is of a mobile browser.
  * 
  * @param	string		$userAgent
  * @return	boolean
  */
 public static function isMobile($userAgent = '')
 {
     require_once CMS_DIR . 'lib/util/Browser.php';
     $browser = new \Browser($userAgent);
     return $browser->isMobile();
 }
コード例 #17
0
ファイル: inc_html_head.php プロジェクト: rundiz/fuel-start
<?php

// start Theme class
$theme = \Theme::instance();
// set page class
$page_class = 'page_' . str_replace(['\\', '/'], '-', \Uri::string());
// check for mobile, tablet, pc device
// get browser class for use instead of fuelphp agent which is does not work.
include_once APPPATH . 'vendor' . DS . 'browser' . DS . 'lib' . DS . 'Browser.php';
$browser = new Browser();
$pc_class = '';
if (!$browser->isMobile() && !$browser->isTablet()) {
    $pc_class .= ' pc_device';
} elseif ($browser->isMobile()) {
    $pc_class .= ' mobile_device';
} elseif ($browser->isTablet()) {
    $pc_class .= ' tablet_device';
}
unset($browser);
// get admin cookie.
if (!isset($cookie_admin) || !isset($cookie_admin['account_display_name'])) {
    $model_account = new \Model_Accounts();
    $cookie_admin = $model_account->getAccountCookie('admin');
    if ($cookie_admin == null) {
        $cookie_admin = $model_account->getAccountCookie();
    }
    unset($model_account);
    if (is_array($cookie_admin) && array_key_exists('account_id', $cookie_admin)) {
        $account_id = $cookie_admin['account_id'];
    }
}
コード例 #18
0
ファイル: index.php プロジェクト: albatronic/hermes
// Cargo los valores para el modo debuger
if ($config['debug_mode']) {
    $result['values']['_debugMode'] = true;
    $result['values']['_auditMode'] = (string) $config['audit_mode'];
    $result['values']['_session'] = print_r(array('emp' => $_SESSION['emp'], 'suc' => $_SESSION['suc'], 'tpv' => $_SESSION['tpv']), true);
    $result['values']['_user'] = print_r($_SESSION['usuarioPortal'], true);
    $result['values']['_debugValues'] = print_r($result['values'], true);
}
// Si el método no devuelve template o no exite, muestro un template de error.
if (!file_exists($config['twig']['templates_folder'] . '/' . $result['template']) or $result['template'] == '') {
    $result['values']['error'] = 'No existe el template: "' . $result['template'] . '" devuelto por el método "' . $clase . ':' . $action . 'Action"';
    $result['template'] = '_global/error.html.twig';
}
// Establecer el layout segun el dispositivo de navegación
$browser = new Browser();
if ($browser->isMobile()) {
    $layout = "_global/layoutTablet.html.twig";
    $popup = "_global/popupTablet.html.twig";
} else {
    $layout = "_global/layoutStd.html.twig";
    $popup = "_global/layoutPopup.html.twig";
}
// Renderizo el template y los valores devueltos por el método
$twig->addGlobal('user', new Agentes($_SESSION['usuarioPortal']['Id']));
$twig->addGlobal('appPath', $app['path']);
$twig->addGlobal('varEnvMod', $result['values']['varEnvMod']);
$twig->addGlobal('permisosModulo', $result['values']['permisos']['permisosModulo']);
$twig->addGlobal('idiomas', $_SESSION['idiomas']);
$twig->loadTemplate($result['template'])->display(array('layout' => $layout, 'popup' => $popup, 'values' => $result['values'], 'app' => $app, 'menu' => $_SESSION['usuarioPortal']['menu'], 'emp' => new PcaeEmpresas($_SESSION['project']['IdEmpresa']), 'suc' => $_SESSION['suc'], 'tpv' => new Tpvs($_SESSION['tpv']), 'project' => $_SESSION['project']));
//------------------------------------------------------------
unset($rq);
コード例 #19
0
ファイル: zt_vars.php プロジェクト: romuland/khparts
 */
$default_menu = $this->params->get('menutype');
//Fancy menu
$fancy = $this->params->get('fancy', 0);
$transition = $this->params->get('transition', 'Fx.Transitions.linear');
$duration = $this->params->get('duration', 500);
$xdelay = $this->params->get('xdelay', 700);
$xduration = $this->params->get('xduration', 2000);
$xtransition = $this->params->get('xtransition', 'Fx.Transitions.Bounce.easeOut');
if (!$default_menu) {
    $default_menu = 'mainmenu';
}
//Mobile block
if ($ztTools->getParam('zt_mobile')) {
    $browser = new Browser();
    $myBrowser = $browser->isMobile();
    $isMobile = $browser->isMobile();
    $getViewType = JRequest::getVar('ismobile');
    $cookieViewType = $ztTools->get_cookie('xenia25_ismobile');
    if ($getViewType != NULL) {
        $myBrowser = $getViewType;
        $ztTools->set_cookie('xenia25_ismobile', $myBrowser);
    } else {
        if ($cookieViewType && $cookieViewType != "") {
            $myBrowser = $cookieViewType;
        } else {
            $ztTools->set_cookie('xenia25_ismobile', $myBrowser);
        }
    }
    if ($myBrowser) {
        $menustyle = "drill";