From 158cb2d5b39b52e75c185d1c2e8b33458f8789a5 Mon Sep 17 00:00:00 2001 From: zone Date: Mon, 21 May 2001 01:09:20 +0000 Subject: [PATCH] Initial revision --- filemanager/admin.php | 136 +++ filemanager/groups.php | 729 +++++++++++++ filemanager/images/.xvpics/folder-home.gif | Bin 0 -> 466 bytes filemanager/images/.xvpics/folder-open.gif | Bin 0 -> 466 bytes filemanager/images/.xvpics/folder-up.gif | Bin 0 -> 466 bytes filemanager/images/.xvpics/folder.gif | Bin 0 -> 466 bytes filemanager/images/.xvpics/locked.gif | 5 + filemanager/images/folder-home.gif | Bin 0 -> 1097 bytes filemanager/images/folder-open.gif | Bin 0 -> 1111 bytes filemanager/images/folder-up.gif | Bin 0 -> 1087 bytes filemanager/images/folder.gif | Bin 0 -> 1090 bytes filemanager/images/locked.gif | Bin 0 -> 348 bytes filemanager/inc/db.inc.php | 47 + filemanager/inc/footer.inc.php | 3 + filemanager/inc/functions.inc.php | 5 + filemanager/inc/header.inc.php | 3 + filemanager/inc/hook_admin.inc.php | 3 + .../hook_phpwebhosting_add_def_pref.inc.php | 11 + filemanager/inc/hook_preferences.inc.php | 40 + filemanager/inc/html.inc.php | 411 ++++++++ filemanager/inc/main.inc.php | 159 +++ filemanager/index.php | 989 ++++++++++++++++++ filemanager/login.php | 48 + filemanager/preferences.php | 108 ++ .../templates/default/column_title.tpl | 2 + filemanager/templates/default/day.tpl | 32 + filemanager/templates/default/day_cal.tpl | 33 + filemanager/templates/default/day_row.tpl | 7 + .../templates/default/day_row_event.tpl | 3 + .../templates/default/day_row_time.tpl | 3 + filemanager/templates/default/edit.tpl | 28 + filemanager/templates/default/footer.tpl | 8 + .../templates/default/footer_column.tpl | 13 + .../templates/default/form_button_script.tpl | 6 + filemanager/templates/default/hr.tpl | 7 + .../templates/default/images/navbar.gif | Bin 0 -> 1097 bytes filemanager/templates/default/index.tpl | 29 + filemanager/templates/default/link_pict.tpl | 4 + filemanager/templates/default/list.tpl | 7 + .../templates/default/matrix_query.tpl | 19 + filemanager/templates/default/mini_cal.tpl | 37 + filemanager/templates/default/mini_day.tpl | 4 + filemanager/templates/default/mini_week.tpl | 5 + filemanager/templates/default/month.tpl | 6 + .../templates/default/month_column.tpl | 5 + filemanager/templates/default/month_day.tpl | 4 + .../templates/default/month_filler.tpl | 2 + .../templates/default/month_header.tpl | 3 + filemanager/templates/default/overlap.tpl | 14 + filemanager/templates/default/pref.tpl | 7 + .../templates/default/pref_colspan.tpl | 4 + filemanager/templates/default/pref_list.tpl | 5 + .../templates/default/preference_acl.tpl | 27 + .../templates/default/preference_acl_row.tpl | 9 + .../templates/default/preference_colspan.tpl | 8 + filemanager/templates/default/search.tpl | 6 + filemanager/templates/default/search_list.tpl | 4 + filemanager/templates/default/view.tpl | 21 + filemanager/templates/default/week.tpl | 33 + .../templates/default/week_day_event.tpl | 5 + .../templates/default/week_day_events.tpl | 4 + .../templates/idsociety/column_title.tpl | 2 + filemanager/templates/idsociety/day.tpl | 32 + filemanager/templates/idsociety/day_cal.tpl | 33 + filemanager/templates/idsociety/day_row.tpl | 7 + .../templates/idsociety/day_row_event.tpl | 3 + .../templates/idsociety/day_row_time.tpl | 3 + filemanager/templates/idsociety/edit.tpl | 28 + filemanager/templates/idsociety/footer.tpl | 8 + .../templates/idsociety/footer_column.tpl | 13 + .../idsociety/form_button_script.tpl | 6 + filemanager/templates/idsociety/hr.tpl | 7 + .../idsociety/images/navbar-over.gif | Bin 0 -> 1097 bytes .../templates/idsociety/images/navbar.gif | Bin 0 -> 1097 bytes filemanager/templates/idsociety/index.tpl | 29 + filemanager/templates/idsociety/link_pict.tpl | 4 + filemanager/templates/idsociety/list.tpl | 7 + .../templates/idsociety/matrix_query.tpl | 19 + filemanager/templates/idsociety/mini_cal.tpl | 37 + filemanager/templates/idsociety/mini_day.tpl | 4 + filemanager/templates/idsociety/mini_week.tpl | 6 + filemanager/templates/idsociety/month.tpl | 6 + .../templates/idsociety/month_column.tpl | 5 + filemanager/templates/idsociety/month_day.tpl | 4 + .../templates/idsociety/month_filler.tpl | 2 + .../templates/idsociety/month_header.tpl | 3 + filemanager/templates/idsociety/overlap.tpl | 14 + filemanager/templates/idsociety/pref.tpl | 7 + .../templates/idsociety/pref_colspan.tpl | 4 + filemanager/templates/idsociety/pref_list.tpl | 5 + .../templates/idsociety/preference_acl.tpl | 27 + .../idsociety/preference_acl_row.tpl | 9 + .../idsociety/preference_colspan.tpl | 8 + filemanager/templates/idsociety/search.tpl | 6 + .../templates/idsociety/search_list.tpl | 4 + filemanager/templates/idsociety/view.tpl | 21 + filemanager/templates/idsociety/week.tpl | 33 + .../templates/idsociety/week_day_event.tpl | 5 + .../templates/idsociety/week_day_events.tpl | 4 + filemanager/test.php | 210 ++++ 100 files changed, 3736 insertions(+) create mode 100755 filemanager/admin.php create mode 100755 filemanager/groups.php create mode 100755 filemanager/images/.xvpics/folder-home.gif create mode 100755 filemanager/images/.xvpics/folder-open.gif create mode 100755 filemanager/images/.xvpics/folder-up.gif create mode 100755 filemanager/images/.xvpics/folder.gif create mode 100755 filemanager/images/.xvpics/locked.gif create mode 100755 filemanager/images/folder-home.gif create mode 100755 filemanager/images/folder-open.gif create mode 100755 filemanager/images/folder-up.gif create mode 100755 filemanager/images/folder.gif create mode 100755 filemanager/images/locked.gif create mode 100755 filemanager/inc/db.inc.php create mode 100644 filemanager/inc/footer.inc.php create mode 100644 filemanager/inc/functions.inc.php create mode 100644 filemanager/inc/header.inc.php create mode 100644 filemanager/inc/hook_admin.inc.php create mode 100755 filemanager/inc/hook_phpwebhosting_add_def_pref.inc.php create mode 100644 filemanager/inc/hook_preferences.inc.php create mode 100755 filemanager/inc/html.inc.php create mode 100755 filemanager/inc/main.inc.php create mode 100755 filemanager/index.php create mode 100755 filemanager/login.php create mode 100644 filemanager/preferences.php create mode 100755 filemanager/templates/default/column_title.tpl create mode 100755 filemanager/templates/default/day.tpl create mode 100755 filemanager/templates/default/day_cal.tpl create mode 100755 filemanager/templates/default/day_row.tpl create mode 100755 filemanager/templates/default/day_row_event.tpl create mode 100755 filemanager/templates/default/day_row_time.tpl create mode 100755 filemanager/templates/default/edit.tpl create mode 100755 filemanager/templates/default/footer.tpl create mode 100755 filemanager/templates/default/footer_column.tpl create mode 100755 filemanager/templates/default/form_button_script.tpl create mode 100755 filemanager/templates/default/hr.tpl create mode 100755 filemanager/templates/default/images/navbar.gif create mode 100755 filemanager/templates/default/index.tpl create mode 100755 filemanager/templates/default/link_pict.tpl create mode 100755 filemanager/templates/default/list.tpl create mode 100755 filemanager/templates/default/matrix_query.tpl create mode 100755 filemanager/templates/default/mini_cal.tpl create mode 100755 filemanager/templates/default/mini_day.tpl create mode 100755 filemanager/templates/default/mini_week.tpl create mode 100755 filemanager/templates/default/month.tpl create mode 100755 filemanager/templates/default/month_column.tpl create mode 100755 filemanager/templates/default/month_day.tpl create mode 100755 filemanager/templates/default/month_filler.tpl create mode 100755 filemanager/templates/default/month_header.tpl create mode 100755 filemanager/templates/default/overlap.tpl create mode 100755 filemanager/templates/default/pref.tpl create mode 100755 filemanager/templates/default/pref_colspan.tpl create mode 100755 filemanager/templates/default/pref_list.tpl create mode 100755 filemanager/templates/default/preference_acl.tpl create mode 100755 filemanager/templates/default/preference_acl_row.tpl create mode 100755 filemanager/templates/default/preference_colspan.tpl create mode 100755 filemanager/templates/default/search.tpl create mode 100755 filemanager/templates/default/search_list.tpl create mode 100755 filemanager/templates/default/view.tpl create mode 100755 filemanager/templates/default/week.tpl create mode 100755 filemanager/templates/default/week_day_event.tpl create mode 100755 filemanager/templates/default/week_day_events.tpl create mode 100755 filemanager/templates/idsociety/column_title.tpl create mode 100755 filemanager/templates/idsociety/day.tpl create mode 100755 filemanager/templates/idsociety/day_cal.tpl create mode 100755 filemanager/templates/idsociety/day_row.tpl create mode 100755 filemanager/templates/idsociety/day_row_event.tpl create mode 100755 filemanager/templates/idsociety/day_row_time.tpl create mode 100755 filemanager/templates/idsociety/edit.tpl create mode 100755 filemanager/templates/idsociety/footer.tpl create mode 100755 filemanager/templates/idsociety/footer_column.tpl create mode 100755 filemanager/templates/idsociety/form_button_script.tpl create mode 100755 filemanager/templates/idsociety/hr.tpl create mode 100644 filemanager/templates/idsociety/images/navbar-over.gif create mode 100644 filemanager/templates/idsociety/images/navbar.gif create mode 100755 filemanager/templates/idsociety/index.tpl create mode 100755 filemanager/templates/idsociety/link_pict.tpl create mode 100755 filemanager/templates/idsociety/list.tpl create mode 100755 filemanager/templates/idsociety/matrix_query.tpl create mode 100755 filemanager/templates/idsociety/mini_cal.tpl create mode 100755 filemanager/templates/idsociety/mini_day.tpl create mode 100755 filemanager/templates/idsociety/mini_week.tpl create mode 100755 filemanager/templates/idsociety/month.tpl create mode 100755 filemanager/templates/idsociety/month_column.tpl create mode 100755 filemanager/templates/idsociety/month_day.tpl create mode 100755 filemanager/templates/idsociety/month_filler.tpl create mode 100755 filemanager/templates/idsociety/month_header.tpl create mode 100755 filemanager/templates/idsociety/overlap.tpl create mode 100755 filemanager/templates/idsociety/pref.tpl create mode 100755 filemanager/templates/idsociety/pref_colspan.tpl create mode 100755 filemanager/templates/idsociety/pref_list.tpl create mode 100755 filemanager/templates/idsociety/preference_acl.tpl create mode 100755 filemanager/templates/idsociety/preference_acl_row.tpl create mode 100755 filemanager/templates/idsociety/preference_colspan.tpl create mode 100755 filemanager/templates/idsociety/search.tpl create mode 100755 filemanager/templates/idsociety/search_list.tpl create mode 100755 filemanager/templates/idsociety/view.tpl create mode 100755 filemanager/templates/idsociety/week.tpl create mode 100755 filemanager/templates/idsociety/week_day_event.tpl create mode 100755 filemanager/templates/idsociety/week_day_events.tpl create mode 100644 filemanager/test.php diff --git a/filemanager/admin.php b/filemanager/admin.php new file mode 100755 index 0000000000..bf95896276 --- /dev/null +++ b/filemanager/admin.php @@ -0,0 +1,136 @@ + "phpwebhosting"); +include("../header.inc.php"); +error_reporting (4); + +if ($update == 1) +{ + if ($commit) + { + $query = sql_query ("SELECT shortcut FROM settings"); + while ($array = mysql_fetch_array ($query)) + { + $shortcutvar = addslashes ($$array["shortcut"]); + $query2 = sql_query ("UPDATE settings SET info = '$shortcutvar' WHERE shortcut = '$array[shortcut]'"); + header ("Location: $hostname/admin.php"); + } + } + + elseif ($set) + { + $query = sql_query ("SELECT shortcut FROM settings"); + while ($array = mysql_fetch_array ($query)) + { + $shortcut = $array["shortcut"]; + $shortcutvar = addslashes ($$shortcut); + $query2 = sql_query ("UPDATE settings SET original = '$shortcutvar' WHERE shortcut = '$shortcut'"); + $query3 = sql_query ("UPDATE settings SET info = original"); + header ("Location: $hostname/admin.php"); + } + } + + elseif ($reset) + { + $query = sql_query ("UPDATE settings SET info = original"); + header ("Location: $hostname/admin.php"); + } +} + +html_page_begin ("Administration"); +html_page_body_begin (); +html_text_italic ("This is the administration section. Here you can change most everything. Be careful, because your changes affect the entire site, including this page."); +html_break (1); +html_text_italic (htmlspecialchars ('"Strings" are arbitrary text included inside of the HTML tags. For example, "Body String" would be in the tag. An example would be "text=blue".')); +html_break (1); +html_text_italic ('"Shortcuts" are used mostly by developers'); +html_break (2); +html_form_begin ("$hostname/users.php?op=logout"); +html_form_input ("submit", NULL, "Log Out"); +html_form_end (); +html_form_begin ("$hostname/admin.php?update=1"); +html_table_begin (); + +$query = sql_query ("SELECT DISTINCT category FROM settings"); +while ($cat = mysql_fetch_array ($query)) +{ + $cat = $cat["category"]; + html_table_row_begin (); + html_table_col_begin (); + html_text_header (2, ucwords ($cat)); + html_table_col_end (); + html_table_row_end (); + + $query2 = sql_query ("SELECT DISTINCT subcategory FROM settings WHERE category = '$cat'"); + while ($sub = mysql_fetch_array ($query2)) + { + $sub = $sub["subcategory"]; + html_table_row_begin (); + html_table_col_begin (); + html_table_col_end (); + html_table_col_begin (); + html_text_header (3, ucwords ($sub)); + html_table_col_end (); + html_table_row_end (); + + $query3 = sql_query ("SELECT DISTINCT subsubcategory FROM settings WHERE category = '$cat' AND subcategory = '$sub'"); + while ($subsub = mysql_fetch_array ($query3)) + { + $subsub = $subsub["subsubcategory"]; + html_table_row_begin (); + html_table_col_begin (); + html_table_col_end (); + html_table_col_begin (); + html_table_col_end (); + html_table_col_begin (); + html_text_header (4, ucwords ($subsub)); + html_table_col_end (); + html_table_row_end (); + + $query4 = sql_query ("SELECT * FROM settings WHERE category = '$cat' AND subcategory = '$sub' AND subsubcategory = '$subsub'"); + while ($settings = mysql_fetch_array ($query4)) + { + $desc = htmlspecialchars ($settings["description"]); + $original = htmlspecialchars ($settings["original"]); + if (($original == NULL || !$original) && !is_int ($original)) + $original = "None"; + $info = $settings["info"]; + $shortcut = $settings["shortcut"]; + html_table_row_begin (); + html_table_col_begin (); + html_table_col_end (); + html_table_col_begin (); + html_table_col_end (); + html_table_col_begin (); + html_table_col_end (); + html_table_col_begin (); + html_text_underline (ucwords ($desc)); + html_font_set (2); + html_break (1, html_nbsp (3, 1)); + html_text ("Shortcut: " . $shortcut); + html_break (1, html_nbsp (3, 1)); + html_text ("Default: " . $original); + html_break (1, html_nbsp (3, 1)); + html_font_end (); + html_form_textarea ($shortcut, 5, 50, $info); + html_table_col_end (); + html_table_row_end (); + } + } + } + +} + +html_table_end (); +html_break (2); +html_form_input ("submit", "commit", "Commit changes"); +html_nbsp (10); +html_form_input ("submit", "set", "Save changes as Defaults"); +html_nbsp (10); +html_form_input ("reset", NULL, "Reset to Session Defaults"); +html_nbsp (10); +html_form_input ("submit", "reset", "Reset to Saved Defaults"); +html_form_end (); +html_page_close (); + +?> diff --git a/filemanager/groups.php b/filemanager/groups.php new file mode 100755 index 0000000000..97ef1a2ba1 --- /dev/null +++ b/filemanager/groups.php @@ -0,0 +1,729 @@ += GROUP_VIEW) + $view = 1; + +if ($group_access >= GROUP_WRITE) + $write = 1; + +if ($group_access >= GROUP_ADMIN) + $admin = 1; + +if ($group_access >= GROUP_FOUNDER) + $founder = 1; + +$phpwh->fs->set_account_type ("group"); + +$query = sql_query ("SELECT * FROM groupinfo WHERE groupname = '$group'"); + +if (!$sortby) + $sortby = "name"; + +if (!$path) + $path = "/"; + +if ($path != "/" && $nextdir) + $path = $path . "/" . $nextdir; +else + $path = $path . $nextdir; + +if ($path == "/") + $disppath = ""; +else + $disppath = $path; + +$cwd = substr ($path, strrpos ($path, "/") +1); + +if (!($lesspath = substr ($path, 0, strrpos ($path, "/")))) + $lesspath = "/"; + +if ($rename) +{ + for ($j = 0; $j != $numoffiles; $j++) + $filesman = array_push ($fileman[$j]); +} + +if ($path != "/") +{ + $query = sql_query ("SELECT name FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND name = '$cwd' AND type = 'Directory' AND directory = '$lesspath'"); + if (!mysql_fetch_row($query)) + { + html_text_error ("Directory does not exist", 1); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); + exit; + } +} + +$query = sql_query ("SELECT * FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND directory = '$path' ORDER BY $sortby"); +$files = mysql_fetch_array($query); +$numoffiles = mysql_affected_rows($db_main); + +if ($op != 'showinfo' && $op != 'changeinfo' && $op != 'delete') +{ + html_page_begin ("Groups :: $groupinfo[groupname]"); + html_page_body_begin (HTML_PAGE_BODY_COLOR); +} + +if (!$op && !$delete && !$createdir && !$renamefiles) +{ + html_table_begin ("100%"); + html_table_row_begin (); + html_table_col_begin (NULL, NULL, "top"); + html_font_set (2); + html_text ("Welcome to " . html_text_bold ("$groupinfo[groupname]", 1)); + html_break (2, html_text_bold ("$userinfo[username]", 1)); + + if ($anonymous) + { + html_break (2, html_link ("$hostname/login.php", "Login", 1)); + html_break (2, html_link ("$hostname/signup.php", "Create an account", 1)); + } + else + html_break (2, html_link ("$hostname/users.php", "Your user page", 1)); + + if ($admin) + html_break (2, html_link ("$hostname/groups.php?group=$groupinfo[groupname]&op=showinfo", "Edit this group", 1)); + + if ($founder) + html_break (2, html_link ("$hostname/groups.php?group=$groupinfo[groupname]&op=delete", "Delete this group", 1)); + + html_break (2, html_link ("$hostname/index.php", "Home", 1)); + html_break (2); + html_break (1); + + html_text_bold ($group_access_names[$group_access]); + html_text ("access"); + html_font_end (); + html_table_col_end (); + html_table_col_begin ("center", NULL, "top"); + html_align ("center"); + html_form_begin ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path"); + if ($numoffiles || $cwd) + { + html_table_begin (); + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_HEADER_BG_COLOR); + html_table_col_begin ("center", NULL, NULL, NULL, 8); + html_table_begin ("100%"); + html_table_row_begin (); + html_table_col_begin ("left"); + + if ($cwd) + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$lesspath", html_image ("$hostname/images/folder-up.gif", "Up", "left", 0, NULL, 1)); + html_table_col_end (); + html_table_col_begin ("center"); + + if ($cwd) + html_image ("$hostname/images/folder.gif", "Folder", "center"); + else + html_image ("$hostname/images/folder-home.gif", "Home"); + + html_font_set (4, HTML_TABLE_FILES_HEADER_TEXT_COLOR); + html_text_bold (strtoupper($cwd)); + html_table_col_end (); + html_table_col_begin ("right"); + + if ($cwd) + html_link ("$hostname/groups.php?group=$groupinfo[groupname]", html_image ("$hostname/images/folder-home.gif", "Home", "right", 0, NULL, 1)); + + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_table_col_end (); + html_table_row_end (); + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_COLUMN_HEADER_BG_COLOR); + + ### + # Start File Table Column Headers + ### + + html_table_col_begin (); + html_text ("Sort by:" . html_nbsp (5, 1)); + html_table_col_end (); + + html_table_col_begin (); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&sortby=name", html_text_bold ("Filename", 1)); + html_table_col_end (); + + html_table_col_begin (); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&sortby=type", html_text_bold ("Type", 1)); + html_table_col_end (); + + html_table_col_begin (); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&sortby=size", html_text_bold ("Size", 1)); + html_table_col_end (); + + html_table_col_begin (); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&sortby=createdby", html_text_bold ("Created By", 1)); + html_table_col_end (); + + html_table_col_begin (); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&sortby=modifiedby", html_text_bold ("Modified By", 1)); + html_table_col_end (); + + html_table_col_begin (); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&sortby=created", html_text_bold ("Created", 1)); + html_table_col_end (); + + html_table_col_begin (); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&sortby=modified", html_text_bold ("Modified", 1)); + html_table_col_end (); + + html_table_col_begin (); + html_table_col_end (); + html_table_row_end (); + + ### + # List all of the files, with their attributes + ### + + $i = 0; + while ($i != $numoffiles) + { + if ($rename) + { + unset($renamethis); + for ($j = 0; $j != $numoffiles; $j++) + { + if ($fileman[$j] == $files["name"]) + { + $renamethis = 1; + break; + } + } + } + + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_BG_COLOR); + html_table_col_begin ("right"); + + if ($write) + { + if (!$rename) + html_form_input ("checkbox", "fileman[$i]", "$files[name]"); + elseif ($renamethis) + html_form_input ("checkbox", "fileman[$files[name]]", "$files[name]", NULL, NULL, "checked"); + else + html_nbsp; + } + + html_table_col_end (); + html_table_col_begin (); + + if ($renamethis) + { + if ($files["type"] == "Directory") + html_image ("$hostname/images/folder.gif", "Folder"); + html_form_input ("text", "renamefiles[$files[name]]", "$files[name]", 255); + } + else + { + if ($files["type"] == "Directory") + { + html_image ("$hostname/images/folder.gif", "Folder"); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path&nextdir=$files[name]", $files["name"]); + } + else + { + html_link ("$hostname/groups/$groupinfo[groupname]$disppath/$files[name]", $files["name"]); + } + } + + html_table_col_end (); + html_table_col_begin (); + html_text ($files["type"]); + html_table_col_end (); + html_table_col_begin (); + + if ($files["type"] == "Directory") + { + $query2 = sql_query ("SELECT SUM(size) FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND directory RLIKE '^$disppath/$files[name]'"); + $fileinfo = mysql_fetch_row($query2); + if ($fileinfo[0]) + borkb($fileinfo[0]+1024); + else + echo "1KB"; + } + else + borkb($files["size"]); + + html_table_col_end (); + + html_table_col_begin (); + html_text ($files["createdby"]); + html_table_col_end (); + + html_table_col_begin (); + html_text ($files["modifiedby"]); + html_table_col_end (); + + html_table_col_begin (); + html_text ($files["created"]); + html_table_col_end (); + + html_table_col_begin (); + html_text ($files["modified"]); + html_table_col_end (); + + html_table_col_begin (); + html_text ($files["owner"]); + html_table_col_end (); + + if ($files["deleteable"] == "N") + { + html_table_col_begin (); + html_image ("$hostname/images/locked.gif", "Locked"); + html_table_col_end (); + } + else + { + html_table_col_begin (); + html_table_col_end (); + } + + html_table_row_end (); + + if ($files["type"] == "Directory") + $usedspace += $fileinfo[0]; + else + $usedspace += $files["size"]; + $files = mysql_fetch_array($query); + $i++; + } + + html_table_end (); + html_break (2); + + if ($write) + { + html_form_input ("submit", "rename", "Rename"); + html_nbsp (3); + if (!$rename) + { + html_form_input ("submit", "delete", "Delete"); + html_nbsp (3); + } + } + } + if (!$rename) + { + if ($write) + { + html_form_input ("text", "createdir", NULL, 255); + html_nbsp (); + html_form_input ("submit", "newdir", "Create Folder"); + html_form_end (); + } + + html_break (1); + html_text_bold ("Files: "); + html_text ($numoffiles); + html_nbsp (3); + + html_text_bold ("Used space: "); + html_text (borkb ($usedspace, NULL, 1)); + html_nbsp (3); + + if ($path == "/") + { + html_text_bold ("Unused space: "); + html_text (borkb ($groupinfo["hdspace"] - $usedspace, NULL, 1)); + + $query = sql_query ("SELECT name FROM groupfiles WHERE groupname = '$groupinfo[groupname]'"); + $i = mysql_affected_rows($db_main); + + html_break (2); + html_text_bold ("Total Files: "); + html_text ($i); + } + } + if ($write) + { + html_break (2); + html_form_begin ("$hostname/groups.php?group=$groupinfo[groupname]&op=upload&path=$path", "post", "multipart/form-data"); + html (html_form_input ("file", "file[]", NULL, 255, NULL, NULL, NULL, 1) . "
", 5); + html_form_input ("submit", "upload_files", "Upload files"); + html_form_end (); + } + + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_page_body_end (); + html_page_end (); +} + +### +# Handle File Uploads +### + +elseif ($op == "upload") +{ + for ($i = 0; $i != 5; $i++) + { + if ($file_size[$i] != 0) + { + if (strlen($file_name[$i]) > 255) + { + html_text_summary_error ("File names must be under 256 characters"); + continue; + } + + if ($badchar = bad_chars($file_name[$i], 1)) + { + html_text_summary_error ("Cannot upload $file_name[$i]", "(filename contains '$badchar')"); + continue; + } + + $query = sql_query ("SELECT * FROM groupfiles WHERE name = '$file_name[$i]' AND groupname = '$groupinfo[groupname]' AND directory = '$path'"); + if ($fileinfo = mysql_fetch_array($query)) + { + if ($fileinfo["type"] == "Directory") + { + html_text_summary_error ("Cannot replace $fileinfo[name] because it is a directory"); + continue; + } + + $query = sql_query ("SELECT SUM(size) FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND name != '$file_name[$i]'"); + $files = mysql_fetch_row($query); + $usedspace = $files[0]; + + if (($file_size[$i] + $usedspace) > $userinfo["hdspace"]) + { + html_text_summary_error ("Not enough space to upload $file_name[$i]", NULL, $file_size[$i]); + continue; + } + + if ($fileinfo["deleteable"] != "N") + { + $query = sql_query ("UPDATE groupfiles SET groupname = '$groupinfo[groupname]',modifiedby = '$userinfo[username]', size = $file_size[$i], type = '$file_type[$i]', modified = NOW(), deleteable = 'Y' WHERE number = '$fileinfo[number]' AND groupname = '$groupinfo[groupname]' AND directory = '$path'"); + copy ($file[$i], "$rootdir/groups/$groupinfo[groupname]$path/$file_name[$i]"); + + html_text_summary ("Replaced $disppath/$file_name[$i]", $file_size[$i]); + } + } + else + { + $query = sql_query ("SELECT SUM(size) FROM groupfiles WHERE groupname = '$groupinfo[groupname]'"); + $files = mysql_fetch_row($query); + $usedspace = $files[0]; + + if (($file_size[$i] + $usedspace) > $userinfo["hdspace"]) + { + html_text_summary_error ("Not enough space to upload $file_name[$i]", NULL, $file_size[$i]); + continue; + } + + $query = sql_query ("SELECT number FROM groupfiles WHERE groupname = 'number'"); + $number = mysql_fetch_row($query); + + $query = sql_query ("INSERT INTO groupfiles SET number = $number[0]+1, groupname='$groupinfo[groupname]', createdby='$userinfo[username]', modifiedby='', size=$file_size[$i], type='$file_type[$i]', created=NOW(), modified='', deleteable='Y', directory='$path', name='$file_name[$i]'"); + copy ($file[$i], "$rootdir/groups/$groupinfo[groupname]$path/$file_name[$i]"); + + $query = sql_query ("UPDATE groupfiles SET number = $number[0]+1 WHERE groupname = 'number'"); + + html_text_summary ("Created $disppath/$file_name[$i]", $file_size[$i]); + } + } + } + +html_break (2); +html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); +} + +elseif ($renamefiles) +{ + while (list($file) = each($renamefiles)) + { + if ($badchar = bad_chars ($renamefiles[$file], 1)) + { + html_text_error_summary ("Cannot rename $file to $renamefiles[$file]", "(filename contains '$badchar')"); + continue; + } + if (($fileman[$file] && $renamefiles[$file]) && ($fileman[$file] != $renamefiles[$file])) + { + $query = sql_query ("SELECT name FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND directory = '$path' AND name = '$renamefiles[$file]'"); + if (mysql_fetch_row($query)) + { + html_text_summary_error ("Cannot rename $fileman[$file]: $renamefiles[$file] exists"); + continue; + } + $query = sql_query ("SELECT number,name,directory FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND (directory RLIKE '^$disppath/$fileman[$file]/' OR directory = '$disppath/$fileman[$file]')"); + while ($fileinfo = mysql_fetch_row($query)) + { + $newdir = $fileinfo[2]; + $newdir = preg_replace("|^$disppath/$fileman[$file]|","$disppath/$renamefiles[$file]",$newdir); + $query2 = sql_query ("UPDATE groupfiles SET directory = '$newdir' WHERE groupname = '$groupinfo[groupname]' AND name = '$fileinfo[1]' AND number = '$fileinfo[0]' AND directory RLIKE '^$disppath/$fileman[$file]'"); + } + + $query = sql_query ("UPDATE groupfiles SET name = '$renamefiles[$file]' WHERE groupname = '$groupinfo[groupname]' AND directory = '$path' AND name = '$fileman[$file]'"); + rename("$rootdir/$userinfo[username]$path/$fileman[$file]","$rootdir/$userinfo[username]$path/$renamefiles[$file]"); + html_text_summary ("Renamed $disppath/$fileman[$file] to $disppath/$renamefiles[$file]"); + } + } + +html_break (2); +html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); +} + +elseif ($delete) +{ + $query = sql_query ("SELECT name FROM groupfiles WHERE groupname = '$groupinfo[groupname]'"); + $numoffiles = mysql_affected_rows($db_main); + for ($i = 0; $i != $numoffiles; $i++) + { + if ($fileman[$i]) + { + if ($query = sql_query ("SELECT name,type,size FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND name = '$fileman[$i]' AND directory = '$path' AND deleteable = 'Y'")) + { + $fileinfo = mysql_fetch_row($query); + if ($fileinfo[1] == "Directory") + { + $query2 = sql_query ("SELECT name,size,directory FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND type != 'Directory' AND directory RLIKE '^$disppath/$fileman[$i]'"); + while ($files = mysql_fetch_row($query2)) + { + unlink("$rootdir/groups/$groupinfo[groupname]$files[2]/$files[0]"); + html_text_summary ("Deleted $files[2]/$files[0]", $files[1]); + } + + $query2 = sql_query ("DELETE FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND directory RLIKE '^$disppath/$fileman[$i]' AND type != 'Directory'"); + + $query2 = sql_query ("SELECT name,type,directory FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND type = 'Directory' AND (directory RLIKE '^$disppath/$fileman[$i]' OR (name = '$fileman[$i]' AND directory = '$path')) ORDER BY directory DESC"); + while ($files = mysql_fetch_row($query2)) + { + rmdir("$rootdir/groups/$groupinfo[groupname]$files[2]/$files[0]"); + html_text_summary ("Deleted directory "); + if ($files[2] == "/") + html_text_bold ("/$files[0]"); + else + html_text_bold ("$files[2]/$files[0]"); + } + + $query2 = sql_query ("DELETE FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND type = 'Directory' AND (directory RLIKE '^$disppath/$fileman[$i]' OR (name = '$fileman[$i]' AND directory = '$path'))"); + } + + else + { + $query = sql_query ("DELETE FROM groupfiles WHERE groupname = '$groupinfo[groupname]' + AND name = '$fileman[$i]' AND directory = '$path'"); + unlink("$rootdir/groups/$groupinfo[groupname]$path/$fileman[$i]"); + + html_text_summary ("Deleted $disppath/$fileman[$i]", $fileinfo[2]); + } + } + } + } +html_break (2); +html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); +} + +elseif ($newdir && $createdir) +{ + if ($badchar = bad_chars ($createdir, 1)) + { + html_text_error_summary ("Cannot create directory $createdir", "(name contains '$badchar')"); + html_break (2); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); + html_page_close (); + } + + if ($createdir[strlen($createdir)-1] == " " || $createdir[0] == " ") + { + html_text_error_summary ("Cannot create directory $createdir because it begins or ends in a space"); + html_break (2); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); + html_page_close (); + } + + $query = sql_query ("SELECT name,type FROM groupfiles WHERE name = '$createdir' AND groupname = '$groupinfo[groupname]' AND directory = '$path'"); + if ($fileinfo = mysql_fetch_row($query)) + { + if ($fileinfo[1] != "Directory") + { + html_text_error_summary ("$fileinfo[0] already exists as a file"); + html_break (2); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); + html_page_close (); + } + else + { + html_text_error ("Directory $fileinfo[0] already exists"); + html_break (2); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); + html_page_close (); + } + } + else + { + $query = sql_query ("SELECT SUM(size) FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND name != '$file_name[$i]'"); + $files = mysql_fetch_row($query); + $usedspace = $files[0]; + + if (($usedspace + 1024) > $userinfo["hdspace"]) + { + html_text_summary_error ("Sorry, you do not have enough space to create a new directory","Groups : $groupinfo[groupname]"); + html_page_close (); + } + + $query = sql_query ("SELECT number FROM groupfiles WHERE groupname = 'number'"); + $number = mysql_fetch_row($query); + + $query = sql_query ("INSERT INTO groupfiles SET number=$number[0]+1, groupname='$groupinfo[groupname]', createdby='$userinfo[username]', modifiedby='', size=1024, type='Directory', created=NOW(), modified='', deleteable='Y', directory='$path', name='$createdir'"); + mkdir("$rootdir/groups/$groupinfo[groupname]$path/$createdir",0755); + + $query = sql_query ("UPDATE groupfiles SET number = $number[0]+1 WHERE groupname = 'number'"); + + html_text_summary ("Created directory $disppath/$createdir/"); + } + +html_break (2); +html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); +} + +### +# Show info about a group (to change), but only if they have admin access +# Having write access is not enough +### + +elseif ($op == "showinfo") +{ + if (group_auth () >= GROUP_ADMIN) + showgroupinfo (); + + else + html_page_error (html_text_summary_error ("Admin access to $groupinfo[groupname] is denied", NULL, NULL, 1)); +} + +### +# Change group info. Proceeds showinfo above +### + +elseif ($op == "changeinfo") +{ + if ($group_access < GROUP_ADMIN) + html_page_error (html_text_summary_error ("Admin access to $groupinfo[groupname] is denied", NULL, NULL, 1)); + + if ($grouppass == $groupinfo["groupname"]) + showgroupinfo ("Your password cannot be the same as the group name"); + + if (strlen ($grouppass) > 10) + showgroupinfo ("Your password must be 10 characters or less"); + + $users = split("\n", $usernames); + + for ($i = 0; $users[$i]; $i++) + { + $query = sql_query ("SELECT username FROM userinfo WHERE username = '$users[$i]'"); + if (!$user = mysql_fetch_row($query)) + showgroupinfo ("User $users[$i] does not exist"); + + $usernamessep .= $user[0] . ","; + } + + if ($usernamessep) + $usernamessep = ',' . $usernamessep; + + if ($public) + $public = 'Y'; + else + $public = 'N'; + + if ($passonly) + $passonly = 'Y'; + else + $passonly = 'N'; + + $query = sql_query ("UPDATE groupinfo SET grouppass = PASSWORD('$grouppass'), public = '$public', passonly = '$passonly', users = '$usernamessep' WHERE groupname = '$groupinfo[groupname]'"); + + html_page_begin ("Groups :: $groupinfo[groupname]"); + html_page_body_begin (); + html_break (2); + html_font_set (NULL, HTML_TEXT_UPDATE_COLOR); + html_text_bold (HTML_TEXT_NAVIGATION_UPDATE_SUCCESSFUL); + html_font_end (); + html_break (2); + html_link ("$hostname/groups.php?group=$groupinfo[groupname]&path=$path", HTML_TEXT_NAVIGATION_BACK_TO_GROUP); + html_page_close (); +} + +elseif ($op == "delete") +{ + if ($group_access < GROUP_FOUNDER) + html_page_error (html_text_summary_error ("Founder access to $groupinfo[groupname] is denied", NULL, NULL, 1)); + + if ($yesdelete) + { + $query = sql_query ("SELECT name,directory FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND type != 'Directory'"); + while ($fileinfo = mysql_fetch_row($query)) + { + unlink ("$rootdir/groups/$groupinfo[groupname]$fileinfo[1]/$fileinfo[0]"); + } + + $query = sql_query ("SELECT name,directory FROM groupfiles WHERE groupname = '$groupinfo[groupname]' AND type = 'Directory' ORDER BY directory DESC"); + while ($fileinfo = mysql_fetch_row($query)) + { + rmdir("$rootdir/groups/$groupinfo[groupname]$fileinfo[1]/$fileinfo[0]"); + } + + $query = sql_query ("DELETE FROM groupfiles WHERE groupname = '$groupinfo[groupname]'"); + + $query = sql_query ("DELETE FROM groupinfo WHERE groupname = '$groupinfo[groupname]'"); + rmdir("$rootdir/groups/$groupinfo[groupname]"); + + html_page_begin ("Groups :: $groupinfo[groupname]"); + html_page_body_begin (); + html_break (2); + html_font_set (NULL, HTML_TEXT_DELETE_ACCOUNT_COLOR); + html_text_bold (HTML_TEXT_NAVIGATION_DELETED_ACCOUNT); + html_font_end (); + html_break (2); + html_link ("$hostname", HTML_TEXT_NAVIGATION_HOME); + html_page_close (); + } + else + { + html_page_begin ("Groups :: $groupinfo[groupname]"); + html_page_body_begin (); + html_font_set (NULL, HTML_TEXT_DELETE_ACCOUNT_COLOR); + html_text_bold (HTML_TEXT_NAVIGATION_DELETE_ACCOUNT); + html_form_begin ("$hostname/groups.php?group=$groupinfo[groupname]&op=delete"); + html_form_input ("submit", "yesdelete", "Yes, please delete my group"); + html_form_end (); + html_page_close (); + } +} + +?> diff --git a/filemanager/images/.xvpics/folder-home.gif b/filemanager/images/.xvpics/folder-home.gif new file mode 100755 index 0000000000000000000000000000000000000000..c40685e7ef408497f2907f31fda9b57dfd92a452 GIT binary patch literal 466 zcmY+=!AiqG5C-6!`xF5;(A;WEDSFhV?tpDYy%z)_g>FIgpzmPB-8@GRjW~hyErh0+ zIrtVr6}rwwJQxBSzWkH?yJtPW(`h&MV0Z$f!T7MUZgB}bUz^?KdOG|3`r3Za2>;9ys^wy--`06i z+s<0DRbDB>pYRCXKO7;OF{l#}g|(5=yE(S122%q#KAw~cb*J*_6G%^;n)BG literal 0 HcmV?d00001 diff --git a/filemanager/images/.xvpics/folder-open.gif b/filemanager/images/.xvpics/folder-open.gif new file mode 100755 index 0000000000000000000000000000000000000000..acff62427d6aa8d29eb629b40837eb668c859a1e GIT binary patch literal 466 zcmZ9|u};G<5C&l8JVm4?QnHm+6%r#Pt#3$+fV~m|2}@iS7~l;U@L(g}qpp;T1W(bS zscOFmBjucd0n3X&{dYdy#YsFKkD>uoGnh{or=#KXXc%A4&f@HtPki(8boZD?gK}Oh z7t`hWqN>XI^;N{7a3_-p5&$8=r6Mmqxi$fj2SbHjUO?`t`%Fa%!Iafjp%kraDJwzr zhSpkCsl%?#O0Gqt5H+#tZbKHy6JXn5y`rtLw%dO<$`jkcJFl(TZ%J=x+Yxy${DF1- zVYJnHz17mS0RHFTebZ{CwP~!CkU_$w9OTwUo0WOPl4tf5Iy&xcLRRw7iJ?HP3x-Nz z0-i+OR}!0fkgDpwg7Nn(!SEh&*S`>rVF|UMc$Sdho(#=z>% literal 0 HcmV?d00001 diff --git a/filemanager/images/.xvpics/folder-up.gif b/filemanager/images/.xvpics/folder-up.gif new file mode 100755 index 0000000000000000000000000000000000000000..b040fdeba0d9f7438ca32aca8ddd0e80e4cddfca GIT binary patch literal 466 zcmYk2&1wQM5Xbk>UVMrLv*6yWQY<~Teq;o-w7m<3g2HB@ABXlGTp{Cgcu;Tx`W&vX zd5?k?+)lPF2!VlLe)-Q#?izl*UMrQM*MWX}a9yi@)T;h{=fJ-i+CdaeHBLy0AKE-yqitp~K-bOt?Q1kAD*%l|%7@T-W))+`DZ$xz(H& z5E*SEAAq;P%ql}lnAL2>dBuhdkcEKLP*2Zx8IMRJP%4%IAv5JWj|hb7M%`$}qo8B% juL?I-s1b2;&W-;V$bb_H=AAIUMU@EelyQb91K)!mO&{B_ literal 0 HcmV?d00001 diff --git a/filemanager/images/.xvpics/folder.gif b/filemanager/images/.xvpics/folder.gif new file mode 100755 index 0000000000000000000000000000000000000000..4aec61e327b9e4c11ebb59694d81ad856c37da32 GIT binary patch literal 466 zcmY+=!AiqG5P)G1p7IodCeYksOA$S4w#^*cih3`I1q{5woSyc=r(Wn@j?UcfQFs!%H_wmrhrsEG zNi>@dXXn%LSWK?39FFWa7&zbo#0wyZ0x(3{k40cjzQ~G6=%TDW2mri9QkLPnTtK;_ zk`uwED9>npzY^7*p&$aD0n})dVU}j~mNHpa)LNqnQ}yvxZ)-)na&KHxsy<)yZBAtN zX1roZL)b&l%#FP#`~y3afK>{y0UMzZ#hPVGU8YJwb%!l WsAT1P2Y(HuOj7T^@eY3M9*Q4_VetY0 literal 0 HcmV?d00001 diff --git a/filemanager/images/.xvpics/locked.gif b/filemanager/images/.xvpics/locked.gif new file mode 100755 index 0000000000..6491c5b94b --- /dev/null +++ b/filemanager/images/.xvpics/locked.gif @@ -0,0 +1,5 @@ +P7 332 +#IMGINFO:14x12 Indexed (348 bytes) +#END_OF_COMMENTS +14 12 255 +I$II۶m۶I$II۶ֶI۶I$II۶$۶I$IIHm۶މm$۶)۶mhnۑm)IiMImmIHMIHJHermmIIm%HI)EnI$IIHnMimrI$IIۑInmmIm \ No newline at end of file diff --git a/filemanager/images/folder-home.gif b/filemanager/images/folder-home.gif new file mode 100755 index 0000000000000000000000000000000000000000..8555f88db2082487d3ae70dce5cf1caf3e168b3a GIT binary patch literal 1097 zcmZ?wbhEHb6k!lyc+S9(7-Zw`Y8v6|aDGwjVpU(}ru_*b#%+&9P8~)vz(^eKyQd0Wk$B$2+KD~ec{?)5j2M+9= z(AiQF>roYLTac5P6XkJjPW0`y`9(z~pFe+o@#4j!N008@xpU>pmBWV*x3sjbS+i!| zym`ryK|5;P^YaTne*Ad+_;EL9`^xgNbLY;TIB{a{-o3@eC9BKbb93`PeE1L&5_10h zc|T8=gh1CIH|wgZs)Gj)?%cU^!-fsTC8ev%-LtZ?U%!6+{P}Ye6BBP&`g1hzOiNbDEWrW^z)Zv9YP1u1;KB-2MCa_wU~?BQ4e1+A?FtjEt-5;V|RD=!i5XHyu7AN znZn4(WMgC7+S=ON+nbq{rKzbM6B8R19X%t%PEb%-Ls9_fsu2zpf3h%gG5lxHVE_V9 zo?zhk$MB!?54*yF1I-+QToMio8X8*!{>wT{a5%`s#wEj1Bk)nag+oX!U`4`1rZyfa zvw{YWh0g5!@(wKmhD|P#MsjPHv_;X28wVG+ z_scspaXhprIMF5Q5+Pz(#NsKW>OI4x@KERjVWogYH8T`axu$9fuW8uPwDj$MohX%@ zhnJ3?7B}!b)FJ7-tS8<${lb#K&27H3_4Do>=u}?*{-CAXiVG`~pYzSLsrvTe<>TX@ z57;;CV%gNZ+)U1~nZwZVaaDq%bNf35uNJoR(yrYSrbRp#1?Ra>P?DT((s`+9Kl5Ds zRVsgbmwL}wr|x{GNn`Rd-wun?Pa^Xwk2lVDXcaPD^`7~SpyyPh(pUd}x2#xV6yU&M F4FFZ5niK#4 literal 0 HcmV?d00001 diff --git a/filemanager/images/folder-open.gif b/filemanager/images/folder-open.gif new file mode 100755 index 0000000000000000000000000000000000000000..da32bfada269f48a762c69258f0adc1d4bdbc56b GIT binary patch literal 1111 zcmcK33sV{d0Kjo{>Kxm3dU~DOE}h*rAG?*EZPK#92SXh5ED^*MA0UFrF+~SSGeq%? zAP9nQMFdSDOi-B*L=k+~d~LdNuFyG}Wp-E|p*^(1*of{^}&umG*B$?T}gsLV&f;n8Db1ZSp zIXykSzyI6r?#|=Kk2W_qR#xsUEX>)s@_6DMs@1kuX@4TrS_< z-rCrBu)4auxHxaIm?kF1hlX?-jY=dE6y#w!G)Ute1V1+>H%ieB|4vzNr4iOQNu{WcsNH7H+ zc)`o%(mBufz1@%hXXlO_?0|q{z$L(IZ=L`+zXBYe`sbw2_&D3y73cwO{f1TS;`lC@ z2R7I{0eykA-vMC`r`-JF)Kt50C*V6FKDMn#C(2xWp*+9TZHEf?fOvIg(9+atk09J! zYpl@(JPV@Pwtg^98@$0q&YoeiGX8t8TEBz|S-F56(;C6@#RKaC;`>r8?fBE;%O^*e zc5cu)j}P&4jSvBJ-s?*CTf>YK7rBif+TQvQ`(jOVDD&mn!#}T|X$2QKxdz~NUD_im z-VO>|H@jLPH9nEG!R4Qyj}}9{Cxub>F5E2nnDNpfK&Xh7!OsW(^^1FVTz5PxZDnR9 z5dEF+j5M-m)jv^3{q@IzO0lVMg!$3G_E7(Nb?Rh==ijgPJv6u(QBaoE=2^g6YL9Aw e_DTn`);FKWTzNn?BCf7Ehw!fce8$}caP2>nsbcs5 literal 0 HcmV?d00001 diff --git a/filemanager/images/folder-up.gif b/filemanager/images/folder-up.gif new file mode 100755 index 0000000000000000000000000000000000000000..3dc145542924f660f7a615c19d3acd33908115a3 GIT binary patch literal 1087 zcmZ?wbhEHb6k!lyc+S9(7-Zw`Y8v6|aDGS5^SJ>x79}5;nfm>3!@pZ|+R7qIN=kqH_|etXwRY{=6DLk2B_(#Y zHkHJBR7KksA>*dX|@$A2@KJsi`S9H&<0vwZFfA@7}$|#U-oD z-E(vEK79DFV#SKZix+EXXc!n6L`O&O+_`hZh7H9frK`%_v$C?EKYxDr?p-r8vk4O> z?B2b5$BrGFHf>tIe0g4eL3(<|qeqYK-@kw3#tjn_lfJ&b&6_u`UcGwJqD5Ibxsj1k zhYugVa^=dUOP7p{jCy){R;^mKWXTe1Yn#T#rY&2x=g6BOV6J_KO-y4!on&o zEv>V&bHRcI3l}b&J$v?~Ns|l>jdF5wX3d&4ZQ3+VO|8Ph!YNax#Ky+8wzl^6_GV^f zX=-Z6#KcBLN6*Nx6BHEIkQDeo3Q$8p@h1x-7sG!B9R?r(UQ|FA0@IMB=? z$R**hprNrv;J>WH1c!r6Y+N!NH3A>yTR4Q&0#+nEWNPD)GAn4{Sm?~oFYnMIVA$ls zDXiwVz+uLsW-d|fh%E&lncR3JjWez|WF)tCNm~@XxN&fCd%wIx6URe~f)iXyu01l2 zlUz;;srk;aX*?8~Afg$(B4lIIQ?6+`QQI0GTw40pUO)aoi=cBkkEBuPsTr2d$MR<> zXIyy(j5y?YtMLu*|35L^ktQ-k#kK fUb8JqKVA9W_@!gML#xo!dp3sxm$0$1FjxZs_wbd* literal 0 HcmV?d00001 diff --git a/filemanager/images/folder.gif b/filemanager/images/folder.gif new file mode 100755 index 0000000000000000000000000000000000000000..43fbfb0969bee4679800cdacb5bd9a9dae200ded GIT binary patch literal 1090 zcmZ?wbhEHb6k!lyc+SA!ZlfLMVI1yd)=&_$d1C6Jc{#Hiqx0ij^7HbyZrZSDYR9?> z`TJ+(?wXM~u_CxO!>zu);r;vfckkX^I=yRYXV%WCX&ZW@7q>@Gsf}JaId^e?R(EA| zLqpTIZ{L3W`0?h=o9oxFuV1xvT6=jV&Qt^%=FXcGcB2@7}%p^y$;{=g%KLe0clz?Q7SrojrT@=+UG5_wV1aW5?2^OD46H z7lhhYR8+ov`SQ`DN9WF+J9g~Y;lqay95}FZ=g#HJmrrV~%n!9KEiJou@7|3YH!fek zeCEuVUAuN|-@bk0#*Opm&+lz4%?q)~&o8`m>C%=hTQ+Riuxiz+S+iz!*A?XkTgS&I zY}&Nx^y$+lPoCVjZ{OOrYgevZxp?v7Y15{4))ZuBX12GtFIcc}+qP}XmMvSdWXYsS zliI8E6BCnGtXQ#d;ljSYzP8HTh=|CdqN3*J=9x2RPMCd2GS|aM-p|iJDJi+O zwr;|N3Ekb@M#|zYF0L^#u~k)7O-)U$6*(F*!mKQ;OiV2H_71_pA!*Tp(Jlr`5(4tl z5{i;S|3@BB{K>+|#qgg&hXDvcd4hrCAH#o676FHb1I--5axxAJ8XB3ol>a$Ta5%`s z#wBAjp+mrlg_Bb)U`4`1rZyfaGnXe94jyI~P;}{02t0IzQ$#aFCFbCw)^2fwq!Tk7 z7q|6FTNJ6ZTv*u3E^A%!<-CcV}!~+3VrQv(MmYfA?duVXQnad#RCr}x}B9WE4jU+l3BfPPD}9>lV!|1 z^JJ~dKRmfOxqyGZcI}^zpOc?*EpTXJ6I7bJVZuV^noSB!b3Fv-xb|dd=X^<-pyb{q zckm#y=A;iDlhguNg>d#S^`7x1<&j3fWi`LKVhWX~{&oI#3|Q#WtF(0al$F8HSQmLM S%@WlP{wTPusMJ7#!5RQSI-(o^ literal 0 HcmV?d00001 diff --git a/filemanager/images/locked.gif b/filemanager/images/locked.gif new file mode 100755 index 0000000000000000000000000000000000000000..3397084cd7c078c7f84f9d7d620f8bf9927c029d GIT binary patch literal 348 zcmZ?wbhEHbFwI=kJA;ZR?g5u3Wit+N5b4Hf*S`ufMdVr?Rqg z|DpXsK|y^J`&O-5rSI>rp<|$}t=-pF85$b8Z`Z!I$~Fflhh@u_fgFbc6o0ZXaxvI5 z=r8~Q$WIJxl?Ub*XsC$ruqzn`2Ixp|Eq%<`>7h2oX{pnn1|B{yRTHj>9jXCoy#}QL znv1wxw)b%TI8+dNYKn=djv}{)8neBqs;-{CfnmR)k(jo{uGVIDWUvMRhbNl} literal 0 HcmV?d00001 diff --git a/filemanager/inc/db.inc.php b/filemanager/inc/db.inc.php new file mode 100755 index 0000000000..8287a390f4 --- /dev/null +++ b/filemanager/inc/db.inc.php @@ -0,0 +1,47 @@ +db->Auto_Free = 0; +} + +/* General SQL query */ +function db_query ($query) +{ + global $phpgw; + global $phpgw_info; + + return $phpgw->db->query ($query); +} + +/* Fetch next array for $query_id */ +function db_fetch_array ($query_id) +{ + global $phpgw; + global $phpgw_info; + + $phpgw->db->Query_ID = $query_id; + $phpgw->db->next_record (); + return $phpgw->db->Record; +} + +/* + General wrapper for all other db calls + Calls in here are simply returned, so not all will work +*/ +function db_call ($function, $query_id) +{ + global $phpgw; + global $phpgw_info; + + $phpgw->db->Query_ID = $query_id; + return $phpgw->db->$function (); +} + +?> diff --git a/filemanager/inc/footer.inc.php b/filemanager/inc/footer.inc.php new file mode 100644 index 0000000000..770465f09e --- /dev/null +++ b/filemanager/inc/footer.inc.php @@ -0,0 +1,3 @@ + diff --git a/filemanager/inc/functions.inc.php b/filemanager/inc/functions.inc.php new file mode 100644 index 0000000000..adc4f53e1b --- /dev/null +++ b/filemanager/inc/functions.inc.php @@ -0,0 +1,5 @@ + diff --git a/filemanager/inc/header.inc.php b/filemanager/inc/header.inc.php new file mode 100644 index 0000000000..770465f09e --- /dev/null +++ b/filemanager/inc/header.inc.php @@ -0,0 +1,3 @@ + diff --git a/filemanager/inc/hook_admin.inc.php b/filemanager/inc/hook_admin.inc.php new file mode 100644 index 0000000000..770465f09e --- /dev/null +++ b/filemanager/inc/hook_admin.inc.php @@ -0,0 +1,3 @@ + diff --git a/filemanager/inc/hook_phpwebhosting_add_def_pref.inc.php b/filemanager/inc/hook_phpwebhosting_add_def_pref.inc.php new file mode 100755 index 0000000000..8bdc78f460 --- /dev/null +++ b/filemanager/inc/hook_phpwebhosting_add_def_pref.inc.php @@ -0,0 +1,11 @@ +change("phpwebhosting","filename","True"); + $pref->change("phpwebhosting","mime_type","False"); + $pref->change("phpwebhosting","size","True"); + $pref->change("phpwebhosting","created","True"); + $pref->change("phpwebhosting","modified","True"); + $pref->change("phpwebhosting","createdby","True"); + $pref->change("phpwebhosting","modifiedby","True"); + $pref->change("phpwebhosting","comment","True"); +?> diff --git a/filemanager/inc/hook_preferences.inc.php b/filemanager/inc/hook_preferences.inc.php new file mode 100644 index 0000000000..9a777e4fd9 --- /dev/null +++ b/filemanager/inc/hook_preferences.inc.php @@ -0,0 +1,40 @@ + * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ +{ + echo "

