diff --git a/admin.php b/admin.php deleted file mode 100644 index 3ce1f30..0000000 --- a/admin.php +++ /dev/null @@ -1,6 +0,0 @@ -owl_fs_root/presentation/webPageTemplate.inc"); - - -?> - diff --git a/admin/admin_dbmodify.php b/admin/admin_dbmodify.php deleted file mode 100755 index 4780fb1..0000000 --- a/admin/admin_dbmodify.php +++ /dev/null @@ -1,183 +0,0 @@ -query("SELECT * FROM $default->owl_users_table WHERE id = '$id'"); - $sql->next_record(); - $newpass = $sql->f("password"); - - // update password - if ($newpass == $password) - { - $sql->query("UPDATE $default->owl_users_table SET groupid='$groupid',username='$loginname',name='$name',password='$password',quota_max='$quota', email='$email',notify='$notify',email='$email',attachfile='$attachfile',disabled='$disabled',noprefaccess='$noprefaccess',language='$newlanguage',maxsessions='$maxsessions' where id = '$id'"); - } - else - { - $sql->query("UPDATE $default->owl_users_table SET groupid='$groupid',username='$loginname',name='$name',password='" . md5($password) ."',quota_max='$quota', email='$email', notify='$notify',attachfile='$attachfile',disabled='$disabled',noprefaccess='$noprefaccess',language='$newlanguage',maxsessions='$maxsessions' where id = '$id'"); - } - // Bozz Change BEGIN - - // Clean Up the member group table first - $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id"); - - // Insert the new Choices the member group table with selected groups - for ( $i = 0 ; $i <= $no_groups_displayed; $i++ ) - { - $checkboxfields = 'group' . $i; - if($$checkboxfields != '') - { - $checkboxvalue = $$checkboxfields; - $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$id', '$checkboxvalue')"); - } - } - /* Bozz Change END */ - header("Location: index.php?sess=$sess&action=users&owluser=$id&change=1"); -} - -// if action selected is group -if($action == "group") -{ - //update the group table - global $default; - $sql = new Owl_DB; - $sql->query("UPDATE $default->owl_groups_table SET name='$name' where id = '$id'"); - header("Location: index.php?sess=$sess&action=groups&group=$id&change=1"); -} - -// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php - -// if action is delete user -if($action == $lang_deleteuser) -{ -// END BUG FIX: #448232 mistake in admin_dbmodify.php - - //delete the user - $sql = new Owl_DB; - $sql->query("DELETE FROM $default->owl_users_table WHERE id = '$id'"); - // Bozz Change Begin - // Also Clean up the groupmember table when a user is deleted - $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id"); - // Bozz Change End - header("Location: index.php?sess=$sess&action=users"); -} - -// if action is edit html -if($action == "edhtml") -{ - //update html settings - $sql = new Owl_DB; - $sql->query("UPDATE $default->owl_html_table SET table_border='$border', table_header_bg='$header_bg', table_cell_bg='$cell_bg',table_cell_bg_alt='$cell_bg_alt',body_bgcolor='$body_bgcolor',body_textcolor='$body_textcolor',body_link='$body_link',body_vlink='$body_vlink',table_expand_width='$expand_width',table_collapse_width='$collapse_width', main_header_bgcolor='$main_header_bgcolor' "); - - header("Location: index.php?sess=$sess&action=edhtml&change=1"); - -} - -//if action is edit prefernces -if($action == "edprefs") { - $sql = new Owl_DB; - - //update the preferences - if ($lookAtHD != "false" ) - $lookAtHD = "true"; - if ($owl_expand != "1") - $owl_expand = "0"; - if ($version_control != "1") - $version_control = "0"; - - $sql->query("UPDATE $default->owl_prefs_table SET email_from='$email_from', email_fromname='$email_fromname', email_replyto='$email_replyto', email_server='$email_server', lookAtHD='$lookAtHD', def_file_security='$def_file_security', def_file_group_owner='$def_file_group_owner', def_file_owner='$def_file_owner', def_file_title='$def_file_title', def_file_meta='$def_file_meta', def_fold_security='$def_fold_security', def_fold_group_owner='$def_fold_group_owner', def_fold_owner='$def_fold_owner', max_filesize='$max_filesize', timeout='$owl_timeout', expand='$owl_expand', version_control='$version_control', restrict_view='$restrict_view', dbdump_path='$dbdump_path', gzip_path='$gzip_path', tar_path='$tar_path'"); - - header("Location: index.php?sess=$sess&action=edprefs&change=1"); -} - -// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php -// if action is delete group -if($action == $lang_deletegroup ) -{ -// END BUG FIX: #448232 mistake in admin_dbmodify.php - - //delete specified group - global $default; - $sql = new Owl_DB; - $sql->query("DELETE FROM $default->owl_groups_table WHERE id = '$id'"); - header("Location: index.php?sess=$sess&action=groups"); -} - -// if action selected is add -if($action == "add") -{ - // if user to be added insert user into db - if($type == "user") - { - $maxsessions = $maxsessions - 1; // always is stored - 1 - $sql = new Owl_DB; - $sql->query("SELECT * FROM $default->owl_users_table WHERE username = '$loginname'"); - - //check if user exists - if($sql->num_rows($sql) > 0) - { - die ("$lang_err_user_exists"); - } - - $sql->query("INSERT INTO $default->owl_users_table (groupid,username,name,password,quota_max,quota_current,email,notify,attachfile,disabled,noprefaccess,language,maxsessions) VALUES ('$groupid', '$loginname', '$name', '" . md5($password) . "', '$quota', '0', '$email', '$notify','$attachfile', '$disabled', '$noprefaccess', '$newlanguage', '$maxsessions')"); - // Bozz Change BEGIN - // Populated the member group table with selected groups - $sql->query("SELECT id FROM $default->owl_users_table WHERE username = '$loginname'"); - $sql->next_record(); - $newuid = $sql->f("id"); - - for ( $i = 0 ; $i <= $no_groups_displayed; $i++ ) - { - $checkboxfields = 'group' . $i; - if($$checkboxfields != '') - { - $checkboxvalue = $$checkboxfields; - $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$newuid', '$checkboxvalue')"); - } - } - /* Bozz Change END */ - - // set home folder???? - if($home == "1") - { - $sql->query("select * from $default->owl_users_table where username = '$loginname'"); - while($sql->next_record()) $id = $sql->f("id"); - $sql->query("insert into $default->owl_folders_table values (0, '$loginname', '2', '54', '$groupid', '$id')"); - mkdir($default->owl_fs_root."/".fid_to_name("1")."/Home/$loginname", 0777); - } - header("Location: index.php?sess=$sess"); - } - elseif($type == "group") - { - $sql = new Owl_DB; - $sql->query("INSERT INTO $default->owl_groups_table (name) VALUES ('$name')"); - header("Location: index.php?sess=$sess"); - } -} - -?> diff --git a/admin/index.php b/admin/index.php deleted file mode 100755 index 4d751b1..0000000 --- a/admin/index.php +++ /dev/null @@ -1,785 +0,0 @@ -"); - -// if usergroupid invalid then unauthorised view and exit -if($usergroupid != "0") { - die("$lang_err_unauthorized"); -} - -// if not action set ..set action to users -if(!isset($action)) { - $action = "users"; -} - -//------------------------------------------------------------- -/** - * Function PrintUsers - * - * Prints the users out - * - */ -//------------------------------------------------------------- -// Semi-Usable - Interface based -function printusers() -{ - global $sess, $default, $lang_users; - - //create a new connection - $sql = new Owl_DB; - // create a new active session - $sql_active_sess = new Owl_DB; - - - $sql->query("select username,name,id,maxsessions from $default->owl_users_table order by name"); - - - /* print(""); - - - print("
table_header_bg>$lang_users
"); - print(""); - print(""); - print("
"); */ - - - print("table_border>"); - - - while($sql->next_record()) { - // loop through record getting user information - $uid = $sql->f("id"); - $username = $sql->f("username"); - $name = $sql->f("name"); - $maxsess = $sql->f("maxsessions") + 1; - $numrows = 0; - - // find active sessions - $sql_active_sess->query("select * from $default->owl_sessions_table where uid = $uid"); - $sql_active_sess->next_record(); - $numrows = $sql_active_sess->num_rows($sql_active_sess); - - // print out information ->not usable - if ($name == "") - print(""); - else - print(""); - print(""); - } - print("
table_header_bg>$lang_userstable_header_bg> 
".$username."
".$name."(".$numrows."/".$maxsess.")
"); -} - -//------------------------------------------------------------- -/** - * Function PrintGroups - * - * Prints the Groups out - * - */ -//------------------------------------------------------------- -// Semi-Usable -> Interface Based -function printgroups() -{// print out all groups - global $sess, $lang_groups, $default; - $sql = new Owl_DB; - $sql->query("select name,id from $default->owl_groups_table order by name"); - print("table_border>"); - - while($sql->next_record()) - { - print(""); - } - print("
table_header_bg>$lang_groups
".$sql->f("name")."
"); -} - -//------------------------------------------------------------- -/** - * Function PrintUsr($id) - * - * Prints the User out - * - * @param $id - * The Id of the user who's info is to be printed - * - */ -//------------------------------------------------------------- -// Semi-Usable -> Interface Based -function printuser($id) -{ //declare globals - global $sess,$change,$lang_saved,$lang_title,$lang_group,$lang_username,$lang_password,$lang_change,$lang_quota,$lang_groupmember,$lang_noprefaccess,$lang_disableuser, $lang_userlang, $lang_maxsessions, $lang_attach_file; - global $lang_flush_sessions_alt, $lang_flushed, $lang_deleteuser, $lang_email, $lang_notification, $default, $flush; - - if($change == 1) - { - print("$lang_saved
"); - } - - if ($flush == 1) - { - flushsessions($id, $sess); - print($lang_flushed); - } - - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table order by name"); - $i=0; - - // store groups in array - while($sql->next_record()) - { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - $sql->query("select * from $default->owl_users_table where id = '$id'"); - - //post to dbmodify any changes and their values - while($sql->next_record()) - { - print(""); - print(""); - print(""); - print(""); - print("table_border>"); - print(""); - //******************************* - // Display the Language dropdown - //******************************* - print(""); - // Bozz Change begin - //This is to allow a user to be part of more than one group - - // assign a user to more than one group - print(""); - print(""); - print(""); - print(""); - print(""); - - // if notify is on ..set its value to checked - if ( $sql->f("notify") == 1) - { - print(""); - } - else - { - print(""); - } - - // if attachfile is on ..set its value to checked - if ( $sql->f("attachfile") == 1) - { - print(""); - } - else - { - print(""); - } - - - if ($id != 1) - { - // if disabled is on ..set its value to checked - if ( $sql->f("disabled") == 1) - { - print(""); - } - else - { - print(""); - } - - // if noprefaccess is on ..set its value to checked - if ( $sql->f("noprefaccess") == 1) - { - print(""); - } - else - { - print(""); - } - } - - print("
table_header_bg align=right>$lang_title
table_header_bg align=right>$lang_group
table_header_bg align=right>$lang_userlang
table_header_bg align=right>$lang_groupmember"); - $i=0; - $sqlmemgroup = new Owl_DB; - foreach($groups as $g) - { - $is_set_gid = $g[0]; - $sqlmemgroup->query("select userid from $default->owl_users_grpmem_table where userid = '$id' and groupid = '$is_set_gid'"); - $sqlmemgroup->next_record(); - - if ($sqlmemgroup->num_rows($sqlmemgroup) > 0) - { - print("$g[1]
"); - } - else - { - print("$g[1]
"); - } - $i++; - } - // This hidden field is to store the nubmer of displayed groups for future use - // when the records are saved to the db - - - print(""); - // Bozz Change End - - print("
table_header_bg ALIGN=RIGHT>$lang_username
table_header_bg align=right>$lang_quota".$sql->f("quota_current")." /
table_header_bg align=right>$lang_maxsessions".($sql->f("maxsessions") + 1)." / - $lang_flush_sessions_alt
table_header_bg align=right>$lang_password
table_header_bg align=right>$lang_email
table_header_bg align=right>$lang_notification
table_header_bg align=right>$lang_notification
table_header_bg align=right>$lang_attach_file
table_header_bg align=right>$lang_attach_file
table_header_bg align=right>$lang_disableuser
table_header_bg align=right>$lang_disableuser
table_header_bg align=right>$lang_noprefaccess
table_header_bg align=right>$lang_noprefaccess

"); - - // delete user if id != 1 - if ($sql->f("id") != 1) - { - print(""); - } - - print(""); - } -} - -//------------------------------------------------------------- -/** - * Function flushsessions($id, $sess) - * - * Flushes the session variable form the db - * - * @param $id - * The Id of the user - * @param $sess - * The session variable -*/ -//------------------------------------------------------------- -// Usable -function flushsessions($id, $sess) -{ - global $default; - $sql= new Owl_DB; - $sql->query("delete from $default->owl_sessions_table where uid='$id' AND sessid!='$sess'"); -} - - -//------------------------------------------------------------- -/** - * Function printgroup($id) - * - * Prints out the group - * - * @param $id - * The Id of the user - * -*/ -//------------------------------------------------------------- -// Semi-Usable -> interface based - -function printgroup($id) -{ - global $sess,$change,$lang_title,$lang_change,$lang_deletegroup,$lang_saved,$default; - - if(isset($change)) - { - print("$lang_saved
"); - } - - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table where id = '$id'"); - - // post to dbmodify with several values - while($sql->next_record()) - { - print("
"); - print(""); - print(""); - print(""); - print("table_border>
table_header_bg>$lang_title
"); - print("
"); - - // delete the group - if($sql->f("id") != 0) - { - print(""); - } - print("
"); - } -} - -//------------------------------------------------------------- -/** - * Function printnewgroup() - * - * Prints out a new group - * - -*/ -//------------------------------------------------------------- -// NOT Usable -function printnewgroup() -{ - global $default, $sess,$lang_title,$lang_add; - print("
"); - print(""); - print(""); - print(""); - print("table_border>
table_header_bg>$lang_title

