当前位置: 首页>>代码示例>>PHP>>正文


PHP AJXP_Utils::userAgentIsNativePydioApp方法代码示例

本文整理汇总了PHP中AJXP_Utils::userAgentIsNativePydioApp方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Utils::userAgentIsNativePydioApp方法的具体用法?PHP AJXP_Utils::userAgentIsNativePydioApp怎么用?PHP AJXP_Utils::userAgentIsNativePydioApp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AJXP_Utils的用法示例。


在下文中一共展示了AJXP_Utils::userAgentIsNativePydioApp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: storeFileToCopy

 public function storeFileToCopy($fileData)
 {
     $user = AuthService::getLoggedUser();
     $files = $user->getTemporaryData("tmp_upload");
     $files[] = $fileData;
     $this->logDebug("Storing data", $fileData);
     $user->saveTemporaryData("tmp_upload", $files);
     if (AJXP_Utils::userAgentIsNativePydioApp()) {
         $this->logInfo("Up from", $_SERVER["HTTP_USER_AGENT"] . " - direct triger of next to remote");
         $this->uploadActions("next_to_remote", array(), array());
     }
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:12,代码来源:class.remote_fsAccessDriver.php

示例2: switchAction


//.........这里部分代码省略.........
                 $sharedHandle = $handle;
             }
             $countFiles = $this->countFiles($path, !$lsOptions["f"], false, $sharedHandle);
             if (isset($sharedHandle)) {
                 rewind($handle);
             }
             if (isset($crt_nodes)) {
                 $crt_nodes += $countFiles;
             }
             $totalPages = $crtPage = 1;
             if (isset($threshold) && isset($limitPerPage) && $countFiles > $threshold) {
                 $offset = 0;
                 $crtPage = 1;
                 if (isset($page)) {
                     $offset = (intval($page) - 1) * $limitPerPage;
                     $crtPage = $page;
                 }
                 $totalPages = floor($countFiles / $limitPerPage) + 1;
             } else {
                 $offset = $limitPerPage = 0;
             }
             $metaData = array();
             if (RecycleBinManager::recycleEnabled() && $dir == "") {
                 $metaData["repo_has_recycle"] = "true";
             }
             $parentAjxpNode = new AJXP_Node($nonPatchedPath, $metaData);
             $parentAjxpNode->loadNodeInfo(false, true, $lsOptions["l"] ? "all" : "minimal");
             AJXP_Controller::applyHook("node.read", array(&$parentAjxpNode));
             if (AJXP_XMLWriter::$headerSent == "tree") {
                 AJXP_XMLWriter::renderAjxpNode($parentAjxpNode, false);
             } else {
                 AJXP_XMLWriter::renderAjxpHeaderNode($parentAjxpNode);
             }
             if (isset($totalPages) && isset($crtPage) && ($totalPages > 1 || !AJXP_Utils::userAgentIsNativePydioApp())) {
                 $remoteOptions = null;
                 if ($this->getFilteredOption("REMOTE_SORTING")) {
                     $remoteOptions = array("remote_order" => "true", "currentOrderCol" => isset($orderField) ? $orderField : $defaultOrder, "currentOrderDir" => isset($orderDirection) ? $orderDirection : $defaultDirection);
                 }
                 $foldersCounts = $this->countFiles($path, TRUE, false, $sharedHandle);
                 if (isset($sharedHandle)) {
                     rewind($sharedHandle);
                 }
                 AJXP_XMLWriter::renderPaginationData($countFiles, $crtPage, $totalPages, $foldersCounts, $remoteOptions);
                 if (!$lsOptions["f"]) {
                     AJXP_XMLWriter::close();
                     if (isset($sharedHandle)) {
                         closedir($sharedHandle);
                     }
                     break;
                 }
             }
             $cursor = 0;
             if (isset($sharedHandle)) {
                 $handle = $sharedHandle;
             } else {
                 $handle = opendir($path);
             }
             if (!$handle) {
                 throw new AJXP_Exception("Cannot open dir " . $nonPatchedPath);
             }
             $nodes = array();
             while (strlen($file = readdir($handle)) > 0) {
                 $nodes[] = $file;
             }
             closedir($handle);
             $fullList = array("d" => array(), "z" => array(), "f" => array());
