?> " wrap="virtual"> <?php echo !empty($query_to_display) ? htmlspecialchars($query_to_display) : 'SELECT * FROM ' . backquote($table) . ' WHERE 1'; ?> </textarea><br /> <input type="checkbox" name="show_query" value="y" checked="checked" /> <?php echo $strShowThisQuery; ?> <br /> </div> <?php // Bookmark Support if ($cfgBookmark['db'] && $cfgBookmark['table']) { if (($bookmark_list = list_bookmarks($db, $cfgBookmark)) && count($bookmark_list) > 0) { echo " <i>{$strOr}</i> {$strBookmarkQuery} :<br />\n"; echo ' <div style="margin-bottom: 5px">' . "\n"; echo ' <select name="id_bookmark" style="vertical-align: middle">' . "\n"; echo ' <option value=""></option>' . "\n"; while (list($key, $value) = each($bookmark_list)) { echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n"; } echo ' </select>' . "\n"; echo ' <input type="radio" name="action_bookmark" value="0" checked="checked" style="vertical-align: middle" />' . $strSubmit . "\n"; echo ' <input type="radio" name="action_bookmark" value="1" style="vertical-align: middle" />' . $strBookmarkView . "\n"; echo ' <input type="radio" name="action_bookmark" value="2" style="vertical-align: middle" />' . $strDelete . "\n"; echo ' <br />' . "\n"; echo ' </div>' . "\n"; } }
//------------------------------------------------------------------------------ // DEFAULT: LIST FILES & DIRS case "getdircontents": require_once _EXT_PATH . "/include/list.php"; $requestedDir = stripslashes(str_replace('_RRR_', '/', extGetParam($_REQUEST, 'node'))); if (empty($requestedDir) || $requestedDir == 'ext_root') { $requestedDir = $dir; } send_dircontents($requestedDir, extGetParam($_REQUEST, 'sendWhat', 'files')); break; case 'get_dir_selects': echo get_dir_selects($dir); break; case 'chdir_event': require_once _EXT_PATH . '/include/bookmarks.php'; $response = array('bookmarks' => list_bookmarks($dir)); $classname = class_exists('ext_Json') ? 'ext_Json' : 'Services_JSON'; $json = new $classname(); echo $json->encode($response); break; case 'get_image': require_once _EXT_PATH . "/include/view.php"; ext_View::sendImage($dir, $item); case 'ftp_authentication': case 'ssh2_authentication': case 'extplorer_authentication': $auth_info = explode('_', $action); $auth_classname = 'ext_' . $action; require_once _EXT_PATH . '/include/authentication/' . $auth_info[0] . '.php'; $auth_plugin = new $auth_classname(); $auth_plugin->onShowLoginForm();
/** * Adds a new bookmark to the bookmark ini file * * @param string $dir */ function modify_bookmark($task, $dir) { global $my, $user, $mainframe; $alias = substr(extGetParam($_REQUEST, 'alias'), 0, 150); $bookmarks = read_bookmarks(); $bookmarkfile = _EXT_PATH . '/config/bookmarks_' . $GLOBALS['file_mode'] . '_'; if (empty($my->id)) { if (class_exists('jfactory')) { $user = JFactory::getUser(); $bookmarkfile .= $user->get('id') . '.php'; } else { $bookmarkfile .= $mainframe->getUserName() . '.php'; } } else { $bookmarkfile .= $my->id . '.php'; } while (@ob_end_clean()) { } header("Status: 200 OK"); switch ($task) { case 'add': if (in_array($dir, $bookmarks)) { echo ext_alertBox($GLOBALS['messages']['already_bookmarked']); exit; } //$alias = preg_replace('~[^\w-.\/\\\]~','', $alias ); // Make the alias ini-safe by removing all non-word characters $alias = strip_invalid_key_char($alias, "_"); $bookmarks[$alias] = $dir; //we deal with the flippped array here $msg = ext_successBox($GLOBALS['messages']['bookmark_was_added']); break; case 'remove': if (!in_array($dir, $bookmarks)) { echo ext_alertBox($GLOBALS['messages']['not_a_bookmark']); exit; } $bookmarks = array_flip($bookmarks); unset($bookmarks[$dir]); $bookmarks = array_flip($bookmarks); $msg = ext_successBox($GLOBALS['messages']['bookmark_was_removed']); } $inifile = "; <?php if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' ); ?>\n"; $inifile .= $GLOBALS['messages']['homelink'] . "=\n"; foreach ($bookmarks as $alias => $directory) { //changed by pokemon if (empty($directory) || empty($alias)) { continue; } if ($directory[0] == $GLOBALS['separator']) { $directory = substr($directory, 1); } $inifile .= "{$alias}={$directory}\n"; } if (!is_writable($bookmarkfile)) { echo ext_alertBox(sprintf($GLOBALS['messages']['bookmarkfile_not_writable'], $task, $bookmarkfile)); exit; } file_put_contents($bookmarkfile, $inifile); echo $msg; echo list_bookmarks($dir); exit; }
function list_dir($dir) { // list directory contents global $dir_up, $mosConfig_live_site, $_VERSION; ?> <script type="text/javascript" src="<?php echo $mosConfig_live_site; ?> /includes/js/overlib_mini.js"></script> <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div> <?php $allow = ($GLOBALS["permissions"] & 01) == 01; $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02; $dir_up = dirname($dir); if ($dir_up == ".") { $dir_up = ""; } if (!get_show_item($dir_up, basename($dir))) { show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]); } // make file & dir tables, & get total filesize & number of items make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items); $dirs = explode("/", $dir); $implode = ""; $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>/"; foreach ($dirs as $directory) { if ($directory != "") { $implode .= $directory . "/"; $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>/"; } } show_header($GLOBALS["messages"]["actdir"] . ": " . $dir_links); // Javascript functions: include _QUIXPLORER_PATH . "/include/javascript.php"; // Sorting of items $images = " <img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/"; if ($GLOBALS["srt"] == "yes") { $_srt = "no"; $images .= "_arrowup.gif\" alt=\"^\">"; } else { $_srt = "yes"; $images .= "_arrowdown.gif\" alt=\"v\">"; } // Toolbar echo "<br><table width=\"95%\"><tr><td><table><tr>\n"; // PARENT DIR echo "<td>"; if ($dir != "") { echo "<a href=\"" . make_link("list", $dir_up, NULL) . "\">"; echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_up.png\" "; echo "alt=\"" . $GLOBALS["messages"]["uplink"] . "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></a>"; } echo "</td>\n"; // HOME DIR echo "<td><a href=\"" . make_link("list", NULL, NULL) . "\">"; echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_home.gif\" "; echo "alt=\"" . $GLOBALS["messages"]["homelink"] . "\" title=\"" . $GLOBALS["messages"]["homelink"] . "\"></a></td>\n"; // RELOAD echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" "; echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_refresh.gif\" alt=\"" . $GLOBALS["messages"]["reloadlink"]; echo "\" title=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></td>\n"; // SEARCH if (!jx_isFTPMode()) { echo "<td><a href=\"" . make_link("search", $dir, NULL) . "\">"; echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_search.gif\" "; echo "alt=\"" . $GLOBALS["messages"]["searchlink"] . "\" title=\"" . $GLOBALS["messages"]["searchlink"]; echo "\"></a></td>\n"; } echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>"; // Joomla Sysinfo echo "<td><a href=\"" . make_link("sysinfo", $dir, NULL) . "\">"; echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/systeminfo.gif\" "; echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" . $GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n"; echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>"; if ($allow) { // COPY echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" "; echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_copy.gif\" alt=\"" . $GLOBALS["messages"]["copylink"]; echo "\" title=\"" . $GLOBALS["messages"]["copylink"] . "\"></a></td>\n"; // MOVE echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" "; echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_move.gif\" alt=\"" . $GLOBALS["messages"]["movelink"]; echo "\" title=\"" . $GLOBALS["messages"]["movelink"] . "\"></A></td>\n"; // DELETE echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" "; echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_delete.gif\" alt=\"" . $GLOBALS["messages"]["dellink"]; echo "\" title=\"" . $GLOBALS["messages"]["dellink"] . "\"></A></td>\n"; // CHMOD echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" "; echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n"; // UPLOAD if (ini_get("file_uploads")) { echo "<td><a href=\"" . make_link("upload", $dir, NULL) . "\">"; echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_upload.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"]; echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></A></td>\n"; } else { echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"]; echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></td>\n"; } // ARCHIVE if (($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) && !jx_isFTPMode()) { echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" "; echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_archive.gif\" alt=\"" . $GLOBALS["messages"]["comprlink"]; echo "\" title=\"" . $GLOBALS["messages"]["comprlink"] . "\"></a></td>\n"; } } else { // COPY echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_copy_.gif\" alt=\"" . $GLOBALS["messages"]["copylink"] . "\" title=\""; echo $GLOBALS["messages"]["copylink"] . "\"></td>\n"; // MOVE echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_move_.gif\" alt=\"" . $GLOBALS["messages"]["movelink"] . "\" title=\""; echo $GLOBALS["messages"]["movelink"] . "\"></td>\n"; // DELETE echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_delete_.gif\" alt=\"" . $GLOBALS["messages"]["dellink"] . "\" title=\""; echo $GLOBALS["messages"]["dellink"] . "\"></td>\n"; // UPLOAD echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uplink"]; echo "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></td>\n"; } // ADMIN & LOGOUT if ($GLOBALS["require_login"]) { echo "<td>::</td>"; // ADMIN if ($admin) { echo "<td><a href=\"" . make_link("admin", $dir, NULL) . "\">"; echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_admin.gif\" alt=\"" . $GLOBALS["messages"]["adminlink"] . "\" title=\""; echo $GLOBALS["messages"]["adminlink"] . "\"></A></td>\n"; } // LOGOUT echo "<td><a href=\"" . make_link("logout", NULL, NULL) . "\">"; echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/_logout.gif\" alt=\"" . $GLOBALS["messages"]["logoutlink"] . "\" title=\""; echo $GLOBALS["messages"]["logoutlink"] . "\"></a></td>\n"; } // Logo echo "<td style=\"padding-left:10px;\">"; //echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >"; echo "<a href=\"" . $GLOBALS['jx_home'] . "\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"jx_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('jx_logo', 60, 99, 500);\" onmouseout=\"opacity('jx_logo', 100, 60, 500);\" "; echo "src=\"" . _QUIXPLORER_URL . "/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>"; //echo "</div>"; echo "</td>\n"; echo "</tr></table></td>\n"; // Create File / Dir if ($allow && @$GLOBALS['jx_File']->is_writable(get_abs_dir($dir))) { echo "<td align=\"right\">\n\t\t\t\t<form action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\" name=\"mkitemform\">\n\n\t\t\t\t<table><tr><td>\n\t\t\t\t\t<select name=\"mktype\" onchange=\"checkMkitemForm(this.options[this.selectedIndex])\">\n\t\t\t\t\t\t<option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>\n\t\t\t\t\t\t<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option>"; if (!jx_isFTPMode() && !$GLOBALS['isWindows']) { echo "\t\t\t<option value=\"symlink\">" . $GLOBALS["mimes"]["symlink"] . "</option>\n"; } echo "\t\t</select>\n\t\t\t\t\t<input name=\"symlink_target\" type=\"hidden\" size=\"25\" title=\"{$GLOBALS['messages']['symlink_target']}\" value=\"{$GLOBALS['mosConfig_absolute_path']}\" />\n\t\t\t\t\t<input name=\"mkname\" type=\"text\" size=\"15\" title=\"{$GLOBALS['messages']['nameheader']}\" />\n\t\t\t\t\t<input type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"] . "\" />\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr>\n\t\t\t\t</table>\n\t\t\t\t<script type=\"text/javascript\">function checkMkitemForm( el ) { if( el.value =='symlink' ) document.mkitemform.symlink_target.type='text'; else document.mkitemform.symlink_target.type='hidden';} </script>\n\t\t\t\t</form>\n\t\t\t </td>\n"; } else { echo "<td align=\"right\">\n\t\t\t\t<table><tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr></table>\n\t\t\t </td>"; } echo "</tr></table>\n"; // End Toolbar // Begin Table + Form for checkboxes echo "<form name=\"selform\" method=\"post\" action=\"" . make_link("post", $dir, null) . "\">\n\t<input type=\"hidden\" name=\"do_action\" /><input type=\"hidden\" name=\"first\" value=\"y\" />\n\t<table class=\"adminlist\" width=\"95%\">\n"; if (extension_loaded("posix")) { $owner_info = '<th width="15%" class="title">' . $GLOBALS['messages']['miscowner'] . ' '; if (jx_isFTPMode()) { $my_user_info = posix_getpwnam($_SESSION['ftp_login']); $my_group_info = posix_getgrgid($my_user_info['gid']); } else { $my_user_info = posix_getpwuid(posix_geteuid()); $my_group_info = posix_getgrgid(posix_getegid()); } $owner_info .= mosTooltip(mysql_escape_string(sprintf($GLOBALS['messages']['miscownerdesc'], $my_user_info['name'], $my_user_info['uid'], $my_group_info['name'], $my_group_info['gid']))); // new [mic] $owner_info .= "</th>\n"; $colspan = 8; } else { $owner_info = ""; $colspan = 7; } // Table Header echo "<tr>\n\t<th width=\"2%\" class=\"title\">\n\t\t<input type=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\" />\n\t</th>\n\t<th width=\"34%\" class=\"title\">\n"; if ($GLOBALS["order"] == "name") { $new_srt = $_srt; } else { $new_srt = "yes"; } echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"]; if ($GLOBALS["order"] == "name") { echo $images; } echo '</a>'; echo "</th>\n\t<th width=\"10%\" class=\"title\">"; if ($GLOBALS["order"] == "size") { $new_srt = $_srt; } else { $new_srt = "yes"; } echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"]; if ($GLOBALS["order"] == "size") { echo $images; } echo "</a></th>\n\t<th width=\"14%\" class=\"title\">"; if ($GLOBALS["order"] == "type") { $new_srt = $_srt; } else { $new_srt = "yes"; } echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"]; if ($GLOBALS["order"] == "type") { echo $images; } echo "</a></th>\n\t<th width=\"14%\" class=\"title\">"; if ($GLOBALS["order"] == "mod") { $new_srt = $_srt; } else { $new_srt = "yes"; } echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"]; if ($GLOBALS["order"] == "mod") { echo $images; } echo "</a></th>\n\t<th width=\"2%\" class=\"title\">" . $GLOBALS["messages"]["permheader"] . "\n"; echo "</th>"; echo $owner_info; echo "<th width=\"10%\" class=\"title\">" . $GLOBALS["messages"]["actionheader"] . "</th>\n\t\n\t</tr>\n"; // make & print Table using lists print_table($dir, make_list($dir_list, $file_list), $allow); // print number of items & total filesize echo "<tr><td colspan=\"{$colspan}\"><hr/></td></tr><tr>\n<td class=\"title\"></td>"; echo "<td class=\"title\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " ("; if (function_exists("disk_free_space")) { $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']); $free = parse_file_size($size); } elseif (function_exists("diskfreespace")) { $size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']); $free = parse_file_size($size); } else { $free = "?"; } echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</td>\n"; echo "<td class=\"title\">" . parse_file_size($tot_file_size) . "</td>\n"; for ($i = 0; $i < $colspan - 3; ++$i) { echo "<td class=\"title\"></td>"; } echo "</tr>\n<tr><td colspan=\"{$colspan}\"><hr/></td></tr></table>\n\t\t</form>"; ?> <script type="text/javascript"><!-- // Uncheck all items (to avoid problems with new items) var ml = document.selform; var len = ml.elements.length; for(var i=0; i<len; ++i) { var e = ml.elements[i]; if(e.name == "selitems[]" && e.checked == true) { e.checked=false; } } opacity('jx_logo', 10, 60, 2000); // --></script> <?php }
<!-- Bookmarks starts here. --> <div class="bookmarks" style="height: <?php echo $table_height; ?> ;"> <?php require_once ABSOLUTE_PATH . "bookmarks.php"; $query = sprintf("SELECT title, url, description, UNIX_TIMESTAMP(date) AS timestamp, id, favicon\n FROM bookmark\n WHERE user='******'\n AND childof='%d'\n AND deleted!='1'\n AND public='1'\n ORDER BY {$order['1']}", $mysql->escape($user), $mysql->escape($folderid)); if ($mysql->query($query)) { $bookmarks = array(); while ($row = mysql_fetch_assoc($mysql->result)) { array_push($bookmarks, $row); } list_bookmarks($bookmarks, false, false, $settings['show_bookmark_icon'], true, $settings['show_bookmark_description'], $settings['show_column_date'], false, false, false, false, true, $user); } else { message($mysql->error); } ?> <!-- Bookmarks ends here. --> </div> <?php } else { echo '<div id="content" style="height:' . $table_height . ';">' . "\n"; $query = "SELECT user, SUM(bookmarks) AS bookmarks, SUM(folders) AS folders FROM (\n SELECT user, 1 AS bookmarks, 0 AS folders FROM bookmark WHERE public='1' AND deleted!='1'\n UNION ALL\n SELECT user, 0 AS bookmarks , 1 AS folders FROM folder WHERE public='1' AND deleted!='1'\n ) AS tmp GROUP BY user"; if ($mysql->query($query)) { while ($row = mysql_fetch_object($mysql->result)) { echo '<p class="shared"><a href="' . $_SERVER['SCRIPT_NAME'] . '?user='******'&folderid=0"><b>' . $row->user . "</b><br>\n";
<?php require_once "./async_header.php"; logged_in_only(); $order = set_get_order(); require_once ABSOLUTE_PATH . "bookmarks.php"; $query = sprintf("SELECT title, url, description, UNIX_TIMESTAMP(date) AS timestamp, id, favicon, public\n\t\tFROM bookmark \n\t\tWHERE user='******'\n\t\tAND childof='%d'\n\t\tAND deleted!='1'\n\t\tORDER BY {$order['1']}", $mysql->escape($username), $mysql->escape($folderid)); if ($mysql->query($query)) { $bookmarks = array(); while ($row = mysql_fetch_assoc($mysql->result)) { array_push($bookmarks, $row); } list_bookmarks($bookmarks, true, false, $settings['show_bookmark_icon'], true, $settings['show_bookmark_description'], $settings['show_column_date'], $settings['show_column_edit'], $settings['show_column_move'], $settings['show_column_delete'], $settings['show_public'], true, false, 'index.php'); } else { message($mysql->error); }
//------------------------------------------------------------------------------ // DEFAULT: LIST FILES & DIRS case "getdircontents": require_once _EXT_PATH . "/include/list.php"; $requestedDir = stripslashes(str_replace('_RRR_', '/', extGetParam($_REQUEST, 'node'))); if (empty($requestedDir) || $requestedDir == 'ext_root') { $requestedDir = $dir; } send_dircontents($requestedDir, extGetParam($_REQUEST, 'sendWhat', 'files')); break; case 'get_dir_selects': echo get_dir_selects($dir); break; case 'chdir_event': require_once _EXT_PATH . '/include/bookmarks.php'; $response = array('dirselects' => get_dir_selects($dir), 'bookmarks' => list_bookmarks($dir)); $json = new ext_Json(); echo $json->encode($response); break; case 'get_image': require_once _EXT_PATH . "/include/view.php"; ext_View::sendImage($dir, $item); default: require_once _EXT_PATH . "/include/list.php"; ext_List::execAction($dir); //------------------------------------------------------------------------------ } // end switch-statement } //------------------------------------------------------------------------------ // Disconnect from ftp server
$qbmlist = implode(",", $bmlist); $query = sprintf("SELECT title, id, public, favicon FROM bookmark WHERE id IN (%s) AND user='******' ORDER BY title", $mysql->escape($qbmlist), $mysql->escape($username)); if ($mysql->query($query)) { require_once ABSOLUTE_PATH . "bookmarks.php"; $query_string = "?bmlist=" . implode("_", $bmlist); ?> <h2 class="title">Change public state:</h2> <div style="width:100%; height:330px; overflow:auto;"> <?php $bookmarks = array(); while ($row = mysql_fetch_assoc($mysql->result)) { array_push($bookmarks, $row); } list_bookmarks($bookmarks, false, false, $settings['show_bookmark_icon'], false, false, false, false, false, false, true, false); ?> </div> <br> <form action="<?php echo $_SERVER['SCRIPT_NAME'] . $query_string; ?> " method="POST" name="bmedit"> <p> <select name="public"> <option value="1">public</option> <option value="0">private</option> </select> </p>
/** * Adds a new bookmark to the bookmark ini file * * @param string $dir */ function modify_bookmark($task, $dir) { $my =& JFactory::getUser(); $alias = substr(JArrayHelper::getValue($_REQUEST, 'alias'), 0, 150); $bookmarks = read_bookmarks(); $bookmarkfile = _QUIXPLORER_PATH . '/config/bookmarks_' . $GLOBALS['file_mode'] . '_' . $my->id . '.php'; header("Status: 200 OK"); switch ($task) { case 'add': if (in_array($dir, $bookmarks)) { echo nx_alertBox($GLOBALS['messages']['already_bookmarked']); exit; } $alias = preg_replace('~[^\\w-.\\/\\\\]~', '', $alias); // Make the alias ini-safe by removing all non-word characters $bookmarks[$alias] = $dir; //we deal with the flippped array here $msg = nx_alertBox($GLOBALS['messages']['bookmark_was_added']); break; case 'remove': if (!in_array($dir, $bookmarks)) { echo nx_alertBox($GLOBALS['messages']['not_a_bookmark']); exit; } $bookmarks = array_flip($bookmarks); unset($bookmarks[$dir]); $bookmarks = array_flip($bookmarks); $msg = nx_alertBox($GLOBALS['messages']['bookmark_was_removed']); } $inifile = "; <?php if( !defined( '_JEXEC' ) die( 'Restricted access' ); ?>\n"; $inifile .= $GLOBALS['messages']['homelink'] . "=\n"; foreach ($bookmarks as $alias => $directory) { //changed by pokemon if (empty($directory) || empty($alias)) { continue; } $inifile .= "{$alias}={$directory}\n"; } if (!is_writable($bookmarkfile)) { echo nx_alertBox(sprintf($GLOBALS['messages']['bookmarkfile_not_writable'], $task, $bookmarkfile)); exit; } file_put_contents($bookmarkfile, $inifile); echo $msg; echo list_bookmarks($dir); nx_exit(); }