\n"; + $imgfile = $phpgw->common->get_image_dir ($appname) . '/' . $appname . '.gif'; + if (file_exists ($imgfile)) + { + $imgpath = $phpgw->common->get_image_path ($appname) . '/' . $appname . '.gif'; + } + else + { + $imgfile = $phpgw->common->get_image_dir ($appname) . '/navbar.gif'; + if (file_exists ($imgfile)) + { + $imgpath = $phpgw->common->get_image_path ($appname) . '/navbar.gif'; + } + else + { + $imgpath = ''; + } + } + + section_start (ucfirst ($appname), $imgpath); + + echo '' . lang ('PHPWebHosting preferences') . ''; + + section_end (); +} +?> diff --git a/filemanager/inc/html.inc.php b/filemanager/inc/html.inc.php new file mode 100755 index 0000000000..f5c65aaa46 --- /dev/null +++ b/filemanager/inc/html.inc.php @@ -0,0 +1,411 @@ +link ($action); + + if ($method != NULL && $method) + $method = "method=$method"; + if ($enctype != NULL && $enctype) + $enctype = "enctype=$enctype"; + $rstring = "

"; + return (eor ($rstring, $return)); +} + +function html_form_input ($type = NULL, $name = NULL, $value = NULL, $maxlength = NULL, $size = NULL, $checked = NULL, $string = HTML_FORM_INPUT_STRING, $return = 0) +{ + if ($type != NULL && $type) + { + if ($type == "checkbox") + $value = string_encode ($value, 1); + $type = "type=$type"; + } + if ($name != NULL && $name) + $name = "name=$name"; + if ($value != NULL && $value) + { + $value = "value=\"$value\""; + } + if (is_int ($maxlength) && $maxlength >= 0) + $maxlength = "maxlength=$maxlength"; + if (is_int ($size) && $size >= 0) + $size = "size=$size"; + if ($checked != NULL && $checked) + $checked = "checked"; + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_form_textarea ($name = NULL, $rows = NULL, $cols = NULL, $value = NULL, $string = HTML_FORM_TEXTAREA_STRING, $return = 0) +{ + if ($name != NULL && $name) + $name = "name=$name"; + if (is_int ($rows) && $rows >= 0) + $rows = "rows=$rows"; + if (is_int ($cols) && $cols >= 0) + $cols = "cols=$cols"; + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_form_select_begin ($name = NULL, $return = 0) +{ + if ($name != NULL && $name) + $name = "name=$name"; + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_form_option ($value = NULL, $selected = NULL, $return = 0) +{ + if ($selected != NULL && $selected) + $selected = "selected"; + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_form_end ($return = 0) +{ + $rstring = '
'; + return (eor ($rstring, $return)); +} + +function html_nbsp ($times = 1, $return = 0) +{ + if ($times == NULL) + $times = 1; + for ($i = 0; $i != $times; $i++) + { + if ($return) + $rstring .= " "; + else + echo " "; + } + if ($return) + return ($rstring); +} + +function html ($string, $times = 1, $return = 0) +{ + for ($i = 0; $i != $times; $i++) + { + if ($return) + $rstring .= $string; + else + echo $string; + } + if ($return) + return ($rstring); +} + +function html_break ($break, $string = "", $return = 0) +{ + if ($break == 1) + $break = '
'; + if ($break == 2) + $break = '

'; + if ($break == 5) + $break = '


'; + return (eor ($break . $string, $return)); +} + +function html_page_begin ($title = NULL, $return = 0) +{ +// $rstring = HTML_PAGE_BEGIN_BEFORE_TITLE . $title . HTML_PAGE_BEGIN_AFTER_TITLE; + return (eor ($rstring, $return)); +} + +function html_page_body_begin ($bgcolor = HTML_PAGE_BODY_COLOR, $background = NULL, $text = NULL, $link = NULL, $vlink = NULL, $alink = NULL, $string = HTML_PAGE_BODY_STRING, $return = 0) +{ + if ($bgcolor != NULL && $bgcolor) + $bgcolor = "bgcolor=$bgcolor"; + if ($background != NULL && $background) + $background = "background=$background"; + if ($text != NULL && $text) + $text = "text=$text"; + if ($link != NULL && $link) + $link = "link=$link"; + if ($vlink != NULL && $vlink) + $vlink = "vlink=$vlink"; + if ($alink != NULL && $alink) + $alink = "alink=$alink"; +// $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_page_body_end ($return = 0) +{ +// $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_page_end ($return = 0) +{ +// $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_page_close () +{ + global $phpgw; +// html_page_body_end (); +// html_page_end (); + $phpgw->common->phpgw_footer (); + exit; +} +function html_text_bold ($text = NULL, $return = 0, $lang = 0) +{ + if ($lang) + $text = translate ($text); + $rstring = "$text"; + return (eor ($rstring, $return)); +} + +function html_text_underline ($text = NULL, $return = 0, $lang = 0) +{ + if ($lang) + $text = translate ($text); + $rstring = "$text"; + return (eor ($rstring, $return)); +} + +function html_text_italic ($text = NULL, $return = 0, $lang = 0) +{ + if ($lang) + $text = translate ($text); + $rstring = "$text"; + return (eor ($rstring, $return)); +} + +function html_text_summary ($text = NULL, $size = NULL, $return = 0, $lang = 0) +{ + if ($lang) + $text = translate ($text); + $rstring .= html_break (1, NULL, $return); + $rstring .= html_text_bold ($text, $return); + $rstring .= html_nbsp (3, $return); + if ($size != NULL && $size >= 0) + $rstring .= borkb ($size, 1, $return); + if ($return) + return ($rstring); +} + +function html_text_summary_error ($text = NULL, $text2 = NULL, $size = NULL, $return = 0, $lang = 0) +{ + if ($lang) + $text = translate ($lang); + $rstring .= html_text_error ($text, 1, $return); + + if (($text2 != NULL && $text2) || ($size != NULL && $size)) + $rstring .= html_nbsp (3, $return); + if ($text2 != NULL && $text2) + $rstring .= html_text_error ($text2, NULL, $return); + if ($size != NULL && $size >= 0) + $rstring .= borkb ($size, 1, $return); + + if ($return) + return ($rstring); +} + +function html_font_set ($size = NULL, $color = NULL, $family = NULL, $return = 0) +{ + if ($size != NULL && $size) + $size = "size=$size"; + if ($color != NULL && $color) + $color = "color=$color"; + if ($family != NULL && $family) + $family = "family=$family"; + + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_font_end ($return = 0) +{ + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_text_error ($errorwas = NULL, $break = 1, $return = 0) +{ + if ($break) + $rstring .= html_break (1, NULL, 1); + + $rstring .= html_font_set (NULL, HTML_TEXT_ERROR_COLOR, NULL, 1); + $rstring .= html_text_bold (html_text_italic ($errorwas, 1), 1); + $rstring .= html_font_end (1); + return (eor ($rstring, $return)); +} + +function html_page_error ($errorwas = NULL, $title = "Error", $return = 0) +{ + $rstring = html_page_begin ($title, $return); + $rstring .= html_page_body_begin (HTML_PAGE_BODY_COLOR, $return); + $rstring .= html_break (2, NULL, $return); + $rstring .= html_text_error ($errorwas, $return); + $rstring .= html_page_body_end ($return); + $rstring .= html_page_end ($return); + if (!$return) + html_page_close (); + else + return ($rstring); +} + +function html_link ($href = NULL, $text = NULL, $return = 0, $encode = 1) +{ + global $phpgw; + global $sep; + global $appname; + + if ($encode) + $href = string_encode ($href, 1); + ### + # This decodes / back to normal + ### + $href = preg_replace ("/%2F/", "/", $href); + $text = trim ($text); +/* + $rstring = "$text"; +*/ + $href = $sep . $href; + $address = $phpgw->link ($href); + $rstring = "$text"; + return (eor ($rstring, $return)); +} + +function html_link_back ($return) +{ + global $hostname; + global $path; + global $groupinfo; + global $appname; + + $rstring .= html_link ("$appname/index.php?path=$path", HTML_TEXT_NAVIGATION_BACK_TO_USER, 1); + + return (eor ($rstring, $return)); +} + +function html_table_begin ($width = NULL, $border = NULL, $cellspacing = NULL, $cellpadding = NULL, $rules = NULL, $string = HTML_TABLE_BEGIN_STRING, $return = 0) +{ + if ($width != NULL && $width) + $width = "width=$width"; + if (is_int ($border) && $border >= 0) + $border = "border=$border"; + if (is_int ($cellspacing) && $cellspacing >= 0) + $cellspacing = "cellspacing=$cellspacing"; + if (is_int ($cellpadding) && $cellpadding >= 0) + $cellpadding = "cellpadding=$cellpadding"; + if ($rules != NULL && $rules) + $rules = "rules=$rules"; + + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_table_end ($return = 0) +{ + $rstring = "
"; + return (eor ($rstring, $return)); +} + +function html_table_row_begin ($align = NULL, $halign = NULL, $valign = NULL, $bgcolor = NULL, $string = HTML_TABLE_ROW_BEGIN_STRING, $return = 0) +{ + if ($align != NULL && $align) + $align = "align=$align"; + if ($halign != NULL && $halign) + $halign = "halign=$halign"; + if ($valign != NULL && $valign) + $valign = "valign=$valign"; + if ($bgcolor != NULL && $bgcolor) + $bgcolor = "bgcolor=$bgcolor"; + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_table_row_end ($return = 0) +{ + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_table_col_begin ($align = NULL, $halign = NULL, $valign = NULL, $rowspan = NULL, $colspan = NULL, $string = HTML_TABLE_COL_BEGIN_STRING, $return = 0) +{ + if ($align != NULL && $align) + $align = "align=$align"; + if ($halign != NULL && $halign) + $halign = "halign=$halign"; + if ($valign != NULL && $valign) + $valign = "valign=$valign"; + if (is_int ($rowspan) && $rowspan >= 0) + $rowspan = "rowspan=$rowspan"; + if (is_int ($colspan) && $colspan >= 0) + $colspan = "colspan=$colspan"; + + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_table_col_end ($return = 0) +{ + $rstring = ""; + return (eor ($rstring, $return)); +} + +function html_text ($string, $times = 1, $return = 0, $lang = 0) +{ + global $phpgw; + + if ($lang) + $string = translate ($string); + + if ($times == NULL) + $times = 1; + for ($i = 0; $i != $times; $i++) + { + if ($return) + $rstring .= $string; + else + echo $string; + } + if ($return) + return ($rstring); +} + +function html_text_header ($size = 1, $string = NULL, $return = 0, $lang = 0) +{ + $rstring = "$string"; + return (eor ($rstring, $return)); +} + +function html_align ($align = NULL, $string = HTML_ALIGN_MAIN_STRING, $return = 0) +{ + $rstring = "

"; + return (eor ($rstring, $return)); +} + +function html_image ($src = NULL, $alt = NULL, $align = NULL, $border = NULL, $string = HTML_IMAGE_MAIN_STRING, $return = 0) +{ + if ($src != NULL && $src) + $src = "src=$src"; + if ($alt != NULL && $alt) + $alt = "alt=\"$alt\""; + if ($align != NULL && $align) + $align = "align=$align"; + if (is_int ($border) && $border >= 0) + $border = "border=$border"; + $rstring = ""; + return (eor ($rstring, $return)); +} + +?> diff --git a/filemanager/inc/main.inc.php b/filemanager/inc/main.inc.php new file mode 100755 index 0000000000..ecbf7f66c3 --- /dev/null +++ b/filemanager/inc/main.inc.php @@ -0,0 +1,159 @@ +vfs->basedir; +$fakebase = $phpgw->vfs->fakebase; +$hostname = $phpgw_info["server"]["webserver_url"] . $filesdir; +$appname = $phpgw_info["flags"]["currentapp"]; +$settings = $phpgw_info["user"]["preferences"][$appname]; + +### End Configuration Options ### + +define ("NULL", ""); + +require ("./inc/db.inc.php"); + +/* Set up any initial db settings */ +db_init (); + +### +# Get user settings from database +### + +/* We have to define these by hand in phpGW, or rely on it's templates */ + +define ('HTML_TABLE_FILES_HEADER_BG_COLOR', ""); +define ('HTML_TABLE_FILES_HEADER_TEXT_COLOR', "maroon"); +define ('HTML_TABLE_FILES_COLUMN_HEADER_BG_COLOR', ""); +define ('HTML_TABLE_FILES_COLUMN_HEADER_TEXT_COLOR', "maroon"); +define ('HTML_TABLE_FILES_BG_COLOR', ""); +define ('HTML_TABLE_FILES_TEXT_COLOR', "maroon"); +define ('HTML_TEXT_ERROR_COLOR', "red"); +define ('HTML_TEXT_NAVIGATION_BACK_TO_USER', "Back to file manager"); + +### +# Need to include this here so they recognize the settings +### + +require ("./inc/html.inc.php"); + +### +# Define the list of file attributes. Format is "internal_name" => "Displayed name" +# This is used both by internally and externally for things like preferences +### + +$file_attributes = array ("name" => "Filename", "mime_type" => "MIME Type", "size" => "Size", "created" => "Created", "modified" => "Modified", "owner" => "Owner", "createdby_id" => "Created by", "modifiedby_id" => "Created by", "modifiedby_id" => "Modified by", "app" => "Application", "comment" => "Comment"); + +### +# Calculate and display B or KB +# And yes, that first if is strange, +# but it does do something +### + +function borkb ($size, $enclosed = NULL, $return = 0) +{ + if (!$size) + $size = 0; + + if ($enclosed) + { + $left = "("; + $right = ")"; + } + + if ($size < 1024) + $rstring = $left . $size . "B" . $right; + else + $rstring = $left . round($size/1024) . "KB" . $right; + + return (eor ($rstring, $return)); +} + +### +# Check for and return the first unwanted character +### + +function bad_chars ($string, $return = 0) +{ + if (preg_match("-([\\\|/|\||\?|\`|\@|\#|\$|%|\&|\*|\(|\)|\[|\{|\]|\}|\;|\:|\"|\'|\<|\>|\,|\ ])-", $string, $badchars)) + $rstring = $badchars[1]; + + return trim ((eor ($rstring, $return))); +} + +### +# Check for and return the first character that can't be used in a file or directory name +### + +function bad_chars_file ($string, $return = 0) +{ + if (preg_match ("-([\\\|\/|\&|\(|\)])-", $string, $badchars)) + $rstring = $badchars[1]; + + return trim ((eor ($rstring, $return))); +} + +### +# Decide whether to echo or return. Used by HTML functions +### + +function eor ($rstring, $return) +{ + if ($return) + return ($rstring); + else + { + html_text ($rstring . "\n"); + return (0); + } +} + +### +# URL encode a string +# First check if its a query string, then if its just a URL, then just encodes it all +# Note: this is a hack. It was made to work with form actions, form values, and links only, +# but should be able to handle any normal query string or URL +### + +function string_encode ($string, $return) +{ + global $hostname; + + if (preg_match ("/=(.*)(&|$)/U", $string)) + $rstring = preg_replace ("/=(.*)(&|$)/Ue", "'=' . rawurlencode ('\\1') . '\\2'", $string); + elseif (ereg ("^$hostname", $string)) + { + $rstring = ereg_replace ("^$hostname/", "", $string); + $rstring = preg_replace ("/(.*)(\/|$)/Ue", "rawurlencode ('\\1') . '\\2'", $rstring); + $rstring = "$hostname/$rstring"; + } + else + { + $rstring = rawurlencode ($string); + + /* Terrible hack, decodes all /'s back to normal */ + $rstring = preg_replace ("/%2F/", "/", $rstring); + } + + return (eor ($rstring, $return)); +} + +function string_decode ($string, $return) +{ + $rstring = urldecode ($string); + + return (eor ($rstring, $return)); +} + +function translate ($text) +{ + global $phpgw; + + return ($phpgw->lang ($text)); +} + +?> diff --git a/filemanager/index.php b/filemanager/index.php new file mode 100755 index 0000000000..662f9c3963 --- /dev/null +++ b/filemanager/index.php @@ -0,0 +1,989 @@ + "phpwebhosting", + "noheader" => False, + "noappheader" => False, + "enable_vfs_class" => True); +include("../header.inc.php"); + +error_reporting (4); + +### +# Page to process users +# Code is fairly hackish at the beginning, but it gets better +# Highly suggest turning wrapping off due to long SQL queries +### + +### +# Note that $userinfo["username"] is actually the id number, not the login name +### + +$userinfo["username"] = $phpgw_info["user"]["account_id"]; +$userinfo["account_lid"] = $phpgw->accounts->id2name ($userinfo["username"]); +$userinfo["hdspace"] = 10000000000; +$homedir = "$fakebase/$userinfo[account_lid]"; + +### +# Enable this to display some debugging info +### + +$phpwh_debug = 0; + +if ($download && $fileman[0]) +{ + $phpgw->browser->content_header ($fn); + echo $phpgw->vfs->read ($path/$fileman[0]); + $phpgw->common->phpgw_exit (); +} + +### +# Default is to sort by name +### + +if (!$sortby) + $sortby = "name"; + +### +# Some hacks to set and display directory paths correctly +### + +if (!$path) +{ + $path = $phpgw->vfs->pwd (); + if (!$path || $phpgw->vfs->pwd (False) == "") + $path = $homedir; +} + +$extra_dir = substr ($path, strlen ($homedir) + 1); +$phpgw->vfs->cd (False, False, array (RELATIVE_NONE)); +$phpgw->vfs->cd ($path, False, array (RELATIVE_NONE)); + +$pwd = $phpgw->vfs->pwd (); + +if (!$cwd = substr ($path, strlen ($homedir) + 1)) + $cwd = "/"; +else + $cwd = substr ($pwd, strrpos ($pwd, "/") + 1); + +$disppath = $path; + +/* This just prevents // in some cases */ +if ($path == "/") + $dispsep = ""; +else + $dispsep = "/"; + +if (!($lesspath = substr ($path, 0, strrpos ($path, "/")))) + $lesspath = "/"; + +$now = date ("Y-m-d"); + +//This will hopefully be replaced by a session management working_id +//if (!$phpgw->vfs->working_id = preg_replace ("/\$fakebase\/(.*)\/(.*)$/U", "\\1", $path)) + +$userinfo["working_id"] = $phpgw->vfs->working_id; +$userinfo["working_lid"] = $phpgw->accounts->id2name ($userinfo["working_id"]); + +if ($phpwh_debug) +{ + echo "PHPWebHosting debug:
+ path: $path
+ disppath: $disppath
+ cwd: $cwd
+ lesspath: $lesspath +

+ phpGW debug:
+ real getabsolutepath: " . $phpgw->vfs->getabsolutepath (False, False, False) . "
+ fake getabsolutepath: " . $phpgw->vfs->getabsolutepath (False) . "
+ appsession: " . $phpgw->common->appsession () . "
+ pwd: " . $phpgw->vfs->pwd () . "
"; +} + +### +# Verify path is real +### + +if ($path != $homedir && $path != "/" && $path != $fakebase) +{ + if ($phpwh_debug) + { + echo "SELECT name FROM phpgw_vfs WHERE owner_id = '$userinfo[username]' AND name = '$cwd' AND mime_type = 'Directory' AND directory = '$lesspath'
"; + } + + $query = db_query ("SELECT name FROM phpgw_vfs WHERE owner_id = '$userinfo[username]' AND name = '$cwd' AND mime_type = 'Directory' AND directory = '$lesspath'"); + if (!$phpgw->db->next_record ($query)) + { + html_text_error ("Directory $dir does not exist", 1); + html_break (2); + html_link ("$appname/index.php?path=$homedir", "Go to your home directory"); + html_break (2); + html_link_back (); + html_page_close (); + } +} + +### +# Read in file info from database to use in the rest of the script +# $files in the loop below uses $query +### + +$files_query = db_query ("SELECT * FROM phpgw_vfs WHERE owner_id = '$userinfo[username]' AND directory = '$path' AND name != '' ORDER BY $sortby"); +$numoffiles = db_call ("affected_rows", $files_query); + +### +# Start Main Page +### + +if ($op != "changeinfo" && $op != "logout" && $op != "delete") +{ + html_page_begin ("Users :: $userinfo[username]"); + html_page_body_begin (HTML_PAGE_BODY_COLOR); +} + +### +# Start Main Table +### + +if (!$op && !$delete && !$createdir && !$renamefiles && !$move && !$copy && !$edit && !$comment_files) +{ + html_table_begin ("100%"); + html_table_row_begin (); + html_table_col_begin ("center", NULL, "top"); + html_align ("center"); + html_form_begin ("$appname/index.php?path=$path"); + if ($numoffiles || $cwd) + { + while (list ($num, $name) = each ($settings)) + { + if ($name) + $columns++; + } + $columns++; + html_table_begin (); + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_HEADER_BG_COLOR); + html_table_col_begin ("center", NULL, NULL, NULL, $columns); + html_table_begin ("100%"); + html_table_row_begin (); + html_table_col_begin ("left"); + + if ($path != "/") + html_link ("$appname/index.php?path=$lesspath", html_image ("images/folder-up.gif", "Up", "left", 0, NULL, 1)); + + html_table_col_end (); + html_table_col_begin ("center"); + + if ($cwd) + { + if ($path == $homedir) + html_image ("images/folder-home.gif", "Folder", "center"); + else + html_image ("images/folder.gif", "Folder", "center"); + } + else + html_image ("images/folder-home.gif", "Home"); + + html_font_set (4, HTML_TABLE_FILES_HEADER_TEXT_COLOR); + html_text_bold (strtoupper ($disppath)); + html_font_end (); + html_table_col_end (); + html_table_col_begin ("right"); + + if ($path != $homedir) + html_link ("$appname/index.php?path=$homedir", html_image ("images/folder-home.gif", "Home", "right", 0, NULL, 1)); + + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_table_col_end (); + html_table_row_end (); + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_COLUMN_HEADER_BG_COLOR); + + ### + # Start File Table Column Headers + # Reads values from $file_attributes array and preferences + ### + + html_table_col_begin (); + html_text ("Sort by:" . html_nbsp (1, 1), NULL, NULL, 1); + html_table_col_end (); + + reset ($file_attributes); + while (list ($internal, $displayed) = each ($file_attributes)) + { + if ($settings[$internal]) + { + html_table_col_begin (); + html_link ("$appname/index.php?path=$path&sortby=$internal", html_text_bold ("$displayed", 1, 1)); + html_table_col_end (); + } + } + + html_table_col_begin (); + html_table_col_end (); + html_table_row_end (); + + if ($settings["dotdot"] && $settings["name"] && $path != "/") + { + html_table_row_begin (); + html_table_col_begin (); + html_table_col_end (); + + /* We can assume the next column is the name */ + html_table_col_begin (); + html_image ("images/folder.gif", "Folder"); + html_link ("$appname/index.php?path=$lesspath", ".."); + html_table_col_end (); + + if ($settings["mime_type"]) + { + html_table_col_begin (); + html_text ("Directory"); + html_table_col_end (); + } + + html_table_row_end (); + } + + ### + # List all of the files, with their attributes + ### + + for ($i = 0; $i != $numoffiles; $i++) + { + $files = db_fetch_array ($files_query); + + if ($rename || $edit_comments) + { + unset ($this_selected); + unset ($renamethis); + unset ($edit_this_comment); + + for ($j = 0; $j != $numoffiles; $j++) + { + if ($fileman[$j] == string_encode ($files["name"], 1)) + { + $this_selected = 1; + break; + } + } + + if ($rename && $this_selected) + $renamethis = 1; + elseif ($edit_comments && $this_selected) + $edit_this_comment = 1; + } + + if (!$settings["dotfiles"] && ereg ("^\.", $files["name"])) + { + continue; + } + + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_BG_COLOR); + + ### + # Checkboxes + ### + + html_table_col_begin ("right"); + + if (!$rename && !$edit_comments) + html_form_input ("checkbox", "fileman[$i]", "$files[name]"); + elseif ($renamethis) + html_form_input ("hidden", "fileman[" . string_encode ($files[name], 1) . "]", "$files[name]", NULL, NULL, "checked"); + else + html_nbsp; + + html_table_col_end (); + + ### + # File name and icon + ### + + if ($settings["name"]) + { + html_table_col_begin (); + + if ($renamethis) + { + if ($files["mime_type"] == "Directory") + html_image ("images/folder.gif", "Folder"); + html_form_input ("text", "renamefiles[" . string_encode ($files[name], 1) . "]", "$files[name]", 255); + } + else + { + if ($files["mime_type"] == "Directory") + { + html_image ("images/folder.gif", "Folder"); + html_link ("$appname/index.php?path=$path$dispsep$files[name]", $files["name"]); + } + else + { + html_link ("$filesdir$pwd/$files[name]", $files["name"]); + } + } + + html_table_col_end (); + } + + ### + # MIME type + ### + + if ($settings["mime_type"]) + { + html_table_col_begin (); + html_text ($files["mime_type"]); + html_table_col_end (); + } + + ### + # File size + ### + + if ($settings["size"]) + { + html_table_col_begin (); + + if ($files["mime_type"] == "Directory") + { + $size_query = db_query ("SELECT SUM(size) FROM phpgw_vfs WHERE owner_id = '$userinfo[username]' AND directory RLIKE '^$disppath/$files[name]'"); + $fileinfo = db_fetch_array ($size_query); + db_call ("free", $size_query); + if ($fileinfo[0]) + borkb ($fileinfo[0]+1024); + else + echo "1KB"; + } + else + borkb ($files["size"]); + + html_table_col_end (); + } + + ### + # Date created + ### + if ($settings["created"]) + { + html_table_col_begin (); + html_text ($files["created"]); + html_table_col_end (); + } + + ### + # Date modified + ### + + if ($settings["modified"]) + { + html_table_col_begin (); + if ($files["modified"] != "0000-00-00") + html_text ($files["modified"]); + html_table_col_end (); + } + + ### + # Owner name + ### + + if ($settings["owner"]) + { + html_table_col_begin (); + html_text ($phpgw->accounts->id2name ($files["owner_id"])); + html_table_col_end (); + } + + ### + # Creator name + ### + + if ($settings["createdby_id"]) + { + html_table_col_begin (); + html_text ($phpgw->accounts->id2name ($files["createdby_id"])); + html_table_col_end (); + } + + ### + # Modified by name + ### + + if ($settings["modifiedby_id"]) + { + html_table_col_begin (); + html_text ($phpgw->accounts->id2name ($files["modifiedby_id"])); + html_table_col_end (); + } + + ### + # Application + ### + + if ($settings["app"]) + { + html_table_col_begin (); + html_text ($files["app"]); + html_table_col_end (); + } + + ### + # Comment + ### + + if ($settings["comment"]) + { + html_table_col_begin (); + if ($edit_this_comment) + { + html_form_input ("text", "comment_files[" . string_encode ($files[name], 1) . "]", "$files[comment]", 255); + } + else + { + html_text ($files["comment"]); + } + html_table_col_end (); + } + + ### + # Deleteable (currently not used) + ### + + if ($settings["deleteable"]) + { + if ($files["deleteable"] == "N") + { + html_table_col_begin (); + html_image ("images/locked.gif", "Locked"); + html_table_col_end (); + } + else + { + html_table_col_begin (); + html_table_col_end (); + } + } + + html_table_row_end (); + + if ($files["mime_type"] == "Directory") + { + $usedspace += $fileinfo[0]; + } + else + { + $usedspace += $files["size"]; + } + } + + html_table_end (); + html_break (2); + + if (!$rename && !$edit_comments) + { + html_form_input ("submit", "edit", "Edit"); + html_nbsp (3); + } + + if (!$edit_comments) + { + html_form_input ("submit", "rename", "Rename"); + html_nbsp (3); + } + + if (!$rename && !$edit_comments) + { + html_form_input ("submit", "delete", "Delete"); + html_nbsp (3); + } + + if (!$rename) + { + html_form_input ("submit", "edit_comments", "Edit comments"); + } + } + + ### + # Display some inputs and info, but not when renaming or editing comments + ### + + if (!$rename && !$edit_comments) + { + ### + # Begin Copy to/Move to selection + ### + + html_break (1); + html_form_input ("submit", "copy", "Copy to:"); + + html_form_input ("submit", "move", "Move to:"); + html_form_select_begin ("todir"); + + $query3 = db_query ("SELECT name, directory FROM phpgw_vfs WHERE owner_id = '$userinfo[username]' AND mime_type = 'Directory' ORDER BY name"); + while ($dirs = db_fetch_array ($query3)) + { + ### + # So we don't display // + ### + + if ($dirs["directory"] != '/') + { + $dirs["directory"] .= '/'; + } + + ### + # No point in displaying the current directory + ### + + if (($dirs["directory"] . $dirs["name"]) != $path) + { + html_form_option ($dirs["directory"] . $dirs["name"]); + } + } + + html_form_select_end (); + + html_break (1); + html_form_input ("submit", "download", "Download"); + html_nbsp (3); + + html_form_input ("text", "createdir", NULL, 255, 15); + html_form_input ("submit", "newdir", "Create Folder"); + + html_form_end (); + + html_break (1); + html_text_bold ("Files: "); + html_text ($numoffiles); + html_nbsp (3); + + html_text_bold ("Used space: "); + html_text (borkb ($usedspace, NULL, 1)); + html_nbsp (3); + + if ($path == $homedir) + { + html_text_bold ("Unused space: "); + html_text (borkb ($userinfo["hdspace"] - $usedspace, NULL, 1)); + + $query4 = db_query ("SELECT name FROM phpgw_vfs WHERE owner_id = '$userinfo[username]'"); + $i = db_call ("affected_rows", $query4); + + html_break (2); + html_text_bold ("Total Files: "); + html_text ($i); + } + + ### + # Show file upload boxes. Note the last argument to html (). Repeats 5 times + ### + + html_break (2); + html_form_begin ("$appname/index.php?op=upload&path=$path", "post", "multipart/form-data"); + html_table_begin (); + html_table_row_begin ("center"); + html_table_col_begin (); + html_text_bold ("File"); + html_table_col_end (); + html_table_col_begin (); + html_text_bold ("Comment"); + html_table_col_end (); + html_table_row_end (); + + html_table_row_begin (); + html_table_col_begin (); + html (html_form_input ("file", "file[]", NULL, 255, NULL, NULL, NULL, 1) . html_break (1, NULL, 1), 5); + html_table_col_end (); + html_table_col_begin (); + html (html_form_input ("text", "comment[]", NULL, NULL, NULL, NULL, NULL, 1) . html_break (1, NULL, 1), 5); + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_form_input ("submit", "upload_files", "Upload files"); + html_form_end (); + } + + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_page_close (); +} + +### +# Handle Editing files +### + +if ($edit) +{ + ### + # If $edit is "Edit", we do nothing, and let the for loop take over + ### + + if ($edit_preview) + { + $content = $$edit_file; + + html_break (1); + html_text_bold ("Preview of $path/$edit_file"); + html_break (2); + + html_table_begin ("90%"); + html_table_row_begin (); + html_table_col_begin (); + html_text (nl2br ($content)); + html_table_col_end (); + html_table_row_end (); + html_table_end (); + } + elseif ($edit_save) + { + $content = $$edit_file; + + if ($phpgw->vfs->write ($edit_file, $content)) + { + html_text_bold ("Saved $path/$edit_file"); + html_break (2); + } + else + { + html_text_error ("Could not save $path/$edit_file"); + html_break (2); + } + } + +/* This doesn't work just yet + elseif ($edit_save_all) + { + for ($j = 0; $j != $numoffiles; $j++) + { + $content = $$fileman[$j]; + echo "fileman[$j]: $fileman[$j]
$content
"; + continue; + + if ($phpgw->vfs->write ($fileman[$j], $content)) + { + html_text_bold ("Saved $path/$fileman[$j]"); + html_break (1); + } + else + { + html_text_error ("Could not save $path/$fileman[$j]"); + html_break (1); + } + } + + html_break (1); + } +*/ + + ### + # Now we display the edit boxes and forms + ### + + for ($j = 0; $j != $numoffiles; $j++) + { + if ($content = $phpgw->vfs->read ($fileman[$j])) + { + html_table_begin ("100%"); + html_form_begin ("$appname/index.php?path=$path"); + html_form_input ("hidden", "edit", True); + html_form_input ("hidden", "edit_file", "$fileman[$j]"); + + ### + # We need to include all of the fileman entries for each file's form, + # so we loop through again + ### + + for ($i = 0; $i != $numoffiles; $i++) + { + html_form_input ("hidden", "fileman[$i]", "$fileman[$i]"); + } + + html_table_row_begin (); + html_table_col_begin (); + html_form_textarea ($fileman[$j], 35, 75, $content); + html_table_col_end (); + html_table_col_begin ("center"); + html_form_input ("submit", "edit_preview", "Preview $fileman[$j]"); + html_break (1); + html_form_input ("submit", "edit_save", "Save $fileman[$j]"); +// html_break (1); +// html_form_input ("submit", "edit_save_all", "Save all"); + html_table_col_end (); + html_table_row_end (); + html_break (2); + html_form_end (); + html_table_end (); + } + } +} + +### +# Handle File Uploads +### + +elseif ($op == "upload") +{ + for ($i = 0; $i != 5; $i++) + { + if ($file_size[$i] != 0) + { + ### + # Check to see if the file exists in the database + ### + + $query = db_query ("SELECT * FROM phpgw_vfs WHERE name = '$file_name[$i]' AND owner_id = '$userinfo[username]' AND directory = '$path'"); + + if ($fileinfo = db_fetch_array ($query)) + { + if ($fileinfo["mime_type"] == "Directory") + { + html_text_summary_error ("Cannot replace $fileinfo[name] because it is a directory"); + continue; + } + + $query = db_query ("SELECT SUM(size) FROM phpgw_vfs WHERE owner_id = '$userinfo[username]' AND name != '$file_name[$i]'"); + $files = db_fetch_array ($query); + $usedspace = $files[0]; + + if (($file_size[$i] + $usedspace) > $userinfo["hdspace"]) + { + html_text_summary_error ("Sorry, you do not have enough space to upload those files"); + continue; + } + + if ($fileinfo["deleteable"] != "N") + { + $phpgw->vfs->set_attributes ($file_name[$i], array ("owner_id" => $userinfo["username"], "modifiedby_id" => $userinfo["username"], "modified" => $now, "size" => $file_size[$i], mime_type => $file_type[$i], "deleteable" => "Y", "comment" => $comment[$i]), array (RELATIVE_ALL)); + $phpgw->vfs->cp ($file[$i], "$file_name[$i]", array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)); + + html_text_summary ("Replaced $disppath/$file_name[$i]", $file_size[$i]); + } + } + else + { + $query = db_query ("SELECT SUM(size) FROM phpgw_vfs WHERE owner_id = '$userinfo[username]'"); + $files = db_fetch_array ($query); + $usedspace = $files[0]; + + if (($file_size[$i] + $usedspace) > $userinfo["hdspace"]) + { + html_text_summary_error ("Not enough space to upload $file_name[$i]", NULL, $file_size[$i]); + continue; + } + + $phpgw->vfs->cp ($file[$i], $file_name[$i], array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)); + $phpgw->vfs->set_attributes ($file_name[$i], array ("mime_type" => $file_type[$i], "comment" => $comment[$i]), array (RELATIVE_ALL)); + + html_text_summary ("Created $disppath/$file_name[$i]", $file_size[$i]); + } + } + } + + html_break (2); + html_link_back (); +} + +### +# Handle Editing comments +### + +elseif ($comment_files) +{ + while (list ($file) = each ($comment_files)) + { + $phpgw->vfs->set_attributes ($file, array ("comment" => $comment_files[$file])); + + html_text_summary ("Updated comment for $path/$file"); + } + + html_break (2); + html_link_back (); +} + +### +# Handle Renaming Files and Directories +### + +elseif ($renamefiles) +{ + while (list ($file) = each ($renamefiles)) + { + $file_decoded = string_decode ($file, 1); + + if (ereg ("/", $renamefiles[$file])) + { + echo $phpgw->common->error_list (array ("File names cannot contain /")); + } + elseif (!$phpgw->vfs->mv ($file_decoded, $renamefiles[$file])) + { + echo $phpgw->common->error_list (array ("Could not rename $disppath/$file_decoded to $disppath/$renamefiles[$file]")); + } + else + { + html_text_summary ("Renamed $disppath/$file_decoded to $disppath/$renamefiles[$file]"); + } + } + + html_break (2); + html_link_back (); +} + +### +# Handle Moving Files and Directories +### + +elseif ($move) +{ + while (list ($num, $file) = each ($fileman)) + { + $file_decoded = string_decode ($file, 1); + if ($phpgw->vfs->mv ($file_decoded, $todir . "/" . $file_decoded, array (RELATIVE_ALL, RELATIVE_NONE))) + { + $moved++; + html_text_summary ("Moved $disppath/$file_decoded to $todir/$file_decoded"); + } + else + { + echo $phpgw->common->error_list (array ("Could not move $disppath/$file_decoded to $todir/$file_decoded")); + } + } + + if ($moved) + { + html_break (2); + html_link ("$appname/index.php?path=$todir", "Go to $todir"); + } + + html_break (2); + html_link_back (); +} + +### +# Handle Copying of Files and Directories +### + +elseif ($copy) +{ + while (list ($num, $file) = each ($fileman)) + { + $file_decoded = string_decode ($file, 1); + + if ($phpgw->vfs->cp ($file_decoded, $todir . "/" . $file_decoded, array (RELATIVE_ALL, RELATIVE_NONE))) + { + $copied++; + html_text_summary ("Copied $disppath/$file_decoded to $todir/$file_decoded"); + } + else + { + echo $phpgw->common->error_list (array ("Could not copy $disppath/$file_decoded to $todir/$file_decoded")); + } + } + + if ($copied) + { + html_break (2); + html_link ("$appname/index.php?path=$todir", "Go to $todir"); + } + + html_break (2); + html_link_back (); +} + +### +# Handle Deleting Files and Directories +### + +elseif ($delete) +{ + $query = db_query ("SELECT name FROM phpgw_vfs WHERE owner_id = '$userinfo[username]'"); + $numoffiles = db_call ("affected_rows", $query); + for ($i = 0; $i != $numoffiles; $i++) + { + if ($fileman[$i]) + { + ### + # There is no need to create a separate $fileman_decode variable, because it will never be passed again + ### + + $fileman[$i] = string_decode ($fileman[$i], 1); + + if ($phpgw->vfs->delete ($fileman[$i])) + { + html_text_summary ("Deleted $disppath/$fileman[$i]", $fileinfo["size"]); + } + else + { + $phpgw->common->error_list (array ("Could not delete $disppath/$fileman[$i]")); + } + } + } + + html_break (2); + html_link_back (); +} + +elseif ($newdir && $createdir) +{ + if ($badchar = bad_chars_file ($createdir, 1)) + { + html_text_summary_error ("Cannot create directory $createdir   (name contains \"$badchar\")"); + html_break (2); + html_link_back (); + html_page_close (); + } + + if ($createdir[strlen($createdir)-1] == " " || $createdir[0] == " ") + { + html_text_summary_error ("Cannot create directory $createdir because it begins or ends in a space", 1); + html_break (2); + html_link_back (); + html_page_close (); + } + + $query = db_query ("SELECT name,mime_type FROM phpgw_vfs WHERE name = '$createdir' AND owner_id = '$userinfo[username]' AND directory = '$path'"); + if ($fileinfo = db_fetch_array ($query)) + { + if ($fileinfo[1] != "Directory") + { + html_text_summary_error ("$fileinfo[0] already exists as a file"); + html_break (2); + html_link_back (); + html_page_close (); + } + else + { + html_text_summary_error ("Directory $fileinfo[0] already exists"); + html_break (2); + html_link_back (); + html_page_close (); + } + } + else + { + $query = db_query ("SELECT SUM(size) FROM phpgw_vfs WHERE owner_id = '$userinfo[username]' AND name != '$file_name[$i]'"); + $files = db_fetch_array ($query); + $usedspace = $files[0]; + + if (($usedspace + 1024) > $userinfo["hdspace"]) + { + html_text_summary_error ("Sorry, you do not have enough space to create a new directory", 1); + html_page_close (); + } + + if ($phpgw->vfs->mkdir ($createdir)) + { + html_text_summary ("Created directory $disppath/$createdir"); + html_break (2); + html_link ("$appname/index.php?path=$disppath/$createdir", "Go to $disppath/$createdir"); + } + else + echo $phpgw->common->error_list (array ("Could not create $disppath/$createdir")); + } + + html_break (2); + html_link_back (); +} + +html_page_close (); + +?> diff --git a/filemanager/login.php b/filemanager/login.php new file mode 100755 index 0000000000..3b116231ec --- /dev/null +++ b/filemanager/login.php @@ -0,0 +1,48 @@ + diff --git a/filemanager/preferences.php b/filemanager/preferences.php new file mode 100644 index 0000000000..63bd3f9135 --- /dev/null +++ b/filemanager/preferences.php @@ -0,0 +1,108 @@ + "phpwebhosting", "enable_nextmatchs_class" => True, "noheader" => True, "nonavbar" => True); + include("../header.inc.php"); + + /* + To add a preference, just add it here. Key is internal name, value is displayed name + */ + $other_checkboxes = array ("dotdot" => "Show ..", "dotfiles" => "Show .files"); + + if ($submit) + { + $phpgw->preferences->read_repository (); + + reset ($file_attributes); + while (list ($internal, $displayed) = each ($file_attributes)) + { + $phpgw->preferences->add ($phpgw_info["flags"]["currentapp"], $internal, $$internal); + } + + reset ($other_checkboxes); + while (list ($internal, $displayed) = each ($other_checkboxes)) + { + $phpgw->preferences->add ($phpgw_info["flags"]["currentapp"], $internal, $$internal); + } + + $phpgw->preferences->save_repository (True); + + Header('Location: '.$phpgw->link('/preferences/index.php')); + $phpgw->common->phpgw_exit(); + } + + function display_item ($field,$data) + { + global $phpgw, $p, $tr_color; + + $tr_color = $phpgw->nextmatchs->alternate_row_color ($tr_color); + $var = array ( + 'bg_color' => $tr_color, + 'field' => $field, + 'data' => $data + ); + $p->set_var ($var); + $p->parse ('row', 'pref_list', True); + } + + $phpgw->common->phpgw_header (); + echo parse_navbar (); + + $p = CreateObject ('phpgwapi.Template', $phpgw->common->get_tpl_dir ('phpwebhosting')); + $templates = array ( + 'pref' => 'pref.tpl', + 'pref_colspan' => 'pref_colspan.tpl', + 'pref_list' => 'pref_list.tpl', + ); + $p->set_file ($templates); + + $var = array ( + 'title' => lang ('PHPWebHosting preferences'), + 'action_url' => $phpgw->link ('/' . $phpgw_info['flags']['currentapp'] . '/preferences.php'), + 'bg_color' => $phpgw_info['theme']['th_bg'], + 'submit_lang' => lang ('submit') + ); + + $p->set_var ($var); + $p->set_var ('text', ' '); + $p->parse ('row', 'pref_colspan', True); + + if ($totalerrors) + { + echo '

' . $phpgw->common->error_list($errors) . '
'; + } + + while (list ($internal, $displayed) = each ($file_attributes)) + { + unset ($checked); + if ($phpgw_info["user"]["preferences"]["phpwebhosting"][$internal]) + $checked = 1; + + $str .= html_form_input ("checkbox", $internal, NULL, NULL, NULL, $checked, NULL, 1) . " $displayed" . html_break (1, NULL, 1); + } + + display_item (lang ('Display attributes'), $str); + + while (list ($internal, $displayed) = each ($other_checkboxes)) + { + unset ($checked); + if ($phpgw_info["user"]["preferences"]["phpwebhosting"][$internal]) + $checked = 1; + + $str = html_form_input ("checkbox", $internal, NULL, NULL, NULL, $checked, NULL, 1); + display_item (lang ($displayed), $str); + } + + $p->pparse ('out', 'pref'); + $phpgw->common->phpgw_footer (); +?> diff --git a/filemanager/templates/default/column_title.tpl b/filemanager/templates/default/column_title.tpl new file mode 100755 index 0000000000..0d74e5059e --- /dev/null +++ b/filemanager/templates/default/column_title.tpl @@ -0,0 +1,2 @@ + + {col_title} diff --git a/filemanager/templates/default/day.tpl b/filemanager/templates/default/day.tpl new file mode 100755 index 0000000000..b7b9d13af4 --- /dev/null +++ b/filemanager/templates/default/day.tpl @@ -0,0 +1,32 @@ + +{printer_friendly} + + + + + + + + +
+
+ + + + +
+ {date}
+ {username} +
+ + + + +
+ {daily_events} +
+
+ {small_calendar} +
+{print} + diff --git a/filemanager/templates/default/day_cal.tpl b/filemanager/templates/default/day_cal.tpl new file mode 100755 index 0000000000..7e7f504053 --- /dev/null +++ b/filemanager/templates/default/day_cal.tpl @@ -0,0 +1,33 @@ + + + + + +{row} +
+ diff --git a/filemanager/templates/default/day_row.tpl b/filemanager/templates/default/day_row.tpl new file mode 100755 index 0000000000..729c1c6535 --- /dev/null +++ b/filemanager/templates/default/day_row.tpl @@ -0,0 +1,7 @@ + + + + {event} + {open_link}{time}{close_link} + + diff --git a/filemanager/templates/default/day_row_event.tpl b/filemanager/templates/default/day_row_event.tpl new file mode 100755 index 0000000000..f0f8c7023b --- /dev/null +++ b/filemanager/templates/default/day_row_event.tpl @@ -0,0 +1,3 @@ + + {event} + diff --git a/filemanager/templates/default/day_row_time.tpl b/filemanager/templates/default/day_row_time.tpl new file mode 100755 index 0000000000..7e1142f88c --- /dev/null +++ b/filemanager/templates/default/day_row_time.tpl @@ -0,0 +1,3 @@ + +
{open_link}{time}{close_link}
+ diff --git a/filemanager/templates/default/edit.tpl b/filemanager/templates/default/edit.tpl new file mode 100755 index 0000000000..8d334100aa --- /dev/null +++ b/filemanager/templates/default/edit.tpl @@ -0,0 +1,28 @@ + + + +
+

{calendar_action}

+ +
+{common_hidden} + + + + + + +{output} + + +
+

{errormsg}

+
+
+ +
+ +{delete_button} +
+ + diff --git a/filemanager/templates/default/footer.tpl b/filemanager/templates/default/footer.tpl new file mode 100755 index 0000000000..80db9b5e24 --- /dev/null +++ b/filemanager/templates/default/footer.tpl @@ -0,0 +1,8 @@ +
+
+ + + +{output} + +
diff --git a/filemanager/templates/default/footer_column.tpl b/filemanager/templates/default/footer_column.tpl new file mode 100755 index 0000000000..3846a016ec --- /dev/null +++ b/filemanager/templates/default/footer_column.tpl @@ -0,0 +1,13 @@ + + +
+ {label}: + + +
+
+ + + diff --git a/filemanager/templates/default/form_button_script.tpl b/filemanager/templates/default/form_button_script.tpl new file mode 100755 index 0000000000..8bcb0ea363 --- /dev/null +++ b/filemanager/templates/default/form_button_script.tpl @@ -0,0 +1,6 @@ + + +
+ +
+ diff --git a/filemanager/templates/default/hr.tpl b/filemanager/templates/default/hr.tpl new file mode 100755 index 0000000000..fdbb59c224 --- /dev/null +++ b/filemanager/templates/default/hr.tpl @@ -0,0 +1,7 @@ + + + + {hr_text} + + + diff --git a/filemanager/templates/default/images/navbar.gif b/filemanager/templates/default/images/navbar.gif new file mode 100755 index 0000000000000000000000000000000000000000..843874f7224c4475df1975cbb084891ca4400774 GIT binary patch literal 1097 zcmZ?wbhEHb6k!lyc+S9(7-Zw`Y8v6|aDGwjVpU(}ru_*b#%+&9P8~)vz(^eKyQd0Wk$B$2+KD~ec{?)5j2M+9= z(AiQF>roYLTac5P6XkJjPW0`y`9(z~pFe+o@#4j!N008@xpU>pmBWV*x3sjbS+i!| zym`ryK|5;P^YaTne*Ad+_;EL9`^xgNbLY;TIB{a{-o3@eC9BKbb93`PeE1L&5_10h zc|T8=gh1CIH|wgZs)Gj)?%cU^!-fsTC8ev%-LtZ?U%!6+{P}Ye6BBP&`g1hzOiNbDEWrW^z)Zv9YP1u1;KB-2MCa_wU~?BQ4e1+A?FtjEt-5;V|RD=!i5XHyu7AN znZn4(WMgC7+S=ON+nbq{rKzbM6B8R19X%t%PEb%-Ls9_fsu2zpf3h%gG5lxHVE_V9 zo?zhk$MB!?54*yF1I-+QToMio8X8*!{>wT{a5%`s#w){7Bk)nag+oX!U`4`1rZyfa zvw{YWh0g5!@(wKmhD|P#MsjPHv_;X28wVG+ z_scspaXhprIMF5Q5+Pz(#NsKW>OI4x@KERjVWogYH8T`axu$9fuW8uPwDj$MohX%@ zhnJ3?7B}!b)FJ7-tS8<${lb#K&27H3_4Do>=u}?*{-CAXiVG`~pYzSLsrvTe<>TX@ z57;;CV%gNZ+)U1~nZwZVaaDq%bNf35uNJoR(yrYSrbRp#1?Ra>P?DT((s`+9Kl5Ds zRVsgbmwL}wr|x{GNn`Rd-wun?Pa^Xwk2lVDXcaPD^`7~SpyyPh(pUd}x2#xV6yU&M F4FFilnil{7 literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/index.tpl b/filemanager/templates/default/index.tpl new file mode 100755 index 0000000000..bf14986f4e --- /dev/null +++ b/filemanager/templates/default/index.tpl @@ -0,0 +1,29 @@ + +{printer_friendly} + + + + + + + + + +
+ {small_calendar_prev} + + {month_identifier} +
{username}
+
+ {small_calendar_next} +
+{large_month} +