"); -} - -//------------------------------------------------------------- -/** - * Function printnewuserr() - * - * Prints out a new user - * -*/ -//------------------------------------------------------------- -// Semi-Usable -function printnewuser() { - global $sess,$lang_title,$lang_username,$lang_group,$lang_password,$lang_add,$default, $lang_quota,$lang_groupmember; - global $lang_email, $lang_notification, $lang_noprefaccess, $lang_disableuser, $lang_userlang, $lang_maxsessions, $lang_attach_file; - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table order by name"); - $i=0; - // get all groups - while($sql->next_record()) - { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - print("
"); - print(""); - print(""); - print(""); - print("table_border>"); - print(""); - print(""); - //******************************* - // Display the Language dropdown - //******************************* - print(""); - - // Bozz Change begin - //This is to allow a user to be part of more than one group - - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - print("
table_header_bg align=right>$lang_title
table_header_bg align=right>$lang_username
table_header_bg align=right>$lang_group
table_header_bg align=right>$lang_userlang
table_header_bg align=right>$lang_groupmember"); - $i=0; - foreach($groups as $g) - { - print("$g[1]
"); - $i++; - } - // This hidden field is to store the nubmer of displayed groups for future use - // when the records are saved to the db - - print(""); - // Bozz Change End - print("
table_header_bg align=right>$lang_quota
table_header_bg align=right>$lang_maxsessions
table_header_bg align=right>$lang_password
table_header_bg align=right>$lang_email
table_header_bg align=right>$lang_attach_file
table_header_bg align=right>$lang_disableuser
table_header_bg align=right>$lang_noprefaccess

"); -} - -//------------------------------------------------------------- -/** - * Function printHTML() - * - * Prints out the required HTML - * - */ -//------------------------------------------------------------- -// NOT Usable -function printhtml() { - global $default, $sess, $lang_add, $lang_change, $change, $lang_saved; - global $lang_ht_tbl_border_sz, $lang_ht_tbl_hd_bg, $lang_ht_tbl_cell_bg_cl, $lang_ht_tbl_cell_bg_al, $lang_ht_tbl_bg_cl, $lang_ht_expand_width, $lang_ht_collapse_width, $lang_ht_bd_bg_cl, $lang_ht_bd_txt_cl, $lang_ht_bd_lnk_cl, $lang_ht_bd_vlnk_cl, $lang_ht_bd_width; - if(isset($change)) print("$lang_saved
"); - print("
"); - print(""); - print(""); - print(""); - print("table_border>"); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print("
table_header_bg align=right>$lang_ht_tbl_border_sz
table_header_bg align=right>$lang_ht_tbl_hd_bgtable_header_bg>
table_header_bg align=right>$lang_ht_tbl_cell_bg_cl
table_header_bg align=right>$lang_ht_tbl_cell_bg_al
table_header_bg align=right>$lang_ht_expand_width
table_header_bg align=right>$lang_ht_collapse_width
table_header_bg align=right>Main Header Background Color
table_header_bg align=right>$lang_ht_bd_bg_cl
table_header_bg align=right>$lang_ht_bd_txt_cl
table_header_bg align=right>$lang_ht_bd_lnk_cl
table_header_bg align=right>$lang_ht_bd_vlnk_cl

"); -} -//------------------------------------------------------------- -/** - * Function printPrefs() - * - * Prints out the preferences in a specific format - * - */ -//------------------------------------------------------------- -// NOT Usable -function printprefs() { - global $default, $sess, $lang_add, $lang_change, $change, $lang_saved; - global $lang_owl_title_email, $lang_owl_email_from, $lang_owl_email_fromname, $lang_owl_email_replyto , $lang_owl_email_server, $lang_owl_title_HD, $lang_owl_lookAtHD, $lang_owl_def_file_security, $lang_owl_def_file_group_owner, $lang_owl_def_file_owner, $lang_owl_def_file_title, $lang_owl_def_file_meta , $lang_owl_def_fold_sec, $lang_owl_def_fold_group_owner, $lang_owl_def_fold_owner, $lang_owl_title_other, $lang_owl_max_filesize, $lang_owl_owl_timeout, $lang_owl_owl_expand, $lang_owl_version_control, $lang_owl_restrict_view ; - global $lang_owl_title_tools, $lang_owl_dbdump_path,$lang_owl_gzip_path, $lang_owl_tar_path; - - if(isset($change)) print("$lang_saved
"); - print("
"); - print(""); - print(""); - print(""); - print("table_border>"); - print(""); - print(" - "); - print(" - "); - print(" - "); - print(" - "); - print(""); - - if ( $default->owl_LookAtHD == "false" ) - { - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - } - else - { - print(""); - printfileperm($default->owl_def_file_security, "def_file_security", $lang_owl_def_file_security, "user"); - - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table"); - $i=0; - // get all groups - while($sql->next_record()) - { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - print(""); - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_users_table"); - $i=0; - - // get all users - while($sql->next_record()) - { - $users[$i][0] = $sql->f("id"); - $users[$i][1] = $sql->f("name"); - $i++; - } - print(""); - - - print(" - "); - print(" - "); - - printgroupperm($default->owl_def_fold_security, "def_fold_security", $lang_owl_def_fold_sec, "user"); - - print(""); - - print(""); - - } - print(""); - print(" - "); - print(" - "); - - //if expansion is true - if ( $default->expand == 1 ) - { - print(""); - } - else - { - print(""); - } - - // if version control checked - if ( $default->owl_version_control == 1 ) - { - print(""); - } - else - { - print(""); - } - - // restrict view checked if true - if ( $default->restrict_view == 1 ) - { - print(""); - } - else - { print(""); - } - - print(""); - print(" - "); - print(" - "); - print(" - "); - print("
main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_email
table_header_bg align=right>$lang_owl_email_from
table_header_bg align=right>$lang_owl_email_fromname
table_header_bg align=right>$lang_owl_email_replyto
table_header_bg align=right>$lang_owl_email_server
main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_HD
table_header_bg align=right>$lang_owl_lookAtHD
table_header_bg align=right>$lang_owl_lookAtHD
table_header_bg>$lang_owl_def_file_group_owner
table_header_bg>$lang_owl_def_file_owner
table_header_bg align=right>$lang_owl_def_file_title
table_header_bg align=right>$lang_owl_def_file_meta
table_header_bg>$lang_owl_def_fold_group_owner
table_header_bg>$lang_owl_def_fold_owner
main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_other
table_header_bg align=right>$lang_owl_max_filesize
table_header_bg align=right>$lang_owl_owl_timeout
table_header_bg align=right>$lang_owl_owl_expand
table_header_bg align=right>$lang_owl_owl_expand:
table_header_bg align=right>$lang_owl_version_control
table_header_bg align=right>$lang_owl_version_control
table_header_bg align=right>$lang_owl_restrict_view
table_header_bg align=right>$lang_owl_restrict_view
main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_tools
table_header_bg align=right>$lang_owl_dbdump_path
table_header_bg align=right>$lang_owl_gzip_path
table_header_bg align=right>$lang_owl_tar_path

"); -} - -//------------------------------------------------------------- -/** - * Function DoBackup() - * - * Does a backup by zipping relevant data - * - */ -//------------------------------------------------------------- -// NOT Usable -function dobackup() { - global $default; - - $command = $default->dbdump_path . " --opt --host=" . $default->owl_db_host . " --user=" . $default->owl_db_user . " --password=" . $default->owl_db_pass . " " . $default->owl_db_name . " | " . $default->gzip_path . " -fc"; - $date = date("Ymd.Hms"); - - header("Content-Disposition: attachment; filename=\"" . $default->owl_db_name . "-$date.sql.gz\""); - header("Content-Location: " . $default->owl_db_name . "-$date.sql.gz"); - header("Content-Type: application/octet-stream"); - //header("Content-Length: $fsize"); - //header("Pragma: no-cache"); - header("Expires: 0"); - passthru($command); - exit(); - -} - - -// if action has been selected..do it.. -if($action) { - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - print(""); - print(""); - print(""); - print(""); - print(""); - print("
"); - print("
"); - print uid_to_name($userid); - print(" : $lang_logout $lang_owl_admin
"); - print("
table_expand_width>
"); - print("table_expand_width BORDER=$default->table_border>
"); - print("table_border>
"); - print("$lang_newuser_alt
"); - print("$lang_newgroup_alt
"); - print("$lang_edthtml_alt
"); - print("$lang_edprefs_alt
"); - - if (file_exists($default->dbdump_path) && file_exists($default->gzip_path)) - { - print("$lang_backup_alt

"); - } - else { - print("$lang_backup_dis_alt

"); - } - -// print("$lang_upg_MD5

"); - printusers(); - print("

"); - printgroups(); - print("
"); - print("
"); - // if user action selected..print user - if(isset($owluser)) - { - printuser($owluser); - } - - //if group action selected print group - if(isset($group)) - { - printgroup($group); - } - - // if newgroup action slelected print the new group - if($action == "newgroup") - { - printnewgroup(); - } - - // if the newuser action print the new user - if($action == "newuser") - { - printnewuser(); - } - - //if the edit html action has been selected run the printHTML - if($action == "edhtml") - { - printhtml(); - } - - // if edit preferences selected print the preferences - if($action == "edprefs") - { - printprefs(); - } - print("
"); -} -else -{ - exit("$lang_err_general"); -} - -print("

