public function _initialize() { // 登录验证 $passport = service('Passport'); if (!$passport->isLogged()) { redirect(U('w3g/Public/login')); } global $ts; // 站点名称 $this->_title = $ts['site']['site_name'] . ' 3G版'; $this->assign('site_name', $this->_title); // 分页 $_GET['page'] = $_POST['page'] ? intval($_POST['page']) : intval($_GET['page']); $this->_page = $_GET['page'] > 0 ? $_GET['page'] : 1; $this->assign('page', $this->_page); $this->_item_count = 20; $this->assign('item_count', $this->_item_count); // 来源类型 if (is_iphone()) { $this->_type_wap = 3; } elseif (is_android()) { $this->_type_wap = 2; } else { $this->_type_wap = 1; } $this->_from_type = array('0' => '网站', '1' => '手机版', '2' => 'Android客户端', '3' => 'iPhone客户端'); $this->assign('from_type', $this->_from_type); // 关注状态 $this->_follow_status = array('eachfollow' => '相互关注', 'havefollow' => '已关注', 'unfollow' => '未关注'); $this->assign('follow_status', $this->_follow_status); // 当前URL $this->_self_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (isset($_POST['key'])) { $this->_self_url .= "&key={$_POST['key']}"; $this->_self_url .= isset($_POST['user']) ? '&user=1' : '&weibo=1'; } $this->assign('self_url', $this->_self_url); // 是否为owner $this->assign('is_owner', $this->uid == $this->mid ? '1' : '0'); $data['user_id'] = $this->uid; $data['page'] = $this->_page; // 用户资料 $this->profile = api('User')->data($data)->show(); $this->assign('profile', $this->profile); return; }
public function getMore() { $url_type = isWeixin(); //判断微信打开 $is_android = is_android(); $is_ios = is_ios(); if ($is_android) { if ($url_type) { $this->where["myapp_url"] = array("neq", ""); } $type = "android"; } if ($is_ios) { if ($url_type) { $this->where["myios_url"] = array("neq", ""); } $type = "ios"; } $result = $this->getList($this->where); $this->assign('url_type', $url_type); $this->assign('data', $result); $this->assign('type', $type); $this->display('page'); }
$app = new \Slim\Slim(); $em = EntityManager::create($conn, $config); function get_menu() { global $em; $r = array(); $children = $em->getRepository('Kategorija')->findOneBy(array('naziv' => 'root'))->getChildren(); foreach ($children as $child) { $r[] = $child->getSimpleSerial(); } usort($r, function ($l, $r) { return $l['prioritet'] >= $r['prioritet'] ? 1 : -1; }); return $r; } $urls = array('rootUri' => $app->request->getRootUri(), 'menu' => get_menu(), 'android' => is_android()); function generateSalt() { return uniqid(mt_rand(), true); } function is_ulogovan($sesija_kljuc = null) { global $em, $urls; $r = array('status' => false); if (!is_null($sesija_kljuc)) { $sesija = $sesija_kljuc; } elseif (array_key_exists('session', $_COOKIE)) { $sesija = $_COOKIE['session']; } else { return $r; }
function is_tablet() { // detect Android Tablets and iPads if (is_android() && !is_android_mobile() || is_ipad()) { return true; } else { return false; } }
<div class="float-left step">STEP</div><div class="span float-left">2</div><div class="float-left content">「おすすめ」タブの一 番下までスクロールします。 Apple ID でサインインします。アカウントをお持ちでない場合は、「Apple IDを新規作成」をタップして Apple ID を作成してください。</div> </div> <div class="col-xs-12 margin-top40"> <img src="__PUBLIC__/images/download/ios_2.jpg"> </div> <div class="col-xs-12 margin-top60"> <div class="float-left step">STEP</div><div class="span float-left">3</div><div class="float-left content">画面下の「検索」をタップして、「BabyBus」またはアプリ名を入力して、検索します。「BabyBus」の検索結果が表示されます。「無料」(または有料)のアイコンをタップし、「インストール」をタップします。</div> </div> <div class="col-xs-12 margin-top40"> <img src="__PUBLIC__/images/download/ios_3.jpg"> </div> </div> </div> <?php } else { if (is_android()) { ?> <div class="col-xs-12"> <div class="row innerpadding"> <div class="col-xs-12 visible-lg"> <a id="guide"></a> <h3 class="text-left" style="text-shadow: 0 1px 0 #efefef; line-height: 60px;">For Android </h3> </div> <div class="col-xs-12 margin-top20"> <div class="float-left step">STEP</div><div class="span float-left">1</div><div class="float-left content" style=" padding-right: 100px; width: 100%;">Google Play ストア アプリを起動します。</div> </div> <div class="col-xs-12 margin-top20"> <div class="float-left step">STEP</div><div class="span float-left">2</div><div class="float-left content">アプリの検索窓で「BabyBus」またはアプリ名を入力、「BabyBus」のアプリをタップし、インストールしてください。</div> </div>
function custom_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome; // Top level if (is_handheld()) { $classes[] = "handheld"; } if (is_mobile()) { $classes[] = "mobile"; } if (is_ios()) { $classes[] = "ios"; } if (is_tablet()) { $classes[] = "tablet"; } // Specific if (is_iphone()) { $classes[] = "iphone"; } if (is_ipad()) { $classes[] = "ipad"; } if (is_ipod()) { $classes[] = "ipod"; } if (is_android()) { $classes[] = "android"; } if (is_blackberry()) { $classes[] = "blackberry"; } if (is_opera_mobile()) { $classes[] = "opera-mobile"; } if (is_palm()) { $classes[] = "palm"; } if (is_symbian()) { $classes[] = "symbian"; } if (is_windows_mobile()) { $classes[] = "windows-mobile"; } if (is_lg()) { $classes[] = "lg"; } if (is_motorola()) { $classes[] = "motorola"; } if (is_nokia()) { $classes[] = "nokia"; } if (is_samsung()) { $classes[] = "samsung"; } if (is_samsung_galaxy_tab()) { $classes[] = "samsung-galaxy-tab"; } if (is_sony_ericsson()) { $classes[] = "sony-ericsson"; } if (is_nintendo()) { $classes[] = "nintendo"; } // Computer browser if (!is_handheld()) { $classes[] = "desktop"; } if ($is_lynx) { $classes[] = "lynx"; } if ($is_gecko) { $classes[] = "gecko"; } if ($is_opera) { $classes[] = "opera"; } if ($is_NS4) { $classes[] = "ns4"; } if ($is_safari) { $classes[] = "safari"; } if ($is_chrome) { $classes[] = "chrome"; } if ($is_IE) { $classes[] = "ie"; } // IE Version check $ie_check = array(); $ie_classes = array('ie7', 'ie8', 'ie9', 'ie10'); $version = 7; while ($version < 11) { $ie_check[] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ' . $version . '.') !== FALSE; ++$version; } $ie = ''; foreach ($ie_check as $key => $value) { if ($value == 1) { $ie = $ie_classes[$key] . ' oldie'; } } $classes[] = $ie; // Check user logged in? if (!is_user_logged_in()) { $classes[] = 'not-login'; } return $classes; }
function mobble_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $mobble_detect; // top level if (is_handheld()) { $classes[] = "handheld"; } if (is_mobile()) { $classes[] = "mobile"; } if (is_ios()) { $classes[] = "ios"; } if (is_tablet()) { $classes[] = "tablet"; } // specific if (is_iphone()) { $classes[] = "iphone"; } if (is_ipad()) { $classes[] = "ipad"; } if (is_ipod()) { $classes[] = "ipod"; } if (is_android()) { $classes[] = "android"; } if (is_blackberry()) { $classes[] = "blackberry"; } if (is_opera_mobile()) { $classes[] = "opera-mobile"; } if (is_webos()) { $classes[] = "webos"; } if (is_symbian()) { $classes[] = "symbian"; } if (is_windows_mobile()) { $classes[] = "windows-mobile"; } //if (is_lg()) { $classes[] = "lg"; } if (is_motorola()) { $classes[] = "motorola"; } //if (is_smartphone()) { $classes[] = "smartphone"; } //if (is_nokia()) { $classes[] = "nokia"; } if (is_samsung()) { $classes[] = "samsung"; } if (is_samsung_tablet()) { $classes[] = "samsung-tablet"; } if (is_sony_ericsson()) { $classes[] = "sony-ericsson"; } if (is_nintendo()) { $classes[] = "nintendo"; } // bonus if (!is_handheld()) { $classes[] = "desktop"; } if ($is_lynx) { $classes[] = "lynx"; } if ($is_gecko) { $classes[] = "gecko"; } if ($mobble_detect->is('Gecko')) { $classes[] = "gecko"; } if ($is_opera) { $classes[] = "opera"; } if ($mobble_detect->is('Opera')) { $classes[] = "opera"; } if ($is_NS4) { $classes[] = "ns4"; } if ($is_safari) { $classes[] = "safari"; } if ($mobble_detect->is('Safari')) { $classes[] = "safari"; } if ($is_chrome) { $classes[] = "chrome"; } if ($mobble_detect->is('Chrome')) { $classes[] = "chrome"; } if ($is_IE) { $classes[] = "ie"; } if ($mobble_detect->is('IE')) { $classes[] = "ie"; } return $classes; }
function do_login() { global $fr_version, $fr_platform; $options = vB::get_datastore()->get_value('options'); $cleaned = vB::getCleaner()->cleanArray($_REQUEST, array('username' => vB_Cleaner::TYPE_STR, 'password' => vB_Cleaner::TYPE_STR, 'md5_password' => vB_Cleaner::TYPE_STR, 'fr_username' => vB_Cleaner::TYPE_STR, 'fr_b' => vB_Cleaner::TYPE_BOOL, 'token' => vB_Cleaner::TYPE_STR)); $navbg = null; if (strlen($options['forumrunner_branding_navbar_bg'])) { $navbg = $options['forumrunner_branding_navbar_bg']; if (is_iphone() && strlen($navbg) == 7) { $r = hexdec(substr($navbg, 1, 2)); $g = hexdec(substr($navbg, 3, 2)); $b = hexdec(substr($navbg, 5, 2)); $navbg = "{$r},{$g},{$b}"; } } $out = array('v' => $fr_version, 'p' => $fr_platform); if ($navbg) { $out['navbg'] = $navbg; } if (is_iphone() && $options['forumrunner_admob_publisherid_iphone']) { $out['admob'] = $options['forumrunner_admob_publisherid_iphone']; } else { if (is_android() && $options['forumrunner_admob_publisherid_android']) { $out['admob'] = $options['forumrunner_admob_publisherid_android']; } } if ($options['forumrunner_google_analytics_id']) { $out['gan'] = $options['forumrunner_google_analytics_id']; } if ($options['forumrunner_enable_registration']) { $out['reg'] = true; } if (!$cleaned['username'] || !$cleaned['password'] && !$cleaned['md5_password']) { // This could be an attempt to see if forums require login. Check. $out += array('authenticated' => false, 'requires_authentication' => requires_authentication()); } else { $login = vB_Api::instance('user')->login($cleaned['username'], $cleaned['password'], '', '', 'cplogin'); if (isset($login['errors']) and !empty($login['errors'])) { $login = vB_Api::instance('user')->login($cleaned['username'], $cleaned['password'], '', '', ''); if (isset($login['errors']) and !empty($login['errors'])) { return json_error('Incorrect login.', RV_BAD_PASSWORD); } } if (!$options['bbactive'] && !vB::getUserContext()->hasAdminPermission('cancontrolpanel')) { vB_Api::instance('user')->processLogout(); return json_error(strip_tags($options['bbclosedreason']), RV_BAD_PASSWORD); } if (isset($login['cpsession'])) { vB5_Cookie::set('cpsession', $login['cpsession'], 30); } vB5_Cookie::set('sessionhash', $login['sessionhash'], 30); vB5_Cookie::set('password', $login['password'], 30); vB5_Cookie::set('userid', $login['userid'], 30); if (isset($cleaned['fr_username'])) { fr_update_push_user($cleaned['fr_username'], $cleaned['fr_b']); } $userinfo = vB_Api::instance('user')->fetchUserInfo(); $out += array('authenticated' => true, 'username' => $userinfo['username'], 'cookiepath' => $options['cookiepath']); } return $out; }
public function actionLogin() { global $fr_version, $fr_platform; $vals = $this->_input->filter(array('username' => XenForo_Input::STRING, 'password' => XenForo_Input::STRING, 'md5_password' => XenForo_Input::STRING, 'fr_username' => XenForo_Input::STRING, 'fr_b' => XenForo_Input::UINT, 'token' => XenForo_Input::STRING)); $login_model = $this->_getLoginModel(); $user_model = $this->_getUserModel(); $options = XenForo_Application::get('options'); $navbg = ''; $style = $options->forumrunnerColor; if ($style) { // Convert to right style. iPhone needs r,g,b. Android needs #rrggbb. $color = convert_color($style); if (is_iphone() && strlen($color) == 7) { $r = hexdec(substr($color, 1, 2)); $g = hexdec(substr($color, 3, 2)); $b = hexdec(substr($color, 5, 2)); $color = "{$r},{$g},{$b}"; } $navbg = $color; } $authenticated = false; $requires_authentication = false; $out = array(); if (!$vals['username'] || !$vals['password'] && !$vals['md5_password']) { if (!XenForo_Visitor::getInstance()->hasPermission('general', 'view')) { $requires_authentication = true; } $options = XenForo_Application::get('options'); if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin')) { $requires_authentication = true; } } else { $user_id = $user_model->validateAuthentication($vals['username'], $vals['password'], $error); if (!$user_id) { $login_model->logLoginAttempt($vals['username']); json_error($error->render(), RV_BAD_PASSWORD); } $login_model->clearLoginAttempts($vals['username']); $user_model->setUserRememberCookie($user_id); XenForo_Model_Ip::log($user_id, 'user', $user_id, 'login'); XenForo_Application::get('session')->changeUserId($user_id); XenForo_Visitor::setup($user_id); $out['username'] = prepare_utf8_string(XenForo_Visitor::getInstance()->get('username')); $authenticated = true; } $out += array('authenticated' => $authenticated, 'v' => $fr_version, 'p' => $fr_platform, 'requires_authentication' => $requires_authentication); if ($navbg != '') { $out['navbg'] = $navbg; } if (is_iphone() && $options->forumrunnerAdsAdMobPublisherIDiPhone) { $out['admob'] = $options->forumrunnerAdsAdMobPublisherIDiPhone; } else { if (is_android() && $options->forumrunnerAdsAdMobPublisherIDAndroid) { $out['admob'] = $options->forumrunnerAdsAdMobPublisherIDAndroid; } } if ($options->forumrunnerGoogleAnalyticsID && $options->forumrunnerGoogleAnalyticsID != '') { $out['gan'] = $options->forumrunnerGoogleAnalyticsID; } if ($options->forumrunnerFacebookApplicationID && $options->forumrunnerFacebookApplicationID != '') { $out['fb'] = $options->forumrunnerFacebookApplicationID; } if ($options->forumrunnerRegistration) { $out['reg'] = true; } fr_update_push_user($vals['fr_username'], $vals['fr_b'], $vals['token']); return $out; }
function is_mobilePhone() { if (is_ktai() || is_iphone() || is_android() || is_firefox_os() || is_windows_phone() || is_blackberry()) { return true; } else { return false; } }
function do_login() { global $vbulletin, $fr_version, $fr_platform; $vbulletin->input->clean_array_gpc('r', array('username' => TYPE_STR, 'password' => TYPE_STR, 'md5_password' => TYPE_STR, 'fr_username' => TYPE_STR, 'fr_b' => TYPE_BOOL)); $navbg = null; if (strlen($vbulletin->options['forumrunner_branding_navbar_bg'])) { $navbg = $vbulletin->options['forumrunner_branding_navbar_bg']; if (is_iphone() && strlen($navbg) == 7) { $r = hexdec(substr($navbg, 1, 2)); $g = hexdec(substr($navbg, 3, 2)); $b = hexdec(substr($navbg, 5, 2)); $navbg = "{$r},{$g},{$b}"; } } $vbulletin->GPC['username'] = prepare_remote_utf8_string($vbulletin->GPC['username']); $vbulletin->GPC['password'] = prepare_remote_utf8_string($vbulletin->GPC['password']); $out = array('v' => $fr_version, 'p' => $fr_platform); if ($navbg) { $out['navbg'] = $navbg; } if (is_iphone() && $vbulletin->options['forumrunner_admob_publisherid_iphone']) { $out['admob'] = $vbulletin->options['forumrunner_admob_publisherid_iphone']; } else { if (is_android() && $vbulletin->options['forumrunner_admob_publisherid_android']) { $out['admob'] = $vbulletin->options['forumrunner_admob_publisherid_android']; } } if ($vbulletin->options['forumrunner_google_analytics_id']) { $out['gan'] = $vbulletin->options['forumrunner_google_analytics_id']; } if ($vbulletin->options['forumrunner_facebook_application_id']) { $out['fb'] = $vbulletin->options['forumrunner_facebook_application_id']; } if ($vbulletin->options['forumrunner_cms_onoff']) { $out['cms'] = true; $out['cms_section'] = $vbulletin->options['forumrunner_cms_section']; } if ($vbulletin->options['forumrunner_enable_registration']) { $out['reg'] = true; } if ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_albums']) { $out['albums'] = true; } if (!$vbulletin->GPC['username'] || !$vbulletin->GPC['password'] && !$vbulletin->GPC['md5_password']) { // This could be an attempt to see if forums require login. Check. $requires_authentication = false; if (!($vbulletin->userinfo['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview'])) { $requires_authentication = true; } // If the forum is closed, require login! if (!$vbulletin->options['bbactive']) { $requires_authentication = true; } $out += array('authenticated' => false, 'requires_authentication' => $requires_authentication); } else { // can the user login? $strikes = verify_strike_status($vbulletin->GPC['username'], true); // make sure our user info stays as whoever we were (for example, we might be logged in via cookies already) $original_userinfo = $vbulletin->userinfo; if (!verify_authentication($vbulletin->GPC['username'], $vbulletin->GPC['password'], $vbulletin->GPC['md5_password'], $vbulletin->GPC['md5_password'], true, true)) { exec_strike_user($vbulletin->GPC['username']); if ($vbulletin->options['usestrikesystem']) { if ($strikes === false) { $message = 'Incorrect login. You have used up your login allowance. Please wait 15 minutes before trying again.'; } else { $message = 'Incorrect login (' . ($strikes + 1) . ' of 5 tries allowed)'; } } else { $message = 'Incorrect login.'; } json_error($message, RV_BAD_PASSWORD); } exec_unstrike_user($vbulletin->GPC['username']); // create new session process_new_login('', true, ''); cache_permissions($vbulletin->userinfo, true); $vbulletin->session->save(); // If the forum is closed, boot em if (!$vbulletin->options['bbactive'] && !($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) { process_logout(); json_error(strip_tags($vbulletin->options['bbclosedreason']), RV_BAD_PASSWORD); } fr_update_push_user($vbulletin->GPC['fr_username'], $vbulletin->GPC['fr_b']); $out += array('authenticated' => true, 'username' => prepare_utf8_string($vbulletin->userinfo['username']), 'cookiepath' => $vbulletin->options['cookiepath']); } return $out; }