本文整理汇总了PHP中ConfService::zipEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfService::zipEnabled方法的具体用法?PHP ConfService::zipEnabled怎么用?PHP ConfService::zipEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfService
的用法示例。
在下文中一共展示了ConfService::zipEnabled方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listing
function listing($nom_rep, $dir_only = false, $offset = 0, $limit = 0)
{
$mess = ConfService::getMessages();
$size_unit = $mess["byte_unit_symbol"];
$orderDir = 0;
$orderBy = "filename";
$handle = opendir($nom_rep);
$recycle = $this->repository->getOption("RECYCLE_BIN");
$cursor = 0;
while (strlen($file = readdir($handle)) > 0) {
if ($file != "." && $file != ".." && !(Utils::isHidden($file) && !$this->driverConf["SHOW_HIDDEN_FILES"])) {
if ($offset > 0 && $cursor < $offset) {
$cursor++;
continue;
}
if ($limit > 0 && $cursor - $offset >= $limit) {
break;
}
$cursor++;
if ($recycle != "" && $nom_rep == $this->repository->getOption("PATH") . "/" . $recycle && $file == RecycleBinManager::getCacheFileName()) {
continue;
}
$poidsfic = @filesize("{$nom_rep}/{$file}") or 0;
if (is_dir("{$nom_rep}/{$file}")) {
if ($this->filterFolder($file)) {
continue;
}
if ($recycle != "" && $this->getPath() . "/" . $recycle == "{$nom_rep}/{$file}") {
continue;
}
if ($orderBy == "mod") {
$liste_rep[$file] = filemtime("{$nom_rep}/{$file}");
} else {
$liste_rep[$file] = $file;
}
} else {
if ($this->filterFile($file)) {
continue;
}
if (!$dir_only) {
if ($orderBy == "filename") {
$liste_fic[$file] = Utils::mimetype("{$nom_rep}/{$file}", "image", is_dir("{$nom_rep}/{$file}"));
} else {
if ($orderBy == "filesize") {
$liste_fic[$file] = $poidsfic;
} else {
if ($orderBy == "mod") {
$liste_fic[$file] = filemtime("{$nom_rep}/{$file}");
} else {
if ($orderBy == "filetype") {
$liste_fic[$file] = Utils::mimetype("{$nom_rep}/{$file}", "type", is_dir("{$nom_rep}/{$file}"));
} else {
$liste_fic[$file] = Utils::mimetype("{$nom_rep}/{$file}", "image", is_dir("{$nom_rep}/{$file}"));
}
}
}
}
} else {
if (preg_match("/\\.zip\$/", $file) && ConfService::zipEnabled()) {
if (!isset($liste_zip)) {
$liste_zip = array();
}
$liste_zip[$file] = $file;
}
}
}
}
}
closedir($handle);
if (isset($liste_fic) && is_array($liste_fic)) {
if ($orderBy == "filename") {
if ($orderDir == 0) {
Utils::natksort($liste_fic);
} else {
Utils::natkrsort($liste_fic);
}
} else {
if ($orderBy == "mod") {
if ($orderDir == 0) {
arsort($liste_fic);
} else {
asort($liste_fic);
}
} else {
if ($orderBy == "filesize" || $orderBy == "filetype") {
if ($orderDir == 0) {
asort($liste_fic);
} else {
arsort($liste_fic);
}
} else {
if ($orderDir == 0) {
Utils::natksort($liste_fic);
} else {
Utils::natkrsort($liste_fic);
}
}
}
}
if ($orderBy != "filename") {
//.........这里部分代码省略.........
示例2: switchAction
//.........这里部分代码省略.........
AJXP_Utils::testResultsToFile($outputArray, $testedParams);
}
}
$START_PARAMETERS = array("BOOTER_URL" => "index.php?get_action=get_boot_conf", "MAIN_ELEMENT" => "ajxp_desktop");
if (AuthService::usersEnabled()) {
AuthService::preLogUser(isset($httpVars["remote_session"]) ? $httpVars["remote_session"] : "");
AuthService::bootSequence($START_PARAMETERS);
if (AuthService::getLoggedUser() != null || AuthService::logUser(null, null) == 1) {
if (AuthService::getDefaultRootId() == -1) {
AuthService::disconnect();
} else {
$loggedUser = AuthService::getLoggedUser();
if (!$loggedUser->canRead(ConfService::getCurrentRootDirIndex()) && AuthService::getDefaultRootId() != ConfService::getCurrentRootDirIndex()) {
ConfService::switchRootDir(AuthService::getDefaultRootId());
}
}
}
}
AJXP_Utils::parseApplicationGetParameters($_GET, $START_PARAMETERS, $_SESSION);
$confErrors = ConfService::getErrors();
if (count($confErrors)) {
$START_PARAMETERS["ALERT"] = implode(", ", array_values($confErrors));
}
$JSON_START_PARAMETERS = json_encode($START_PARAMETERS);
$crtTheme = $this->pluginConf["GUI_THEME"];
if (ConfService::getConf("JS_DEBUG")) {
if (!isset($mess)) {
$mess = ConfService::getMessages();
}
if (is_file(AJXP_INSTALL_PATH . "/plugins/gui.ajax/res/themes/{$crtTheme}/html/gui_debug.html")) {
include AJXP_INSTALL_PATH . "/plugins/gui.ajax/res/themes/{$crtTheme}/html/gui_debug.html";
} else {
include AJXP_INSTALL_PATH . "/plugins/gui.ajax/res/html/gui_debug.html";
}
} else {
if (is_file(AJXP_INSTALL_PATH . "/plugins/gui.ajax/res/themes/{$crtTheme}/html/gui.html")) {
$content = file_get_contents(AJXP_INSTALL_PATH . "/plugins/gui.ajax/res/themes/{$crtTheme}/html/gui.html");
} else {
$content = file_get_contents(AJXP_INSTALL_PATH . "/plugins/gui.ajax/res/html/gui.html");
}
if (preg_match('/MSIE 7/', $_SERVER['HTTP_USER_AGENT']) || preg_match('/MSIE 8/', $_SERVER['HTTP_USER_AGENT'])) {
$content = str_replace("ajaxplorer_boot.js", "ajaxplorer_boot_protolegacy.js", $content);
}
$content = AJXP_XMLWriter::replaceAjxpXmlKeywords($content, false);
if ($JSON_START_PARAMETERS) {
$content = str_replace("//AJXP_JSON_START_PARAMETERS", "startParameters = " . $JSON_START_PARAMETERS . ";", $content);
}
print $content;
}
break;
//------------------------------------
// GET CONFIG FOR BOOT
//------------------------------------
//------------------------------------
// GET CONFIG FOR BOOT
//------------------------------------
case "get_boot_conf":
if (isset($_GET["server_prefix_uri"])) {
$_SESSION["AJXP_SERVER_PREFIX_URI"] = $_GET["server_prefix_uri"];
}
$config = array();
$config["ajxpResourcesFolder"] = "plugins/gui.ajax/res";
$config["ajxpServerAccess"] = AJXP_SERVER_ACCESS;
$config["zipEnabled"] = ConfService::zipEnabled();
$config["multipleFilesDownloadEnabled"] = ConfService::getCoreConf("ZIP_CREATION");
$config["customWording"] = array("welcomeMessage" => $this->pluginConf["CUSTOM_WELCOME_MESSAGE"], "title" => ConfService::getCoreConf("APPLICATION_TITLE"), "icon" => $this->pluginConf["CUSTOM_ICON"], "iconWidth" => $this->pluginConf["CUSTOM_ICON_WIDTH"], "iconHeight" => $this->pluginConf["CUSTOM_ICON_HEIGHT"], "iconOnly" => $this->pluginConf["CUSTOM_ICON_ONLY"], "titleFontSize" => $this->pluginConf["CUSTOM_FONT_SIZE"]);
$config["usersEnabled"] = AuthService::usersEnabled();
$config["loggedUser"] = AuthService::getLoggedUser() != null;
$config["currentLanguage"] = ConfService::getLanguage();
$config["session_timeout"] = intval(ini_get("session.gc_maxlifetime"));
if (!isset($this->pluginConf["CLIENT_TIMEOUT_TIME"]) || $this->pluginConf["CLIENT_TIMEOUT_TIME"] == "") {
$to = $config["session_timeout"];
} else {
$to = $this->pluginConf["CLIENT_TIMEOUT_TIME"];
}
$config["client_timeout"] = $to;
$config["client_timeout_warning"] = $this->pluginConf["CLIENT_TIMEOUT_WARN"];
$config["availableLanguages"] = ConfService::getConf("AVAILABLE_LANG");
$config["usersEditable"] = ConfService::getAuthDriverImpl()->usersEditable();
$config["ajxpVersion"] = AJXP_VERSION;
$config["ajxpVersionDate"] = AJXP_VERSION_DATE;
if (stristr($_SERVER["HTTP_USER_AGENT"], "msie 6")) {
$config["cssResources"] = array("css/pngHack/pngHack.css");
}
if (!empty($this->pluginConf['GOOGLE_ANALYTICS_ID'])) {
$config["googleAnalyticsData"] = array("id" => $this->pluginConf['GOOGLE_ANALYTICS_ID'], "domain" => $this->pluginConf['GOOGLE_ANALYTICS_DOMAIN'], "event" => $this->pluginConf['GOOGLE_ANALYTICS_EVENT']);
}
$config["i18nMessages"] = ConfService::getMessages();
$config["password_min_length"] = ConfService::getCoreConf("PASSWORD_MINLENGTH", "auth");
$config["SECURE_TOKEN"] = AuthService::generateSecureToken();
$config["streaming_supported"] = "true";
$config["theme"] = $this->pluginConf["GUI_THEME"];
header("Content-type:application/json;charset=UTF-8");
print json_encode($config);
break;
default:
break;
}
return false;
}
示例3: getAjxpMimes
static function getAjxpMimes($keyword)
{
if ($keyword == "editable") {
// Gather editors!
$pServ = AJXP_PluginsService::getInstance();
$plugs = $pServ->getPluginsByType("editor");
//$plugin = new AJXP_Plugin();
$mimes = array();
foreach ($plugs as $plugin) {
$node = $plugin->getManifestRawContent("/editor/@mimes", "node");
$openable = $plugin->getManifestRawContent("/editor/@openable", "node");
if ($openable->item(0) && $openable->item(0)->value == "true" && $node->item(0)) {
$mimestring = $node->item(0)->value;
$mimesplit = explode(",", $mimestring);
foreach ($mimesplit as $value) {
$mimes[$value] = $value;
}
}
}
return implode(",", array_values($mimes));
} else {
if ($keyword == "image") {
return "png,bmp,jpg,jpeg,gif";
} else {
if ($keyword == "audio") {
return "mp3";
} else {
if ($keyword == "zip") {
if (ConfService::zipEnabled()) {
return "zip";
} else {
return "none_allowed";
}
}
}
}
}
return "";
}
示例4: getAjxpMimes
function getAjxpMimes($keyword)
{
if ($keyword == "editable") {
return "txt,sql,php,php3,phtml,htm,html,cgi,pl,js,css,inc,xml,xsl,java";
} else {
if ($keyword == "image") {
return "png,bmp,jpg,jpeg,gif";
} else {
if ($keyword == "audio") {
return "mp3";
} else {
if ($keyword == "zip") {
if (ConfService::zipEnabled()) {
return "zip";
} else {
return "none_allowed";
}
}
}
}
}
return "";
}
示例5: urldecode
$ROOT_DIR_ID = "null";
$ROOT_DIR_XML = "";
} else {
$ROOT_DIR_NAME = ConfService::getCurrentRootDirDisplay();
$ROOT_DIR_ID = ConfService::getCurrentRootDirIndex();
$ROOT_DIR_XML = HTMLWriter::repositoryDataAsJS();
}
$EXT_REP = "/";
if (isset($_GET["folder"])) {
$EXT_REP = urldecode($_GET["folder"]);
}
$CRT_USER = "shared_bookmarks";
if (isset($_GET["user"])) {
$CRT_USER = $_GET["user"];
}
$ZIP_ENABLED = ConfService::zipEnabled() ? "true" : "false";
$loggedUser = AuthService::getLoggedUser();
$DEFAULT_DISPLAY = "list";
if ($loggedUser != null && $loggedUser->getId() != "guest") {
if ($loggedUser->getPref("lang") != "") {
ConfService::setLanguage($loggedUser->getPref("lang"));
}
if ($loggedUser->getPref("display") != "") {
$DEFAULT_DISPLAY = $loggedUser->getPref("display");
}
} else {
if (isset($_COOKIE["AJXP_lang"])) {
ConfService::setLanguage($_COOKIE["AJXP_lang"]);
}
if (isset($_COOKIE["AJXP_display"]) && ($_COOKIE["AJXP_display"] == "list" || $_COOKIE["AJXP_display"] == "thumb")) {
$DEFAULT_DISPLAY = $_COOKIE["AJXP_display"];
示例6: listing
function listing($nom_rep, $dir_only = false)
{
$mess = ConfService::getMessages();
$size_unit = $mess["byte_unit_symbol"];
$sens = 0;
$ordre = "nom";
$poidstotal = 0;
$contents = @ftp_rawlist($this->connect, $nom_rep);
if (!is_array($contents)) {
// We might have timed out, so let's go passive if not done yet
global $_SESSION;
if ($_SESSION["ftpPasv"] == "true") {
return array();
}
@ftp_pasv($this->connect, TRUE);
$_SESSION["ftpPasv"] = "true";
$contents = @ftp_rawlist($this->connect, $nom_rep);
if (!is_array($contents)) {
return array();
}
}
foreach ($contents as $entry) {
$info = array();
$vinfo = preg_split("/[\\s]+/", $entry, 9);
if ($vinfo[0] !== "total") {
$info['chmod'] = $vinfo[0];
$info['num'] = $vinfo[1];
$info['owner'] = $vinfo[2];
$info['group'] = $vinfo[3];
$info['size'] = $vinfo[4];
$info['month'] = $vinfo[5];
$info['day'] = $vinfo[6];
$info['timeOrYear'] = $vinfo[7];
$info['name'] = $vinfo[8];
}
$file = trim($info['name']);
$filetaille = trim($info['size']);
if (strstr($info["timeOrYear"], ":")) {
$info["time"] = $info["timeOrYear"];
$info["year"] = date("Y");
} else {
$info["time"] = '09:00';
$info["year"] = $info["timeOrYear"];
}
$filedate = trim($info['day']) . " " . trim($info['month']) . " " . trim($info['year']) . " " . trim($info['time']);
$filedate = strtotime($filedate);
$fileperms = trim($info['chmod']);
$info['chmod1'] = $this->convertingChmod(trim($info['chmod']));
$isDir = false;
$info['modifTime'] = $filedate;
$info['isDir'] = false;
//gestion des Simbolic Link pour la navigation
if (strpos($fileperms, "d") !== FALSE || strpos($fileperms, "l") !== FALSE) {
if (strpos($fileperms, "l") !== FALSE) {
$test = explode(" ->", $file);
$file = $test[0];
$info['name'] = $file;
}
$isDir = true;
$info['isDir'] = true;
}
if ($file != "." && $file != "..") {
if (RecycleBinManager::recycleEnabled() && $nom_rep == $this->repository->getOption("PATH") . "/" . $this->repository->getOption("RECYCLE_BIN") && $file == RecycleBinManager::getCacheFileName()) {
continue;
}
$poidstotal += $filetaille;
if ($isDir) {
if (RecycleBinManager::recycleEnabled() && $this->repository->getOption("PATH") . "/" . $this->repository->getOption("RECYCLE_BIN") == "{$nom_rep}/{$file}") {
continue;
}
$liste_rep[$file] = $info;
$liste_rep[$file]['icon'] = Utils::mimetype("{$nom_rep}/{$file}", "image", $isDir);
$liste_rep[$file]['type'] = Utils::mimetype("{$nom_rep}/{$file}", "type", $isDir);
} else {
if (!$dir_only) {
$liste_fic[$file] = $info;
$liste_fic[$file]['icon'] = Utils::mimetype("{$nom_rep}/{$file}", "image", $isDir);
$liste_fic[$file]['type'] = Utils::mimetype("{$nom_rep}/{$file}", "type", $isDir);
} else {
if (preg_match("/\\.zip\$/", $file) && ConfService::zipEnabled()) {
if (!isset($liste_zip)) {
$liste_zip = array();
}
$liste_zip[$file] = $file;
}
}
}
}
}
if (isset($liste_fic) && is_array($liste_fic)) {
if ($ordre == "nom") {
if ($sens == 0) {
ksort($liste_fic);
} else {
krsort($liste_fic);
}
} else {
if ($ordre == "mod") {
if ($sens == 0) {
arsort($liste_fic);
//.........这里部分代码省略.........
示例7: computeBootConf
public function computeBootConf()
{
if (isset($_GET["server_prefix_uri"])) {
$_SESSION["AJXP_SERVER_PREFIX_URI"] = str_replace("_UP_", "..", $_GET["server_prefix_uri"]);
}
$currentIsMinisite = strpos(session_name(), "AjaXplorer_Shared") === 0;
$config = array();
$config["ajxpResourcesFolder"] = "plugins/gui.ajax/res";
if ($currentIsMinisite) {
$config["ajxpServerAccess"] = "index_shared.php";
} else {
$config["ajxpServerAccess"] = AJXP_SERVER_ACCESS;
}
$config["zipEnabled"] = ConfService::zipEnabled();
$config["multipleFilesDownloadEnabled"] = ConfService::getCoreConf("ZIP_CREATION");
$customIcon = $this->getFilteredOption("CUSTOM_ICON");
self::filterXml($customIcon);
$config["customWording"] = array("welcomeMessage" => $this->getFilteredOption("CUSTOM_WELCOME_MESSAGE"), "title" => ConfService::getCoreConf("APPLICATION_TITLE"), "icon" => $customIcon, "iconWidth" => $this->getFilteredOption("CUSTOM_ICON_WIDTH"), "iconHeight" => $this->getFilteredOption("CUSTOM_ICON_HEIGHT"), "iconOnly" => $this->getFilteredOption("CUSTOM_ICON_ONLY"), "titleFontSize" => $this->getFilteredOption("CUSTOM_FONT_SIZE"));
$cIcBin = $this->getFilteredOption("CUSTOM_ICON_BINARY");
if (!empty($cIcBin)) {
$config["customWording"]["icon_binary_url"] = "get_action=get_global_binary_param&binary_id=" . $cIcBin;
}
$config["usersEnabled"] = AuthService::usersEnabled();
$config["loggedUser"] = AuthService::getLoggedUser() != null;
$config["currentLanguage"] = ConfService::getLanguage();
$config["session_timeout"] = intval(ini_get("session.gc_maxlifetime"));
$timeoutTime = $this->getFilteredOption("CLIENT_TIMEOUT_TIME");
if (empty($timeoutTime)) {
$to = $config["session_timeout"];
} else {
$to = $timeoutTime;
}
if ($currentIsMinisite) {
$to = -1;
}
$config["client_timeout"] = intval($to);
$config["client_timeout_warning"] = floatval($this->getFilteredOption("CLIENT_TIMEOUT_WARN"));
$config["availableLanguages"] = ConfService::getConf("AVAILABLE_LANG");
$config["usersEditable"] = ConfService::getAuthDriverImpl()->usersEditable();
$config["ajxpVersion"] = AJXP_VERSION;
$config["ajxpVersionDate"] = AJXP_VERSION_DATE;
$analytic = $this->getFilteredOption('GOOGLE_ANALYTICS_ID');
if (!empty($analytic)) {
$config["googleAnalyticsData"] = array("id" => $analytic, "domain" => $this->getFilteredOption('GOOGLE_ANALYTICS_DOMAIN'), "event" => $this->getFilteredOption('GOOGLE_ANALYTICS_EVENT'));
}
$config["i18nMessages"] = ConfService::getMessages();
$config["SECURE_TOKEN"] = AuthService::generateSecureToken();
$config["streaming_supported"] = "true";
$config["theme"] = $this->pluginConf["GUI_THEME"];
return $config;
}
示例8: switchAction
//.........这里部分代码省略.........
print AJXP_XMLWriter::replaceAjxpXmlKeywords($regDoc->saveXML($nodes->item(0)));
}
AJXP_XMLWriter::close("ajxp_registry_part");
} else {
header('Content-Type: application/xml; charset=UTF-8');
print AJXP_XMLWriter::replaceAjxpXmlKeywords($regDoc->saveXML());
}
break;
//------------------------------------
// DISPLAY DOC
//------------------------------------
//------------------------------------
// DISPLAY DOC
//------------------------------------
case "display_doc":
HTMLWriter::charsetHeader();
echo HTMLWriter::getDocFile(htmlentities($_GET["doc_file"]));
break;
//------------------------------------
// CHECK UPDATE
//------------------------------------
//------------------------------------
// CHECK UPDATE
//------------------------------------
case "check_software_update":
$content = @file_get_contents(SOFTWARE_UPDATE_SITE . "ajxp.version");
$message = $mess["345"];
if (isset($content) && $content != "") {
if (strstr($content, "::URL::") !== false) {
list($version, $downloadUrl) = explode("::URL::", $content);
} else {
$version = $content;
$downloadUrl = "http://www.ajaxplorer.info/";
}
$compare = version_compare(AJXP_VERSION, $content);
if ($compare >= 0) {
$message = $mess["346"];
} else {
$link = '<a target="_blank" href="' . $downloadUrl . '">' . $downloadUrl . '</a>';
$message = sprintf($mess["347"], $version, $link);
}
}
HTMLWriter::charsetHeader("text/plain");
print $message;
break;
//------------------------------------
// GET CONFIG FOR BOOT
//------------------------------------
//------------------------------------
// GET CONFIG FOR BOOT
//------------------------------------
case "get_boot_conf":
if (isset($_GET["server_prefix_uri"])) {
$_SESSION["AJXP_SERVER_PREFIX_URI"] = $_GET["server_prefix_uri"];
}
$config = array();
$config["ajxpResourcesFolder"] = AJXP_THEME_FOLDER;
$config["ajxpServerAccess"] = SERVER_ACCESS;
$config["zipEnabled"] = ConfService::zipEnabled();
$config["multipleFilesDownloadEnabled"] = !DISABLE_ZIP_CREATION;
$config["flashUploaderEnabled"] = ConfService::getConf("UPLOAD_ENABLE_FLASH");
$welcomeCustom = ConfService::getConf("WELCOME_CUSTOM_MSG");
if ($welcomeCustom != "") {
$config["customWelcomeMessage"] = $welcomeCustom;
}
if (!ConfService::getConf("UPLOAD_ENABLE_FLASH")) {
$UploadMaxSize = AJXP_Utils::convertBytes(ini_get('upload_max_filesize'));
$confMaxSize = ConfService::getConf("UPLOAD_MAX_FILE");
if ($confMaxSize != 0 && $confMaxSize < $UploadMaxSize) {
$UploadMaxSize = $confMaxSize;
}
$confTotalNumber = ConfService::getConf("UPLOAD_MAX_NUMBER");
$config["htmlMultiUploaderOptions"] = array("282" => $UploadMaxSize, "284" => $confTotalNumber);
}
$config["usersEnabled"] = AuthService::usersEnabled();
$config["loggedUser"] = AuthService::getLoggedUser() != null;
$config["currentLanguage"] = ConfService::getLanguage();
$config["session_timeout"] = intval(ini_get("session.gc_maxlifetime"));
$config["client_timeout"] = ConfService::getConf("CLIENT_TIMEOUT_TIME");
$config["client_timeout_warning"] = ConfService::getConf("CLIENT_TIMEOUT_WARNING");
$config["availableLanguages"] = ConfService::getConf("AVAILABLE_LANG");
$config["ajxpVersion"] = AJXP_VERSION;
$config["ajxpVersionDate"] = AJXP_VERSION_DATE;
if (stristr($_SERVER["HTTP_USER_AGENT"], "msie 6")) {
$config["cssResources"] = array("css/pngHack/pngHack.css");
}
if (defined("GOOGLE_ANALYTICS_ID") && GOOGLE_ANALYTICS_ID != "") {
$config["googleAnalyticsData"] = array("id" => GOOGLE_ANALYTICS_ID, "domain" => GOOGLE_ANALYTICS_DOMAIN, "event" => GOOGLE_ANALYTICS_EVENT);
}
$config["i18nMessages"] = ConfService::getMessages();
$config["password_min_length"] = defined('AJXP_PASSWORD_MINLENGTH') ? AJXP_PASSWORD_MINLENGTH : 8;
$config["SECURE_TOKEN"] = AuthService::generateSecureToken();
header("Content-type:application/json;charset=UTF-8");
print json_encode($config);
break;
default:
break;
}
return false;
}
示例9: switchAction
//.........这里部分代码省略.........
//------------------------------------
//------------------------------------
// DISPLAY DOC
//------------------------------------
case "display_doc":
HTMLWriter::charsetHeader();
echo HTMLWriter::getDocFile(htmlentities($_GET["doc_file"]));
exit(1);
break;
//------------------------------------
// CHECK UPDATE
//------------------------------------
//------------------------------------
// CHECK UPDATE
//------------------------------------
case "check_software_update":
$content = @file_get_contents(SOFTWARE_UPDATE_SITE . "last_version.txt");
$message = $mess["345"];
if (isset($content) && $content != "") {
$last_version = floatval($content);
$currrent_version = floatval(AJXP_VERSION);
if ($last_version == $currrent_version) {
$message = $mess["346"];
} else {
if ($last_version > $currrent_version) {
$message = sprintf($mess["347"], $content, '<a href="http://www.ajaxplorer.info/">http://www.ajaxplorer.info/</a>');
}
}
}
HTMLWriter::charsetHeader("text/plain");
print $message;
exit(1);
break;
//------------------------------------
// GET CONFIG FOR BOOT
//------------------------------------
//------------------------------------
// GET CONFIG FOR BOOT
//------------------------------------
case "get_boot_conf":
if (isset($_GET["server_prefix_uri"])) {
$_SESSION["AJXP_SERVER_PREFIX_URI"] = $_GET["server_prefix_uri"];
}
$config = array();
$config["ajxpResourcesFolder"] = AJXP_THEME_FOLDER;
$config["ajxpServerAccess"] = SERVER_ACCESS;
$config["zipEnabled"] = ConfService::zipEnabled();
$config["multipleFilesDownloadEnabled"] = !DISABLE_ZIP_CREATION;
$config["flashUploaderEnabled"] = ConfService::getConf("UPLOAD_ENABLE_FLASH");
$welcomeCustom = ConfService::getConf("WELCOME_CUSTOM_MSG");
if ($welcomeCustom != "") {
$config["customWelcomeMessage"] = $welcomeCustom;
}
if (!ConfService::getConf("UPLOAD_ENABLE_FLASH")) {
$UploadMaxSize = AJXP_Utils::convertBytes(ini_get('upload_max_filesize'));
$confMaxSize = ConfService::getConf("UPLOAD_MAX_FILE");
if ($confMaxSize != 0 && $confMaxSize < $UploadMaxSize) {
$UploadMaxSize = $confMaxSize;
}
$confTotalNumber = ConfService::getConf("UPLOAD_MAX_NUMBER");
$config["htmlMultiUploaderOptions"] = array("282" => $UploadMaxSize, "284" => $confTotalNumber);
}
$config["usersEnabled"] = AuthService::usersEnabled();
$config["loggedUser"] = AuthService::getLoggedUser() != null;
$config["currentLanguage"] = ConfService::getLanguage();
$config["userChangePassword"] = AuthService::changePasswordEnabled();
$config["availableLanguages"] = ConfService::getConf("AVAILABLE_LANG");
$config["ajxpVersion"] = AJXP_VERSION;
$config["ajxpVersionDate"] = AJXP_VERSION_DATE;
if (stristr($_SERVER["HTTP_USER_AGENT"], "msie 6")) {
$config["cssResources"] = array("css/pngHack/pngHack.css");
}
if (defined("GOOGLE_ANALYTICS_ID") && GOOGLE_ANALYTICS_ID != "") {
$config["googleAnalyticsData"] = array("id" => GOOGLE_ANALYTICS_ID, "domain" => GOOGLE_ANALYTICS_DOMAIN, "event" => GOOGLE_ANALYTICS_EVENT);
}
$config["i18nMessages"] = ConfService::getMessages();
header("Content-type:application/json;charset=UTF-8");
print json_encode($config);
exit(1);
break;
default:
break;
}
if (isset($logMessage) || isset($errorMessage)) {
$xmlBuffer .= AJXP_XMLWriter::sendMessage(isset($logMessage) ? $logMessage : null, isset($errorMessage) ? $errorMessage : null, false);
}
if (isset($requireAuth)) {
$xmlBuffer .= AJXP_XMLWriter::requireAuth(false);
}
if (isset($reload_current_node) && $reload_current_node == "true") {
$xmlBuffer .= AJXP_XMLWriter::reloadCurrentNode(false);
}
if (isset($reload_dest_node) && $reload_dest_node != "") {
$xmlBuffer .= AJXP_XMLWriter::reloadNode($reload_dest_node, false);
}
if (isset($reload_file_list)) {
$xmlBuffer .= AJXP_XMLWriter::reloadFileList($reload_file_list, false);
}
return $xmlBuffer;
}