table_expand_width>
"); -?> - - - - diff --git a/admin/upgrade-users.php b/admin/upgrade-users.php deleted file mode 100755 index 7210f8a..0000000 --- a/admin/upgrade-users.php +++ /dev/null @@ -1,51 +0,0 @@ -"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("
DO NOT RUN THIS AGAIN

"); -print("Running through $default->owl_users_table
"); -$sql = new Owl_DB; -$sql->query("select * from $default->owl_users_table"); -$sqlupd = new Owl_DB; -while($sql->next_record()) -{ - $userid = $sql->f("id"); - $password = $sql->f("password"); - if (strlen($password) <> 32) - { - $sqlupd->query("update $default->owl_users_table set password='" . md5($password) . "' where id = '$userid'"); - print "Updated user id $userid: ".$sql->f("username")."
"; - } - else - { - print "ALREADY UPGRADED -> $userid: ".$sql->f("username")."
"; - } -} -print("DONE

"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("********************** WARNING WARNING WARNING ****************************
"); -print("
DO NOT RUN THIS AGAIN

"); diff --git a/browse.php b/browse.php deleted file mode 100755 index f8fc1ed..0000000 --- a/browse.php +++ /dev/null @@ -1,411 +0,0 @@ -expand; -if(!isset($order)) $order = "name"; -if(!isset($sortname)) $sortname = "ASC"; -// Daphne change -if(!isset($sortver)) $sortver = "ASC, minor_revision ASC"; -if(!isset($sortcheckedout)) $sortcheckedout = "ASC"; -// end daphne change -if(!isset($sortfilename)) $sortfilename = "DESC"; -if(!isset($sortsize)) $sortsize = "DESC"; -if(!isset($sortposted)) $sortposted = "DESC"; -if(!isset($sortmod)) $sortmod = "DESC"; -if(!isset($sort)) $sort = "asc"; - -// Begin 496814 Column Sorts are not persistant -switch ($order) { - case "name": - $sortorder = 'sortname'; - $sort=$sortname; - break; - case "major_revision": - $sortorder = 'sortver'; - $sort=$sortver; - break; - case "filename" : - $sortorder = 'sortfilename'; - $sort=$sortfilename; - break; - case "size" : - $sortorder = 'sortsize'; - $sort=$sortsize; - break; - case "creatorid" : - $sortorder = 'sortposted'; - $sort=$sortposted; - break; - case "smodified" : - $sortorder = 'sortmod'; - $sort=$sortmod; - break; - case "checked_out": - $sortorder = 'sortcheckedout'; - $sort = $sortcheckedout; - break; - default: - $sort="ASC"; - break; -} - -// END 496814 Column Sorts are not persistant - - -if(check_auth($parent, "folder_view", $userid) != "1") { - printError($lang_nofolderaccess,""); - exit; -} - -print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); -?> - -
-"); - } - print uid_to_name($userid); - print (""); -?> - -$lang_logout");?> - -  "); -print(" -  "); -print(" -   "); -if($expand==1) { - print("owl_root_url/locale/$default->owl_lang/graphics/btn_collapse_view.gif' - \t\tBORDER=0>"); -} else { - print("\t\t\towl_root_url/locale/$default->owl_lang/graphics/btn_expand_view.gif' - \t\tBORDER=0>  \n"); -} - -print("
"); - -print("
"); -if ($expand == 1) { - print("\t\ttable_expand_width BORDER=$default->table_border>\n"); -} else { - print("\t\t
table_collapse_width BORDER=$default->table_border>\n"); -} - -print("\t\t\t"); -print("\t\t\t
" . gen_navbar($parent) . "
"); - -if ($expand == 1) { - print("\t\t
table_expand_width>\n"); -} else { - print("\t\t
table_collapse_width>\n"); -} - -// -// functions to create/show the links to be sorted on -// -function show_link($column,$sortname,$sortvalue,$order,$sess,$expand,$parent,$lang_title,$url) { - - if ($sortvalue == "ASC") - { - print("\t\t\t\t$lang_title"); - if ($order == $column) - { - print(""); - } - else - { - print(""); - } - - } - else - { - print("\t\t\t\t$lang_title"); - if ($order == $column) - { - print(""); - } - else - { - print(""); - } - } -} - - - -if ($expand == 1) { - print("\t\t\ttable_expand_width BORDER=$default->table_border>"); - show_link("name","sortname",$sortname,$order,$sess,$expand,$parent,$lang_title,$default->owl_root_url); - // Daphne change - column for files checked out - if ($default->owl_version_control == 1) { - show_link("major_revision","sortver",$sortver,$order,$sess,$expand,$parent,$lang_ver,$default->owl_root_url); - } - // end Daphne change - show_link("filename","sortfilename",$sortfilename,$order,$sess,$expand,$parent,$lang_file,$default->owl_root_url); - show_link("size","sortsize",$sortsize,$order,$sess,$expand,$parent,$lang_size,$default->owl_root_url); - show_link("creatorid","sortposted", $sortposted,$order,$sess,$expand,$parent,$lang_postedby,$default->owl_root_url); - show_link("smodified","sortmod", $sortmod,$order,$sess,$expand,$parent,$lang_modified,$default->owl_root_url); - print(""); - // Daphne change - column for files checked out - if ($default->owl_version_control == 1) { - show_link("checked_out","sortcheckedout", $sortcheckedout, $order,$sess,$expand,$parent,$lang_held,$default->owl_root_url); - } - // end Daphne change -} else { - print("\t\t\t
$lang_actions
table_collapse_width BORDER=$default->table_border>"); - show_link("name","sortname",$sortname,$order,$sess,$expand,$parent,$lang_title,$default->owl_root_url); - // Begin Daphne Change - if ($default->owl_version_control == 1) { - show_link("major_revision","sortver",$sortver,$order,$sess,$expand,$parent,$lang_ver,$default->owl_root_url); - } - // end Daphne change - show_link("filename","sortfilename",$sortfilename,$order,$sess,$expand,$parent,$lang_file,$default->owl_root_url); - show_link("size","sortsize",$sortsize,$order,$sess,$expand,$parent,$lang_size,$default->owl_root_url); - // Daphne change - column for files checked out - if ($default->owl_version_control == 1) { - show_link("checked_out","sortcheckedout", $sortcheckedout, $order,$sess,$expand,$parent,$lang_held,$default->owl_root_url); - } - // end Daphne change -} - -//Looping out Folders - -$DBFolderCount = 0; -$CountLines = 0; - -$sql = new Owl_DB; -if ($order == "creatorid") { - $sql->query("SELECT * from $default->owl_folders_table where parent = '$parent' order by $order"); -} else { - $sql->query("SELECT * from $default->owl_folders_table where parent = '$parent' order by name "); -} - -//********************** -//* BEGIN Print Folders -//********************** - -while($sql->next_record()) { - if($default->restrict_view == 1) { - if(!check_auth($sql->f("id"), "folder_view", $userid)) - continue; - } - $CountLines++; - $PrintLines = $CountLines % 2; - if ($PrintLines == 0) - print("\t\t\t\t"); - else - print("\t\t\t\t"); - - print(""); - - $DBFolderCount++; //count number of filez in db 2 use with array - $DBFolders[$DBFolderCount] = $sql->f("name"); //create list if files in - - if($expand == 1) { - print("\t\t\t\t"); - // begin Daphne change - // extra colunm width for "version" column which folders don't need - if ($default->owl_version_control == 1) { - print(""); - } - // end Daphne change - print(""); - if ($default->owl_version_control == 1) - print (""); - print(""); - } else { - //print(""); - print("\t\t\t\t"); - // begin Daphne change - // extra column width for "held" column which folders don't need - if ($default->owl_version_control == 1) { - if ($PrintLines == 0) - print (""); - else - print (""); - - } - // end Daphne change - print(""); - - } -} - -if ($default->owl_LookAtHD != "false") -{ - $DBFolders[$DBFolderCount+1] = "[END]"; //end DBfolder array - $RefreshPage = CompareDBnHD('folder', $default->owl_FileDir . "/" . get_dirpath($parent), $DBFolders, $parent, $default->owl_folders_table); -} - -//********************** -// BEGIN Print Files -//********************** -$sql = new Owl_DB; -//$sql->query("SELECT * from $default->owl_files_table where parent = '$parent' order by $order $sort"); -if ($default->owl_version_control == 1) -{ - //$sql->query("drop table tmp"); - $sql->query("create temporary table tmp (name char(80) not null, parent int(4) not null, val double(4,2) not null)"); - // POSTGRES? $sql->query("create temporary table tmp (name varchar(80) not null, parent int4 not null, val float not null);"); - //$sql->query("lock tables files read"); - $sql->query("insert into tmp select name, parent, max(major_revision+(minor_revision/10)) from files group by name,parent"); - $sql->query("select files.* from files,tmp where files.name=tmp.name and major_revision+(minor_revision/10)=tmp.val AND tmp.parent=files.parent AND tmp.parent = '$parent' order by $order $sort"); -} - else -{ - - $sql->query("select * from $default->owl_files_table where parent = '$parent' order by $order $sort" ); -} - -//Looping out files from DB! - -$DBFileCount = 0; - -while($sql->next_record()) { - if($default->restrict_view == 1) { - if(!check_auth($sql->f("id"), "file_download", $userid)) - continue; - } - $CountLines++; - $PrintLines = $CountLines % 2; - if ($PrintLines == 0) - print("\t\t\t\t"); - else - print("\t\t\t\t"); - print(""); - else - print($sql->f("name").""); - // Begin Daphne Change - // print version numbers if version control used - if ($default->owl_version_control == 1){ - if($fileid == $sql->f("id")) - print(""); - else - print(""); - } - // end Daphne Change - if ($sql->f("url") == "1") - if($fileid == $sql->f("id")) - print(""); - else - print(""); - else - if($fileid == $sql->f("id")) - print(""); - else - print(""); - - - $DBFileCount++; //count number of filez in db 2 use with array - $DBFiles[$DBFileCount] = $sql->f("filename"); //create list if files in -//print("

HERE WE ARE ID - $tmp