+

+{print} + diff --git a/filemanager/templates/default/link_pict.tpl b/filemanager/templates/default/link_pict.tpl new file mode 100755 index 0000000000..fe1c2e4c90 --- /dev/null +++ b/filemanager/templates/default/link_pict.tpl @@ -0,0 +1,4 @@ + + + {description} + diff --git a/filemanager/templates/default/list.tpl b/filemanager/templates/default/list.tpl new file mode 100755 index 0000000000..0ad7059a4e --- /dev/null +++ b/filemanager/templates/default/list.tpl @@ -0,0 +1,7 @@ + + + + {field}: + {data} + + diff --git a/filemanager/templates/default/matrix_query.tpl b/filemanager/templates/default/matrix_query.tpl new file mode 100755 index 0000000000..391217d70c --- /dev/null +++ b/filemanager/templates/default/matrix_query.tpl @@ -0,0 +1,19 @@ + + +

+

{matrix_action}

+ +
+ + + +{output} + + +
+ +
+{cancel_button} +
+ + diff --git a/filemanager/templates/default/mini_cal.tpl b/filemanager/templates/default/mini_cal.tpl new file mode 100755 index 0000000000..dfb3978607 --- /dev/null +++ b/filemanager/templates/default/mini_cal.tpl @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
    {month}  
