public function performChecks() { if (AJXP_Utils::userAgentIsIOS() && !isset($_GET["skipIOS"]) && !isset($_COOKIE["SKIP_IOS"])) { return; } if (AJXP_Utils::userAgentIsAndroid() && !isset($_GET["skipANDROID"]) && !isset($_COOKIE["SKIP_ANDROID"])) { return; } throw new Exception("Active only when mobile user agent detected."); }
public function performChecks() { if (isset($_SESSION["CURRENT_MINISITE"])) { throw new Exception("Disabled for minisites"); } if (AJXP_Utils::userAgentIsIOS() && !isset($_GET["skipIOS"]) && !isset($_COOKIE["SKIP_IOS"])) { return; } if (AJXP_Utils::userAgentIsAndroid() && !isset($_GET["skipANDROID"]) && !isset($_COOKIE["SKIP_ANDROID"])) { return; } throw new Exception("Active only when mobile user agent detected."); }
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() || strpos($_SERVER["HTTP_USER_AGENT"], "ajaxplorer-ios-client") !== false; $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("<", $from); $from = trim(array_shift($ar)); $text = ($index < 10 ? "0" : "") . $index . ". " . $from . " > " . $child->getAttribute("eml_subject"); if (strpos($_SERVER["HTTP_USER_AGENT"], "ajaxplorer-ios-client") !== false) { $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(); }