"); -//exit(); - if($expand ==1) { - if($fileid == $sql->f("id")) - print("\t\t\t\t"); - else - print("\t\t\t\t"); - print("\t\t\t\t"); - } - else { - print("\t"); - } - } - // end Daphne Change - -} - -if ($default->owl_version_control == 1) { - //$sql->query("unlock tables"); - $sql->query("drop table tmp"); -} - -$DBFiles[$DBFileCount+1] = "[END]"; //end DBfile array - -print("
" . $sql->f("name") . "     "); - - if(check_auth($sql->f("id"), "folder_delete", $userid) == 1) - print("\t$lang_del_folder_alt "); - if(check_auth($sql->f("id"), "folder_modify", $userid) == 1) { - print("$lang_mod_folder_alt"); - print("$lang_move_folder_alt"); - print(" - $lang_get_file_alt "); - - } - - print(" 
"); - $iconfiles = array("html","htm","gif","jpg","bmp","zip","tar","doc","mdb","xls","ppt","pdf","gz","mp3","tgz"); - $choped = split("\.", $sql->f("filename")); - $pos = count($choped); -// BEGIN BUG FIX: #433548 Problem with uppercase fileextensions - $ext = strtolower($choped[$pos-1]); -// END BUG FIX: #433548 Problem with uppercase fileextensions - if ($sql->f("url") == "1") - print(" "); - else { - if (preg_grep("/$ext/",$iconfiles)) - print(" "); - else - print(" "); - } - if($fileid == $sql->f("id")) - print("".$sql->f("name")."".$sql->f("major_revision").".".$sql->f("minor_revision")."".$sql->f("major_revision").".".$sql->f("minor_revision")."".$sql->f("name")." ".gen_filesize($sql->f("size"))."".$sql->f("name")." ".gen_filesize($sql->f("size"))."".$sql->f("filename")."".gen_filesize($sql->f("size"))."".$sql->f("filename")."".gen_filesize($sql->f("size"))."".fid_to_creator($sql->f("id"))."".$sql->f("modified")."".fid_to_creator($sql->f("id"))."".$sql->f("modified").""); - - printFileIcons($sql->f("id"),$sql->f("filename"),$sql->f("checked_out"),$sql->f("url"),$default->owl_version_control,$ext); - - } - - // begin Daphne change - // printing who has a document checked out - if ($default->owl_version_control == 1) { - if (($holder = uid_to_name($sql->f("checked_out"))) == "Owl") { - print("\t-
$holder
"); - -// *********************************** -// If the refresh from hard drive -// feature is enabled -// *********************************** -if ($default->owl_LookAtHD != "false") -{ - if($RefreshPage == true) { - CompareDBnHD('file', $default->owl_FileDir . "/" . get_dirpath($parent), $DBFiles, $parent, $default->owl_files_table); - }else{ - $RefreshPage = CompareDBnHD('file', $default->owl_FileDir . "/" . get_dirpath($parent), $DBFiles, $parent, $default->owl_files_table); - } - - if($RefreshPage == true) { -?> - - diff --git a/dbmodify.php b/dbmodify.php deleted file mode 100755 index edde4ca..0000000 --- a/dbmodify.php +++ /dev/null @@ -1,964 +0,0 @@ -query("select parent from $default->owl_folders_table where id = '$parent'"); - while($sql->next_record()) { - $path = fid_to_name($sql->f("parent"))."/".$path; - $parent = $sql->f("parent"); - } - } - return $path; -} - -function delTree($fid) { - global $fCount, $folderList, $default; - //delete from database - $sql = new Owl_DB; - $sql->query("delete from $default->owl_folders_table where id = '$fid'"); - $sql->query("delete from $default->owl_files_table where parent = '$fid'"); - for ($c=0; $c < $fCount; $c++) { - if ($folderList[$c][2]==$fid) { - delTree($folderList[$c][0]); - } - } -} - -// Begin 496814 Column Sorts are not persistant -// + ADDED &order=$order&$sortorder=$sortname to -// all browse.php? header and HREF LINES - -switch ($order) { - case "name": - $sortorder = 'sortname'; - break; - case "major_revision": - $sortorder = 'sortver'; - break; - case "filename" : - $sortorder = 'sortfilename'; - break; - case "size" : - $sortorder = 'sortsize'; - break; - case "creatorid" : - $sortorder = 'sortposted'; - break; - case "smodified" : - $sortorder = 'sortmod'; - break; - case "checked_out": - $sortorder = 'sortcheckedout'; - break; - default: - break; -} - -// END 496814 Column Sorts are not persistant -// BEGIN BUG FIX: #433932 Fileupdate and Quotas -if($action == "file_update") { - if(check_auth($parent, "folder_modify", $userid) == 1) { - //if($title == "") exit($lang_specifyname); - $userfile = uploadCompat("userfile"); - $sql = new Owl_DB; - $sql->query("select * from $default->owl_users_table where id = '$userid'"); - while($sql->next_record()) { - $quota_max = $sql->f("quota_max"); - $quota_current = $sql->f("quota_current"); - //$new_quota = $quota_current + $userfile_size; - } - $new_name = ereg_replace("[^-A-Za-z0-9._]", "", ereg_replace(" ", "_", ereg_replace("%20|^-", "_", $userfile["name"]))); - $newpath = $default->owl_FileDir."/".find_path($parent)."/".$new_name; - - /* Begin Daphne Change - backups of files - * If user requests automatic backups of files - * get current details from db and save file state information - */ - if ($default->owl_version_control == 1) { - - if ($default->owl_use_fs) - { - $sql->query("select * from $default->owl_files_table where filename='$new_name' and parent='$parent'"); - } - else - { - // this is guaranteed to get the ID of the most recent revision, just in case we're updating a previous rev. - $sql->query("select distinct b.* from $default->owl_files_table as a, $default->owl_files_table as b where b.id='$id' AND a.name=b.name AND a.parent=b.parent order by major_revision, minor_revision desc"); - } - //$query = "select b.* from $default->owl_files_table as a, $default->owl_files_table as b where a.id='$id' AND a.name=b.name AND a.parent=b.parent order by major_revision, minor_revision desc"; - //printError("QU: $query"); - - while($sql->next_record()) { - // save state information - $major_revision = $backup_major = $sql->f("major_revision"); - $minor_revision = $backup_minor = $sql->f("minor_revision"); - $backup_filename = $sql->f("filename"); - $backup_name = $sql->f("name"); - $backup_size = $sql->f("size"); - $backup_creatorid = $sql->f("creatorid"); - $backup_modified = $sql->f("modified"); - $backup_smodified = $sql->f("smodified"); - $backup_description = $sql->f("description"); - $backup_description = ereg_replace("'","\\'",$backup_description); - $backup_metadata = $sql->f("metadata"); - $backup_parent = $sql->f("parent"); - $backup_security = $sql->f("security"); - $backup_groupid = $groupid = $sql->f("groupid"); - - $new_quota = $quota_current - $backup_size + $userfile['size']; - $filename = $sql->f(filename); - $title = $sql->f(name); - $description = $sql->f(description); - - if ($default->owl_use_fs) - { - if ($default->owl_FileDir."/".find_path($parent)."/".$sql->f(filename) != $newpath) - printError("$lang_err_file_update",""); - } - - } - } - - // End Daphne Change - - //$newpath = $default->owl_fs_root."/".find_path($parent)."/".$new_name; - //$newpath = $default->owl_FileDir."/".find_path($parent)."/".$new_name; - //***neller: Read data from database - //$sql->query("select * from $default->owl_files_table where id='$id'"); - //while($sql->next_record()) { - //if ($default->owl_fs_root."/".find_path($parent)."/".$sql->f(filename) != $newpath) - //if ($default->owl_FileDir."/".find_path($parent)."/".$sql->f(filename) != $newpath) - //printError("$lang_err_file_update",""); - //$new_quota = $quota_current - $sql->f(size) + $userfile_size; - //$filename = $sql->f(filename); - //$title = $sql->f(name); - //$description = $sql->f(description); - //} - if (($new_quota > $quota_max) && ($quota_max != "0")) { - printError("$lang_err_quota".$new_quota."$lang_err_quota_needed".($quota_max - $quota_current)."$lang_err_quota_avail",""); - if(($quota_max - $quota_current) == "0") - printError("$lang_err_quota_exceed"); - } - // End neller - - /* Begin Daphne Change - * copy old version to backup folder - * change version numbers, - * update database entries - * upload new file over the old - * backup filename will be 'name_majorrev-minorrev' e.g. 'testing_1-2.doc' - */ - - // BEGIN wes change - if ($default->owl_use_fs) - { - if ($default->owl_version_control == 1) { - if(!(file_exists($newpath)==1) || $backup_filename != $new_name) printError("$lang_err_file_update",""); - // Get the file extension. - $extension = explode(".",$new_name); - // rename the new, backed up (versioned) filename - $version_name = $extension[0]."_$major_revision-$minor_revision.$extension[1]"; - // specify path for new file in the /backup/ file of each directory. - $backuppath = $default->owl_FileDir."/".find_path($parent)."/backup/$version_name"; - - // Danilo change - - if(!is_dir("$default->owl_FileDir/".find_path($parent)."/backup")) { - mkdir("$default->owl_FileDir/".find_path($parent)."/backup", 0777); - - // End Danilo change - - - - // is there already a backup directory for current dir? - if(is_dir("$default->owl_FileDir/".find_path($parent)."/backup")) { - $sql->query("INSERT into $default->owl_folders_table (name, parent, security, groupid, creatorid) values ('backup', '$parent', '50', '$groupid', '$userid')"); - } else { - printError("$lang_err_backup_folder_create",""); - } - } - copy($newpath,$backuppath); // copy existing file to backup folder - } - // End Daphne Change - - if(!file_exists($newpath) == 1) printError("$lang_err_file_update",""); - copy($userfile['tmp_name'], $newpath); - unlink($userfile['tmp_name']); - if(!file_exists($newpath)) - if ($default->debug == true) - printError($lang_err_upload,$newpath); - else - printError($lang_err_upload,""); - // Begin Daphne Change - if ($default->owl_version_control == 1) { - if(!file_exists($backuppath)) die ("$lang_err_backup_file"); - - // find id of the backup folder you are saving the old file to - $sql->query("Select id from $default->owl_folders_table where name='backup' and parent='$parent'"); - while($sql->next_record()) { - $backup_parent = $sql->f("id"); - } - } - } - - if($versionchange == 'major_revision') { - // if someone requested a major revision, must - // make the minor revision go back to 0 - //$versionchange = "minor_revision='0', major_revision"; - //$new_version_num = $major_revision + 1; - $new_major = $major_revision + 1; - $new_minor = 0; - $versionchange = "minor_revision='0', major_revision"; - $new_version_num = $major_revision + 1; - - } - else { - // simply increment minor revision number - $new_version_num = $minor_revision + 1; - $new_minor = $minor_revision + 1; - $new_major = $major_revision; - } - - // printError("old: $minor_revision", "New: $new_minor"); - // End Daphne Change - - $groupid = owlusergroup($userid); - $modified = date("M d, Y \a\\t h:i a"); - $smodified = date("Y-m-d g:i:s"); - - // Begin Daphne Change - if ($default->owl_version_control == 1) { - if ($default->owl_use_fs) - { - // insert entry for backup file - // WORKING WORKING - $sql->query("INSERT into $default->owl_files_table (name,filename,size,creatorid,parent,modified, smodified,groupid,description,metadata,security,major_revision,minor_revision) values ('$backup_name','$version_name','$backup_size','$backup_creatorid','$backup_parent','$backup_modified', '$backup_smodified','$backup_groupid', '$backup_description','$backup_metadata','$backup_security','$backup_major','$backup_minor')") or unlink($backuppath); - - // update entry for existing file. Bozz's code is repeated underneath, - // without the versioning attribute included. - - - // BEGIN Bozz Change - // Added this check, if the policy is allow Read Write NO DELETE - // we have to make sure that the Creator is not changed. - // in the case of an updated, that would then allow a user to - // delete the file. Only the original Creator should be allowed - // to delete the file. - if ( getfilepolicy($id) == 5 || getfilepolicy($id) == 6) - { - // Daphne addition -- $versionchange = $new_version_num - $sql->query("UPDATE $default->owl_files_table set size='".$userfile['size']."',modified='$modified',smodified='$smodified', $versionchange='$new_version_num', description='$newdesc' where id='$id'") or unlink($newpath); - } - else - { - // Daphne addition -- $versionchange = $new_version_num - $sql->query("UPDATE $default->owl_files_table set size='".$userfile['size']."',creatorid='$userid',modified='$modified',smodified='$smodified', $versionchange='$new_version_num',description='$newdesc' where id='$id'") or unlink($newpath); - } - } else { - // BEGIN wes change - // insert entry for current version of file - $compressed = '0'; - $userfile = uploadCompat("userfile"); - $fsize = filesize($userfile['tmp_name']); - $sql->query("INSERT into $default->owl_files_table (name,filename,size,creatorid,parent,modified, smodified,groupid,description,metadata,security,major_revision,minor_revision) values ('$backup_name','".$userfile['name']."','".$userfile['size']."','$backup_creatorid','$parent','$modified', '$smodified','$backup_groupid', '$newdesc', '$backup_metadata','$backup_security','$new_major','$new_minor')"); - $id = $sql->insert_id(); - - - - - - if ($default->owl_compressed_database && file_exists($default->gzip_path)) { - system($default->gzip_path . " " . escapeshellarg($userfile['tmp_name'])); - $fd = fopen($userfile['tmp_name'] . ".gz", 'rb'); - $userfile['tmp_name'] = $userfile['tmp_name'] . ".gz"; - $fsize = filesize($userfile['tmp_name']); - $compressed = '1'; - } else { - $fd = fopen($userfile['tmp_name'], 'rb'); - } - $filedata = addSlashes(fread($fd, $fsize)); - fclose($fd); - - if ($id !== NULL && $filedata) { - $sql->query("insert into $default->owl_files_data_table (id, data, compressed) values ('$id', '$filedata','$compressed')"); - } - // END wes change - } - // END Bozz Change - - } - - else { // versioning not included in the DB update - if ($default->owl_use_fs) - { - // BEGIN Bozz Change - if ( getfilepolicy($id) == 5 || getfilepolicy($id) == 6) - { - $sql->query("update $default->owl_files_table set size='".$userfile['size']."',modified='$modified',smodified='$smodified' where id='$id'") or unlink($newpath); - } - else - { - $sql->query("update $default->owl_files_table set size='".$userfile['size']."',creatorid='$userid',modified='$modified',smodified='$smodified' where id='$id'") or unlink($newpath); - } - // END Bozz Change - } - } - - // End Daphne Change - - if ($quota_max != "0") $sql->query("update $default->owl_users_table set quota_current = '$new_quota' where id = '$userid'"); - - //notify_users($groupid,1, find_path($parent),$filename, $title, $newdesc); - notify_users($groupid,1,$parent,$filename, $title, $newdesc, $type); - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); -// END BUG FIX: #433932 Fileupdate and Quotas - } else { - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
-"); - print uid_to_name($userid); - print (""); -?> - - - $lang_logout");?> - "); ?> -


- query("insert into $default->owl_files_table (name,filename,size,creatorid,parent,modified,description,metadata,security,groupid,smodified,checked_out, major_revision, minor_revision, url) values ('$title', '".$userfile["name"]."', '".$userfile["size"]."', '$userid', '$parent', '$modified', '$description', '$metadata', '$security', '$groupid','$smodified','$checked_out','$major_revision','1','1')"); - } - else { - $sql->query("select * from $default->owl_users_table where id = '$userid'"); - while($sql->next_record()) { - $quota_max = $sql->f("quota_max"); - $quota_current = $sql->f("quota_current"); - $new_quota = $quota_current + $userfile["size"]; - } - if (($new_quota > $quota_max) && ($quota_max != "0")) { - - die("$lang_err_quota".$new_quota."$lang_err_quota_needed".($quota_max - $quota_current)."$lang_err_quota_avail"); - if(($quota_max - $quota_current) == "0") - die("$lang_err_quota_exceed"); - } - $new_name = ereg_replace("[^-A-Za-z0-9._]", "", ereg_replace(" ", "_", ereg_replace("%20|^-", "_", $userfile["name"]))); - - if ($default->owl_use_fs) - { - $newpath = $default->owl_FileDir."/".find_path($parent)."/".$new_name; - if(file_exists($newpath) == 1) - if ($default->debug == true) - printError($lang_fileexists,$newpath); - else - printError($lang_fileexists,""); - - copy($userfile["tmp_name"], $newpath); - unlink($userfile["tmp_name"]); - if(!file_exists($newpath)) - if ($default->debug == true) - printError($lang_err_upload,$newpath); - else - printError($lang_err_upload,""); - } - else { - // is name already used? - //printError("SQL", "select filename from $default->owl_files_table where filename = '$new_name' and parent='$parent'"); - $sql->query("select filename from $default->owl_files_table where filename = '$new_name' and parent='$parent'"); - while($sql->next_record()) - { - if ($sql->f("filename")) { - // can't move... - printError("File Exists:","There is already a file with the name $new_name in this directory.",""); - // print("$lang_return

"); - // needs to be internationalized - //exit("File Exists: There is already a file with the name $title in this directory."); - } - } - - } - /* BEGIN Bozz Change - If your not part of the Administartor Group - the Folder will have your group ID assigned to it */ - - if ( owlusergroup($userid) != 0 ) - { - $groupid = owlusergroup($userid); - } - // Bozz Change End - - $modified = date("M d, Y \a\\t h:i a"); - $smodified = date("Y-m-d g:i:s"); - if($title == "") $title = $new_name; - if($major_revision == "") $major_revision = 0; - if($minor_revision == "") $minor_revision = 1; - if($checked_out == "") $checked_out = 0; - // WORKING WORKING - - $compressed = '0'; - $userfile = uploadCompat("userfile"); - $fsize = $userfile['size']; - if (!$default->owl_use_fs && $default->owl_compressed_database && file_exists($default->gzip_path)) { - system($default->gzip_path . " " . escapeshellarg($userfile['tmp_name'])); - $userfile['tmp_name'] = $userfile['tmp_name'] . ".gz"; - $fsize = filesize($userfile['tmp_name']); - $compressed = '1'; - } - $result = $sql->query("insert into $default->owl_files_table (name,filename,size,creatorid,parent,modified,description,metadata,security,groupid,smodified,checked_out, major_revision, minor_revision, url) values ('$title', '$new_name', '".$userfile['size']."', '$userid', '$parent', '$modified', '$description', '$metadata', '$security', '$groupid','$smodified','$checked_out','$major_revision','$minor_revision', '0')") or unlink($newpath); - - if (!$result && $default->owl_use_fs) unlink($newpath); - // BEGIN wes change - if (!$default->owl_use_fs) { - $id = $sql->insert_id(); - $fd = fopen($userfile['tmp_name'], 'rb'); - $filedata = addSlashes(fread($fd, $fsize)); - fclose($fd); - - if ($id !== NULL && $filedata) { - $sql->query("insert into $default->owl_files_data_table (id, data, compressed) values ('$id', '$filedata', '$compressed')"); - } - } - - - if ($quota_max != "0") $sql->query("update $default->owl_users_table set quota_current = '$new_quota' where id = '$userid'"); - } - - notify_users($groupid,0,$parent,$new_name, $title, $description, $type); - - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - } else { - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
- "); - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - "); ?> -


- owl_use_fs) - { - - $name = flid_to_name($id); - if ($name != $title) - { - // we're changing the name ... need to roll this to other revisions - // is name already used? - $sql->query("select name from $default->owl_files_table where name = '$title' and parent='$parent'"); - while($sql->next_record()) - { - if ($sql->f("name")) { - // can't move... - //print("$lang_return

"); - // needs to be internationalized - printError("File Exists: There is already a file with the name $title in this directory.",""); - } - } - $sql->query("update $default->owl_files_table set name='$title' where parent='$parent' AND name = '$name'"); - } - } - - $sql->query("update $default->owl_files_table set name='$title', security='$security', metadata='$metadata', description='$description',groupid='$groupid', creatorid ='$file_owner' where id = '$id'"); - // End Bozz Change - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - } else { - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
- "); - } - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - "); ?> -


- query("delete from $default->owl_files_table where id = '$id'"); - } - else { - $sql->query("select * from $default->owl_files_table where id = '$id'"); - while($sql->next_record()) { - $path = find_path($sql->f("parent")); - $filename = $sql->f("filename"); - $filesize = $sql->f("size"); - $owner = $sql->f("creatorid"); - } - $sql->query("select * from $default->owl_users_table where id = '$owner'"); - while($sql->next_record()) { - $quota_current = $sql->f("quota_current"); - $quota_max = $sql->f("quota_max"); - } - $new_quota = $quota_current - $filesize; - if($quota_max != "0") $sql->query("update $default->owl_users_table set quota_current = '$new_quota' where id = '$owner'"); - - if($default->owl_use_fs) { - unlink($default->owl_FileDir."/".$path."/".$filename); - } else { - $sql->query("delete from $default->owl_files_data_table where id = '$id'"); - } - - $sql->query("delete from $default->owl_files_table where id = '$id'"); - sleep(.5); - } - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - } else { - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
-"); - print uid_to_name($userid); - print (""); -?> - - $lang_logout");?> - "); ?> -