+ + {daynames} + {display_monthweek} +
+
+ + diff --git a/filemanager/templates/default/mini_day.tpl b/filemanager/templates/default/mini_day.tpl new file mode 100755 index 0000000000..a52269bb69 --- /dev/null +++ b/filemanager/templates/default/mini_day.tpl @@ -0,0 +1,4 @@ + + + {dayname} + diff --git a/filemanager/templates/default/mini_week.tpl b/filemanager/templates/default/mini_week.tpl new file mode 100755 index 0000000000..5625f51e29 --- /dev/null +++ b/filemanager/templates/default/mini_week.tpl @@ -0,0 +1,5 @@ + + + {monthweek_day} + + diff --git a/filemanager/templates/default/month.tpl b/filemanager/templates/default/month.tpl new file mode 100755 index 0000000000..522a79dab1 --- /dev/null +++ b/filemanager/templates/default/month.tpl @@ -0,0 +1,6 @@ + + + {row} +
+ + diff --git a/filemanager/templates/default/month_column.tpl b/filemanager/templates/default/month_column.tpl new file mode 100755 index 0000000000..813fd3399c --- /dev/null +++ b/filemanager/templates/default/month_column.tpl @@ -0,0 +1,5 @@ + + +{column_data} + + diff --git a/filemanager/templates/default/month_day.tpl b/filemanager/templates/default/month_day.tpl new file mode 100755 index 0000000000..e553084c5c --- /dev/null +++ b/filemanager/templates/default/month_day.tpl @@ -0,0 +1,4 @@ + + {new_event_link} +[ {day_number} ]
+ diff --git a/filemanager/templates/default/month_filler.tpl b/filemanager/templates/default/month_filler.tpl new file mode 100755 index 0000000000..b36797fba9 --- /dev/null +++ b/filemanager/templates/default/month_filler.tpl @@ -0,0 +1,2 @@ + +{month_filler_text} diff --git a/filemanager/templates/default/month_header.tpl b/filemanager/templates/default/month_header.tpl new file mode 100755 index 0000000000..9bff1cc1bb --- /dev/null +++ b/filemanager/templates/default/month_header.tpl @@ -0,0 +1,3 @@ + + +{column_header} diff --git a/filemanager/templates/default/overlap.tpl b/filemanager/templates/default/overlap.tpl new file mode 100755 index 0000000000..a1e8563cc3 --- /dev/null +++ b/filemanager/templates/default/overlap.tpl @@ -0,0 +1,14 @@ + + +
+

