本文整理汇总了PHP中AJXP_XMLWriter::reloadFileList方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_XMLWriter::reloadFileList方法的具体用法?PHP AJXP_XMLWriter::reloadFileList怎么用?PHP AJXP_XMLWriter::reloadFileList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_XMLWriter
的用法示例。
在下文中一共展示了AJXP_XMLWriter::reloadFileList方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switchAction
//.........这里部分代码省略.........
print '<pagination count="' . $countFiles . '" total="' . $totalPages . '" current="' . $crtPage . '"/>';
}
foreach ($reps as $repIndex => $repName) {
if (preg_match("/\\.zip\$/", $repName) && $skipZip) {
continue;
}
$attributes = "";
if ($searchMode) {
if (is_file($nom_rep . "/" . $repIndex)) {
$attributes = "is_file=\"true\" icon=\"{$repName}\"";
$repName = $repIndex;
}
} else {
if ($fileListMode) {
$currentFile = $nom_rep . "/" . $repIndex;
$atts = array();
$atts[] = "is_file=\"" . (is_file($currentFile) ? "1" : "0") . "\"";
$atts[] = "is_image=\"" . Utils::is_image($currentFile) . "\"";
$fGroup = @filegroup($currentFile) || "unknown";
$atts[] = "file_group=\"" . $fGroup . "\"";
$fOwner = @fileowner($currentFile) || "unknown";
$atts[] = "file_owner=\"" . $fOwner . "\"";
$fPerms = @fileperms($currentFile);
if ($fPerms !== false) {
$fPerms = substr(decoct($fPerms), is_file($currentFile) ? 2 : 1);
} else {
$fPerms = '0000';
}
$atts[] = "file_perms=\"" . $fPerms . "\"";
if (Utils::is_image($currentFile)) {
list($width, $height, $type, $attr) = @getimagesize($currentFile);
$atts[] = "image_type=\"" . image_type_to_mime_type($type) . "\"";
$atts[] = "image_width=\"{$width}\"";
$atts[] = "image_height=\"{$height}\"";
}
$atts[] = "mimestring=\"" . Utils::mimetype($currentFile, "type", is_dir($currentFile)) . "\"";
$datemodif = $this->date_modif($currentFile);
$atts[] = "ajxp_modiftime=\"" . ($datemodif ? $datemodif : "0") . "\"";
$bytesize = @filesize($currentFile) or 0;
if ($bytesize < 0) {
$bytesize = sprintf("%u", $bytesize);
}
$atts[] = "filesize=\"" . Utils::roundSize($bytesize) . "\"";
$atts[] = "bytesize=\"" . $bytesize . "\"";
$atts[] = "filename=\"" . Utils::xmlEntities(SystemTextEncoding::toUTF8($dir . "/" . $repIndex)) . "\"";
$atts[] = "icon=\"" . (is_file($currentFile) ? SystemTextEncoding::toUTF8($repName) : (is_dir($currentFile) ? "folder.png" : "mime-empty.png")) . "\"";
$attributes = join(" ", $atts);
$repName = $repIndex;
} else {
$folderBaseName = Utils::xmlEntities($repName);
$link = SystemTextEncoding::toUTF8(SERVER_ACCESS . "?dir=" . $dir . "/" . $folderBaseName);
$link = urlencode($link);
$folderFullName = Utils::xmlEntities($dir) . "/" . $folderBaseName;
$parentFolderName = $dir;
if (!$completeMode) {
$icon = CLIENT_RESOURCES_FOLDER . "/images/foldericon.png";
$openicon = CLIENT_RESOURCES_FOLDER . "/images/openfoldericon.png";
if (preg_match("/\\.zip\$/", $repName)) {
$icon = $openicon = CLIENT_RESOURCES_FOLDER . "/images/crystal/actions/16/accessories-archiver.png";
}
$attributes = "icon=\"{$icon}\" openicon=\"{$openicon}\" filename=\"" . SystemTextEncoding::toUTF8($folderFullName) . "\" src=\"{$link}\"";
}
}
}
print "<tree text=\"" . Utils::xmlEntities(SystemTextEncoding::toUTF8($repName)) . "\" {$attributes}>";
print "</tree>";
}
// ADD RECYCLE BIN TO THE LIST
if ($nom_rep == $this->repository->getOption("PATH") && RecycleBinManager::recycleEnabled() && !$completeMode && !$skipZip) {
$recycleBinOption = $this->repository->getOption("RECYCLE_BIN");
if (is_dir($this->repository->getOption("PATH") . "/" . $recycleBinOption)) {
$recycleIcon = $this->countFiles($this->repository->getOption("PATH") . "/" . $recycleBinOption, false, true) > 0 ? "trashcan_full.png" : "trashcan.png";
if ($fileListMode) {
print "<tree text=\"" . Utils::xmlEntities($mess[122]) . "\" filesize=\"-\" is_file=\"0\" is_recycle=\"1\" mimestring=\"Trashcan\" ajxp_modiftime=\"" . $this->date_modif($this->repository->getOption("PATH") . "/" . $recycleBinOption) . "\" filename=\"/" . $recycleBinOption . "\" icon=\"{$recycleIcon}\"></tree>";
} else {
print "<tree text=\"{$mess['122']}\" is_recycle=\"true\" icon=\"" . CLIENT_RESOURCES_FOLDER . "/images/crystal/mimes/16/{$recycleIcon}\" openIcon=\"" . CLIENT_RESOURCES_FOLDER . "/images/crystal/mimes/16/{$recycleIcon}\" filename=\"/" . $recycleBinOption . "\"/>";
}
}
}
AJXP_XMLWriter::close();
exit(1);
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;
}
示例2: switchAction
//.........这里部分代码省略.........
$editPass = $userId != "guest" ? "1" : "0";
$authDriver = ConfService::getAuthDriverImpl();
if (!$authDriver->passwordsEditable()) {
$editPass = "0";
}
print "<edit_options edit_pass=\"" . $editPass . "\" edit_admin_right=\"" . ($userId != "guest" && $userId != $loggedUser->getId() ? "1" : "0") . "\" edit_delete=\"" . ($userId != "guest" && $userId != $loggedUser->getId() && $authDriver->usersEditable() ? "1" : "0") . "\"/>";
AJXP_XMLWriter::close("admin_data");
exit(1);
break;
case "create_user":
if (!isset($_GET["new_user_login"]) || $_GET["new_user_login"] == "" || !isset($_GET["new_user_pwd"]) || $_GET["new_user_pwd"] == "") {
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, "Wrong Arguments!");
AJXP_XMLWriter::close();
exit(1);
}
$forbidden = array("guest", "share");
if (AuthService::userExists($_GET["new_user_login"]) || in_array($_GET["new_user_login"], $forbidden)) {
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, "User already exists, please choose another login!");
AJXP_XMLWriter::close();
exit(1);
}
if (get_magic_quotes_gpc()) {
$_GET["new_user_login"] = stripslashes($_GET["new_user_login"]);
}
$_GET["new_user_login"] = str_replace("'", "", $_GET["new_user_login"]);
$confStorage = ConfService::getConfStorageImpl();
$newUser = $confStorage->createUserObject($_GET["new_user_login"]);
$newUser->save();
AuthService::createUser($_GET["new_user_login"], $_GET["new_user_pwd"]);
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage("User created successfully", null);
AJXP_XMLWriter::reloadFileList($_GET["new_user_login"]);
AJXP_XMLWriter::close();
exit(1);
break;
case "change_admin_right":
$userId = $_GET["user_id"];
$confStorage = ConfService::getConfStorageImpl();
$user = $confStorage->createUserObject($userId);
$user->setAdmin($_GET["right_value"] == "1" ? true : false);
$user->save();
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage("Changed admin right for user " . $_GET["user_id"], null);
AJXP_XMLWriter::reloadFileList(false);
AJXP_XMLWriter::close();
exit(1);
break;
case "update_user_right":
if (!isset($_GET["user_id"]) || !isset($_GET["repository_id"]) || !isset($_GET["right"]) || !AuthService::userExists($_GET["user_id"])) {
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, "Wrong arguments");
print "<update_checkboxes user_id=\"" . $_GET["user_id"] . "\" repository_id=\"" . $_GET["repository_id"] . "\" read=\"old\" write=\"old\"/>";
AJXP_XMLWriter::close();
exit(1);
}
$confStorage = ConfService::getConfStorageImpl();
$user = $confStorage->createUserObject($_GET["user_id"]);
$user->setRight($_GET["repository_id"], $_GET["right"]);
$user->save();
$loggedUser = AuthService::getLoggedUser();
if ($loggedUser->getId() == $user->getId()) {
AuthService::updateUser($user);
}
AJXP_XMLWriter::header();
示例3: switchAction
//.........这里部分代码省略.........
//------------------------------------
case "public_url":
$file = SystemTextEncoding::fromUTF8($file);
$url = $this->makePubliclet($file, $password, $expiration);
header("Content-type:text/plain");
echo $url;
exit(1);
break;
//------------------------------------
// XML LISTING
//------------------------------------
//------------------------------------
// XML LISTING
//------------------------------------
case "ls":
if (!isset($dir) || $dir == "/") {
$dir = "";
}
$searchMode = $fileListMode = $completeMode = false;
if (isset($mode)) {
if ($mode == "search") {
$searchMode = true;
} else {
if ($mode == "file_list") {
$fileListMode = true;
} else {
if ($mode == "complete") {
$completeMode = true;
}
}
}
}
$nom_rep = $dir;
AJXP_Exception::errorToXml($nom_rep);
$result = $this->SSHOperation->listFilesIn($nom_rep);
AJXP_XMLWriter::header();
foreach ($result as $file) {
$attributes = "";
$fileName = SystemTextEncoding::toUTF8($file["name"]);
$icon = Utils::mimetype($fileName, "image", $file["isDir"] == 1);
if ($searchMode) {
if ($file["isDir"] == 0) {
$attributes = "is_file=\"true\" icon=\"" . SystemTextEncoding::toUTF8($icon) . "\"";
}
} else {
if ($fileListMode) {
$atts = array();
$atts[] = "is_file=\"" . (1 - $file["isDir"]) . "\"";
$atts[] = "is_image=\"" . Utils::is_image($fileName) . "\"";
$atts[] = "mimestring=\"" . Utils::mimetype($fileName, "type", $file["isDir"] == 1) . "\"";
$atts[] = "ajxp_modiftime=\"" . $this->dateModif($file["time"]) . "\"";
$atts[] = "filesize=\"" . Utils::roundSize($file["size"]) . "\"";
$atts[] = "bytesize=\"" . $file["size"] . "\"";
$atts[] = "filename=\"" . str_replace("&", "&", $dir . "/" . $fileName) . "\"";
$atts[] = "icon=\"" . ($file["isDir"] == 1 ? "folder.png" : SystemTextEncoding::toUTF8($icon)) . "\"";
$attributes = join(" ", $atts);
} else {
if ($file["isDir"] == 1) {
$link = SERVER_ACCESS . "?dir=" . $dir . "/" . $fileName;
$link = urlencode($link);
$folderBaseName = str_replace("&", "&", $fileName);
$folderFullName = "{$dir}/" . $folderBaseName;
$parentFolderName = $dir;
if (!$completeMode) {
$icon = CLIENT_RESOURCES_FOLDER . "/images/foldericon.png";
$openicon = CLIENT_RESOURCES_FOLDER . "/images/openfoldericon.png";
if (preg_match("/\\.zip\$/", $file["name"])) {
$icon = $openicon = CLIENT_RESOURCES_FOLDER . "/images/crystal/actions/16/accessories-archiver.png";
}
$attributes = "icon=\"{$icon}\" openicon=\"{$openicon}\" filename=\"" . $folderFullName . "\" src=\"{$link}\"";
}
}
}
}
if (strlen($attributes) > 0) {
print "<tree text=\"" . str_replace("&", "&", SystemTextEncoding::toUTF8($this->SSHOperation->unescapeFileName($file["name"]))) . "\" {$attributes}>";
print "</tree>";
}
}
AJXP_XMLWriter::close();
exit(1);
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;
}
示例4: exit
AJXP_XMLWriter::requireAuth();
AJXP_XMLWriter::close();
exit(1);
}
}
$xmlResult = $Driver->applyAction($action, array_merge($_GET, $_POST), $_FILES);
if ($xmlResult != "") {
AJXP_XMLWriter::header();
print $xmlResult;
AJXP_XMLWriter::close();
exit(1);
}
}
AJXP_XMLWriter::header();
if (isset($logMessage) || isset($errorMessage)) {
AJXP_XMLWriter::sendMessage(isset($logMessage) ? $logMessage : null, isset($errorMessage) ? $errorMessage : null);
}
if (isset($requireAuth)) {
AJXP_XMLWriter::requireAuth();
}
if (isset($reload_current_node) && $reload_current_node == "true") {
AJXP_XMLWriter::reloadCurrentNode();
}
if (isset($reload_dest_node) && $reload_dest_node != "") {
AJXP_XMLWriter::reloadNode($reload_dest_node);
}
if (isset($reload_file_list)) {
AJXP_XMLWriter::reloadFileList($reload_file_list);
}
AJXP_XMLWriter::close();
session_write_close();
示例5: switchAction
//.........这里部分代码省略.........
if (isset($_GET["bm_action"]) && isset($_GET["bm_path"])) {
if ($_GET["bm_action"] == "add_bookmark") {
$title = "";
if (isset($_GET["title"])) {
$title = $_GET["title"];
}
if ($title == "" && $_GET["bm_path"] == "/") {
$title = ConfService::getCurrentRootDirDisplay();
}
$bmUser->addBookMark($_GET["bm_path"], $title);
} else {
if ($_GET["bm_action"] == "delete_bookmark") {
$bmUser->removeBookmark($_GET["bm_path"]);
} else {
if ($_GET["bm_action"] == "rename_bookmark" && isset($_GET["bm_title"])) {
$bmUser->renameBookmark($_GET["bm_path"], $_GET["bm_title"]);
}
}
}
}
if (AuthService::usersEnabled() && AuthService::getLoggedUser() != null) {
$bmUser->save();
AuthService::updateUser($bmUser);
} else {
if (!AuthService::usersEnabled()) {
$bmUser->save();
}
}
AJXP_XMLWriter::header();
AJXP_XMLWriter::writeBookmarks($bmUser->getBookmarks());
AJXP_XMLWriter::close();
exit(1);
break;
//------------------------------------
// SAVE USER PREFERENCE
//------------------------------------
//------------------------------------
// SAVE USER PREFERENCE
//------------------------------------
case "save_user_pref":
$userObject = AuthService::getLoggedUser();
if ($userObject == null) {
exit(1);
}
$i = 0;
while (isset($_GET["pref_name_" . $i]) && isset($_GET["pref_value_" . $i])) {
$prefName = $_GET["pref_name_" . $i];
$prefValue = $_GET["pref_value_" . $i];
if ($prefName != "password") {
$userObject->setPref($prefName, $prefValue);
$userObject->save();
AuthService::updateUser($userObject);
setcookie("AJXP_{$prefName}", $prefValue);
} else {
if (isset($_GET["crt"]) && AuthService::checkPassword($userObject->getId(), $_GET["crt"], false, $_GET["pass_seed"])) {
AuthService::updatePassword($userObject->getId(), $prefValue);
} else {
//$errorMessage = "Wrong password!";
header("Content-Type:text/plain");
print "PASS_ERROR";
exit(1);
}
}
$i++;
}
header("Content-Type:text/plain");
print "SUCCESS";
exit(1);
break;
//------------------------------------
// DISPLAY DOC
//------------------------------------
//------------------------------------
// DISPLAY DOC
//------------------------------------
case "display_doc":
header("Content-type:text/html; charset:UTF-8");
echo HTMLWriter::getDocFile(htmlentities($_GET["doc_file"]));
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;
}
示例6: switchAction
//.........这里部分代码省略.........
$query = "SELECT * FROM {$tableName}";
$searchQuery = false;
if ($tableName == "ajxpmysqldriver_searchresults") {
if (isset($_SESSION["LAST_SQL_QUERY"])) {
$query = $_SESSION["LAST_SQL_QUERY"];
$matches = array();
if (preg_match("/SELECT [\\S, ]* FROM (\\S*).*/i", $query, $matches) !== false) {
$tableName = $matches[1];
$searchQuery = true;
} else {
break;
}
} else {
break;
}
}
if (isset($order_column)) {
$query .= " ORDER BY {$order_column} " . strtoupper($order_direction);
if (!isset($_SESSION["AJXP_ORDER_DATA"])) {
$_SESSION["AJXP_ORDER_DATA"] = array();
}
$_SESSION["AJXP_ORDER_DATA"][$this->repository->getUniqueId() . "_" . $tableName] = array("column" => $order_column, "dir" => $order_direction);
} else {
if (isset($_SESSION["AJXP_ORDER_DATA"])) {
if (isset($_SESSION["AJXP_ORDER_DATA"][$this->repository->getUniqueId() . "_" . $tableName])) {
$order_column = $_SESSION["AJXP_ORDER_DATA"][$this->repository->getUniqueId() . "_" . $tableName]["column"];
$order_direction = $_SESSION["AJXP_ORDER_DATA"][$this->repository->getUniqueId() . "_" . $tableName]["dir"];
$query .= " ORDER BY {$order_column} " . strtoupper($order_direction);
}
}
}
$result = $this->showRecords($query, $tableName, $currentPage);
if ($searchQuery && is_a($result, "AJXP_Exception")) {
unset($_SESSION["LAST_SQL_QUERY"]);
// Do not store wrong query!
}
AJXP_Exception::errorToXml($result);
AJXP_XMLWriter::header();
$blobCols = array();
print '<columns switchDisplayMode="list" switchGridMode="grid">';
foreach ($result["COLUMNS"] as $col) {
print "<column messageString=\"" . $col["NAME"] . "\" attributeName=\"" . $col["NAME"] . "\" field_name=\"" . $col["NAME"] . "\" field_type=\"" . $col["TYPE"] . "\" field_size=\"" . $col["LENGTH"] . "\" field_flags=\"" . $this->cleanFlagString($col["FLAGS"]) . "\" field_pk=\"" . (preg_match("/primary/", $col["FLAGS"]) ? "1" : "0") . "\" field_null=\"" . (preg_match("/not_null/", $col["FLAGS"]) ? "NOT_NULL" : "NULL") . "\" sortType=\"" . $this->sqlTypeToSortType($col["TYPE"]) . "\" field_default=\"" . $col["DEFAULT"] . "\"/>";
if (stristr($col["TYPE"], "blob") !== false && ($col["FLAGS"] != "" && stristr($col["FLAGS"], "binary"))) {
$blobCols[] = $col["NAME"];
}
}
print '</columns>';
print '<pagination total="' . $result["TOTAL_PAGES"] . '" current="' . $currentPage . '" remote_order="true" currentOrderCol="' . $order_column . '" currentOrderDir="' . $order_direction . '"/>';
foreach ($result["ROWS"] as $row) {
print '<tree ';
$pkString = "";
foreach ($row as $key => $value) {
if (in_array($key, $blobCols)) {
$sizeStr = "-NULL";
if (strlen($value)) {
$sizeStr = "-" . Utils::roundSize(strlen($sizeStr));
}
print "{$key}=\"BLOB{$sizeStr}\" ";
} else {
$value = str_replace("\"", "", $value);
$value = Utils::xmlEntities($value);
print $key . '="' . SystemTextEncoding::toUTF8($value) . '" ';
if ($result["HAS_PK"] > 0) {
if (in_array($key, $result["PK_FIELDS"])) {
$pkString .= $key . "__" . $value . ".";
}
}
}
}
if ($result["HAS_PK"] > 0) {
print 'filename="record.' . $pkString . 'pk" ';
print 'is_file="1" ajxp_mime="pk"/>';
} else {
print 'filename="record.no_pk" ';
print 'is_file="1" ajxp_mime="row"/>';
}
}
AJXP_XMLWriter::close();
}
$this->closeDbLink($link);
exit(1);
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;
}
示例7: switchAction
//.........这里部分代码省略.........
}
$nom_rep = $this->initName($dir);
AJXP_Exception::errorToXml($nom_rep);
$result = $this->listing($nom_rep, !($searchMode || $fileListMode));
$this->fileListData = $result[0];
$reps = $result[0];
AJXP_XMLWriter::header();
if (!is_array($reps)) {
AJXP_XMLWriter::close();
exit(1);
}
foreach ($reps as $repIndex => $repName) {
if (is_string($repName) && (preg_match("/\\.zip\$/", $repName) && $skipZip)) {
continue;
}
$attributes = "";
if ($searchMode) {
if (is_file($nom_rep . "/" . $repIndex)) {
$attributes = "is_file=\"true\" icon=\"{$repName}\"";
$repName = $repIndex;
}
} else {
if ($fileListMode) {
$currentFile = $nom_rep . "/" . $repName['name'];
$atts = array();
$atts[] = "is_file=\"" . ($repName['isDir'] ? "0" : "1") . "\"";
$atts[] = "is_image=\"" . Utils::is_image($currentFile) . "\"";
$atts[] = "file_group=\"" . $repName['group'] . "\"";
$atts[] = "file_owner=\"" . $repName['owner'] . "\"";
$atts[] = "file_perms=\"" . $repName['chmod1'] . "\"";
if (Utils::is_image($currentFile)) {
list($width, $height, $type, $attr) = $this->getimagesize($currentFile);
$atts[] = "image_type=\"" . image_type_to_mime_type($type) . "\"";
$atts[] = "image_width=\"{$width}\"";
$atts[] = "image_height=\"{$height}\"";
}
$atts[] = "mimestring=\"" . $repName['type'] . "\"";
$datemodif = $repName['modifTime'];
$atts[] = "ajxp_modiftime=\"" . ($datemodif ? $datemodif : "0") . "\"";
$bytesize = $repName['size'] or 0;
if ($bytesize < 0) {
$bytesize = sprintf("%u", $bytesize);
}
$atts[] = "filesize=\"" . Utils::roundSize($bytesize) . "\"";
$atts[] = "bytesize=\"" . $bytesize . "\"";
$atts[] = "filename=\"" . str_replace("&", "&", SystemTextEncoding::toUTF8($dir . "/" . $repIndex)) . "\"";
$atts[] = "icon=\"" . $repName['icon'] . "\"";
$attributes = join(" ", $atts);
$repName = $repIndex;
} else {
//Menu treeview repertoire
$folderBaseName = str_replace("&", "&", $repName['name']);
$link = SystemTextEncoding::toUTF8(SERVER_ACCESS . "?dir=" . $dir . "/" . $folderBaseName);
$link = urlencode($link);
$folderFullName = str_replace("&", "&", $dir) . "/" . $folderBaseName;
$parentFolderName = $dir;
$repName = $repIndex;
if (!$completeMode) {
$icon = CLIENT_RESOURCES_FOLDER . "/images/foldericon.png";
$openicon = CLIENT_RESOURCES_FOLDER . "/images/openfoldericon.png";
if (preg_match("/\\.zip\$/", $repName)) {
$icon = $openicon = CLIENT_RESOURCES_FOLDER . "/images/crystal/actions/16/accessories-archiver.png";
}
$attributes = "icon=\"{$icon}\" openicon=\"{$openicon}\" filename=\"" . SystemTextEncoding::toUTF8($folderFullName) . "\" src=\"{$link}\"";
}
}
}
print "<tree text=\"" . str_replace("&", "&", SystemTextEncoding::toUTF8($repName)) . "\" {$attributes}>";
print "</tree>";
}
// ADD RECYCLE BIN TO THE LIST
if ($nom_rep == $this->repository->getOption("PATH") && RecycleBinManager::recycleEnabled() && !$completeMode && !$skipZip) {
$recycleBinOption = $this->repository->getOption("RECYCLE_BIN");
if ($fileListMode) {
print "<tree text=\"" . Utils::xmlEntities($mess[122]) . "\" filesize=\"-\" is_file=\"0\" is_recycle=\"1\" mimestring=\"Trashcan\" ajxp_modiftime=\"\" filename=\"/" . $recycleBinOption . "\" icon=\"trashcan.png\"></tree>";
} else {
print "<tree text=\"{$mess['122']}\" is_recycle=\"true\" icon=\"" . CLIENT_RESOURCES_FOLDER . "/images/crystal/mimes/16/trashcan.png\" openIcon=\"" . CLIENT_RESOURCES_FOLDER . "/images/crystal/mimes/16/trashcan.png\" filename=\"/" . $recycleBinOption . "\"/>";
}
}
AJXP_XMLWriter::close();
exit(1);
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;
}
示例8: switchAction
//.........这里部分代码省略.........
print "<edit_options edit_pass=\"" . $editPass . "\" edit_admin_right=\"" . ($userId != "guest" && $userId != $loggedUser->getId() ? "1" : "0") . "\" edit_delete=\"" . ($userId != "guest" && $userId != $loggedUser->getId() && $authDriver->usersEditable() ? "1" : "0") . "\"/>";
print "<ajxp_roles>";
foreach (AuthService::getRolesList() as $roleId => $roleObject) {
print "<role id=\"{$roleId}\"/>";
}
print "</ajxp_roles>";
AJXP_XMLWriter::close("admin_data");
exit(1);
break;
case "create_user":
if (!isset($httpVars["new_user_login"]) || $httpVars["new_user_login"] == "" || !isset($httpVars["new_user_pwd"]) || $httpVars["new_user_pwd"] == "") {
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, $mess["ajxp_conf.61"]);
AJXP_XMLWriter::close();
exit(1);
}
$forbidden = array("guest", "share");
if (AuthService::userExists($httpVars["new_user_login"]) || in_array($httpVars["new_user_login"], $forbidden)) {
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, $mess["ajxp_conf.43"]);
AJXP_XMLWriter::close();
exit(1);
}
if (get_magic_quotes_gpc()) {
$httpVars["new_user_login"] = stripslashes($httpVars["new_user_login"]);
}
$httpVars["new_user_login"] = str_replace("'", "", $httpVars["new_user_login"]);
$confStorage = ConfService::getConfStorageImpl();
$newUser = $confStorage->createUserObject($httpVars["new_user_login"]);
$newUser->save();
AuthService::createUser($httpVars["new_user_login"], $httpVars["new_user_pwd"]);
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage($mess["ajxp_conf.44"], null);
AJXP_XMLWriter::reloadFileList($httpVars["new_user_login"]);
AJXP_XMLWriter::close();
exit(1);
break;
case "change_admin_right":
$userId = $httpVars["user_id"];
$confStorage = ConfService::getConfStorageImpl();
$user = $confStorage->createUserObject($userId);
$user->setAdmin($httpVars["right_value"] == "1" ? true : false);
$user->save();
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage($mess["ajxp_conf.45"] . $httpVars["user_id"], null);
AJXP_XMLWriter::reloadFileList(false);
AJXP_XMLWriter::close();
exit(1);
break;
case "update_user_right":
if (!isset($httpVars["user_id"]) || !isset($httpVars["repository_id"]) || !isset($httpVars["right"]) || !AuthService::userExists($httpVars["user_id"])) {
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage(null, $mess["ajxp_conf.61"]);
print "<update_checkboxes user_id=\"" . $httpVars["user_id"] . "\" repository_id=\"" . $httpVars["repository_id"] . "\" read=\"old\" write=\"old\"/>";
AJXP_XMLWriter::close();
exit(1);
}
$confStorage = ConfService::getConfStorageImpl();
$user = $confStorage->createUserObject($httpVars["user_id"]);
$user->setRight($httpVars["repository_id"], $httpVars["right"]);
$user->save();
$loggedUser = AuthService::getLoggedUser();
if ($loggedUser->getId() == $user->getId()) {
AuthService::updateUser($user);
}
AJXP_XMLWriter::header();
示例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;
}