- query("select checked_out from $default->owl_files_table where id = '$id'"); - - while($sql->next_record()) { - $file_lock = $sql->f("checked_out"); - } - - if ($file_lock == 0) { - // reserve the file - $sql->query("update $default->owl_files_table set checked_out='$userid' where id='$id'"); - } - else { - if ($file_lock == $userid) { - // check the file back in - $sql->query("update $default->owl_files_table set checked_out='0' where id='$id'"); - } - else { - // throw error; someone else is trying to lock the file! - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
- "); - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - "); ?> -


- table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - - "); - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - - "); ?> -

- owl_use_fs) { - $fID=$parent; - do { - $sql->query("select name,parent from $default->owl_folders_table where id='$fID'"); - while($sql->next_record()) { - $tName = $sql->f("name"); - $fID = $sql->f("parent"); - } - $path=$tName."/".$path; - } while ($fID != 0); - } - $sql->query("select name, filename, description from $default->owl_files_table where id='$id'"); - $sql->next_record(); - $name= $sql->f("name"); - $desc= $sql->f("description"); - $filename = $sql->f("filename"); - - $mail = new phpmailer(); - - $mail->IsSMTP(); // set mailer to use SMTP - $mail->Host = "$default->owl_email_server"; // specify main and backup server - $mail->From = "$default->owl_email_from"; - $mail->FromName = "$default->owl_email_fromname"; - - $r=preg_split("(\;|\,)",$mailto); - reset ($r); - while (list ($occ, $email) = each ($r)) - $mail->AddAddress($email); - if($replyto == "" ) - $mail->AddReplyTo("$default->owl_email_replyto", "OWL Intranet"); - else - $mail->AddReplyTo("$replyto"); - - if($ccto != "") - $mail->AddCC("$ccto"); - - - $mail->WordWrap = 50; // set word wrap to 50 characters - $mail->IsHTML(true); // set email format to HTML - - $mail->Subject = "$lang_file: $name -- $subject"; - if ($type != "url") { - $mail->Body = "$mailbody" . "

" . "$lang_description:

$desc"; - $mail->altBody = "$mailbody" . "\n\n" . "$lang_description: \n\n $desc"; - // BEGIN wes change - if (!$default->owl_use_fs) { - if (file_exists("$default->owl_FileDir/$path$filename")) { - unlink("$default->owl_FileDir/$path$filename"); - } - $file = fopen("$default->owl_FileDir/$path$filename", 'wb'); - $sql->query("select data,compressed from $default->owl_files_data_table where id='$id'"); - while ($sql->next_record()) { - if ($sql->f("compressed")) { - - $tmpfile = $default->owl_FileDir . "owltmp.$id.gz"; - $uncomptmpfile = $default->owl_FileDir . "owltmp.$id"; - if (file_exists($tmpfile)) unlink($tmpfile); - - $fp=fopen($tmpfile,"w"); - fwrite($fp, $sql->f("data")); - fclose($fp); - - system($default->gzip_path . " -df $tmpfile"); - - $fsize = filesize($uncomptmpfile); - $fd = fopen($uncomptmpfile, 'rb'); - $filedata = fread($fd, $fsize); - fclose($fd); - - fwrite($file, $filedata); - unlink($uncomptmpfile); - } else { - fwrite($file, $sql->f("data")); - } - } - fclose($file); - } - - $mail->AddAttachment("$default->owl_FileDir/$path$filename"); - } - else { - $mail->Body = "$filename" . "

" . "$mailbody" . "

" . "$lang_description:

$desc"; - $mail->altBody = "$filename" . "\n\n" ."$mailbody" . "\n\n" . "$lang_description: \n\n $desc"; - } - - if(!$mail->Send()) - { - printError($lang_err_email, $mail->ErrorInfo); - //printError("Server:$default->owl_email_server
File:$default->owl_FileDir/$path$filename ", $mail->ErrorInfo); - } - if (!$default->owl_use_fs) { - unlink("$default->owl_FileDir/$path$filename"); - } - - } -} - - -if($action == "folder_create") { - if(check_auth($parent, "folder_modify", $userid) == 1) { - $sql = new Owl_DB; - //we have to be careful with the name just like with the files - //Comment this one out TRACKER : 603887, this was not done for renaming a folder - // So lets see if it causes problems while creating folders. - // Seems it causes a problem, so I put it back. - $name = ereg_replace("[^-A-Za-z0-9._[:space:]]", "", ereg_replace("%20|^-", " ", $name)); - $sql->query("select * from $default->owl_folders_table where name = '$name' and parent = '$parent'"); - if($sql->num_rows() > 0) - printError("$lang_err_folder_exist",""); - - if ( $name == '') - printError($lang_err_nameempty,""); - - if($default->owl_use_fs) { - $path = find_path($parent); - mkdir($default->owl_FileDir."/".$path."/".$name, 0777); - if(!is_dir("$default->owl_FileDir/$path/$name")) { - if ($default->debug == true) - printError($lang_err_folder_create,"$default->owl_FileDir/$path/$name"); - else - printError($lang_err_folder_create,""); - } - } - $sql->query("insert into $default->owl_folders_table (name,parent,security,groupid,creatorid) values ('$name', '$parent', '$policy', '$groupid', '$userid')"); - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - } else { - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
- "); - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - "); ?> -


- query("select parent from $default->owl_folders_table where id = '$id'"); - while($sql->next_record()) $parent = $sql->f("parent"); - $path = $default->owl_FileDir."/".find_path($parent)."/"; - $source = $path . $origname; - $name = ereg_replace("[^-A-Za-z0-9._[:space:]]", "", ereg_replace("%20|^-", " ", $name)); - $dest = $path . $name; - - if ($default->owl_use_fs) { - if (!file_exists($path . $name) == 1 || $source == $dest) { - if (substr(php_uname(), 0, 7) != "Windows") { - if ($source != $dest) { - $cmd="mv \"$path$origname\" \"$path$name\" 2>&1"; - $lines=array();$errco=0; - $result = myExec($cmd,$lines,$errco); - if ( $errco != 0 ) - printError($lang_err_movecancel, $result); - } - } - else { - // IF Windows just do a rename and hope for the best - rename ("$path$origname", "$path$name"); - } - - } - else - printError($lang_err_folderexists,""); - } - else { - $sql->query("select * from $default->owl_folders_table where parent = '$parent' and name = '$name'"); - if ($sql->num_rows($sql) != 0) - printError($lang_err_folderexists,""); - } - /* BEGIN Bozz Change - If your not part of the Administartor Group - the Folder will have your group ID assigned to it */ - if ( owlusergroup($userid) != 0 ) - { - $sql->query("update $default->owl_folders_table set name='$name', security='$policy' where id = '$id'"); - } - else - { - $sql->query("update $default->owl_folders_table set name='$name', security='$policy', groupid='$groupid' where id = '$id'"); - } - - - // Bozz change End - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - } else { - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
- "); - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - "); ?> -


- query("select id,name,parent from $default->owl_folders_table order by name"); - $fCount = ($sql->nf()); - $i = 0; - while($sql->next_record()) { - $folderList[$i][0] = $sql->f("id"); - $folderList[$i][2] = $sql->f("parent"); - $i++; - } - if ($default->owl_use_fs) - myDelete($default->owl_FileDir."/".find_path($id)); - - delTree($id); - sleep(.5); - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - } else { - include("./lib/header.inc"); - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - -
- "); - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - "); ?> -


- query("select * from $default->owl_sessions_table where uid = '$id' and sessid = '$sess'"); - if($sql->num_rows() <> 1) - { - die ("$lang_err_unauthorized"); - } - - if ($newpassword <> '') - { - $sql = new Owl_DB; - $sql->query("select * from $default->owl_users_table where id = '$id' and password = '" . md5($oldpassword) ."'"); - if($sql->num_rows() == 0) - die("$lang_err_pass_wrong"); - if ( $newpassword == $confpassword) - $sql->query("UPDATE $default->owl_users_table SET name='$name',password='" . md5("$newpassword") . "' where id = '$id'"); - else - die ("$lang_err_pass_missmatch"); - } - $sql->query("UPDATE $default->owl_users_table SET name='$name', email='$email', notify='$notify', attachfile='$attachfile', language='$newlanguage' where id = '$id'"); -} - - -header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - -?> diff --git a/download.php b/download.php deleted file mode 100755 index 25e41e1..0000000 --- a/download.php +++ /dev/null @@ -1,225 +0,0 @@ -query("select parent from $default->owl_folders_table where id = '$parent'"); - while($sql->next_record()) { - $path = fid_to_name($sql->f("parent"))."/".$path; - $parent = $sql->f("parent"); - } - } - return $path; -} - -function fid_to_filename($id) { - global $default; - $sql = new Owl_DB; - $sql->query("select filename from $default->owl_files_table where id = '$id'"); - while($sql->next_record()) return $sql->f("filename"); -} - -function zip_folder($id, $userid) { - - global $default, $sess; - - $tmpdir = $default->owl_FileDir . "/owltmpfld_$sess.$id"; - //if (file_exists($tmpdir)) system("rm -rf " . escapeshellarg($tmpdir)); - if (file_exists($tmpdir)) myDelete($tmpdir); - - mkdir("$tmpdir", 0777); - //system("mkdir " . escapeshellarg($tmpdir)); - $sql = new Owl_DB; - $sql2 = new Owl_DB; - - $sql->query("select name, id from $default->owl_folders_table where id = '$id'"); - while($sql->next_record()) { - $top= $sql->f("name"); - } - $path = "$tmpdir/$top"; - mkdir("$path", 0777); - //system("mkdir " . escapeshellarg($path)); - - folder_loop($sql, $sql2, $id, $path, $userid); - // get all files in folder - // GETTING IE TO WORK IS A PAIN! - if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) - header("Content-Type: application/x-gzip"); - else - header("Content-Type: application/octet-stream"); - - - header("Content-Disposition: attachment; filename=\"$top.tgz\""); - header("Content-Location: \"$top.tgz\""); - // header("Content-Length: $fsize"); - header("Expires: 0"); - //header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - //header("Pragma: Public"); - - if (file_exists($default->tar_path)) { - if (file_exists($default->gzip_path)) { - //passthru("$default->tar_path -C ". escapeshellarg($tmpdir) . " -zc " . escapeshellarg($top)); - passthru("$default->tar_path cf - -C ". escapeshellarg($tmpdir) . " " . escapeshellarg($top) . "| " . $default->gzip_path . " -c -9"); - } else { - //passthru("$default->tar_path -C ". escapeshellarg($tmpdir) . " -zc " . escapeshellarg($top)); - passthru("$default->tar_path cf - -C ". escapeshellarg($tmpdir) . " " . escapeshellarg($top) ); - } - } else { - myDelete($tmpdir); - printError("$default->tar_path was not found",""); - } - myDelete($tmpdir); - //system("rm -rf " . escapeshellarg($tmpdir)); -} - - - -//function folder_loop(&$sql, &$sql2, $id, $tmpdir, $userid) { -function folder_loop($sql, $sql2, $id, $tmpdir, $userid) { - - global $default; - - if(check_auth($id, "folder_view", $userid) == 1) { - - $sql = new Owl_DB; - // write out all the files - $sql->query("select * from $default->owl_files_table where parent = '$id'"); - while($sql->next_record()) { - $fid = $sql->f("id"); - $filename = $tmpdir . "/" . $sql->f("filename"); - if(check_auth($fid, "file_download", $userid) == 1) { - - if ($default->owl_use_fs) { - $source = $default->owl_FileDir . "/" . get_dirpath($id) . "/" . $sql->f("filename"); - copy($source, $filename); - } - else { - $sql2->query("select data,compressed from " . $default->owl_files_data_table . " where id='$fid'"); - while($sql2->next_record()) { - if ($sql2->f("compressed")) { - - $fp=fopen($filename . ".gz","w"); - fwrite($fp, $sql2->f("data")); - fclose($fp); - system($default->gzip_path . " -d " . escapeshellarg($filename) .".gz"); - - } else { - $fp=fopen($filename,"w"); - fwrite($fp, $sql2->f("data")); - fclose($fp); - } // end if - - } // end if - - } // end while - - } // end if - - } // end while - - // recurse into directories - $sql->query("select name, id from $default->owl_folders_table where parent = '$id'"); - while($sql->next_record()) { - $saved = $tmpdir; - $tmpdir .= "/" . $sql->f("name"); - mkdir("$tmpdir", 0777); - //system("mkdir " . escapeshellarg($tmpdir)); - folder_loop($sql, $sql2, $sql->f("id"), $tmpdir, $userid); - $tmpdir = $saved; - } - } -} - - - -if ($action == "folder") { - $abort_status = ignore_user_abort(true); - zip_folder($id, $userid); - ignore_user_abort($abort_status); - exit; -} - -if(check_auth($id, "file_download", $userid) == 1) { - $filename = fid_to_filename($id); - $mimeType = "application/octet-stream"; - - if ($binary != 1) { - if ($filetype = strrchr($filename,".")) { - $filetype = substr($filetype,1); - $sql = new Owl_DB; - $sql->query("select * from $default->owl_mime_table where filetype = '$filetype'"); - while($sql->next_record()) $mimeType = $sql->f("mimetype"); - } - } - - // BEGIN wes change - - if ($default->owl_use_fs) { - $path = find_path($parent)."/".$filename; - $fspath = $default->owl_FileDir."/".$path; - $fsize = filesize($fspath); - } else { - $sql->query("select size from " . $default->owl_files_table . " where id='$id'"); - while($sql->next_record()) $fsize = $sql->f("size"); - } - // END wes change - - - // BEGIN BUG: 495556 File download sends incorrect headers - // header("Content-Disposition: filename=\"$filename\""); - header("Content-Disposition: attachment; filename=\"$filename\""); - header("Content-Location: $filename"); - header("Content-Type: $mimeType"); - header("Content-Length: $fsize"); - //header("Pragma: no-cache"); - header("Expires: 0"); - // END BUG: 495556 File download sends incorrect headers - - // BEGIN wes change - if ($default->owl_use_fs) { - if (substr(php_uname(), 0, 7) != "Windows") - $fp=fopen("$fspath","r"); - else - $fp=fopen("$fspath","rb"); - print fread($fp,filesize("$fspath")); - fclose($fp); - } else { - $sql->query("select data,compressed from " . $default->owl_files_data_table . " where id='$id'"); - while($sql->next_record()) { - if ($sql->f("compressed")) { - $tmpfile = $default->owl_FileDir . "owltmp.$id"; - if (file_exists($tmpfile)) unlink($tmpfile); - - $fp=fopen($tmpfile,"w"); - fwrite($fp, $sql->f("data")); - fclose($fp); - flush(passthru($default->gzip_path . " -dfc $tmpfile")); - unlink($tmpfile); - } else { - print $sql->f("data"); - flush(); - } - } - } - // END wes change -} else { - print($lang_nofileaccess); -} - -?> diff --git a/index.php b/index.php deleted file mode 100755 index 1e5d592..0000000 --- a/index.php +++ /dev/null @@ -1,165 +0,0 @@ -Open_Session(0,$verified["uid"]); - /* - $sql = new Owl_DB; - $sql->query("select * from $default->owl_folders_table where parent = '2' and name = '$loginname'"); - while($sql->next_record()) $id = $sql->f("id"); - */ - $id = 1; - - /* BEGIN Admin Change */ - - /* If an admin signs on We want to se the admin menu - Not the File Browser. */ - if ( $verified["group"] == 0) - { - // if admin logs on..goto the admin main page - // else goto the normal file browser page - if(!isset($fileid)) - { - header("Location: admin/index.php?sess=". $uid->sessdata["sessid"]); - } - else - { - header("Location: browse.php?sess=". $uid->sessdata["sessid"]."&parent=$parent&fileid=$fileid"); - } - } - else - { - if(!isset($fileid)) - { - header("Location: browse.php?sess=". $uid->sessdata["sessid"]); - } - else - { - header("Location: browse.php?sess=". $uid->sessdata["sessid"]."&parent=$parent&fileid=$fileid"); - } - } - /* END Admin Change */ - - } - else - {//normal user..check failures - if ($verified["bit"] == 2) - { - header("Location: index.php?login=1&failure=2"); - } - else if ($verified["bit"] == 3 ) - { - header("Location: index.php?login=1&failure=3"); - } - else - { - header("Location: index.php?login=1&failure=1"); - } - } -} - -// -if(($login == 1) || ($failure == 1)) - { - include("./lib/header.inc"); - print("
"); -// BUG Number: 457588 -// This is to display the version inforamation -// BEGIN - print("
$lang_engine
$lang_version: $default->version

"); -// END - if($failure == 1) - { - print("
$lang_loginfail
"); - } - if($failure == 2) - { - print("
$lang_logindisabled
"); - } - if($failure == 3) - { - print("
$lang_toomanysessions
"); - } - print "
"; - - if (isset($fileid)) - { - print ""; - print ""; - } - - print ""; - print "
$lang_username:
$lang_password:
"; - print "\n"; - print "


"; - exit; -} -// when the user logouts the session is deleted from the session table -if($login == "logout") -{ - include("./lib/header.inc"); - print("
"); -// BUG Number: 457588 -// This is to display the version inforamation -// BEGIN - print("
$lang_engine
$lang_version: $default->version

"); -// END - $sql = new Owl_DB; - $sql->query("delete from $default->owl_sessions_table where sessid = '$sess'"); - print("
$lang_successlogout
"); - print ""; - print ""; - print "
$lang_username:
$lang_password:
"; - print "\n"; - print "


"; - exit; -} -include("./lib/footer.inc"); -?> diff --git a/log.php b/log.php deleted file mode 100755 index 6bb5b0c..0000000 --- a/log.php +++ /dev/null @@ -1,157 +0,0 @@ -table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); -?> - -"); - } - print uid_to_name($userid); - print (""); -?> - - -$lang_logout");?> - -");?> - -"); - // generates a navigation bar and provides details for the docs - print("table_expand_width BORDER=$default->table_border>"); - print(""); - print("
$lang_viewlog ".gen_navbar($parent)."/".flid_to_name($id)."