+ Scheduling Conflict +

+ + + +
{overlap_text}
    {overlap_list}
+ {resubmit_button} + {reedit_button} +
+ diff --git a/filemanager/templates/default/pref.tpl b/filemanager/templates/default/pref.tpl new file mode 100755 index 0000000000..34b48b1c9d --- /dev/null +++ b/filemanager/templates/default/pref.tpl @@ -0,0 +1,7 @@ +

{title}:


+

+ + {row} +
+
+
diff --git a/filemanager/templates/default/pref_colspan.tpl b/filemanager/templates/default/pref_colspan.tpl new file mode 100755 index 0000000000..e6fae732b8 --- /dev/null +++ b/filemanager/templates/default/pref_colspan.tpl @@ -0,0 +1,4 @@ + + {text} + + diff --git a/filemanager/templates/default/pref_list.tpl b/filemanager/templates/default/pref_list.tpl new file mode 100755 index 0000000000..e8542cfbd1 --- /dev/null +++ b/filemanager/templates/default/pref_list.tpl @@ -0,0 +1,5 @@ + + {field} + {data} + + diff --git a/filemanager/templates/default/preference_acl.tpl b/filemanager/templates/default/preference_acl.tpl new file mode 100755 index 0000000000..6d9380e8e6 --- /dev/null +++ b/filemanager/templates/default/preference_acl.tpl @@ -0,0 +1,27 @@ +{errors} +{title} + + + {nml} + + {nmr} + +
+
+
+{common_hidden_vars} + + +
+
+
+
+ +{row} +
+{common_hidden_vars_form} + +
+
+ + diff --git a/filemanager/templates/default/preference_acl_row.tpl b/filemanager/templates/default/preference_acl_row.tpl new file mode 100755 index 0000000000..01b22d84b5 --- /dev/null +++ b/filemanager/templates/default/preference_acl_row.tpl @@ -0,0 +1,9 @@ + + + {user} + + + + + + diff --git a/filemanager/templates/default/preference_colspan.tpl b/filemanager/templates/default/preference_colspan.tpl new file mode 100755 index 0000000000..6360c88b20 --- /dev/null +++ b/filemanager/templates/default/preference_colspan.tpl @@ -0,0 +1,8 @@ + + {string} + {read_lang} + {add_lang} + {edit_lang} + {delete_lang} + {private_lang} + diff --git a/filemanager/templates/default/search.tpl b/filemanager/templates/default/search.tpl new file mode 100755 index 0000000000..d8070783af --- /dev/null +++ b/filemanager/templates/default/search.tpl @@ -0,0 +1,6 @@ + +

