1
0

Getting rid of dangeros in export.php, import.php and folders.php.

This commit is contained in:
Stefan Frech
2008-08-12 19:40:21 +00:00
committed by Jonas Kattendick
parent 132a3c4c0d
commit 754adfab01
7 changed files with 35 additions and 30 deletions

View File

@@ -6,16 +6,16 @@ if (basename ($_SERVER['SCRIPT_NAME']) == basename (__FILE__)) {
class folder {
function folder ($user = false) {
global $settings;
global $settings, $username, $folderid, $expand;
$this->username = $GLOBALS['username'];
$this->folderid = $GLOBALS['folderid'];
$this->username = $username;
$this->folderid = $folderid;
$this->expand = $expand;
$this->folders = array ();
$this->tree = array ();
$this->get_children = array ();
$this->level = 0;
$this->foreign_username = false;
$this->expand = $GLOBALS['expand'];
if ($user) {
$this->get_shared_data ($user);
@@ -59,15 +59,15 @@ class folder {
}
}
function get_shared_data ($username) {
global $mysql;
function get_shared_data ($user) {
global $mysql, $username;
# does the user exist in the database?
if (check_username ($username)) {
$this->foreign_username = $username;
if (check_username ($user)) {
$this->foreign_username = $user;
}
else {
$this->foreign_username = $GLOBALS['username'];
$this->foreign_username = $username;
}
# get all shared folders for the given user
@@ -285,16 +285,14 @@ class folder {
### prints a path
###
function print_path ($id) {
global $settings;
global $settings, $delimiter;
$parents = $this->get_path_to_root ($id);
$parents = array_reverse ($parents);
# the following if condition has been disabled. could be enabled to
# allow the "show_root_folder" function.
#if ($GLOBALS['show_root_folder']){
$path = $GLOBALS['delimiter'] . $settings['root_folder_name'];
#}
$path = $delimiter . $settings['root_folder_name'];
foreach ($parents as $value) {
$path .= $GLOBALS['delimiter'] . $this->folders[$value]['name'];
$path .= $delimiter . $this->folders[$value]['name'];
}
return $path;
}