table_expand_width>
$filename"); - - print ("table_expand_width border=$default->table_border cellpadding=3 cellspacing=0> - - - - "); - - $sql = new Owl_DB; - - -// SPECIFIC SQL LOG QUERY - NOT USED (problematic) -// This SQL log query is designed for repository assuming there is only 1 -// digit in major revision, and noone decides to have a "_x-" in their -// filename. -// -// Has to be changed if the naming structure changes. -// Also a problem that it didn't catch the "current" -// file because of the "_x-" matching (grr) -// -//$sql->query("select * from $default->owl_files_table where filename LIKE '$filesearch[0]\__-%$filesearch[1]' order by major_revision desc, minor_revision desc"); - -// GENERIC SQL LOG QUERY - currently used. -// prone to errors when people name a set of docs -// Blah.doc -// Blah_errors.doc -// Blah_standards.doc -// etc. and search for a log on Blah.doc (it brings up all 3 docs) - -//$sql->query("select * from $default->owl_files_table where filename LIKE '$filesearch[0]%$filesearch[1]' order by major_revision desc, minor_revision desc"); -//$SQL = "select * from $default->owl_files_table where filename LIKE '$filesearch[0]%$filesearch[1]' order by major_revision desc, minor_revision desc"; -//printError("PARENT: $parent",$SQL); - -if ($default->owl_use_fs) -{ - $sql->query("Select id from $default->owl_folders_table where name='backup' and parent='$parent'"); - while($sql->next_record()) { - $backup_parent = $sql->f("id"); - } - $sql->query("select * from $default->owl_files_table where filename LIKE '$filesearch[0]%$filesearch[1]' AND (parent = $backup_parent OR parent = $parent) order by major_revision desc, minor_revision desc"); - -} -else -{ -// name based query -- assuming that the given name for the file doesn't change... - - $name = flid_to_name($id); - $sql->query("select * from $default->owl_files_table where name='$name' AND parent='$parent' order by major_revision desc, minor_revision desc"); -} - -//global $sess; -// prints out all the relevant information on the specific document - while($sql->next_record()) - { - $choped = split("\.", $sql->f("filename")); - $pos = count($choped); - $ext = strtolower($choped[$pos-1]); - - print(" - - - "); - } - - //print(" - // - // - //"); - //} - print("
$lang_ver$lang_user$lang_log_file$lang_modified
".$sql->f("major_revision").".".$sql->f("minor_revision")."".uid_to_name($sql->f("creatorid")).""); - printFileIcons($sql->f("id"),$sql->f("filename"),$sql->f("checked_out"),$sql->f("url"),$default->owl_version_control,$ext); - print("  [ ".$sql->f("filename")." ]
-
".$sql->f("description")."
".$sql->f("modified")."
".$sql->f("major_revision").".".$sql->f("minor_revision")."".uid_to_name($sql->f("creatorid"))."[ ".$sql->f("filename")." ]
- //
".$sql->f("description")."
".$sql->f("modified")."
"); - include("./lib/footer.inc"); - -?> diff --git a/modify.php b/modify.php deleted file mode 100755 index db19558..0000000 --- a/modify.php +++ /dev/null @@ -1,461 +0,0 @@ -MODIFY Sess: $sess
Loginname: $loginname
Login:$login"); - -require("./config/owl.php"); -require("./lib/owl.lib.php"); -require("./config/html.php"); -require("./lib/security.lib.php"); - -include("./lib/header.inc"); -// Begin 496814 Column Sorts are not persistant -// + ADDED &order=$order&$sortorder=$sortname to -// all browse.php? header and HREF LINES - - -switch ($order) { - case "name": - $sortorder = 'sortname'; - break; - case "major_revision": - $sortorder = 'sortver'; - break; - case "filename" : - $sortorder = 'sortfilename'; - break; - case "size" : - $sortorder = 'sortsize'; - break; - case "creatorid" : - $sortorder = 'sortposted'; - break; - case "smodified" : - $sortorder = 'sortmod'; - break; - case "checked_out": - $sortorder = 'sortcheckedout'; - break; - default: - break; -} - -// END 496814 Column Sorts are not persistant - -print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); -?> -
-"); - } - //print(""); - print uid_to_name($userid); - print (""); -?> - - -$lang_logout");?> - -");?> -
-"); - -if ($action == "file_update") { - if(check_auth($id, "file_modify", $userid) == 1) { - print("
"); - $expand = 1; - print("table_expand_width BORDER=$default->table_border>"); - print(""); - print("
$lang_updating ".gen_navbar($parent)."/".flid_to_name($id)."