{search_text}

+{quantity}

+{output} +

+ diff --git a/filemanager/templates/default/search_list.tpl b/filemanager/templates/default/search_list.tpl new file mode 100755 index 0000000000..4255e81551 --- /dev/null +++ b/filemanager/templates/default/search_list.tpl @@ -0,0 +1,4 @@ + + +

  • {result_desc} + diff --git a/filemanager/templates/default/view.tpl b/filemanager/templates/default/view.tpl new file mode 100755 index 0000000000..bf95d8863a --- /dev/null +++ b/filemanager/templates/default/view.tpl @@ -0,0 +1,21 @@ + + +
    +

    + + {name} + +

    + + + +{output} + + +
    +

    +{edit_button}      {delete_button} +

    + + + diff --git a/filemanager/templates/default/week.tpl b/filemanager/templates/default/week.tpl new file mode 100755 index 0000000000..81ee232707 --- /dev/null +++ b/filemanager/templates/default/week.tpl @@ -0,0 +1,33 @@ + +{printer_friendly} + + + + + + + + + + + +
    + {small_calendar_prev} + + {prev_week_link} + + {small_calendar_this} + {week_identifier} +
    {username}
    +
    + {next_week_link} + + {small_calendar_next} +
    +{week_display} +{print} diff --git a/filemanager/templates/default/week_day_event.tpl b/filemanager/templates/default/week_day_event.tpl new file mode 100755 index 0000000000..370d6b2548 --- /dev/null +++ b/filemanager/templates/default/week_day_event.tpl @@ -0,0 +1,5 @@ + +{link_entry} + {start_time}{end_time}{close_view_link}  + {name}
    + diff --git a/filemanager/templates/default/week_day_events.tpl b/filemanager/templates/default/week_day_events.tpl new file mode 100755 index 0000000000..5461b0fd61 --- /dev/null +++ b/filemanager/templates/default/week_day_events.tpl @@ -0,0 +1,4 @@ + + +{events} + diff --git a/filemanager/templates/idsociety/column_title.tpl b/filemanager/templates/idsociety/column_title.tpl new file mode 100755 index 0000000000..0d74e5059e --- /dev/null +++ b/filemanager/templates/idsociety/column_title.tpl @@ -0,0 +1,2 @@ + + {col_title} diff --git a/filemanager/templates/idsociety/day.tpl b/filemanager/templates/idsociety/day.tpl new file mode 100755 index 0000000000..b7b9d13af4 --- /dev/null +++ b/filemanager/templates/idsociety/day.tpl @@ -0,0 +1,32 @@ + +{printer_friendly} + + + + + + + + +
    +
    + + + + +
    + {date}
    + {username} +
    + + + + +
    + {daily_events} +
    +
    + {small_calendar} +
    +{print} + diff --git a/filemanager/templates/idsociety/day_cal.tpl b/filemanager/templates/idsociety/day_cal.tpl new file mode 100755 index 0000000000..7e7f504053 --- /dev/null +++ b/filemanager/templates/idsociety/day_cal.tpl @@ -0,0 +1,33 @@ + + + + + +{row} +
    + diff --git a/filemanager/templates/idsociety/day_row.tpl b/filemanager/templates/idsociety/day_row.tpl new file mode 100755 index 0000000000..729c1c6535 --- /dev/null +++ b/filemanager/templates/idsociety/day_row.tpl @@ -0,0 +1,7 @@ + + + + {event} + {open_link}{time}{close_link} + + diff --git a/filemanager/templates/idsociety/day_row_event.tpl b/filemanager/templates/idsociety/day_row_event.tpl new file mode 100755 index 0000000000..f0f8c7023b --- /dev/null +++ b/filemanager/templates/idsociety/day_row_event.tpl @@ -0,0 +1,3 @@ + + {event} + diff --git a/filemanager/templates/idsociety/day_row_time.tpl b/filemanager/templates/idsociety/day_row_time.tpl new file mode 100755 index 0000000000..7e1142f88c --- /dev/null +++ b/filemanager/templates/idsociety/day_row_time.tpl @@ -0,0 +1,3 @@ + +
    {open_link}{time}{close_link}
    + diff --git a/filemanager/templates/idsociety/edit.tpl b/filemanager/templates/idsociety/edit.tpl new file mode 100755 index 0000000000..8d334100aa --- /dev/null +++ b/filemanager/templates/idsociety/edit.tpl @@ -0,0 +1,28 @@ + + + +
    +

    {calendar_action}

    + +
    +{common_hidden} + + + + + + +{output} + + +
    +

    {errormsg}

    +
    +
    + +
    + +{delete_button} +
    + + diff --git a/filemanager/templates/idsociety/footer.tpl b/filemanager/templates/idsociety/footer.tpl new file mode 100755 index 0000000000..80db9b5e24 --- /dev/null +++ b/filemanager/templates/idsociety/footer.tpl @@ -0,0 +1,8 @@ +
    +
    + + + +{output} + +
    diff --git a/filemanager/templates/idsociety/footer_column.tpl b/filemanager/templates/idsociety/footer_column.tpl new file mode 100755 index 0000000000..3846a016ec --- /dev/null +++ b/filemanager/templates/idsociety/footer_column.tpl @@ -0,0 +1,13 @@ + + +
    + {label}: + + +
    +
    + + + diff --git a/filemanager/templates/idsociety/form_button_script.tpl b/filemanager/templates/idsociety/form_button_script.tpl new file mode 100755 index 0000000000..8bcb0ea363 --- /dev/null +++ b/filemanager/templates/idsociety/form_button_script.tpl @@ -0,0 +1,6 @@ + + +
    + +
    + diff --git a/filemanager/templates/idsociety/hr.tpl b/filemanager/templates/idsociety/hr.tpl new file mode 100755 index 0000000000..fdbb59c224 --- /dev/null +++ b/filemanager/templates/idsociety/hr.tpl @@ -0,0 +1,7 @@ + + + + {hr_text} + + + diff --git a/filemanager/templates/idsociety/images/navbar-over.gif b/filemanager/templates/idsociety/images/navbar-over.gif new file mode 100644 index 0000000000000000000000000000000000000000..843874f7224c4475df1975cbb084891ca4400774 GIT binary patch literal 1097 zcmZ?wbhEHb6k!lyc+S9(7-Zw`Y8v6|aDGwjVpU(}ru_*b#%+&9P8~)vz(^eKyQd0Wk$B$2+KD~ec{?)5j2M+9= z(AiQF>roYLTac5P6XkJjPW0`y`9(z~pFe+o@#4j!N008@xpU>pmBWV*x3sjbS+i!| zym`ryK|5;P^YaTne*Ad+_;EL9`^xgNbLY;TIB{a{-o3@eC9BKbb93`PeE1L&5_10h zc|T8=gh1CIH|wgZs)Gj)?%cU^!-fsTC8ev%-LtZ?U%!6+{P}Ye6BBP&`g1hzOiNbDEWrW^z)Zv9YP1u1;KB-2MCa_wU~?BQ4e1+A?FtjEt-5;V|RD=!i5XHyu7AN znZn4(WMgC7+S=ON+nbq{rKzbM6B8R19X%t%PEb%-Ls9_fsu2zpf3h%gG5lxHVE_V9 zo?zhk$MB!?54*yF1I-+QToMio8X8*!{>wT{a5%`s#w){7Bk)nag+oX!U`4`1rZyfa zvw{YWh0g5!@(wKmhD|P#MsjPHv_;X28wVG+ z_scspaXhprIMF5Q5+Pz(#NsKW>OI4x@KERjVWogYH8T`axu$9fuW8uPwDj$MohX%@ zhnJ3?7B}!b)FJ7-tS8<${lb#K&27H3_4Do>=u}?*{-CAXiVG`~pYzSLsrvTe<>TX@ z57;;CV%gNZ+)U1~nZwZVaaDq%bNf35uNJoR(yrYSrbRp#1?Ra>P?DT((s`+9Kl5Ds zRVsgbmwL}wr|x{GNn`Rd-wun?Pa^Xwk2lVDXcaPD^`7~SpyyPh(pUd}x2#xV6yU&M F4FFilnil{7 literal 0 HcmV?d00001 diff --git a/filemanager/templates/idsociety/images/navbar.gif b/filemanager/templates/idsociety/images/navbar.gif new file mode 100644 index 0000000000000000000000000000000000000000..843874f7224c4475df1975cbb084891ca4400774 GIT binary patch literal 1097 zcmZ?wbhEHb6k!lyc+S9(7-Zw`Y8v6|aDGwjVpU(}ru_*b#%+&9P8~)vz(^eKyQd0Wk$B$2+KD~ec{?)5j2M+9= z(AiQF>roYLTac5P6XkJjPW0`y`9(z~pFe+o@#4j!N008@xpU>pmBWV*x3sjbS+i!| zym`ryK|5;P^YaTne*Ad+_;EL9`^xgNbLY;TIB{a{-o3@eC9BKbb93`PeE1L&5_10h zc|T8=gh1CIH|wgZs)Gj)?%cU^!-fsTC8ev%-LtZ?U%!6+{P}Ye6BBP&`g1hzOiNbDEWrW^z)Zv9YP1u1;KB-2MCa_wU~?BQ4e1+A?FtjEt-5;V|RD=!i5XHyu7AN znZn4(WMgC7+S=ON+nbq{rKzbM6B8R19X%t%PEb%-Ls9_fsu2zpf3h%gG5lxHVE_V9 zo?zhk$MB!?54*yF1I-+QToMio8X8*!{>wT{a5%`s#w){7Bk)nag+oX!U`4`1rZyfa zvw{YWh0g5!@(wKmhD|P#MsjPHv_;X28wVG+ z_scspaXhprIMF5Q5+Pz(#NsKW>OI4x@KERjVWogYH8T`axu$9fuW8uPwDj$MohX%@ zhnJ3?7B}!b)FJ7-tS8<${lb#K&27H3_4Do>=u}?*{-CAXiVG`~pYzSLsrvTe<>TX@ z57;;CV%gNZ+)U1~nZwZVaaDq%bNf35uNJoR(yrYSrbRp#1?Ra>P?DT((s`+9Kl5Ds zRVsgbmwL}wr|x{GNn`Rd-wun?Pa^Xwk2lVDXcaPD^`7~SpyyPh(pUd}x2#xV6yU&M F4FFilnil{7 literal 0 HcmV?d00001 diff --git a/filemanager/templates/idsociety/index.tpl b/filemanager/templates/idsociety/index.tpl new file mode 100755 index 0000000000..bf14986f4e --- /dev/null +++ b/filemanager/templates/idsociety/index.tpl @@ -0,0 +1,29 @@ + +{printer_friendly} + + + + + + + + + +
    + {small_calendar_prev} + + {month_identifier} +
    {username}
    +
    + {small_calendar_next} +
    +{large_month} +

    +

    +{print} + diff --git a/filemanager/templates/idsociety/link_pict.tpl b/filemanager/templates/idsociety/link_pict.tpl new file mode 100755 index 0000000000..fe1c2e4c90 --- /dev/null +++ b/filemanager/templates/idsociety/link_pict.tpl @@ -0,0 +1,4 @@ + + + {description} + diff --git a/filemanager/templates/idsociety/list.tpl b/filemanager/templates/idsociety/list.tpl new file mode 100755 index 0000000000..0ad7059a4e --- /dev/null +++ b/filemanager/templates/idsociety/list.tpl @@ -0,0 +1,7 @@ + + + + {field}: + {data} + + diff --git a/filemanager/templates/idsociety/matrix_query.tpl b/filemanager/templates/idsociety/matrix_query.tpl new file mode 100755 index 0000000000..391217d70c --- /dev/null +++ b/filemanager/templates/idsociety/matrix_query.tpl @@ -0,0 +1,19 @@ + + +

    +

    {matrix_action}

    + +
    + + + +{output} + + +
    + +
    +{cancel_button} +
    + + diff --git a/filemanager/templates/idsociety/mini_cal.tpl b/filemanager/templates/idsociety/mini_cal.tpl new file mode 100755 index 0000000000..dfb3978607 --- /dev/null +++ b/filemanager/templates/idsociety/mini_cal.tpl @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + +
        {month}  
    + + {daynames} + {display_monthweek} +
    +
    + + diff --git a/filemanager/templates/idsociety/mini_day.tpl b/filemanager/templates/idsociety/mini_day.tpl new file mode 100755 index 0000000000..a52269bb69 --- /dev/null +++ b/filemanager/templates/idsociety/mini_day.tpl @@ -0,0 +1,4 @@ + + + {dayname} + diff --git a/filemanager/templates/idsociety/mini_week.tpl b/filemanager/templates/idsociety/mini_week.tpl new file mode 100755 index 0000000000..12974c64b3 --- /dev/null +++ b/filemanager/templates/idsociety/mini_week.tpl @@ -0,0 +1,6 @@ + + + + {monthweek_day} + + diff --git a/filemanager/templates/idsociety/month.tpl b/filemanager/templates/idsociety/month.tpl new file mode 100755 index 0000000000..522a79dab1 --- /dev/null +++ b/filemanager/templates/idsociety/month.tpl @@ -0,0 +1,6 @@ + + + {row} +
    + + diff --git a/filemanager/templates/idsociety/month_column.tpl b/filemanager/templates/idsociety/month_column.tpl new file mode 100755 index 0000000000..813fd3399c --- /dev/null +++ b/filemanager/templates/idsociety/month_column.tpl @@ -0,0 +1,5 @@ + + +{column_data} + + diff --git a/filemanager/templates/idsociety/month_day.tpl b/filemanager/templates/idsociety/month_day.tpl new file mode 100755 index 0000000000..e553084c5c --- /dev/null +++ b/filemanager/templates/idsociety/month_day.tpl @@ -0,0 +1,4 @@ + + {new_event_link} +[ {day_number} ]
    + diff --git a/filemanager/templates/idsociety/month_filler.tpl b/filemanager/templates/idsociety/month_filler.tpl new file mode 100755 index 0000000000..b36797fba9 --- /dev/null +++ b/filemanager/templates/idsociety/month_filler.tpl @@ -0,0 +1,2 @@ + +{month_filler_text} diff --git a/filemanager/templates/idsociety/month_header.tpl b/filemanager/templates/idsociety/month_header.tpl new file mode 100755 index 0000000000..9bff1cc1bb --- /dev/null +++ b/filemanager/templates/idsociety/month_header.tpl @@ -0,0 +1,3 @@ + + +{column_header} diff --git a/filemanager/templates/idsociety/overlap.tpl b/filemanager/templates/idsociety/overlap.tpl new file mode 100755 index 0000000000..a1e8563cc3 --- /dev/null +++ b/filemanager/templates/idsociety/overlap.tpl @@ -0,0 +1,14 @@ + + +
    +

    + Scheduling Conflict +

    + + + +
    {overlap_text}
      {overlap_list}
    + {resubmit_button} + {reedit_button} +
    + diff --git a/filemanager/templates/idsociety/pref.tpl b/filemanager/templates/idsociety/pref.tpl new file mode 100755 index 0000000000..34b48b1c9d --- /dev/null +++ b/filemanager/templates/idsociety/pref.tpl @@ -0,0 +1,7 @@ +

    {title}:


    +

    + + {row} +
    +
    +
    diff --git a/filemanager/templates/idsociety/pref_colspan.tpl b/filemanager/templates/idsociety/pref_colspan.tpl new file mode 100755 index 0000000000..e6fae732b8 --- /dev/null +++ b/filemanager/templates/idsociety/pref_colspan.tpl @@ -0,0 +1,4 @@ + + {text} + + diff --git a/filemanager/templates/idsociety/pref_list.tpl b/filemanager/templates/idsociety/pref_list.tpl new file mode 100755 index 0000000000..e8542cfbd1 --- /dev/null +++ b/filemanager/templates/idsociety/pref_list.tpl @@ -0,0 +1,5 @@ + + {field} + {data} + + diff --git a/filemanager/templates/idsociety/preference_acl.tpl b/filemanager/templates/idsociety/preference_acl.tpl new file mode 100755 index 0000000000..6d9380e8e6 --- /dev/null +++ b/filemanager/templates/idsociety/preference_acl.tpl @@ -0,0 +1,27 @@ +{errors} +{title} + + + {nml} + + {nmr} + +
    +
    +
    +{common_hidden_vars} + + +
    +
    +
    +
    + +{row} +
    +{common_hidden_vars_form} + +
    +
    + + diff --git a/filemanager/templates/idsociety/preference_acl_row.tpl b/filemanager/templates/idsociety/preference_acl_row.tpl new file mode 100755 index 0000000000..01b22d84b5 --- /dev/null +++ b/filemanager/templates/idsociety/preference_acl_row.tpl @@ -0,0 +1,9 @@ + + + {user} + + + + + + diff --git a/filemanager/templates/idsociety/preference_colspan.tpl b/filemanager/templates/idsociety/preference_colspan.tpl new file mode 100755 index 0000000000..f1b02d9929 --- /dev/null +++ b/filemanager/templates/idsociety/preference_colspan.tpl @@ -0,0 +1,8 @@ + + {string} + {read_lang} + {add_lang} + {edit_lang} + {delete_lang} + {private_lang} + diff --git a/filemanager/templates/idsociety/search.tpl b/filemanager/templates/idsociety/search.tpl new file mode 100755 index 0000000000..d8070783af --- /dev/null +++ b/filemanager/templates/idsociety/search.tpl @@ -0,0 +1,6 @@ + +

    {search_text}

    +{quantity}

    +{output} +

    + diff --git a/filemanager/templates/idsociety/search_list.tpl b/filemanager/templates/idsociety/search_list.tpl new file mode 100755 index 0000000000..4255e81551 --- /dev/null +++ b/filemanager/templates/idsociety/search_list.tpl @@ -0,0 +1,4 @@ + + +

  • {result_desc} + diff --git a/filemanager/templates/idsociety/view.tpl b/filemanager/templates/idsociety/view.tpl new file mode 100755 index 0000000000..bf95d8863a --- /dev/null +++ b/filemanager/templates/idsociety/view.tpl @@ -0,0 +1,21 @@ + + +
    +

    + + {name} + +

    + + + +{output} + + +
    +

    +{edit_button}      {delete_button} +

    + + + diff --git a/filemanager/templates/idsociety/week.tpl b/filemanager/templates/idsociety/week.tpl new file mode 100755 index 0000000000..81ee232707 --- /dev/null +++ b/filemanager/templates/idsociety/week.tpl @@ -0,0 +1,33 @@ + +{printer_friendly} + + + + + + + + + + + +
    + {small_calendar_prev} + + {prev_week_link} + + {small_calendar_this} + {week_identifier} +
    {username}
    +
    + {next_week_link} + + {small_calendar_next} +
    +{week_display} +{print} diff --git a/filemanager/templates/idsociety/week_day_event.tpl b/filemanager/templates/idsociety/week_day_event.tpl new file mode 100755 index 0000000000..370d6b2548 --- /dev/null +++ b/filemanager/templates/idsociety/week_day_event.tpl @@ -0,0 +1,5 @@ + +{link_entry} + {start_time}{end_time}{close_view_link}  + {name}
    + diff --git a/filemanager/templates/idsociety/week_day_events.tpl b/filemanager/templates/idsociety/week_day_events.tpl new file mode 100755 index 0000000000..5461b0fd61 --- /dev/null +++ b/filemanager/templates/idsociety/week_day_events.tpl @@ -0,0 +1,4 @@ + + +{events} + diff --git a/filemanager/test.php b/filemanager/test.php new file mode 100644 index 0000000000..5ef457aa8c --- /dev/null +++ b/filemanager/test.php @@ -0,0 +1,210 @@ + "phpwebhosting", + "noheader" => False, + "noappheader" => False, + "enable_vfs_class" => True); + +include("../header.inc.php"); + +/* + General format for output is: + function - current directory - input[...] - what output should be - what output was +*/ + +html_break (1); +html_text_italic (PHP_OS . " - " . $phpgw_info["server"]["db_type"] . " - " . PHP_VERSION); +html_break (1); + +### +# start of getabsolutepath tests + +$sep = $phpgw_info["server"]["dir_separator"]; +$user = $phpgw->vfs->working_lid; +$homedir = $phpgw->vfs->fakebase . "/" . $user; +$filesdir = $phpgw->vfs->basedir; +$currentapp = $phpgw_info["flags"]["currentapp"]; + +$phpgw->vfs->cd (); +$io = array ("" => "$homedir", "dir" => "$homedir/dir", "dir/file" => "$homedir/dir/file", "dir/dir2" => "$homedir/dir/dir2", "dir/dir2/file" => "$homedir/dir/dir2/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$homedir/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i)) != $o) + { + echo "
    getabsolutepath - $cd - $i - $o - $ao"; + } +} + +$cd = "test"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_NONE)); +$io = array ("" => "/test", "dir" => "/test/dir", "dir/file" => "/test/dir/file", "dir/dir2" => "/test/dir/dir2", "dir/dir2/file" => "/test/dir/dir2/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "/test/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i)) != $o) + { + echo "
    getabsolutepath - $cd - $i - $o - $ao"; + } +} + +$cd = "test/test2/test3"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_NONE)); +$io = array ("" => "/test/test2/test3", "dir" => "/test/test2/test3/dir", "dir/file" => "/test/test2/test3/dir/file", "dir/dir2" => "/test/test2/test3/dir/dir2", "dir/dir2/file" => "/test/test2/test3/dir/dir2/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "/test/test2/test3/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i)) != $o) + { + echo "
    getabsolutepath - $cd - $i - $o - $ao"; + } +} + +/* Actually means cd to home directory */ +$cd = ""; +$phpgw->vfs->cd ($cd); +$relatives = array (RELATIVE_USER); +$io = array ("" => "$homedir", "dir" => "$homedir/dir", "dir/file" => "$homedir/dir/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$homedir/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives)) != $o) + { + echo "
    getabsolutepath - $cd - $i - $relatives[0] - $o - $ao"; + } +} + +/* $cd shouldn't affect this test, but we'll set it anyways */ +$cd = "test2/test4"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_NONE)); +$relatives = array (RELATIVE_NONE); +$io = array ("" => "", "dir" => "dir", "dir/file" => "dir/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives)) != $o) + { + echo "
    getabsolutepath - $cd (shouldn't matter) - $i - $relatives[0] - $o - $ao"; + } +} + +/* $cd shouldn't affect this test, but we'll set it anyways */ +$cd = "test3/test5"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_NONE)); +$relatives = array (RELATIVE_USER_APP); +$io = array ("" => "$homedir/.$currentapp", "dir" => "$homedir/.$currentapp/dir", "dir/dir2" => "$homedir/.$currentapp/dir/dir2", "dir/file" => "$homedir/.$currentapp/dir/file", "dir/dir2/dir3/file" => "$homedir/.$currentapp/dir/dir2/dir3/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$homedir/.$currentapp/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives)) != $o) + { + echo "
    getabsolutepath - $cd (shouldn't matter) - $i - $relatives[0] - $o - $ao"; + } +} + +/* $cd shouldn't affect this test, but we'll set it anyways */ +$cd = "test4/test6"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_NONE)); +$relatives = array (RELATIVE_ROOT); +$io = array ("" => "", "dir" => "/dir", "/dir/dir2/dir3" => "/dir/dir2/dir3", "dir/file" => "/dir/file", "dir/dir2/dir3" => "/dir/dir2/dir3", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives)) != $o) + { + echo "
    getabsolutepath - $cd (shouldn't matter) - $i - $relatives[0] - $o - $ao"; + } +} + +/* Now a few to test the VFS_REAL capabilities */ +$cd = ""; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_NONE)); +$relatives = array (RELATIVE_ROOT|VFS_REAL); +$io = array ("" => "$filesdir", "dir" => "$filesdir/dir", "dir/dir2/dir3" => "$filesdir/dir/dir2/dir3", "dir/file" => "$filesdir/dir/file", "dir/dir2/dir3/file" => "$filesdir/dir/dir2/dir3/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$filesdir/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives, False)) == $o) + { + echo "
    getabsolutepath - $cd (shouldn't matter) - $i - $relatives[0] - $o - $ao"; + } +} + +$cd = "test5/test7"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_NONE)); +$relatives = array (RELATIVE_USER|VFS_REAL); +$io = array ("" => "$filesdir$homedir", "dir" => "$filesdir$homedir/dir", "dir/dir2/dir3" => "$filesdir$homedir/dir/dir2/dir3", "dir/file" => "$filesdir$homedir/dir/file", "dir/dir2/dir3/file" => "$filesdir$homedir/dir/dir2/dir3/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$filesdir$homedir/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives, False)) != $o) + { + echo "
    getabsolutepath - $cd (shouldn't matter) - $i - $relatives[0] - $o - $ao"; + } +} + +$cd = "test6/test8"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_USER)); +/* RELATIVE_CURRENT should be implied */ +$relatives = array (VFS_REAL); +$io = array ("" => "$filesdir$homedir/$cd", "dir" => "$filesdir$homedir/$cd/dir", "dir/dir2/dir3" => "$filesdir$homedir/$cd/dir/dir2/dir3", "dir/file" => "$filesdir$homedir/$cd/dir/file", "dir/dir2/dir3/file" => "$filesdir$homedir/$cd/dir/dir2/dir3/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$filesdir$homedir/$cd/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives, False)) != $o) + { + echo "
    getabsolutepath - $cd - $i - $relatives[0] - $o - $ao"; + } +} + +$cd = "test7/test9"; +$phpgw->vfs->cd ($cd, False, array (RELATIVE_USER)); +$relatives = array (RELATIVE_USER_APP|VFS_REAL); +$io = array ("" => "$filesdir$homedir/.$currentapp", "dir" => "$filesdir$homedir/.$currentapp/dir", "dir/dir2/dir3" => "$filesdir$homedir/.$currentapp/dir/dir2/dir3", "dir/file" => "$filesdir$homedir/.$currentapp/dir/file", "dir/dir2/dir3/file" => "$filesdir$homedir/.$currentapp/dir/dir2/dir3/file", "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => "$filesdir$homedir/.$currentapp/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?"); + +while (list ($i, $o) = each ($io)) +{ + if (($ao = $phpgw->vfs->getabsolutepath ($i, $relatives, False)) != $o) + { + echo "
    getabsolutepath - $cd (shouldn't matter) - $i - $relatives[0] - $o - $ao"; + } +} + +# end of getabsolutepath tests +### + +### +# start of path_parts tests + +/* Just for convienience +$io = array ("" => array ("fake_full_path" => "", "fake_leading_dirs" => "", "fake_extra_path" => "", "fake_name" => "", "real_full_path" => "", "real_leading_dirs" => "", "real_extra_path" => "", "real_name" => "")); +`~!@#$%^&*()-_=+/|[{]};:'\",<.>? +*/ + +$cd = "test8/test10"; +$relatives[0] = RELATIVE_USER; +$phpgw->vfs->cd ($cd, False, array ($relatives[0])); +$subhome = substr ($homedir, 1); +$io = array ("" => array ("fake_full_path" => "$homedir/$cd", "fake_leading_dirs" => "$homedir/test8", "fake_extra_path" => "$subhome/test8", "fake_name" => "test10", "real_full_path" => "$filesdir$homedir/$cd", "real_leading_dirs" => "$filesdir$homedir/test8", "real_extra_path" => "$subhome/test8", "real_name" => "test10"), "dir2/file" => array ("fake_full_path" => "$homedir/$cd/dir2/file", "fake_leading_dirs" => "$homedir/$cd/dir2", "fake_extra_path" => "$subhome/$cd/dir2", "fake_name" => "file", "real_full_path" => "$filesdir$homedir/$cd/dir2/file", "real_leading_dirs" => "$filesdir$homedir/$cd/dir2", "real_extra_path" => "$subhome/$cd/dir2", "real_name" => "file"), "`~!@#$%^&*()-_=+/|[{]};:'\",<.>?" => array ("fake_full_path" => "$homedir/$cd/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?", "fake_leading_dirs" => "$homedir/$cd/`~!@#$%^&*()-_=+", "fake_extra_path" => "$subhome/$cd/`~!@#$%^&*()-_=+", "fake_name" => "|[{]};:'\",<.>?", "real_full_path" => "$filesdir$homedir/$cd/`~!@#$%^&*()-_=+/|[{]};:'\",<.>?", "real_leading_dirs" => "$filesdir$homedir/$cd/`~!@#$%^&*()-_=+", "real_extra_path" => "$subhome/$cd/`~!@#$%^&*()-_=+", "real_name" => "|[{]};:'\",<.>?")); + +while (list ($i, $o) = each ($io)) +{ + $ao = $phpgw->vfs->path_parts ($i); + while (list ($key, $value) = each ($o)) + { + if ($ao->$key != $o[$key]) + { + echo "
    path_parts - $cd - $i - $relatives[0] - $key - $o[$key] - $ao[$key]"; + } + } +} + +# end of path_parts tests +### + +html_break (2); +html_text_bold ("The less output, the better. Please send errors to the current VFS maintainer (NOT the PHPWebHosting maintainer (although they may be one in the same)). Thanks!"); + +html_page_close (); + +?>