开发者ID:ad-m,项目名称:pydio-core,代码行数:67,代码来源:class.fsAccessDriver.php

示例3: lsPostProcess

 public function lsPostProcess($action, $httpVars, $outputVars)
 {
     if (!EmlParser::$currentListingOnlyEmails) {
         if (isset($httpVars["playlist"])) {
             return;
         }
         header('Content-Type: text/xml; charset=UTF-8');
         header('Cache-Control: no-cache');
         print $outputVars["ob_output"];
         return;
     }
     $config = '<columns template_name="eml.list">
         <column messageId="editor.eml.1" attributeName="ajxp_label" sortType="String"/>
         <column messageId="editor.eml.2" attributeName="eml_to" sortType="String"/>
         <column messageId="editor.eml.3" attributeName="eml_subject" sortType="String"/>
         <column messageId="editor.eml.4" attributeName="ajxp_modiftime" sortType="MyDate"/>
         <column messageId="2" attributeName="filesize" sortType="NumberKo"/>
         <column messageId="editor.eml.5" attributeName="eml_attachments" sortType="Number" modifier="EmlViewer.prototype.attachmentCellRenderer" fixedWidth="30"/>
     </columns>';
     $dom = new DOMDocument("1.0", "UTF-8");
     $dom->loadXML($outputVars["ob_output"]);
     $mobileAgent = AJXP_Utils::userAgentIsIOS() || AJXP_Utils::userAgentIsNativePydioApp();
     $this->logDebug("MOBILE AGENT DETECTED?" . $mobileAgent, $_SERVER["HTTP_USER_AGENT"]);
     if (EmlParser::$currentListingOnlyEmails === true) {
         // Replace all text attributes by the "from" value
         $index = 1;
         foreach ($dom->documentElement->childNodes as $child) {
             if ($mobileAgent) {
                 $from = $child->getAttribute("eml_from");
                 $ar = explode("&lt;", $from);
                 $from = trim(array_shift($ar));
                 $text = ($index < 10 ? "0" : "") . $index . ". " . $from . " &gt; " . $child->getAttribute("eml_subject");
                 if (AJXP_Utils::userAgentIsNativePydioApp()) {
                     $text = html_entity_decode($text, ENT_COMPAT, "UTF-8");
                 }
                 $index++;
             } else {
                 $text = $child->getAttribute("eml_from");
             }
             $child->setAttribute("text", $text);
             $child->setAttribute("ajxp_modiftime", $child->getAttribute("eml_time"));
         }
     }
     // Add the columns template definition
     $insert = new DOMDocument("1.0", "UTF-8");
     $config = "<client_configs><component_config className=\"FilesList\" local=\"true\">{$config}</component_config></client_configs>";
     $insert->loadXML($config);
     $imported = $dom->importNode($insert->documentElement, true);
     $dom->documentElement->appendChild($imported);
     header('Content-Type: text/xml; charset=UTF-8');
     header('Cache-Control: no-cache');
     print $dom->saveXML();
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:53,代码来源:class.EmlParser.php

示例4: tryToLogUser

 function tryToLogUser(&$httpVars, $isLast = false)
 {
     // CATCH THE STANDARD LOGIN OPERATION
     if (!isset($httpVars["get_action"]) || $httpVars["get_action"] != "login") {
         return false;
     }
     if (AJXP_Utils::userAgentIsNativePydioApp()) {
         return false;
     }
     $userId = isset($httpVars["userid"]) ? trim($httpVars["userid"]) : null;
     $duoActive = false;
     if (!empty($userId)) {
         $uObject = ConfService::getConfStorageImpl()->createUserObject($userId);
         if ($uObject != null) {
             $duoActive = $uObject->mergedRole->filterParameterValue("authfront.duosecurity", "DUO_AUTH_ACTIVE", AJXP_REPO_SCOPE_ALL, false);
         }
     }
     if (!$duoActive) {
         return false;
     }
     $rememberLogin = "";
     $rememberPass = "";
     $secureToken = "";
     $loggedUser = null;
     include_once AJXP_BIN_FOLDER . "/class.CaptchaProvider.php";
     if (AuthService::suspectBruteForceLogin() && (!isset($httpVars["captcha_code"]) || !CaptchaProvider::checkCaptchaResult($httpVars["captcha_code"]))) {
         $loggingResult = -4;
     } else {
         $userId = isset($httpVars["userid"]) ? trim($httpVars["userid"]) : null;
         $userPass = isset($httpVars["password"]) ? trim($httpVars["password"]) : null;
         $rememberMe = isset($httpVars["remember_me"]) && $httpVars["remember_me"] == "true" ? true : false;
         $cookieLogin = isset($httpVars["cookie_login"]) ? true : false;
         $loggingResult = AuthService::logUser($userId, $userPass, false, $cookieLogin, $httpVars["login_seed"]);
         if ($rememberMe && $loggingResult == 1) {
             $rememberLogin = "notify";
             $rememberPass = "notify";
         }
         if ($loggingResult == 1) {
             session_regenerate_id(true);
             $secureToken = AuthService::generateSecureToken();
         }
         if ($loggingResult < 1 && AuthService::suspectBruteForceLogin()) {
             $loggingResult = -4;
             // Force captcha reload
         }
     }
     $loggedUser = AuthService::getLoggedUser();
     if ($loggedUser != null) {
         $force = $loggedUser->mergedRole->filterParameterValue("core.conf", "DEFAULT_START_REPOSITORY", AJXP_REPO_SCOPE_ALL, -1);
         $passId = -1;
         if (isset($httpVars["tmp_repository_id"])) {
             $passId = $httpVars["tmp_repository_id"];
         } else {
             if ($force != "" && $loggedUser->canSwitchTo($force) && !isset($httpVars["tmp_repository_id"]) && !isset($_SESSION["PENDING_REPOSITORY_ID"])) {
                 $passId = $force;
             }
         }
         $res = ConfService::switchUserToActiveRepository($loggedUser, $passId);
         if (!$res) {
             AuthService::disconnect();
             $loggingResult = -3;
         }
     }
     if ($loggedUser != null && (AuthService::hasRememberCookie() || isset($rememberMe) && $rememberMe == true)) {
         AuthService::refreshRememberCookie($loggedUser);
     }
     AJXP_XMLWriter::header();
     AJXP_XMLWriter::loggingResult($loggingResult, $rememberLogin, $rememberPass, $secureToken);
     AJXP_XMLWriter::close();
     if ($loggingResult > 0 && $loggedUser != null) {
         require_once $this->getBaseDir() . "/duo_php/duo_web.php";
         $appUnique = $this->getFilteredOption("DUO_AUTH_AKEY");
         $iKey = $this->getFilteredOption("DUO_AUTH_IKEY");
         $sKey = $this->getFilteredOption("DUO_AUTH_SKEY");
         $res = Duo::signRequest($iKey, $sKey, $appUnique, $loggedUser->getId());
         $loggedUser->personalRole->setParameterValue("authfront.duosecurity", "DUO_AUTH_LAST_SIGNATURE", $res);
         $loggedUser->setLock("duo_show_iframe");
         $loggedUser->save("superuser");
     }
     //        if($loggingResult > 0 || $isLast){
     exit;
     //       }
 }
开发者ID:floffel03,项目名称:pydio-core,代码行数:83,代码来源:class.DuoSecurityFrontend.php


注:本文中的AJXP_Utils::userAgentIsNativePydioApp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。