table_expand_width>
"); - print(" - - - - - - - "); -// BUG FIX: #449395 expanded/collapse view bugs - print(""); -// END BUG FIX: #449395 expanded/collapse view bugs - print("table_border>"); - // begin Daphne change - version control - if ($default->owl_version_control == 1) { - print(" - "); - print(" - "); - } - // End Daphne Change - print("
table_header_bg>$lang_sendthisfile
table_header_bg valign=top>$lang_vertype
table_header_bg valign=top>$lang_verdescription -
"); - include("./lib/footer.inc"); - } else { - print($lang_noupload); - } -} - -if ($action == "file_upload") { - - if(check_auth($parent, "folder_modify", $userid) == 1) { - $expand = 1; - - /* BEGIN Bozz Change - Retrieve Group information if the user is in the - Administrator group */ - - if ( owlusergroup($userid) == 0 ) { - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table"); - $i=0; - while($sql->next_record()) { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - } - else { - $sql = new Owl_DB; - $sql->query("select userid,groupid from $default->owl_users_grpmem_table where userid = $userid "); - if ($sql->num_rows($sql) == 0) - $sql->query("SELECT u.groupid as groupid, g.name as name from $default->owl_users_table as u join $default->owl_groups_table as g where u.id = $userid and u.groupid = g.id"); - $i=0; - while($sql->next_record()) { - $groups[$i][0] = $sql->f("groupid"); - $groups[$i][1] = group_to_name($sql->f("groupid")); - $i++; - } - } - /* END Bozz Change */ - - print("table_expand_width BORDER=$default->table_border>"); - print(""); - print("
$lang_addingfile".gen_navbar($parent)."

table_expand_width>
"); - print("
- - - - - - - - table_border>"); - - if ($type == "url") - print(""); - else - print(""); - - print(" - "); - - print(" -
table_header_bg>$lang_sendthisurl:
table_header_bg>$lang_sendthisfile:
table_header_bg>$lang_title:
table_header_bg>$lang_keywords:
table_header_bg>$lang_ownergroup:
table_header_bg>"); - // Daphne Change - add wrap=hard to textarea for logs - print("$lang_description:
"); - include("./lib/footer.inc"); - } else { - print($lang_noupload); - } -} - -if ($action == "file_modify") { - if(check_auth($id, "file_modify", $userid) == 1) { - $expand = 1; - - /* BEGIN Bozz Change - Retrieve Group information if the user is in the - Administrator group */ - - if ( owlusergroup($userid) == 0 ) { - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table"); - $i=0; - while($sql->next_record()) { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - $sql->query("select id,name from $default->owl_users_table"); - $i=0; - while($sql->next_record()) { - $users[$i][0] = $sql->f("id"); - $users[$i][1] = $sql->f("name"); - $i++; - } - } - else { - if (uid_to_name($userid) == fid_to_creator($id)) { - $sql = new Owl_DB; - $sql->query("select userid,groupid from $default->owl_users_grpmem_table where userid = $userid "); - if ($sql->num_rows($sql) == 0) - $sql->query("SELECT u.groupid as groupid, g.name as name from $default->owl_users_table as u join $default->owl_groups_table as g where u.id = $userid and u.groupid = g.id"); - $i=0; - while($sql->next_record()) { - $groups[$i][0] = $sql->f("groupid"); - $groups[$i][1] = group_to_name($sql->f("groupid")); - $i++; - } - $mygroup = owlusergroup($userid); - $sql->query("select id,name from $default->owl_users_table where groupid='$mygroup'"); - $i=0; - while($sql->next_record()) { - $users[$i][0] = $sql->f("id"); - $users[$i][1] = $sql->f("name"); - $i++; - } - } - } - - /* END Bozz Change */ - - print("table_expand_width BORDER=$default->table_border>"); - print(""); - print("
$lang_modifying".gen_navbar($parent)."/".flid_to_name($id)."

table_expand_width>
"); - $sql = new Owl_DB; $sql->query("select * from $default->owl_files_table where id = '$id'"); - while($sql->next_record()) { - print("table_border> - "); - // Bozz Change Begin - - - - $security = $sql->f("security"); - $current_groupid = owlfilegroup($id); - $current_owner = owlfilecreator($id); - - if ( owlusergroup($userid) == 0 || uid_to_name($userid) == fid_to_creator($id)) - { - print(""); - -print(""); - printfileperm($security, "security", "$lang_permissions:","admin"); - } - else - { - print(""); - print(""); - print(""); - print(""); - } - // Bozz change End - //print(" - print(" -
table_header_bg> - $lang_title:f("name")."\">
table_header_bg>$lang_file:".$sql->f("filename")." (".gen_filesize($sql->f("size")).")
table_header_bg>$lang_ownership:
table_header_bg>$lang_ownergroup:
table_header_bg>$lang_ownership:".fid_to_creator($id)." (".group_to_name(owlfilegroup($id)).")
table_header_bg>$lang_keywords:
table_header_bg VALIGN=TOP> - $lang_description: - - - - - -
- -
"); - include("./lib/footer.inc"); - } - } else { - print("

".$lang_nofilemod); - } -} - -if ($action == "folder_create") { - if(check_auth($parent, "folder_modify", $userid) == 1) { - $expand=1; - - /* BEGIN Bozz Change - Retrieve Group information if the user is in the - Administrator group */ - - - - $sql = new Owl_DB; - if ( owlusergroup($userid) == 0 ) { - $sql->query("SELECT id,name from $default->owl_groups_table"); - } - else { - $sql->query("SELECT * from $default->owl_users_grpmem_table join $default->owl_groups_table where id = groupid and userid = $userid"); - if ($sql->num_rows($sql) == 0) - $sql->query("SELECT u.groupid as id, g.name as name from $default->owl_users_table as u join $default->owl_groups_table as g where u.id = $userid and u.groupid = g.id"); - } - $i=0; - while($sql->next_record()) { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - - /* END Bozz Change */ - - print("table_expand_width BORDER=$default->table_border>
$lang_addingfolder ".gen_navbar($parent)."

table_expand_width>
- table_border> - - - - "); - - /* BEGIN Bozz Change - Display Retrieved Group information if the user is in the - Administrator group */ - print("
table_header_bg>$lang_name:
- -
table_header_bg>$lang_ownergroup:
"); - include("./lib/footer.inc"); - } else { - print($lang_nosubfolder); - } -} - -if ($action == "folder_modify") { - if(check_auth($id, "folder_property", $userid) == 1) { - $expand=1; - - /* BEGIN Bozz Change - Retrieve Group information if the user is in the - Administrator group */ - - if ( owlusergroup($userid) == 0 ) { - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table"); - $i=0; - while($sql->next_record()) { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - } - /* END Bozz Change */ - - print("table_expand_width BORDER=$default->table_border>"); - print(""); - print("
$lang_modifying ".gen_navbar($id)."

table_expand_width>
table_border>"); - $sql = new Owl_DB; $sql->query("select * from $default->owl_folders_table where id = '$id'"); - while($sql->next_record()) { - $security = $sql->f("security"); - - print(""); - print(""); - //print(""); - print(" - - - - - "); - - /* BEGIN Bozz Change - Display Retrieved Group information if the user is in the - Administrator group */ - if ( owlusergroup($userid) == 0 ) - { - print("
table_header_bg>$lang_name:
table_header_bg>$lang_policy:$security
table_header_bg>$lang_ownership:".uid_to_name(owlfoldercreator($id))." (".group_to_name(owlfoldergroup($id)).")
table_header_bg>$lang_ownergroup:
- "); - include("./lib/footer.inc"); - - } - } else { - print($lang_nofoldermod); - } -} - -if ($action == "file_email") { - if(check_auth($id, "file_modify", $userid) == 1) { - print("
"); - $expand = 1; - - $sql = new Owl_DB; - $sql->query("select * from $default->owl_users_table where id = '$userid'"); - $sql->next_record(); - $default_reply_to = $sql->f("email"); - - print("
"); - print(""); - - print("table_expand_width BORDER=$default->table_border>"); - print(""); - print("
$lang_emailing ".gen_navbar($parent)."/".flid_to_name($id)."

table_expand_width>
"); - print(" - - - - - - - - "); - - print(""); - print("table_border> - - - "); - print(" - "); - print("
table_header_bg>$lang_email_to
table_header_bg>$lang_email_cc
table_header_bg>$lang_email_reply_to
table_header_bg>$lang_email_subject
table_header_bg valign=top>$lang_email_body
"); - include("./lib/footer.inc"); - } else { - print($lang_noemail); - } -} - -?> diff --git a/move.php b/move.php deleted file mode 100755 index 17438d6..0000000 --- a/move.php +++ /dev/null @@ -1,296 +0,0 @@ -table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - - "); - } - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - - - "); ?> -

- table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - ?> - - "); - } - print uid_to_name($userid); - print (""); - ?> - - - $lang_logout");?> - - "); ?> -

- owl_root_url/locale/$default->owl_lang/graphics/icons/blank.gif' height=16 width=18 align=top>"; - if ($fDepth) print ""; - - $gray=0; // Work out when to gray out folders ... - if ($fid==$excludeID) $gray=1; // current parent for all moves - if (($action=="folder") && ($fid==$id)) $gray=1; // subtree for folder moves - if (check_auth($fid, "folder_modify", $userid) == 0) $gray = 1; // check for permissions - - - if ($gray) { - print ""; - print " $folder
\n"; - } else { - print " $folder
\n"; - } - - if (($action=="folder") && ($fid==$id)) return; // Don't show subtree of selected folder as target for folder move - for ($c=0; $c<$fCount; $c++) { - if ($folderList[$c][2]==$fid) { - $fDepth++; - showFoldersIn( $folderList[$c][0] , $folderList[$c][1] ); - $fDepth--; - } - } -} - -if ($action=="$lang_cancel_button") { - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); - exit(); -} - -checkForNewFolder(); -if (isset($newFolder)) { - $sql = new Owl_DB; - - $source=""; - $fID=$parent; - do { - $sql->query("select name,parent from $default->owl_folders_table where id='$fID'"); - while($sql->next_record()) { - $tName = $sql->f("name"); - $fID = $sql->f("parent"); - } - $source=$tName."/".$source; - } while ($fID != 0); - - $dest=""; - $fID=$newFolder; - do { - $sql->query("select name,parent from $default->owl_folders_table where id='$fID'"); - while($sql->next_record()) { - $tName = $sql->f("name"); - $fID = $sql->f("parent"); - } - $dest=$tName."/".$dest; - } while ($fID != 0); - - if ($action=="file") { - $sql = new Owl_DB; - $sql->query("select filename, parent from $default->owl_files_table where id = '$id'"); - while($sql->next_record()) { - $fname = $sql->f("filename"); - $parent = $sql->f("parent"); - } - } else { - $sql = new Owl_DB; - $sql->query("select name, parent from $default->owl_folders_table where id='$id'"); - while($sql->next_record()) { - $fname = $sql->f("name"); - $parent = $sql->f("parent"); - } - } - - - if($default->owl_use_fs) { - if ($type != "url") { - if (!file_exists("$default->owl_FileDir/$dest$fname")) { - if (substr(php_uname(), 0, 7) != "Windows") { - $cmd="mv \"$default->owl_FileDir/$source$fname\" \"$default->owl_FileDir/$dest\" 2>&1"; - $lines=array();$errco=0; - $result = myExec($cmd,$lines,$errco); - if ( $errco != 0 ) - printError($lang_err_movecancel, $result); - } - else { - // IF Windows just do a rename and hope for the best - rename ("$default->owl_FileDir/$source$fname", "$default->owl_FileDir/$dest/$fname"); - } - } - else - printError($lang_err_fileexists,$result); - } - } - - - if ($action=="file") { - $sql->query("update $default->owl_files_table set parent='$newFolder' where id='$id'"); - } else { - $sql->query("update $default->owl_folders_table set parent='$newFolder' where id='$id'"); - } - - - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname"); -} - - - // First time through. Generate screen for selecting target directory - -include("./lib/header.inc"); -print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); -?> -
-"); - } - print uid_to_name($userid); - print (""); -?> - - -$lang_logout");?> - -");?> -
-"); - - // Get information about file or directory we want to move - -if ($action=="file") { - $sql = new Owl_DB; - $sql->query("select filename, parent from $default->owl_files_table where id='$id'"); -} else { - $sql = new Owl_DB; - $sql->query("select name, parent from $default->owl_folders_table where id='$id'"); -} - -while($sql->next_record()) { - if($action == "file") $fname = $sql->f("filename"); - if($action == "folder") $fname = $sql->f("name"); - $parent = $sql->f("parent"); -} - -//print "

$lang_moving $action $fname. $lang_select

"; -print "

$lang_moving $fname. $lang_select

"; -?> -
-
- - - - - - -

-query("select id,name,parent from $default->owl_folders_table order by name"); - -$i=0; -while($sql->next_record()) { - $folderList[$i][0] = $sql->f("id"); - $folderList[$i][1] = $sql->f("name"); - $folderList[$i][2] = $sql->f("parent"); - $i++; -} - -$fCount = count($folderList); - -$fDepth=0; -$excludeID=$parent; // current location should not be a offered as a target -showFoldersIn(1, fid_to_name("1")); - -?> -

-
- - -
-
- - diff --git a/prefs.php b/prefs.php deleted file mode 100755 index a761109..0000000 --- a/prefs.php +++ /dev/null @@ -1,199 +0,0 @@ -table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); -?> - - -$lang_logout"); -?> - -");?> - - -

-"); - } - - // get the id and name from the groups table - $sql = new Owl_DB; - $sql->query("select id,name from $default->owl_groups_table"); - $i=0; - - // store in a double array - while($sql->next_record()) - { - $groups[$i][0] = $sql->f("id"); - $groups[$i][1] = $sql->f("name"); - $i++; - } - - //get all information from the users table based on the group id - $sql->query("select * from $default->owl_users_table where id = '$id'"); - // loop through the recordset - while($sql->next_record()) - { - print("
"); - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - print(""); - - //******************************* - // Display the Language dropdown - //******************************* - - print(""); - print(""); - print(""); - print(""); - print(""); - - // check if notification has been checked on - if ( $sql->f("notify") == 1) - { - print(""); - } - else - { - print(""); - } - - // check if attachfile has been checked - if ( $sql->f("attachfile") == 1) - { - print(""); - } - else - print(""); - print("
table_header_bg align=right>$lang_title
table_header_bg align=right>$lang_userlang
table_header_bg align=right>$lang_oldpassword
table_header_bg align=right>$lang_newpassword
table_header_bg align=right>$lang_confpassword
table_header_bg align=right>$lang_email
table_header_bg align=right>$lang_notification
table_header_bg align=right>$lang_notification
table_header_bg align=right>$lang_attach_file
table_header_bg align=right>$lang_attach_file

"); - print("
"); - } -} - -//------------------------------------------------------------- -// if an action has occurred, check if user is set and then print out user preferences -if($action) -{ - if(isset($owluser)) - { - printuser($owluser); - } -} -else -{ - exit("$lang_err_general"); -} - -$expand = 0; -include("./lib/footer.inc"); - -?> diff --git a/search.php b/search.php deleted file mode 100755 index 3432cad..0000000 --- a/search.php +++ /dev/null @@ -1,291 +0,0 @@ -query("select parent from $default->owl_folders_table where id = '$parent'"); - while($sql->next_record()) - { - $path = fid_to_name($sql->f("parent"))."/".$path; - $parent = $sql->f("parent"); - } - } - return $path; -} - -// This Layout section will not be needed as it is going to change - -// BEGIN patch Scott Tigr -// patch for layout -include("./lib/header.inc"); - - print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); - print(""); - print(""); - print(""); - print(""); - print(""); - print("
"); - print("
"); - print uid_to_name($userid); - print(" : $lang_logout 
"); - -print "
"; -print "
"; -if ($expand == 1) -{ // long view - print("\t\ttable_expand_width."\" border=\"0\">\n"); -} -else -{ - print("\t\t
table_collapse_width>\n"); -} - - print("\t\t\t
".$lang_search.": "); - - print(gen_navbar($parent) . "
"); - -// END patch Scott Tigr - -$groupid = owlusergroup($userid); - -// first we have to find out what we can search -// we need a list of all folder that can be searched -// so we need to see which folders the user can read -$sql = new Owl_DB; -$sql->query("SELECT id,creatorid,groupid,security FROM $default->owl_folders_table"); - -// -// get all the folders that the user can read -while($sql->next_record()) -{ - $id = $sql->f("id"); - if(check_auth($id, "folder_view", $userid) == 1) $folders[$id] = $id; -} - -// -// get all the files in those folders that the user can read -foreach($folders as $item) -{ - $sql->query("SELECT * FROM $default->owl_files_table where parent = '$item'"); - while($sql->next_record()) - { - $id = $sql->f("id"); - - if(check_auth($id, "file_download", $userid) == 1) - { - $files[$id][id] = $id; - $files[$id][n] = $sql->f("name"); - $files[$id][m] = explode(" ", $sql->f("metadata")); - $files[$id][d] = explode(" ", $sql->f("description")); - $files[$id][f] = $sql->f("filename"); - $files[$id][c] = $sql->f("checked_out"); - $files[$id][u] = $sql->f("url"); - $files[$id][p] = $sql->f("parent"); - $files[$id][score] = 0; - } - } -} - -// -// right now we have the array $files with all possible files that the user has read access to - -// BEGIN bufix Scott Tigr -// error_handler if query empty - -if (strlen(trim($query))>0) { - -// END bugfix Scott Tigr - -// -// break up our query string -$query = explode(" ", $query); - -// -// the is the meat of the matching -if(sizeof($files) > 0) { -foreach($query as $keyword) - { - foreach(array_keys($files) as $key) - { - // BEGIN enhancement Sunil Savkar - // if the $parent string contains a keyword to be searched, then the score is - // adjusted. This takes into account the hierarchy. - - // if keyword is found in the path - if(eregi("$keyword", find_path($files[$key][p]))) - { - $files[$key][score] = $files[$key][score] + 4; - } - - //if keyword is found in the files array - if(eregi("$keyword", $files[$key][n])) - { - $files[$key][score] = $files[$key][score] + 4; - } - - if(eregi("$keyword", $files[$key][f])) - { - $files[$key][score] = $files[$key][score] + 3; - } - // if keyword is found in metadata - foreach($files[$key][m] as $metaitem) - { - // add 2 to the score if we find it in metadata (key search items) - if(eregi("$keyword", $metaitem)) - { - $files[$key][score] = $files[$key][score] + 2; - } - } - - // if keyword is found in description - foreach($files[$key][d] as $descitem) - { - // only add 1 for regular description matches - if(eregi("$keyword", $descitem)) - { - $files[$key][score] = $files[$key][score] + 1; - } - } - } -} -} -// -// gotta find order to the scores...any better ideas? -print "$lang_search_results_for \"".implode(" ", $query)."\"



"; -$max = 30; -$hit = 1; -$CountLines = 0; -$iconfiles = array("html","htm","gif","jpg","bmp","zip","tar","doc","mdb","xls","ppt","pdf","gz","mp3","tgz"); - -//if array exists print out the results based on their score of relavence -// This section will have to change as the interface is changing -if(sizeof($files) > 0) -{ - while($max > 0) - { - foreach(array_keys($files) as $key) - { - if($files[$key][score] == $max) - { - $name = find_path($files[$key][p])."/".$files[$key][n]; - $filename = $files[$key][f]; - $choped = split("\.", $filename); - $pos = count($choped); - $ext = strtolower($choped[$pos-1]); - print("table_expand_width BORDER=$default->table_border CELLSPACING=1 CELLPADDING=1>"); - - $CountLines++; - $PrintLines = $CountLines % 2; - if ($PrintLines == 0) - { - print(""); - } - else - print(""); - print ""; - print(""; - print(""); - print("
"; - //for ($i=$max; $i>0; $i--) { - - //} - - // display results based on relevance (different graphics) and score - $t_score = $max; - for ($c=$max; $c>=1; $c--) - { - if ( $t_score >= 10) - { - if ( 0 == ($c % 10)) - { - print ""; - $t_score = $t_score - 10; - } - } - else - { - if ( (0 == ($t_score % 2)) && $t_score > 0 ) - { - print ""; - } - $t_score = $t_score - 1; - } - - } - - //print "
($lang_score $max)"; - print "
"); - print "$hit. ".$name.""); - - if ($files[$key][u] == "1") - print(" "); - else { - if (preg_grep("/$ext/",$iconfiles)) - print(" "); - else - print(" "); - } - - print("  $filename"); - printFileIcons($files[$key][id],$name,$files[$key][c],$files[$key][u],$default->owl_version_control,$ext); - print("
"); - //print "
".implode(" ", $files[$key][d])."

"; - $hit++; - } - } - $max--; - } -} -print "
table_expand_width."\" ALIGN=\"center\">
"; -print "

"; - -// BEGIN bugfix Scott Tigr -// error_handler if query empty -} // end of check strlen(query) -else { // if query was empty - - - -print("

" . $lang_query_empty . "

"); - -} - -include("./lib/footer.inc"); - -// END bugfix Scott Tigr -?> diff --git a/test.php b/test.php deleted file mode 100644 index 99119dd..0000000 --- a/test.php +++ /dev/null @@ -1,39 +0,0 @@ -"www.google.com",1=>"www.yahoo.com",2=>"www.msn.com"); -$aTopMenuText = array(0=>"google",1=>"yahoo",2=>"msn"); -$oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, $aTopMenuText, 3, 1); - -/* build the central grid for paging through results */ -$aCentralPageColumns = array(0=>"name",1=>"parent",2=>"security"); -$aColumnTypes = array(0=>1,1=>2,2=>1); -$oTableSqlQuery = & new PatternTableSqlQuery("Folders", $aCentralPageColumns, $aColumnTypes); -($HTTP_GET_VARS["fStartIndex"]) ? $oTableSqlQuery->setStartIndex($HTTP_GET_VARS["fStartIndex"]) : $oTableSqlQuery->setStartIndex(0); -$oTableSqlQuery->setLinkType(1); - - - -/* get a page */ -$tmp = new PatternMainPage(); - -/* put the page together */ -$tmp->setNorthWestPayload($img); -$tmp->setNorthPayload($oPatternTableLinks); -$tmp->setCentralPayload($oTableSqlQuery); -$tmp->setFormAction("Navigate.inc"); -$tmp->render(); - - - -?> diff --git a/view.php b/view.php deleted file mode 100755 index 4980a01..0000000 --- a/view.php +++ /dev/null @@ -1,263 +0,0 @@ -query("select parent from $default->owl_folders_table where id = '$parent'"); - while($sql->next_record()) { - $path = fid_to_name($sql->f("parent"))."/".$path; - $parent = $sql->f("parent"); - } - } - return $path; -} - -function fid_to_filename($id) { - global $default; - $sql = new Owl_DB; - $sql->query("select filename from $default->owl_files_table where id = '$id'"); - while($sql->next_record()) return $sql->f("filename"); -} - -if($action == "image_show") { - if(check_auth($id, "file_download", $userid) == 1) { - if ($default->owl_use_fs) { - $path = $default->owl_FileDir."/".find_path($parent)."/".fid_to_filename($id); - readfile("$path"); - } - else { - $sql = new Owl_DB; - $filename = fid_to_filename($id); - if ($filetype = strrchr($filename,".")) { - $filetype = substr($filetype,1); - $sql->query("select * from $default->owl_mime_table where filetype = '$filetype'"); - while($sql->next_record()) $mimeType = $sql->f("mimetype"); - } - if ($mimeType) { - header("Content-Type: $mimeType"); - $sql->query("select data,compressed from " . $default->owl_files_data_table . " where id='$id'"); - while($sql->next_record()) { - if ($sql->f("compressed")) { - $tmpfile = $default->owl_FileDir . "owltmp.$id"; - if (file_exists($tmpfile)) unlink($tmpfile); - $fp=fopen($tmpfile,"w"); - fwrite($fp, $sql->f("data")); - fclose($fp); - flush(passthru($default->gzip_path . " -dfc $tmpfile")); - unlink($tmpfile); - } else { - print $sql->f("data"); - } - } - } - } - } else { - print($lang_nofileaccess); - } - die; -} -print("table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>"); -?> -
-"); - } - print uid_to_name($userid); - print (""); -?> - -$lang_logout");?> - -");?> -
-table_expand_width BORDER=$default->table_border>"); - print("".gen_navbar($parent)."/".flid_to_name($id).""); - print("
table_expand_width>
"); - $sql = new Owl_DB; $sql->query("select * from $default->owl_files_table where id = '$id'"); - while($sql->next_record()) { - $security = $sql->f("security"); - if ($security == "0") $security = $lang_everyoneread; - if ($security == "1") $security = $lang_everyonewrite; - if ($security == "2") $security = $lang_groupread; - if ($security == "3") $security = $lang_groupwrite; - if ($security == "4") $security = $lang_onlyyou; - if ($security == "5") $security = $lang_groupwrite_nod; - if ($security == "6") $security = $lang_everyonewrite_nod; - if ($security == "7") $security = $lang_groupwrite_worldread; - if ($security == "8") $security = $lang_groupwrite_worldread_nod; - - print("table_border> - - - - - -
table_header_bg> - $lang_title:".$sql->f("name")."
table_header_bg>$lang_file:".$sql->f("filename")." (".gen_filesize($sql->f("size")).")
table_header_bg>$lang_ownership:".fid_to_creator($id)." (".group_to_name(owlfilegroup($id)).")
table_header_bg>$lang_permissions:$security
table_header_bg>$lang_keywords:".$sql->f("metadata")."
table_header_bg VALIGN=TOP>$lang_description:

"); - include("./lib/footer.inc"); - } - } -} - -if($action == "image_preview") { - if(check_auth($id, "file_download", $userid) == 1) { - $path = find_path($parent)."/".fid_to_filename($id); - print("$lang_viewing". gen_navbar($parent) . "/" . fid_to_filename($id) ."


"); - print(""); - } else { - print($lang_nofileaccess); - } -} - -if($action == "zip_preview") { - if(check_auth($id, "file_download", $userid) == 1) { - $name = fid_to_filename($id); - - if ($default->owl_use_fs) { - $path = find_path($parent)."/".$name; - } else { - $path = $name; - if (file_exists($default->owl_FileDir. "/$path")) unlink($default->owl_FileDir. "/$path"); - $file = fopen($default->owl_FileDir. "/$path", 'wb'); - $sql->query("select data,compressed from $default->owl_files_data_table where id='$id'"); - while($sql->next_record()) { - if ($sql->f("compressed")) { - - $tmpfile = $default->owl_FileDir . "owltmp.$id.gz"; - $uncomptmpfile = $default->owl_FileDir . "owltmp.$id"; - if (file_exists($tmpfile)) unlink($tmpfile); - - $fp=fopen($tmpfile,"w"); - fwrite($fp, $sql->f("data")); - fclose($fp); - - system($default->gzip_path . " -df $tmpfile"); - - $fsize = filesize($uncomptmpfile); - $fd = fopen($uncomptmpfile, 'rb'); - $filedata = fread($fd, $fsize); - fclose($fd); - - fwrite($file, $filedata); - unlink($uncomptmpfile); - } else { - fwrite($file, $sql->f("data")); - } - fclose($file); - } - - } - - //$path = find_path($parent)."/".$name; - $expr = "-t"; - if(ereg("gz", $name)) $expr .= "z"; - print("$lang_viewing". gen_navbar($parent) . "/" . fid_to_filename($id) ."


"); - print("table_border CELLPADDING=0 CELLSPACING=0>
");
-		passthru("$default->tar_path $expr < $default->owl_FileDir/$path | sort");
-		unlink($default->owl_FileDir. "/$path");
-		print("
"); - } else { - print($lang_nofileaccess); - } -} - -// BEGIN wes change -if($action == "html_show" || $action == "text_show") { - if(check_auth($id, "file_download", $userid) == 1) { - if ($default->owl_use_fs) { - $path = $default->owl_FileDir."/".find_path($parent)."/".fid_to_filename($id); - print("
$lang_viewing". gen_navbar($parent) . "/" . fid_to_filename($id) ."


"); - if ($action == "text_show") print(""); - readfile("$path"); - } else { - print("$lang_viewing /".find_path($parent)."/".fid_to_filename($id)."<HR WIDTH=50%><BR><BR></CENTER>"); - if ($action == "text_show") print("<xmp>"); - - $sql->query("select data,compressed from " . $default->owl_files_data_table . " where id='$id'"); - - while($sql->next_record()) { - - if ($sql->f("compressed")) { - - $tmpfile = $default->owl_FileDir . "owltmp.$id"; - if (file_exists($tmpfile)) unlink($tmpfile); - - $fp=fopen($tmpfile,"w"); - fwrite($fp, $sql->f("data")); - fclose($fp); - flush(passthru($default->gzip_path . " -dfc $tmpfile")); - unlink($tmpfile); - } else { - print $sql->f("data"); - } - } - } - $path = find_path($parent)."/".fid_to_filename($id); - } else { - print($lang_nofileaccess); - } -} -// end wes change - -?>