Commit 3cdbd0ae8a3389d98ad7fbe543652af2dd46b33b

Authored by Michael Joseph
1 parent f7c3594d

Initial revision


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 612 changed files with 19799 additions and 0 deletions

Too many changes.

To preserve performance only 100 of 612 files are displayed.

Documents/test.txt 0 → 100755
  1 +You have successfuly installed OWL.
... ...
admin/admin_dbmodify.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 + * admin_dbmodify.php
  5 + *
  6 + * Copyright (c) 1999-2002 The Owl Project Team
  7 + * Licensed under the GNU GPL. For full terms see the file COPYING.
  8 + *
  9 + * $Id$
  10 + */
  11 +require("../config/owl.php");
  12 +require("../lib/owl.lib.php");
  13 +require("../config/html.php");
  14 +
  15 +if(owlusergroup($userid) != 0) exit("$lang_err_unauth_area");
  16 +
  17 +
  18 +if($action == "user") {
  19 + $maxsessions = $maxsessions - 1; // always is stored - 1
  20 + $sql = new Owl_DB;
  21 + $sql->query("SELECT * FROM $default->owl_users_table WHERE id = '$id'");
  22 + $sql->next_record();
  23 + $newpass = $sql->f("password");
  24 + if ($newpass == $password) {
  25 + $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'");
  26 + }
  27 + else
  28 + {
  29 + $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'");
  30 + }
  31 + // Bozz Change BEGIN
  32 +
  33 + // Clean Up the member group table first
  34 +
  35 + $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id");
  36 +
  37 + // Insert the new Choices the member group table with selected groups
  38 + for ( $i = 0 ; $i <= $no_groups_displayed; $i++ ) {
  39 + $checkboxfields = 'group' . $i;
  40 + if($$checkboxfields != '') {
  41 + $checkboxvalue = $$checkboxfields;
  42 + $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$id', '$checkboxvalue')");
  43 + }
  44 + }
  45 + /* Bozz Change END */
  46 + header("Location: index.php?sess=$sess&action=users&owluser=$id&change=1");
  47 +}
  48 +
  49 +if($action == "group") {
  50 + global $default;
  51 + $sql = new Owl_DB;
  52 + $sql->query("UPDATE $default->owl_groups_table SET name='$name' where id = '$id'");
  53 + header("Location: index.php?sess=$sess&action=groups&group=$id&change=1");
  54 +}
  55 +
  56 +// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php
  57 +if($action == $lang_deleteuser) {
  58 +// END BUG FIX: #448232 mistake in admin_dbmodify.php
  59 + $sql = new Owl_DB;
  60 + $sql->query("DELETE FROM $default->owl_users_table WHERE id = '$id'");
  61 + // Bozz Change Begin
  62 + // Also Clean up the groupmember table when a user is deleted
  63 + $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id");
  64 + // Bozz Change End
  65 + header("Location: index.php?sess=$sess&action=users");
  66 +}
  67 +
  68 +if($action == "edhtml") {
  69 + $sql = new Owl_DB;
  70 + $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' ");
  71 +
  72 + header("Location: index.php?sess=$sess&action=edhtml&change=1");
  73 +
  74 +}
  75 +
  76 +if($action == "edprefs") {
  77 + $sql = new Owl_DB;
  78 +
  79 + if ($lookAtHD != "false" )
  80 + $lookAtHD = "true";
  81 + if ($owl_expand != "1")
  82 + $owl_expand = "0";
  83 + if ($version_control != "1")
  84 + $version_control = "0";
  85 +
  86 + $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'");
  87 +
  88 + header("Location: index.php?sess=$sess&action=edprefs&change=1");
  89 +}
  90 +
  91 +// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php
  92 +if($action == $lang_deletegroup ) {
  93 +// END BUG FIX: #448232 mistake in admin_dbmodify.php
  94 + global $default;
  95 + $sql = new Owl_DB;
  96 + $sql->query("DELETE FROM $default->owl_groups_table WHERE id = '$id'");
  97 + header("Location: index.php?sess=$sess&action=groups");
  98 +}
  99 +
  100 +if($action == "add") {
  101 + if($type == "user") {
  102 + $maxsessions = $maxsessions - 1; // always is stored - 1
  103 + $sql = new Owl_DB;
  104 + $sql->query("SELECT * FROM $default->owl_users_table WHERE username = '$loginname'");
  105 + if($sql->num_rows($sql) > 0) die ("$lang_err_user_exists");
  106 + $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')");
  107 + // Bozz Change BEGIN
  108 + // Populated the member group table with selected groups
  109 + $sql->query("SELECT id FROM $default->owl_users_table WHERE username = '$loginname'");
  110 + $sql->next_record();
  111 + $newuid = $sql->f("id");
  112 + for ( $i = 0 ; $i <= $no_groups_displayed; $i++ ) {
  113 + $checkboxfields = 'group' . $i;
  114 + if($$checkboxfields != '') {
  115 + $checkboxvalue = $$checkboxfields;
  116 + $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$newuid', '$checkboxvalue')");
  117 + }
  118 + }
  119 + /* Bozz Change END */
  120 + if($home == "1") {
  121 + $sql->query("select * from $default->owl_users_table where username = '$loginname'");
  122 + while($sql->next_record()) $id = $sql->f("id");
  123 + $sql->query("insert into $default->owl_folders_table values (0, '$loginname', '2', '54', '$groupid', '$id')");
  124 + mkdir($default->owl_fs_root."/".fid_to_name("1")."/Home/$loginname", 0777);
  125 + }
  126 + header("Location: index.php?sess=$sess");
  127 + } elseif($type == "group") {
  128 + $sql = new Owl_DB;
  129 + $sql->query("INSERT INTO $default->owl_groups_table (name) VALUES ('$name')");
  130 + header("Location: index.php?sess=$sess");
  131 + }
  132 +}
  133 +
  134 +?>
... ...
admin/index.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 + * index.php
  5 + *
  6 + * Copyright (c) 1999-2002 The Owl Project Team
  7 + * Licensed under the GNU GPL. For full terms see the file COPYING.
  8 + *
  9 + * $Id$
  10 + */
  11 +
  12 +require("../config/owl.php");
  13 +require("../lib/owl.lib.php");
  14 +require("../config/html.php");
  15 +
  16 +
  17 +if($action == "backup") dobackup();
  18 +
  19 +include("../lib/header.inc");
  20 +print("<CENTER>");
  21 +
  22 +if($usergroupid != "0") die("$lang_err_unauthorized");
  23 +
  24 +if(!isset($action)) $action = "users";
  25 +
  26 +function printusers() {
  27 + global $sess, $default, $lang_users;
  28 +
  29 + $sql = new Owl_DB;
  30 + $sql_active_sess = new Owl_DB;
  31 +
  32 + $sql->query("select username,name,id,maxsessions from $default->owl_users_table order by name");
  33 +
  34 +
  35 + /* print("<TABLE><TR><TD BGCOLOR=$default->table_header_bg>$lang_users</TD></TR>");
  36 +
  37 +
  38 + print("<tr><td><form method=post action=index.php?sess=$sess&action=users>");
  39 + print("<input type=hidden name=sess value=$sess>");
  40 + print("<input type=hidden name=action value=users>");
  41 + print("<tr><td><select name=owluser>");
  42 +
  43 + while($sql->next_record()) {
  44 + $uid = $sql->f("id");
  45 + $username = $sql->f("username");
  46 + $name = $sql->f("name");
  47 + $maxsess = $sql->f("maxsessions") + 1;
  48 + $numrows = 0;
  49 +
  50 + $sql_active_sess->query("select * from $default->owl_sessions_table where uid = $uid");
  51 + $sql_active_sess->next_record();
  52 + $numrows = $sql_active_sess->num_rows($sql_active_sess);
  53 +
  54 + if ($name == "")
  55 + print("<option value=".$uid.">".$username."</option>");
  56 + else
  57 + if ($uid == $owluser)
  58 + print("<option value=".$uid." SELECTED>(".$numrows."/".$maxsess.") ".$name."</option>");
  59 + else
  60 + print("<option value=".$uid." >(".$numrows."/".$maxsess.") ".$name."</option>");
  61 + }
  62 + print("</select><input type=submit value=Go></td></tr></table>"); */
  63 +
  64 +
  65 + print("<TABLE BORDER=$default->table_border><TR><TD BGCOLOR=$default->table_header_bg>$lang_users</TD><TD BGCOLOR=$default->table_header_bg>&nbsp</TD></TR>");
  66 +
  67 +
  68 + while($sql->next_record()) {
  69 + $uid = $sql->f("id");
  70 + $username = $sql->f("username");
  71 + $name = $sql->f("name");
  72 + $maxsess = $sql->f("maxsessions") + 1;
  73 + $numrows = 0;
  74 +
  75 + $sql_active_sess->query("select * from $default->owl_sessions_table where uid = $uid");
  76 + $sql_active_sess->next_record();
  77 + $numrows = $sql_active_sess->num_rows($sql_active_sess);
  78 +
  79 + if ($name == "")
  80 + print("<TR><TD align=left><A HREF='index.php?sess=$sess&action=users&owluser=".$uid."'>".$username."</A></TD>");
  81 + else
  82 + print("<TR><TD align=left><A HREF='index.php?sess=$sess&action=users&owluser=".$uid."'>".$name."</A></TD>");
  83 + print("<TD align='right'>(".$numrows."/".$maxsess.")</TD></TR>");
  84 + }
  85 + print("</TABLE>");
  86 +}
  87 +
  88 +function printgroups() {
  89 + global $sess, $lang_groups, $default;
  90 + $sql = new Owl_DB;
  91 + $sql->query("select name,id from $default->owl_groups_table order by name");
  92 + print("<TABLE BORDER=$default->table_border><TR><TD BGCOLOR=$default->table_header_bg>$lang_groups</TD></TR>");
  93 + while($sql->next_record()) {
  94 + print("<TR><TD align=left><A HREF='index.php?sess=$sess&action=groups&group=".$sql->f("id")."'>".$sql->f("name")."</A></TD></TR>");
  95 + }
  96 + print("</TABLE>");
  97 +}
  98 +
  99 +function printuser($id) {
  100 + 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;
  101 + global $lang_flush_sessions_alt, $lang_flushed, $lang_deleteuser, $lang_email, $lang_notification, $default, $flush;
  102 +
  103 + if($change == 1) print("$lang_saved<BR>");
  104 +
  105 + if ($flush == 1) {
  106 + flushsessions($id, $sess);
  107 + print($lang_flushed);
  108 + }
  109 +
  110 + $sql = new Owl_DB;
  111 + $sql->query("select id,name from $default->owl_groups_table order by name");
  112 + $i=0;
  113 + while($sql->next_record()) {
  114 + $groups[$i][0] = $sql->f("id");
  115 + $groups[$i][1] = $sql->f("name");
  116 + $i++;
  117 + }
  118 + $sql->query("select * from $default->owl_users_table where id = '$id'");
  119 + while($sql->next_record()) {
  120 + print("<FORM ACTION='admin_dbmodify.php' METHOD=POST>");
  121 + print("<INPUT TYPE=HIDDEN NAME=id VALUE=".$sql->f("id").">");
  122 + print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");
  123 + print("<INPUT TYPE=HIDDEN name=action VALUE=user>");
  124 + print("<TABLE BORDER=$default->table_border><TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_title</TD><TD align=left><INPUT TYPE=text NAME=name VALUE='".$sql->f("name")."'></TD></TR>");
  125 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_group</TD><TD align=left><SELECT NAME=groupid>");
  126 + print("<OPTION VALUE=".$sql->f("groupid").">".group_to_name($sql->f("groupid")));
  127 + foreach($groups as $g) {
  128 + print("<OPTION VALUE=$g[0]>$g[1]");
  129 + }
  130 + print("</SELECT></TD></TR>");
  131 + //*******************************
  132 + // Display the Language dropdown
  133 + //*******************************
  134 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_userlang</TD><TD align=left><SELECT NAME=newlanguage>");
  135 + print("<OPTION VALUE=".$sql->f("language").">".$sql->f("language"));
  136 + $dir = dir($default->owl_LangDir);
  137 + $dir->rewind();
  138 +
  139 + while($file=$dir->read())
  140 + {
  141 + if ($file != "." and $file != "..")
  142 + print("<OPTION VALUE=$file>$file");
  143 + }
  144 + $dir->close();
  145 + print("</SELECT></TD></TR>");
  146 + // Bozz Change begin
  147 + //This is to allow a user to be part of more than one group
  148 +
  149 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_groupmember</TD><TD align=left>");
  150 + $i=0;
  151 + $sqlmemgroup = new Owl_DB;
  152 + foreach($groups as $g) {
  153 + $is_set_gid = $g[0];
  154 + $sqlmemgroup->query("select userid from $default->owl_users_grpmem_table where userid = '$id' and groupid = '$is_set_gid'");
  155 + $sqlmemgroup->next_record();
  156 + if ($sqlmemgroup->num_rows($sqlmemgroup) > 0) {
  157 + print("<input type='checkbox' name='group$i' value=$g[0] checked>$g[1]<BR>");
  158 + }
  159 + else {
  160 + print("<input type='checkbox' name='group$i' value=$g[0]>$g[1]<BR>");
  161 + }
  162 + $i++;
  163 + }
  164 + // This hidden field is to store the nubmer of displayed groups for future use
  165 + // when the records are saved to the db
  166 +
  167 +
  168 + print("<INPUT TYPE=HIDDEN NAME=no_groups_displayed VALUE=$i>");
  169 + // Bozz Change End
  170 +
  171 + print("<TR><TD BGCOLOR=$default->table_header_bg ALIGN=RIGHT>$lang_username</TD><TD align=left><INPUT TYPE=TEXT NAME=loginname VALUE='".$sql->f("username")."'></TD></TR>");
  172 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_quota</TD><TD align=left>".$sql->f("quota_current")." / <INPUT TYPE=TEXT NAME=quota VALUE=".$sql->f("quota_max")."></TD></TR>");
  173 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_maxsessions</TD><TD align=left>".($sql->f("maxsessions") + 1)." / <INPUT TYPE=TEXT NAME=maxsessions VALUE=".($sql->f("maxsessions") + 1).">
  174 +<a href=\"index.php?sess=$sess&action=user&owluser=$id&change=0&flush=1\"><IMG SRC='$default->owl_root_url/graphics/admin_flush.gif' BORDER=0 ALT='$lang_flush_sessions_alt' TITLE='$lang_flush_sessions_alt'></a></TD></TR>");
  175 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_password</TD><TD align=left><INPUT TYPE=PASSWORD NAME=password VALUE='".$sql->f("password")."'></TD></TR>");
  176 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_email</TD><TD align=left><INPUT TYPE=TEXT NAME=email VALUE='".$sql->f("email")."'></TD></TR>");
  177 + if ( $sql->f("notify") == 1)
  178 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_notification</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=notify VALUE=1 checked></TD></TR>");
  179 + else
  180 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_notification</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=notify VALUE=1></TD></TR>");
  181 + if ( $sql->f("attachfile") == 1)
  182 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_attach_file</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=attachfile VALUE=1 checked></TD></TR>");
  183 + else
  184 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_attach_file</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=attachfile VALUE=1></TD></TR>");
  185 + if ($id != 1) {
  186 + if ( $sql->f("disabled") == 1)
  187 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_disableuser</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=disabled VALUE=1 checked></TD></TR>");
  188 + else
  189 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_disableuser</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=disabled VALUE=1></TD></TR>");
  190 + if ( $sql->f("noprefaccess") == 1)
  191 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_noprefaccess</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=noprefaccess VALUE=1 checked></TD></TR>");
  192 + else
  193 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_noprefaccess</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=noprefaccess VALUE=1></TD></TR>");
  194 + }
  195 + print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change>");
  196 + if ($sql->f("id") != 1) {
  197 + print("<INPUT TYPE=SUBMIT NAME=action VALUE='$lang_deleteuser'>");
  198 + }
  199 +
  200 + print("</FORM>");
  201 + }
  202 +}
  203 +
  204 +function flushsessions($id, $sess) {
  205 + global $default;
  206 + $sql= new Owl_DB;
  207 + $sql->query("delete from $default->owl_sessions_table where uid='$id' AND sessid!='$sess'");
  208 +}
  209 +
  210 +
  211 +function printgroup($id) {
  212 + global $sess,$change,$lang_title,$lang_change,$lang_deletegroup,$lang_saved,$default;
  213 + if(isset($change)) print("$lang_saved<BR>");
  214 + $sql = new Owl_DB;
  215 + $sql->query("select id,name from $default->owl_groups_table where id = '$id'");
  216 + while($sql->next_record()) {
  217 + print("<FORM ACTION='admin_dbmodify.php' METHOD=POST>");
  218 + print("<INPUT TYPE=HIDDEN NAME=id VALUE=".$sql->f("id").">");
  219 + print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");
  220 + print("<INPUT TYPE=HIDDEN name=action VALUE=group>");
  221 + print("<TABLE BORDER=$default->table_border><TR><TD BGCOLOR=$default->table_header_bg>$lang_title</TD><TD><INPUT TYPE=text NAME=name VALUE='".$sql->f("name")."'></TD></TR></TABLE>");
  222 + print("<BR><INPUT TYPE=SUBMIT VALUE=$lang_change>");
  223 + if($sql->f("id") != 0) print("<INPUT TYPE=SUBMIT NAME=action VALUE='$lang_deletegroup'>");
  224 + print("</FORM>");
  225 + }
  226 +}
  227 +
  228 +function printnewgroup() {
  229 + global $default, $sess,$lang_title,$lang_add;
  230 + print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");
  231 + print("<INPUT TYPE=HIDDEN NAME=action VALUE=add>");
  232 + print("<INPUT TYPE=HIDDEN NAME=type VALUE=group>");
  233 + print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");
  234 + print("<TABLE BORDER=$default->table_border><TR><TD BGCOLOR=$default->table_header_bg>$lang_title</TD><TD><INPUT TYPE=TEXT NAME=name></TD></TR></TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_add></FORM>");
  235 +}
  236 +
  237 +function printnewuser() {
  238 + global $sess,$lang_title,$lang_username,$lang_group,$lang_password,$lang_add,$default, $lang_quota,$lang_groupmember;
  239 + global $lang_email, $lang_notification, $lang_noprefaccess, $lang_disableuser, $lang_userlang, $lang_maxsessions, $lang_attach_file;
  240 + $sql = new Owl_DB;
  241 + $sql->query("select id,name from $default->owl_groups_table order by name");
  242 + $i=0;
  243 + while($sql->next_record()) {
  244 + $groups[$i][0] = $sql->f("id");
  245 + $groups[$i][1] = $sql->f("name");
  246 + $i++;
  247 + }
  248 + print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");
  249 + print("<INPUT TYPE=HIDDEN NAME=action VALUE=add>");
  250 + print("<INPUT TYPE=HIDDEN NAME=type VALUE=user>");
  251 + print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");
  252 + print("<TABLE BORDER=$default->table_border><TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_title</TD><TD align=left><INPUT TYPE=TEXT NAME=name></TD></TR>");
  253 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_username</TD><TD align=left><INPUT TYPE=TEXT NAME=loginname></TD></TR>");
  254 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_group</TD><TD align=left><SELECT NAME=groupid>");
  255 + foreach($groups as $g) {
  256 + print("<OPTION VALUE=$g[0]>$g[1]");
  257 + }
  258 + print("</SELECT></TD></TR>");
  259 + //*******************************
  260 + // Display the Language dropdown
  261 + //*******************************
  262 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_userlang</TD><TD align=left><SELECT NAME=newlanguage>");
  263 + $dir = dir($default->owl_LangDir);
  264 + $dir->rewind();
  265 +
  266 + while($file=$dir->read())
  267 + {
  268 + if ($file != "." and $file != "..")
  269 + {
  270 + //janu's change BEGIN
  271 + print("<OPTION VALUE=$file");
  272 + if ($file == $default->owl_lang)
  273 + print (" SELECTED");
  274 + print(">$file");
  275 + //janu's change END
  276 + }
  277 + }
  278 + $dir->close();
  279 + print("</SELECT></TD></TR>");
  280 +
  281 + // Bozz Change begin
  282 + //This is to allow a user to be part of more than one group
  283 +
  284 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_groupmember</TD><TD align=left>");
  285 + $i=0;
  286 + foreach($groups as $g) {
  287 + print("<input type='checkbox' name='group$i' value=$g[0]>$g[1]<BR>");
  288 + $i++;
  289 + }
  290 + // This hidden field is to store the nubmer of displayed groups for future use
  291 + // when the records are saved to the db
  292 +
  293 + print("<INPUT TYPE=HIDDEN NAME=no_groups_displayed VALUE=$i>");
  294 + // Bozz Change End
  295 + print("</TD></TR><TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_quota</TD><TD align=left><INPUT TYPE=TEXT NAME=quota VALUE=0></TD></TR>");
  296 + print("</TD></TR><TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_maxsessions</TD><TD align=left><INPUT TYPE=TEXT NAME=maxsessions VALUE=1></TD></TR>");
  297 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_password</TD><TD align=left><INPUT TYPE=PASSWORD NAME=password></TD></TR>");
  298 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_email</TD><TD align=left><INPUT TYPE=TEXT NAME=email></TD></TR>");
  299 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_attach_file</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=attachfile VALUE=1></TD></TR>");
  300 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_disableuser</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=disabled VALUE=1></TD></TR>");
  301 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_noprefaccess</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=noprefaccess VALUE=1></TD></TR>");
  302 + print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_add></FORM>");
  303 +}
  304 +
  305 +function printhtml() {
  306 + global $default, $sess, $lang_add, $lang_change, $change, $lang_saved;
  307 + 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;
  308 + if(isset($change)) print("$lang_saved<BR>");
  309 + print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");
  310 + print("<INPUT TYPE=HIDDEN NAME=action VALUE=edhtml>");
  311 + print("<INPUT TYPE=HIDDEN NAME=type VALUE=html>");
  312 + print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");
  313 + print("<TABLE BORDER=$default->table_border>");
  314 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_border_sz</TD>
  315 + <TD align=left><INPUT TYPE=TEXT NAME=border VALUE='$default->table_border'></TD></TR>");
  316 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_hd_bg</TD>
  317 + <TD align=left><INPUT TYPE=TEXT NAME=header_bg VALUE=$default->table_header_bg></TD></TR>");
  318 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_cell_bg_cl</TD>
  319 + <TD align=left><INPUT TYPE=TEXT NAME=cell_bg VALUE='$default->table_cell_bg'></TD></TR>");
  320 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_cell_bg_al</TD>
  321 + <TD align=left><INPUT TYPE=TEXT NAME=cell_bg_alt VALUE='$default->table_cell_bg_alt'></TD></TR>");
  322 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_expand_width</TD>
  323 + <TD align=left><INPUT TYPE=TEXT NAME=expand_width VALUE='$default->table_expand_width'></TD></TR>");
  324 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_collapse_width</TD>
  325 + <TD align=left><INPUT TYPE=TEXT NAME=collapse_width VALUE='$default->table_collapse_width'></TD></TR>");
  326 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>Main Header Background Color</TD>
  327 + <TD align=left><INPUT TYPE=TEXT NAME=main_header_bgcolor VALUE='$default->main_header_bgcolor'></TD></TR>");
  328 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_bg_cl</TD>
  329 + <TD align=left><INPUT TYPE=TEXT NAME=body_bgcolor VALUE='$default->body_bgcolor'></TD></TR>");
  330 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_txt_cl</TD>
  331 + <TD align=left><INPUT TYPE=TEXT NAME=body_textcolor VALUE='$default->body_textcolor'></TD></TR>");
  332 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_lnk_cl</TD>
  333 + <TD align=left><INPUT TYPE=TEXT NAME=body_link VALUE='$default->body_link'></TD></TR>");
  334 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_vlnk_cl</TD>
  335 + <TD align=left><INPUT TYPE=TEXT NAME=body_vlink VALUE='$default->body_vlink'></TD></TR>");
  336 + print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change></FORM>");
  337 +}
  338 +
  339 +function printprefs() {
  340 + global $default, $sess, $lang_add, $lang_change, $change, $lang_saved;
  341 + 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 ;
  342 + global $lang_owl_title_tools, $lang_owl_dbdump_path,$lang_owl_gzip_path, $lang_owl_tar_path;
  343 +
  344 + if(isset($change)) print("$lang_saved<BR>");
  345 + print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");
  346 + print("<INPUT TYPE=HIDDEN NAME=action VALUE=edprefs>");
  347 + print("<INPUT TYPE=HIDDEN NAME=type VALUE=html>");
  348 + print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");
  349 + print("<TABLE BORDER=$default->table_border>");
  350 + print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_email</TD></TR>");
  351 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_from</TD>
  352 + <TD align=left><INPUT TYPE=TEXT NAME=email_from VALUE='$default->owl_email_from' size=30></TD></TR>");
  353 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_fromname</TD>
  354 + <TD align=left><INPUT TYPE=TEXT NAME=email_fromname VALUE='$default->owl_email_fromname' size=30></TD></TR>");
  355 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_replyto</TD>
  356 + <TD align=left><INPUT TYPE=TEXT NAME=email_replyto VALUE='$default->owl_email_replyto' size=30></TD></TR>");
  357 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_server</TD>
  358 + <TD align=left><INPUT TYPE=TEXT NAME=email_server VALUE='$default->owl_email_server' size=30></TD></TR>");
  359 + print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_HD</TD></TR>");
  360 +
  361 + if ( $default->owl_LookAtHD == "false" ){
  362 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_lookAtHD</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=lookAtHD VALUE='false' checked></TD></TR>");
  363 + print("<INPUT TYPE=HIDDEN NAME=def_file_security VALUE='$default->owl_def_file_security'>");
  364 + print("<INPUT TYPE=HIDDEN NAME=def_file_group_owner VALUE='$default->owl_def_file_group_owner'>");
  365 + print("<INPUT TYPE=HIDDEN NAME=def_file_owner VALUE='$default->owl_def_file_owner'>");
  366 + print("<INPUT TYPE=HIDDEN NAME=def_file_title VALUE='$default->owl_def_file_title'>");
  367 + print("<INPUT TYPE=HIDDEN NAME=def_file_meta VALUE='$default->owl_def_file_meta'>");
  368 + print("<INPUT TYPE=HIDDEN NAME=def_fold_security VALUE='$default->owl_def_fold_security'>");
  369 + print("<INPUT TYPE=HIDDEN NAME=def_fold_group_owner VALUE='$default->owl_def_fold_group_owner'>");
  370 + print("<INPUT TYPE=HIDDEN NAME=def_fold_owner VALUE='$default->owl_def_fold_owner'>");
  371 + }
  372 + else {
  373 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_lookAtHD</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=lookAtHD VALUE='false'></TD></TR>");
  374 + printfileperm($default->owl_def_file_security, "def_file_security", $lang_owl_def_file_security, "user");
  375 +
  376 +
  377 +
  378 + $sql = new Owl_DB;
  379 + $sql->query("select id,name from $default->owl_groups_table");
  380 + $i=0;
  381 + while($sql->next_record()) {
  382 + $groups[$i][0] = $sql->f("id");
  383 + $groups[$i][1] = $sql->f("name");
  384 + $i++;
  385 + }
  386 + print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_owl_def_file_group_owner</TD><TD align=left><SELECT NAME=def_file_group_owner>");
  387 + foreach($groups as $g) {
  388 + print("<OPTION VALUE=$g[0] ");
  389 + if($g[0] == $default->owl_def_file_group_owner)
  390 + print("SELECTED");
  391 + print(">$g[1]");
  392 + }
  393 + print("</SELECT></TD></TR>");
  394 + $sql = new Owl_DB;
  395 + $sql->query("select id,name from $default->owl_users_table");
  396 + $i=0;
  397 + while($sql->next_record()) {
  398 + $users[$i][0] = $sql->f("id");
  399 + $users[$i][1] = $sql->f("name");
  400 + $i++;
  401 + }
  402 + print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_owl_def_file_owner</TD><TD align=left><SELECT NAME=def_file_owner>");
  403 + foreach($users as $g) {
  404 + print("<OPTION VALUE=$g[0] ");
  405 + if($g[0] == $default->owl_def_file_owner)
  406 + print("SELECTED");
  407 + print(">$g[1]");
  408 + }
  409 + print("</SELECT></TD></TR>");
  410 +
  411 +
  412 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_def_file_title</TD>
  413 + <TD align=left><INPUT TYPE=TEXT NAME=def_file_title VALUE='$default->owl_def_file_title' size=40></TD></TR>");
  414 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_def_file_meta</TD>
  415 + <TD align=left><INPUT TYPE=TEXT NAME=def_file_meta VALUE='$default->owl_def_file_meta' size=40></TD></TR>");
  416 +
  417 + printgroupperm($default->owl_def_fold_security, "def_fold_security", $lang_owl_def_fold_sec, "user");
  418 +
  419 + print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_owl_def_fold_group_owner</TD><TD align=left><SELECT NAME=def_fold_group_owner>");
  420 + foreach($groups as $g) {
  421 + print("<OPTION VALUE=$g[0] ");
  422 + if($g[0] == $default->owl_def_fold_group_owner)
  423 + print("SELECTED");
  424 + print(">$g[1]");
  425 + }
  426 + print("</SELECT></TD></TR>");
  427 +
  428 + print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_owl_def_fold_owner</TD><TD align=left><SELECT NAME=def_fold_owner>");
  429 + foreach($users as $g) {
  430 + print("<OPTION VALUE=$g[0] ");
  431 + if($g[0] == $default->owl_def_fold_owner)
  432 + print("SELECTED");
  433 + print(">$g[1]");
  434 + }
  435 + print("</SELECT></TD></TR>");
  436 +
  437 + }
  438 + print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_other</TD></TR>");
  439 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_max_filesize</TD>
  440 + <TD align=left><INPUT TYPE=TEXT NAME=max_filesize VALUE='$default->max_filesize'></TD></TR>");
  441 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_owl_timeout</TD>
  442 + <TD align=left><INPUT TYPE=TEXT NAME=owl_timeout VALUE='$default->owl_timeout'></TD></TR>");
  443 +
  444 + if ( $default->expand == 1 )
  445 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_owl_expand</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=owl_expand VALUE=1 checked></TD></TR>");
  446 + else
  447 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_owl_expand:</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=owl_expand VALUE=1></TD></TR>");
  448 +
  449 + if ( $default->owl_version_control == 1 )
  450 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_version_control</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=version_control VALUE=1 checked></TD></TR>");
  451 + else
  452 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_version_control</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=version_control VALUE=1></TD></TR>");
  453 +
  454 + if ( $default->restrict_view == 1 )
  455 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_restrict_view</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=restrict_view VALUE=1 checked></TD></TR>");
  456 + else
  457 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_restrict_view</TD><TD align=left><INPUT TYPE=CHECKBOX NAME=restrict_view VALUE=1></TD></TR>");
  458 +
  459 + print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_tools</TD></TR>");
  460 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_dbdump_path</TD>
  461 + <TD align=left><INPUT TYPE=TEXT NAME=dbdump_path VALUE='$default->dbdump_path' size=30></TD></TR>");
  462 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_gzip_path</TD>
  463 + <TD align=left><INPUT TYPE=TEXT NAME=gzip_path VALUE='$default->gzip_path' size=30></TD></TR>");
  464 + print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_tar_path</TD>
  465 + <TD align=left><INPUT TYPE=TEXT NAME=tar_path VALUE='$default->tar_path' size=30></TD></TR>");
  466 + print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change></FORM>");
  467 +}
  468 +
  469 +function dobackup() {
  470 + global $default;
  471 +
  472 + $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";
  473 + $date = date("Ymd.Hms");
  474 +
  475 + header("Content-Disposition: attachment; filename=\"" . $default->owl_db_name . "-$date.sql.gz\"");
  476 + header("Content-Location: " . $default->owl_db_name . "-$date.sql.gz");
  477 + header("Content-Type: application/octet-stream");
  478 + //header("Content-Length: $fsize");
  479 + //header("Pragma: no-cache");
  480 + header("Expires: 0");
  481 + passthru($command);
  482 + exit();
  483 +
  484 +}
  485 +
  486 +
  487 +
  488 +if($action) {
  489 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  490 + print("<TR><TD WIDTH=200 VALIGN=TOP>");
  491 + print("<TR>");
  492 + print("<TD ALIGN=LEFT WIDTH=33%>");
  493 + print uid_to_name($userid);
  494 + print(" : <A HREF='../index.php?login=logout&sess=$sess'>$lang_logout</A></TD>");
  495 + print("<TD ALIGN=CENTER WIDTH=33%> $lang_owl_admin</TD>");
  496 + print("<TD ALIGN=RIGHT WIDTH=33%> <A HREF='../browse.php?sess=$sess'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A> </TD>");
  497 + print("</TR>");
  498 + print("</TABLE>");
  499 + print("<HR WIDTH=$default->table_expand_width><BR>");
  500 + print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border><TR><TD WIDTH=200 VALIGN=TOP>");
  501 + print("<TABLE BORDER=$default->table_border><TR><TD align=left>");
  502 + print("<A HREF='index.php?sess=$sess&action=newuser'><IMG SRC='$default->owl_root_url/graphics/admin_users.gif' BORDER=0 ALT='$lang_newuser_alt' TITLE='$lang_newuser_alt'></A><BR>");
  503 + print("<A HREF='index.php?sess=$sess&action=newgroup'><IMG SRC='$default->owl_root_url/graphics/admin_groups.gif' BORDER=0 ALT='$lang_newgroup_alt' TITLE='$lang_newgroup_alt'></A><BR>");
  504 + print("<A HREF='index.php?sess=$sess&action=edhtml'><IMG SRC='$default->owl_root_url/graphics/admin_html_prefs.gif' BORDER=0 ALT='$lang_edthtml_alt' TITLE='$lang_edthtml_alt'></A><BR>");
  505 + print("<A HREF='index.php?sess=$sess&action=edprefs'><IMG SRC='$default->owl_root_url/graphics/admin_site_prefs.gif' BORDER=0 ALT='$lang_edprefs_alt' TITLE='$lang_edprefs_alt'></A><BR>");
  506 + if (file_exists($default->dbdump_path) && file_exists($default->gzip_path)) {
  507 + print("<A HREF='index.php?sess=$sess&action=backup'><IMG SRC='$default->owl_root_url/graphics/admin_backup.gif' BORDER=0 ALT='$lang_backup_alt' TITLE='$lang_backup_alt'></A><BR><BR>");
  508 + }
  509 + else {
  510 + print("<IMG SRC='$default->owl_root_url/graphics/admin_backup_disabled.gif' BORDER=0 ALT='$lang_backup_dis_alt' TITLE='$lang_backup_dis_alt'></A><BR><BR>");
  511 + }
  512 +// print("<A HREF='upgrade-users.php?sess=$sess'>$lang_upg_MD5</A><BR><BR>");
  513 + printusers();
  514 + print("<BR><BR>");
  515 + printgroups();
  516 + print("</TD></TR></TABLE>");
  517 + print("</TD><TD VALIGN=TOP>");
  518 + if(isset($owluser)) printuser($owluser);
  519 + if(isset($group)) printgroup($group);
  520 + if($action == "newgroup") printnewgroup();
  521 + if($action == "newuser") printnewuser();
  522 + if($action == "edhtml") printhtml();
  523 + if($action == "edprefs") printprefs();
  524 + print("</TD></TR></TABLE>");
  525 +} else {
  526 + exit("$lang_err_general");
  527 +}
  528 +
  529 +print("<BR><HR WIDTH=$default->table_expand_width><BR><A HREF='../browse.php?sess=$sess'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>");
  530 +?>
  531 +<!-- BEGIN BUG FIX: #448241 HTML-Syntax-Error in admin/index.php -->
  532 +</BODY>
  533 +</HTML>
  534 +<!-- BEGIN BUG FIX: #448241 HTML-Syntax-Error in admin/index.php -->
... ...
admin/upgrade-users.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: upgrade-users.php
  6 + Author: Chris
  7 + Date: 2001/01/24
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +
  18 +require("../config/owl.php");
  19 +require("../lib/owl.lib.php");
  20 +require("../config/html.php");
  21 +
  22 +print("<CENTER>");
  23 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  24 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  25 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  26 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  27 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  28 +print("<BR>DO NOT RUN THIS AGAIN</CENTER><BR><BR>");
  29 +print("Running through $default->owl_users_table<BR>");
  30 +$sql = new Owl_DB;
  31 +$sql->query("select * from $default->owl_users_table");
  32 +$sqlupd = new Owl_DB;
  33 +while($sql->next_record()) {
  34 + $userid = $sql->f("id");
  35 + $password = $sql->f("password");
  36 + if (strlen($password) <> 32) {
  37 + $sqlupd->query("update $default->owl_users_table set password='" . md5($password) . "' where id = '$userid'");
  38 + print "Updated user id $userid: ".$sql->f("username")."<BR>";
  39 + } else {
  40 + print "ALREADY UPGRADED -> $userid: ".$sql->f("username")."<BR>";
  41 + }
  42 +}
  43 +print("DONE<BR><BR><CENTER>");
  44 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  45 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  46 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  47 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  48 +print("********************** WARNING WARNING WARNING ****************************<BR>");
  49 +print("<BR>DO NOT RUN THIS AGAIN</CENTER><BR>");
... ...
browse.php 0 → 100755
  1 +<?php
  2 +/*
  3 + * browse.php -- Browse page
  4 + *
  5 + * Copyright (c) 1999-2002 The Owl Project Team
  6 + * Licensed under the GNU GPL. For full terms see the file COPYING.
  7 + *
  8 + * $Id$
  9 +*/
  10 +
  11 +require("./config/owl.php");
  12 +require("./lib/owl.lib.php");
  13 +require("./config/html.php");
  14 +require("./lib/readhd.php");
  15 +require("./lib/security.lib.php");
  16 +include("./lib/header.inc");
  17 +
  18 +if(!isset($parent)) $parent = "1";
  19 +if(!isset($expand)) $expand = $default->expand;
  20 +if(!isset($order)) $order = "name";
  21 +if(!isset($sortname)) $sortname = "ASC";
  22 +// Daphne change
  23 +if(!isset($sortver)) $sortver = "ASC, minor_revision ASC";
  24 +if(!isset($sortcheckedout)) $sortcheckedout = "ASC";
  25 +// end daphne change
  26 +if(!isset($sortfilename)) $sortfilename = "DESC";
  27 +if(!isset($sortsize)) $sortsize = "DESC";
  28 +if(!isset($sortposted)) $sortposted = "DESC";
  29 +if(!isset($sortmod)) $sortmod = "DESC";
  30 +if(!isset($sort)) $sort = "asc";
  31 +
  32 +// Begin 496814 Column Sorts are not persistant
  33 +switch ($order) {
  34 + case "name":
  35 + $sortorder = 'sortname';
  36 + $sort=$sortname;
  37 + break;
  38 + case "major_revision":
  39 + $sortorder = 'sortver';
  40 + $sort=$sortver;
  41 + break;
  42 + case "filename" :
  43 + $sortorder = 'sortfilename';
  44 + $sort=$sortfilename;
  45 + break;
  46 + case "size" :
  47 + $sortorder = 'sortsize';
  48 + $sort=$sortsize;
  49 + break;
  50 + case "creatorid" :
  51 + $sortorder = 'sortposted';
  52 + $sort=$sortposted;
  53 + break;
  54 + case "smodified" :
  55 + $sortorder = 'sortmod';
  56 + $sort=$sortmod;
  57 + break;
  58 + case "checked_out":
  59 + $sortorder = 'sortcheckedout';
  60 + $sort = $sortcheckedout;
  61 + break;
  62 + default:
  63 + $sort="ASC";
  64 + break;
  65 +}
  66 +
  67 +// END 496814 Column Sorts are not persistant
  68 +
  69 +
  70 +if(check_auth($parent, "folder_view", $userid) != "1") {
  71 + printError($lang_nofolderaccess,"");
  72 + exit;
  73 +}
  74 +
  75 +print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  76 +?>
  77 +<TR><TD ALIGN=LEFT>
  78 +<?php print("$lang_user: ");
  79 +// If the user is the anonymouse users
  80 +// do not allow him to change his prefs
  81 + if(prefaccess($userid)) {
  82 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&parent=$parent&expand=$expand&order=$order&sortname=$sort'>");
  83 + }
  84 + print uid_to_name($userid);
  85 + print ("</A>");
  86 +?>
  87 +<FONT SIZE=-1>
  88 +<?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  89 + </FONT></TD>
  90 + <TD ALIGN=RIGHT> <?php
  91 +
  92 +print("<A HREF='modify.php?sess=$sess&action=folder_create&parent=$parent&expand=$expand&order=$order&sortname=$sort'>
  93 + <IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/btn_add_folder.gif' BORDER=0></A>&nbsp;");
  94 +print("<A HREF='modify.php?sess=$sess&action=file_upload&type=url&parent=$parent&expand=$expand&order=$order&sortname=$sort'>
  95 + <IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/btn_add_url.gif' BORDER=0></A>&nbsp;");
  96 +print("<A HREF='modify.php?sess=$sess&action=file_upload&parent=$parent&expand=$expand&order=$order&sortname=$sort'>
  97 + <IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/btn_add_file.gif' BORDER=0></A>&nbsp;&nbsp;");
  98 +if($expand==1) {
  99 + print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=0&order=$order'><IMG SRC=
  100 + \t\t'$default->owl_root_url/locale/$default->owl_lang/graphics/btn_collapse_view.gif'
  101 + \t\tBORDER=0></A>");
  102 +} else {
  103 + print("\t\t\t<A HREF='browse.php?sess=$sess&parent=$parent&expand=1&order=$order'><IMG SRC=
  104 + \t\t'$default->owl_root_url/locale/$default->owl_lang/graphics/btn_expand_view.gif'
  105 + \t\tBORDER=0></A>&nbsp;&nbsp;\n");
  106 +}
  107 +
  108 +print("</TD></TR></TABLE>");
  109 +
  110 +print("<CENTER>");
  111 +if ($expand == 1) {
  112 + print("\t\t<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>\n");
  113 +} else {
  114 + print("\t\t<TABLE WIDTH=$default->table_collapse_width BORDER=$default->table_border>\n");
  115 +}
  116 +
  117 +print("\t\t\t<TR><TD></TD></TR>");
  118 +print("\t\t\t<TR><TD align=left>" . gen_navbar($parent) . "</TD></TR></TABLE>");
  119 +
  120 +if ($expand == 1) {
  121 + print("\t\t<HR WIDTH=$default->table_expand_width>\n");
  122 +} else {
  123 + print("\t\t<HR WIDTH=$default->table_collapse_width>\n");
  124 +}
  125 +
  126 +//
  127 +// functions to create/show the links to be sorted on
  128 +//
  129 +function show_link($column,$sortname,$sortvalue,$order,$sess,$expand,$parent,$lang_title,$url) {
  130 +
  131 + if ($sortvalue == "ASC")
  132 + {
  133 + print("\t\t\t\t<TD align=left><A HREF='browse.php?sess=$sess&expand=$expand&parent=$parent&order=$column&$sortname=DESC' STYLE='toplink'>$lang_title");
  134 + if ($order == $column)
  135 + {
  136 + print("<img border='0' src='$url/graphics/asc.gif' width='16' height='16'></A></TD>");
  137 + }
  138 + else
  139 + {
  140 + print("</A></TD>");
  141 + }
  142 +
  143 + }
  144 + else
  145 + {
  146 + print("\t\t\t\t<TD align=left><A HREF='browse.php?sess=$sess&expand=$expand&parent=$parent&order=$column&$sortname=ASC' STYLE='toplink'>$lang_title");
  147 + if ($order == $column)
  148 + {
  149 + print("<img border='0' src='$url/graphics/desc.gif' width='16' height='16'></A></TD>");
  150 + }
  151 + else
  152 + {
  153 + print("</A></TD>");
  154 + }
  155 + }
  156 +}
  157 +
  158 +
  159 +
  160 +if ($expand == 1) {
  161 + print("\t\t\t<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border><TR BGCOLOR='$default->table_header_bg'>");
  162 + show_link("name","sortname",$sortname,$order,$sess,$expand,$parent,$lang_title,$default->owl_root_url);
  163 + // Daphne change - column for files checked out
  164 + if ($default->owl_version_control == 1) {
  165 + show_link("major_revision","sortver",$sortver,$order,$sess,$expand,$parent,$lang_ver,$default->owl_root_url);
  166 + }
  167 + // end Daphne change
  168 + show_link("filename","sortfilename",$sortfilename,$order,$sess,$expand,$parent,$lang_file,$default->owl_root_url);
  169 + show_link("size","sortsize",$sortsize,$order,$sess,$expand,$parent,$lang_size,$default->owl_root_url);
  170 + show_link("creatorid","sortposted", $sortposted,$order,$sess,$expand,$parent,$lang_postedby,$default->owl_root_url);
  171 + show_link("smodified","sortmod", $sortmod,$order,$sess,$expand,$parent,$lang_modified,$default->owl_root_url);
  172 + print("<TD align=left>$lang_actions</TD>");
  173 + // Daphne change - column for files checked out
  174 + if ($default->owl_version_control == 1) {
  175 + show_link("checked_out","sortcheckedout", $sortcheckedout, $order,$sess,$expand,$parent,$lang_held,$default->owl_root_url);
  176 + }
  177 + // end Daphne change
  178 +} else {
  179 + print("\t\t\t<TABLE WIDTH=$default->table_collapse_width BORDER=$default->table_border><TR BGCOLOR='$default->table_header_bg'>");
  180 + show_link("name","sortname",$sortname,$order,$sess,$expand,$parent,$lang_title,$default->owl_root_url);
  181 + // Begin Daphne Change
  182 + if ($default->owl_version_control == 1) {
  183 + show_link("major_revision","sortver",$sortver,$order,$sess,$expand,$parent,$lang_ver,$default->owl_root_url);
  184 + }
  185 + // end Daphne change
  186 + show_link("filename","sortfilename",$sortfilename,$order,$sess,$expand,$parent,$lang_file,$default->owl_root_url);
  187 + show_link("size","sortsize",$sortsize,$order,$sess,$expand,$parent,$lang_size,$default->owl_root_url);
  188 + // Daphne change - column for files checked out
  189 + if ($default->owl_version_control == 1) {
  190 + show_link("checked_out","sortcheckedout", $sortcheckedout, $order,$sess,$expand,$parent,$lang_held,$default->owl_root_url);
  191 + }
  192 + // end Daphne change
  193 +}
  194 +
  195 +//Looping out Folders
  196 +
  197 +$DBFolderCount = 0;
  198 +$CountLines = 0;
  199 +
  200 +$sql = new Owl_DB;
  201 +if ($order == "creatorid") {
  202 + $sql->query("SELECT * from $default->owl_folders_table where parent = '$parent' order by $order");
  203 +} else {
  204 + $sql->query("SELECT * from $default->owl_folders_table where parent = '$parent' order by name ");
  205 +}
  206 +
  207 +//**********************
  208 +//* BEGIN Print Folders
  209 +//**********************
  210 +
  211 +while($sql->next_record()) {
  212 + if($default->restrict_view == 1) {
  213 + if(!check_auth($sql->f("id"), "folder_view", $userid))
  214 + continue;
  215 + }
  216 + $CountLines++;
  217 + $PrintLines = $CountLines % 2;
  218 + if ($PrintLines == 0)
  219 + print("\t\t\t\t<TR BGCOLOR='$default->table_cell_bg_alt'>");
  220 + else
  221 + print("\t\t\t\t<TR BGCOLOR='$default->table_cell_bg'>");
  222 +
  223 + print("<TD ALIGN=LEFT><A HREF='browse.php?sess=$sess&parent=" . $sql->f("id") . "&expand=$expand&order=$order&$sortorder=$sort'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/folder_closed.gif' BORDER=0>" . $sql->f("name") . "</A></TD>");
  224 +
  225 + $DBFolderCount++; //count number of filez in db 2 use with array
  226 + $DBFolders[$DBFolderCount] = $sql->f("name"); //create list if files in
  227 +
  228 + if($expand == 1) {
  229 + print("\t\t\t\t<TD>&nbsp</TD><TD>&nbsp</TD><TD>&nbsp</TD><TD>&nbsp</TD>");
  230 + // begin Daphne change
  231 + // extra colunm width for "version" column which folders don't need
  232 + if ($default->owl_version_control == 1) {
  233 + print("<TD>&nbsp</TD>");
  234 + }
  235 + // end Daphne change
  236 + print("<TD ALIGN=LEFT>");
  237 +
  238 + if(check_auth($sql->f("id"), "folder_delete", $userid) == 1)
  239 + print("\t<A HREF='dbmodify.php?sess=$sess&action=folder_delete&id=".$sql->f("id")."&parent=$parent&expand=$expand&order=$order&sortname=$sort'\tonClick='return confirm(\"$lang_reallydelete ".htmlspecialchars($sql->f("name"),ENT_QUOTES)."?\");'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/trash.gif' ALT='$lang_del_folder_alt' TITLE='$lang_del_folder_alt'\tBORDER=0 ></A>&nbsp;");
  240 + if(check_auth($sql->f("id"), "folder_modify", $userid) == 1) {
  241 + print("<A HREF='modify.php?sess=$sess&action=folder_modify&id=".$sql->f("id")."&parent=$parent&expand=$expand&order=$order&sortname=$sort'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/edit.gif' BORDER=0 ALT='$lang_mod_folder_alt' TITLE='$lang_mod_folder_alt'>");
  242 + print("<A HREF='move.php?sess=$sess&id=".$sql->f("id")."&parent=$parent&expand=$expand&action=folder&order=$order&sortname=$sort'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/move.gif' BORDER=0 ALT='$lang_move_folder_alt' TITLE='$lang_move_folder_alt'></A>");
  243 + print("<A HREF='download.php?sess=$sess&id=".$sql->f("id")."&parent=".$sql->f("parent")."&action=folder&binary=1'>
  244 + <IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/zip.jpg' BORDER=0 ALT='$lang_get_file_alt' TITLE='$lang_get_file_alt'></A>&nbsp;");
  245 +
  246 + }
  247 +
  248 + print("</TD>");
  249 + if ($default->owl_version_control == 1)
  250 + print ("<TD>&nbsp</TD>");
  251 + print("</TR>");
  252 + } else {
  253 + //print("</TD>");
  254 + print("\t\t\t\t<TD></TD><TD></TD><TD></TD>");
  255 + // begin Daphne change
  256 + // extra column width for "held" column which folders don't need
  257 + if ($default->owl_version_control == 1) {
  258 + if ($PrintLines == 0)
  259 + print ("<TD BGCOLOR='$default->table_cell_bg_alt'></TD>");
  260 + else
  261 + print ("<TD BGCOLOR='$default->table_cell_bg'></TD>");
  262 +
  263 + }
  264 + // end Daphne change
  265 + print("</TR>");
  266 +
  267 + }
  268 +}
  269 +
  270 +if ($default->owl_LookAtHD != "false")
  271 +{
  272 + $DBFolders[$DBFolderCount+1] = "[END]"; //end DBfolder array
  273 + $RefreshPage = CompareDBnHD('folder', $default->owl_FileDir . "/" . get_dirpath($parent), $DBFolders, $parent, $default->owl_folders_table);
  274 +}
  275 +
  276 +//**********************
  277 +// BEGIN Print Files
  278 +//**********************
  279 +$sql = new Owl_DB;
  280 +//$sql->query("SELECT * from $default->owl_files_table where parent = '$parent' order by $order $sort");
  281 +if ($default->owl_version_control == 1)
  282 +{
  283 + //$sql->query("drop table tmp");
  284 + $sql->query("create temporary table tmp (name char(80) not null, parent int(4) not null, val double(4,2) not null)");
  285 + // POSTGRES? $sql->query("create temporary table tmp (name varchar(80) not null, parent int4 not null, val float not null);");
  286 + //$sql->query("lock tables files read");
  287 + $sql->query("insert into tmp select name, parent, max(major_revision+(minor_revision/10)) from files group by name,parent");
  288 + $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");
  289 +}
  290 + else
  291 +{
  292 +
  293 + $sql->query("select * from $default->owl_files_table where parent = '$parent' order by $order $sort" );
  294 +}
  295 +
  296 +//Looping out files from DB!
  297 +
  298 +$DBFileCount = 0;
  299 +
  300 +while($sql->next_record()) {
  301 + if($default->restrict_view == 1) {
  302 + if(!check_auth($sql->f("id"), "file_download", $userid))
  303 + continue;
  304 + }
  305 + $CountLines++;
  306 + $PrintLines = $CountLines % 2;
  307 + if ($PrintLines == 0)
  308 + print("\t\t\t\t<TR BGCOLOR='$default->table_cell_bg_alt'>");
  309 + else
  310 + print("\t\t\t\t<TR BGCOLOR='$default->table_cell_bg'>");
  311 + print("<TD ALIGN=LEFT><A HREF='view.php?sess=$sess&action=file_details&id=".$sql->f("id")."&parent=$parent&expand=$expand&order=$order&sortname=$sort'>");
  312 + $iconfiles = array("html","htm","gif","jpg","bmp","zip","tar","doc","mdb","xls","ppt","pdf","gz","mp3","tgz");
  313 + $choped = split("\.", $sql->f("filename"));
  314 + $pos = count($choped);
  315 +// BEGIN BUG FIX: #433548 Problem with uppercase fileextensions
  316 + $ext = strtolower($choped[$pos-1]);
  317 +// END BUG FIX: #433548 Problem with uppercase fileextensions
  318 + if ($sql->f("url") == "1")
  319 + print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/url.gif' BORDER=0>&nbsp;");
  320 + else {
  321 + if (preg_grep("/$ext/",$iconfiles))
  322 + print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/$ext.jpg' BORDER=0>&nbsp;");
  323 + else
  324 + print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/file.gif' BORDER=0>&nbsp;");
  325 + }
  326 + if($fileid == $sql->f("id"))
  327 + print("<B>".$sql->f("name")."</B></A></TD>");
  328 + else
  329 + print($sql->f("name")."</A></TD>");
  330 + // Begin Daphne Change
  331 + // print version numbers if version control used
  332 + if ($default->owl_version_control == 1){
  333 + if($fileid == $sql->f("id"))
  334 + print("<TD ALIGN=LEFT><B>".$sql->f("major_revision").".".$sql->f("minor_revision")."<B></td>");
  335 + else
  336 + print("<TD ALIGN=LEFT>".$sql->f("major_revision").".".$sql->f("minor_revision")."</td>");
  337 + }
  338 + // end Daphne Change
  339 + if ($sql->f("url") == "1")
  340 + if($fileid == $sql->f("id"))
  341 + print("<TD ALIGN=LEFT><A HREF='".$sql->f("filename")."' TARGET=new><B>".$sql->f("name")." </B></A></TD><TD ALIGN=RIGHT><B>".gen_filesize($sql->f("size"))."</B></TD>");
  342 + else
  343 + print("<TD ALIGN=LEFT><A HREF='".$sql->f("filename")."' TARGET=new>".$sql->f("name")." </A></TD><TD ALIGN=RIGHT>".gen_filesize($sql->f("size"))."</TD>");
  344 + else
  345 + if($fileid == $sql->f("id"))
  346 + print("<TD ALIGN=LEFT><A HREF='download.php?sess=$sess&id=".$sql->f("id")."&parent=".$sql->f("parent")."'><B>".$sql->f("filename")."</B></A></TD><TD ALIGN=RIGHT><B>".gen_filesize($sql->f("size"))."</B></TD>");
  347 + else
  348 + print("<TD ALIGN=LEFT><A HREF='download.php?sess=$sess&id=".$sql->f("id")."&parent=".$sql->f("parent")."'>".$sql->f("filename")."</A></TD><TD ALIGN=RIGHT>".gen_filesize($sql->f("size"))."</TD>");
  349 +
  350 +
  351 + $DBFileCount++; //count number of filez in db 2 use with array
  352 + $DBFiles[$DBFileCount] = $sql->f("filename"); //create list if files in
  353 +//print("<H1> HERE WE ARE ID - $tmp</H1>");
  354 +//exit();
  355 + if($expand ==1) {
  356 + if($fileid == $sql->f("id"))
  357 + print("\t\t\t\t<TD ALIGN=LEFT><B>".fid_to_creator($sql->f("id"))."</B></TD><TD ALIGN=left><B>".$sql->f("modified")."</B></TD>");
  358 + else
  359 + print("\t\t\t\t<TD ALIGN=LEFT>".fid_to_creator($sql->f("id"))."</TD><TD ALIGN=left>".$sql->f("modified")."</TD>");
  360 + print("\t\t\t\t<TD ALIGN=LEFT>");
  361 +
  362 + printFileIcons($sql->f("id"),$sql->f("filename"),$sql->f("checked_out"),$sql->f("url"),$default->owl_version_control,$ext);
  363 +
  364 + }
  365 +
  366 + // begin Daphne change
  367 + // printing who has a document checked out
  368 + if ($default->owl_version_control == 1) {
  369 + if (($holder = uid_to_name($sql->f("checked_out"))) == "Owl") {
  370 + print("\t<TD ALIGN=center>-</TD></TR>");
  371 + }
  372 + else {
  373 + print("\t<TD align=left>$holder</TD></TR>");
  374 + }
  375 + }
  376 + // end Daphne Change
  377 +
  378 +}
  379 +
  380 +if ($default->owl_version_control == 1) {
  381 + //$sql->query("unlock tables");
  382 + $sql->query("drop table tmp");
  383 +}
  384 +
  385 +$DBFiles[$DBFileCount+1] = "[END]"; //end DBfile array
  386 +
  387 +print("</TABLE>");
  388 +
  389 +// ***********************************
  390 +// If the refresh from hard drive
  391 +// feature is enabled
  392 +// ***********************************
  393 +if ($default->owl_LookAtHD != "false")
  394 +{
  395 + if($RefreshPage == true) {
  396 + CompareDBnHD('file', $default->owl_FileDir . "/" . get_dirpath($parent), $DBFiles, $parent, $default->owl_files_table);
  397 + }else{
  398 + $RefreshPage = CompareDBnHD('file', $default->owl_FileDir . "/" . get_dirpath($parent), $DBFiles, $parent, $default->owl_files_table);
  399 + }
  400 +
  401 + if($RefreshPage == true) {
  402 +?>
  403 + <script language="javascript">
  404 + window.location.reload(true);
  405 + </script>
  406 + <?php
  407 + }
  408 +}
  409 +
  410 +include("./lib/footer.inc");
  411 +?>
... ...
config/html.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: html.php
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +getprefs();
  18 +gethtmlprefs();
  19 +
  20 +// styles sheet
  21 +// this is an absolute URL and not a filesystem reference
  22 +
  23 +$default->styles = "$default->owl_root_url/lib/styles.css";
  24 +?>
... ...
config/owl.nt40.apache.php 0 → 100644
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: owl.php
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +
  18 +// Some urls
  19 +$default->owl_root_url = "/intranet";
  20 +$default->owl_graphics_url = $default->owl_root_url . "/graphics";
  21 +
  22 +// Directory where owl is located
  23 +$default->owl_fs_root = "C:\Program Files\Apache Group\Apache\htdocs\intranet";
  24 +$default->owl_LangDir = $default->owl_fs_root . "/locale";
  25 +
  26 +// Directory where The Documents Directory is On Disc
  27 +$default->owl_FileDir = "C:\Program Files\Apache Group\Apache\htdocs\intranet";
  28 +
  29 +//****************************************************
  30 +// Pick your language system default language
  31 +// now each user can pick his language
  32 +// if they are allowed by the admin to change their
  33 +// preferences.
  34 +//****************************************************
  35 +// b5
  36 +// Chinese
  37 +// Danish
  38 +// Deutsch
  39 +// Dutch
  40 +// English
  41 +// Francais
  42 +// Hungarian
  43 +// Italian
  44 +// NewEnglish <- NEW LOOK, English will be obsoleted in a future version
  45 +// Norwegian
  46 +// Portuguese
  47 +// Spanish
  48 +
  49 +$default->owl_lang = "NewEnglish";
  50 +
  51 +// Table with user info
  52 +$default->owl_users_table = "users";
  53 +
  54 +// Table with group memebership for users
  55 +$default->owl_users_grpmem_table= "membergroup";
  56 +$default->owl_sessions_table = "active_sessions";
  57 +
  58 +// Table with file info
  59 +$default->owl_files_table = "files";
  60 +
  61 +// Table with folders info
  62 +$default->owl_folders_table = "folders";
  63 +
  64 +// Table with group info
  65 +$default->owl_groups_table = "groups";
  66 +
  67 +// Table with mime info
  68 +$default->owl_mime_table = "mimes";
  69 +
  70 +// Table with html attributes
  71 +$default->owl_html_table = "html";
  72 +
  73 +// Table with html attributes
  74 +$default->owl_prefs_table = "prefs";
  75 +
  76 +// Table with file data info
  77 +$default->owl_files_data_table = "filedata";
  78 +
  79 +
  80 +// Change this to reflect the database you are using
  81 +require("$default->owl_fs_root/phplib/db_mysql.inc");
  82 +//require("$default->owl_fs_root/phplib/db_pgsql.inc");
  83 +
  84 +//begin WES change
  85 +// Database info
  86 +$default->owl_db_user = "root";
  87 +$default->owl_db_pass = "";
  88 +$default->owl_db_host = "localhost";
  89 +$default->owl_db_name = "intranet";
  90 +
  91 +
  92 +$default->owl_notify_link = "http://$SERVER_NAME$default->owl_root_url/";
  93 +
  94 +// logo file that must reside inside lang/graphics directory
  95 +$default->logo = "owl.gif";
  96 +
  97 +// BUG Number: 457588
  98 +// This is to display the version information in the footer
  99 +
  100 +$default->version = "owl 0.7";
  101 +$default->phpversion = "4.0.2";
  102 +$default->debug = False;
  103 +$default->owl_use_fs = true;
  104 +?>
... ...
config/owl.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: owl.php
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +
  18 +// Some urls
  19 +$default->owl_root_url = "/intranet";
  20 +$default->owl_graphics_url = $default->owl_root_url . "/graphics";
  21 +
  22 +// Directory where owl is located
  23 +$default->owl_fs_root = "/var/www/html/intranet";
  24 +$default->owl_LangDir = $default->owl_fs_root . "/locale";
  25 +
  26 +// Directory where The Documents Directory is On Disc
  27 +$default->owl_FileDir = "/var/www/html/intranet";
  28 +//$default->owl_FileDir = "/tmp";
  29 +
  30 +// Set to true to use the file system to store documents, false only uses the database
  31 +//$default->owl_use_fs = false;
  32 +// the Trailing Slash is important here.
  33 +//$default->owl_FileDir = "/tmp/";
  34 +//$default->owl_compressed_database = 1;
  35 +
  36 +
  37 +$default->owl_use_fs = true;
  38 +
  39 +//****************************************************
  40 +// Pick your language system default language
  41 +// now each user can pick his language
  42 +// if they are allowed by the admin to change their
  43 +// preferences.
  44 +//****************************************************
  45 +// b5
  46 +// Chinese
  47 +// Danish
  48 +// Deutsch
  49 +// Dutch
  50 +// English
  51 +// Francais
  52 +// Hungarian
  53 +// Italian
  54 +// NewEnglish <- NEW LOOK, English will be obsoleted in a future version
  55 +// Norwegian
  56 +// Portuguese
  57 +// Spanish
  58 +
  59 +$default->owl_lang = "NewEnglish";
  60 +$default->owl_notify_link = "http://$SERVER_NAME$default->owl_root_url/";
  61 +
  62 +// Table with user info
  63 +$default->owl_users_table = "users";
  64 +
  65 +// Table with group memebership for users
  66 +$default->owl_users_grpmem_table= "membergroup";
  67 +$default->owl_sessions_table = "active_sessions";
  68 +
  69 +// Table with file info
  70 +$default->owl_files_table = "files";
  71 +
  72 +// Table with folders info
  73 +$default->owl_folders_table = "folders";
  74 +
  75 +// Table with group info
  76 +$default->owl_groups_table = "groups";
  77 +
  78 +// Table with mime info
  79 +$default->owl_mime_table = "mimes";
  80 +
  81 +// Table with html attributes
  82 +$default->owl_html_table = "html";
  83 +
  84 +// Table with html attributes
  85 +$default->owl_prefs_table = "prefs";
  86 +
  87 +// Table with file data info
  88 +$default->owl_files_data_table = "filedata";
  89 +
  90 +
  91 +
  92 +// Change this to reflect the database you are using
  93 +require("$default->owl_fs_root/phplib/db_mysql.inc");
  94 +//require("$default->owl_fs_root/phplib/db_pgsql.inc");
  95 +
  96 +//begin WES change
  97 +// Database info
  98 +$default->owl_db_user = "root";
  99 +$default->owl_db_pass = "";
  100 +$default->owl_db_host = "localhost";
  101 +$default->owl_db_name = "intranet";
  102 +
  103 +// logo file that must reside inside lang/graphics directory
  104 +$default->logo = "owl.gif";
  105 +
  106 +// BUG Number: 457588
  107 +// This is to display the version information in the footer
  108 +
  109 +$default->version = "owl 0.7 20021129";
  110 +$default->phpversion = "4.0.2";
  111 +
  112 +$default->debug = True;
  113 +
  114 +// WES STUFF
  115 +// Untested or in the process of implementing (DORMANT)
  116 +// change at your own risks
  117 +// on Second though Don't even think of changing anything below this line.
  118 +
  119 +//$default->owl_use_htaccess = 1;
  120 +//$default->owl_launch_in_browser = 0;
  121 +//$default->owl_restrict_linkto = true;
  122 +
  123 +
  124 +?>
... ...
config/owl.win2k.iis.php 0 → 100644
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: owl.php
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +This sample config file is known to work with:
  17 +
  18 +Win 2000 Server
  19 +IIS 5.0
  20 +MySQL 3.49
  21 +PHP 4.11
  22 +
  23 +*/
  24 +
  25 +// Some urls
  26 +$default->owl_root_url = "/intranet";
  27 +$default->owl_graphics_url = $default->owl_root_url . "/graphics";
  28 +
  29 +// Directory where owl is located
  30 +$default->owl_fs_root = "C:/Inetpub/wwwroot/intranet";
  31 +$default->owl_LangDir = $default->owl_fs_root . "/locale";
  32 +
  33 +// Directory where The Documents Directory is On Disc
  34 +$default->owl_FileDir = "d:/intranet";
  35 +
  36 +//****************************************************
  37 +// Pick your language system default language
  38 +// now each user can pick his language
  39 +// if they are allowed by the admin to change their
  40 +// preferences.
  41 +//****************************************************
  42 +// b5
  43 +// Chinese
  44 +// Danish
  45 +// Deutsch
  46 +// Dutch
  47 +// English
  48 +// Francais
  49 +// Hungarian
  50 +// Italian
  51 +// NewEnglish <- NEW LOOK, English will be obsoleted in a future version
  52 +// Norwegian
  53 +// Portuguese
  54 +// Spanish
  55 +
  56 +$default->owl_lang = "Deutsch";
  57 +$default->owl_notify_link = "http://$SERVER_NAME$default->owl_root_url/";
  58 +
  59 +// Table with user info
  60 +$default->owl_users_table = "users";
  61 +
  62 +// Table with group memebership for users
  63 +$default->owl_users_grpmem_table= "membergroup";
  64 +$default->owl_sessions_table = "active_sessions";
  65 +
  66 +// Table with file info
  67 +$default->owl_files_table = "files";
  68 +
  69 +// Table with folders info
  70 +$default->owl_folders_table = "folders";
  71 +
  72 +// Table with group info
  73 +$default->owl_groups_table = "groups";
  74 +
  75 +// Table with mime info
  76 +$default->owl_mime_table = "mimes";
  77 +
  78 +// Table with html attributes
  79 +$default->owl_html_table = "html";
  80 +
  81 +// Table with html attributes
  82 +$default->owl_prefs_table = "prefs";
  83 +
  84 +// Table with file data info
  85 +$default->owl_files_data_table = "filedata";
  86 +
  87 +
  88 +// Change this to reflect the database you are using
  89 +require("$default->owl_fs_root/phplib/db_mysql.inc");
  90 +//require("$default->owl_fs_root/phplib/db_pgsql.inc");
  91 +
  92 +//begin WES change
  93 +// Database info
  94 +$default->owl_db_user = "root";
  95 +$default->owl_db_pass = "";
  96 +$default->owl_db_host = "localhost";
  97 +$default->owl_db_name = "intranet";
  98 +
  99 +
  100 +// logo file that must reside inside lang/graphics directory
  101 +$default->logo = "owl.gif";
  102 +
  103 +// BUG Number: 457588
  104 +// This is to display the version information in the footer
  105 +
  106 +$default->version = "owl 0.7";
  107 +$default->phpversion = "4.0.2";
  108 +$default->debug = False;
  109 +$default->owl_use_fs = true;
  110 +?>
... ...
dbmodify.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 + * dbmodify.php
  5 + *
  6 + * Copyright (c) 1999-2002 The Owl Project Team
  7 + * Licensed under the GNU GPL. For full terms see the file COPYING.
  8 + *
  9 + * $Id$
  10 + */
  11 +
  12 +require("./config/owl.php");
  13 +require("./lib/owl.lib.php");
  14 +require("./config/html.php");
  15 +require("./lib/security.lib.php");
  16 +require("phpmailer/class.phpmailer.php");
  17 +
  18 +function find_path($parent) {
  19 + global $default;
  20 + $path = fid_to_name($parent);
  21 + $sql = new Owl_DB;
  22 + while($parent != 1) {
  23 + $sql->query("select parent from $default->owl_folders_table where id = '$parent'");
  24 + while($sql->next_record()) {
  25 + $path = fid_to_name($sql->f("parent"))."/".$path;
  26 + $parent = $sql->f("parent");
  27 + }
  28 + }
  29 + return $path;
  30 +}
  31 +
  32 +function delTree($fid) {
  33 + global $fCount, $folderList, $default;
  34 + //delete from database
  35 + $sql = new Owl_DB;
  36 + $sql->query("delete from $default->owl_folders_table where id = '$fid'");
  37 + $sql->query("delete from $default->owl_files_table where parent = '$fid'");
  38 + for ($c=0; $c < $fCount; $c++) {
  39 + if ($folderList[$c][2]==$fid) {
  40 + delTree($folderList[$c][0]);
  41 + }
  42 + }
  43 +}
  44 +
  45 +// Begin 496814 Column Sorts are not persistant
  46 +// + ADDED &order=$order&$sortorder=$sortname to
  47 +// all browse.php? header and HREF LINES
  48 +
  49 +switch ($order) {
  50 + case "name":
  51 + $sortorder = 'sortname';
  52 + break;
  53 + case "major_revision":
  54 + $sortorder = 'sortver';
  55 + break;
  56 + case "filename" :
  57 + $sortorder = 'sortfilename';
  58 + break;
  59 + case "size" :
  60 + $sortorder = 'sortsize';
  61 + break;
  62 + case "creatorid" :
  63 + $sortorder = 'sortposted';
  64 + break;
  65 + case "smodified" :
  66 + $sortorder = 'sortmod';
  67 + break;
  68 + case "checked_out":
  69 + $sortorder = 'sortcheckedout';
  70 + break;
  71 + default:
  72 + break;
  73 +}
  74 +
  75 +// END 496814 Column Sorts are not persistant
  76 +// BEGIN BUG FIX: #433932 Fileupdate and Quotas
  77 +if($action == "file_update") {
  78 + if(check_auth($parent, "folder_modify", $userid) == 1) {
  79 + //if($title == "") exit($lang_specifyname);
  80 + $userfile = uploadCompat("userfile");
  81 + $sql = new Owl_DB;
  82 + $sql->query("select * from $default->owl_users_table where id = '$userid'");
  83 + while($sql->next_record()) {
  84 + $quota_max = $sql->f("quota_max");
  85 + $quota_current = $sql->f("quota_current");
  86 + //$new_quota = $quota_current + $userfile_size;
  87 + }
  88 + $new_name = ereg_replace("[^-A-Za-z0-9._]", "", ereg_replace(" ", "_", ereg_replace("%20|^-", "_", $userfile["name"])));
  89 + $newpath = $default->owl_FileDir."/".find_path($parent)."/".$new_name;
  90 +
  91 + /* Begin Daphne Change - backups of files
  92 + * If user requests automatic backups of files
  93 + * get current details from db and save file state information
  94 + */
  95 + if ($default->owl_version_control == 1) {
  96 +
  97 + if ($default->owl_use_fs)
  98 + {
  99 + $sql->query("select * from $default->owl_files_table where filename='$new_name' and parent='$parent'");
  100 + }
  101 + else
  102 + {
  103 + // this is guaranteed to get the ID of the most recent revision, just in case we're updating a previous rev.
  104 + $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");
  105 + }
  106 + //$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";
  107 + //printError("QU: $query");
  108 +
  109 + while($sql->next_record()) {
  110 + // save state information
  111 + $major_revision = $backup_major = $sql->f("major_revision");
  112 + $minor_revision = $backup_minor = $sql->f("minor_revision");
  113 + $backup_filename = $sql->f("filename");
  114 + $backup_name = $sql->f("name");
  115 + $backup_size = $sql->f("size");
  116 + $backup_creatorid = $sql->f("creatorid");
  117 + $backup_modified = $sql->f("modified");
  118 + $backup_smodified = $sql->f("smodified");
  119 + $backup_description = $sql->f("description");
  120 + $backup_description = ereg_replace("'","\\'",$backup_description);
  121 + $backup_metadata = $sql->f("metadata");
  122 + $backup_parent = $sql->f("parent");
  123 + $backup_security = $sql->f("security");
  124 + $backup_groupid = $groupid = $sql->f("groupid");
  125 +
  126 + $new_quota = $quota_current - $backup_size + $userfile['size'];
  127 + $filename = $sql->f(filename);
  128 + $title = $sql->f(name);
  129 + $description = $sql->f(description);
  130 +
  131 + if ($default->owl_use_fs)
  132 + {
  133 + if ($default->owl_FileDir."/".find_path($parent)."/".$sql->f(filename) != $newpath)
  134 + printError("$lang_err_file_update","");
  135 + }
  136 +
  137 + }
  138 + }
  139 +
  140 + // End Daphne Change
  141 +
  142 + //$newpath = $default->owl_fs_root."/".find_path($parent)."/".$new_name;
  143 + //$newpath = $default->owl_FileDir."/".find_path($parent)."/".$new_name;
  144 + //***neller: Read data from database
  145 + //$sql->query("select * from $default->owl_files_table where id='$id'");
  146 + //while($sql->next_record()) {
  147 + //if ($default->owl_fs_root."/".find_path($parent)."/".$sql->f(filename) != $newpath)
  148 + //if ($default->owl_FileDir."/".find_path($parent)."/".$sql->f(filename) != $newpath)
  149 + //printError("$lang_err_file_update","");
  150 + //$new_quota = $quota_current - $sql->f(size) + $userfile_size;
  151 + //$filename = $sql->f(filename);
  152 + //$title = $sql->f(name);
  153 + //$description = $sql->f(description);
  154 + //}
  155 + if (($new_quota > $quota_max) && ($quota_max != "0")) {
  156 + printError("$lang_err_quota".$new_quota."$lang_err_quota_needed".($quota_max - $quota_current)."$lang_err_quota_avail","");
  157 + if(($quota_max - $quota_current) == "0")
  158 + printError("$lang_err_quota_exceed");
  159 + }
  160 + // End neller
  161 +
  162 + /* Begin Daphne Change
  163 + * copy old version to backup folder
  164 + * change version numbers,
  165 + * update database entries
  166 + * upload new file over the old
  167 + * backup filename will be 'name_majorrev-minorrev' e.g. 'testing_1-2.doc'
  168 + */
  169 +
  170 + // BEGIN wes change
  171 + if ($default->owl_use_fs)
  172 + {
  173 + if ($default->owl_version_control == 1) {
  174 + if(!(file_exists($newpath)==1) || $backup_filename != $new_name) printError("$lang_err_file_update","");
  175 + // Get the file extension.
  176 + $extension = explode(".",$new_name);
  177 + // rename the new, backed up (versioned) filename
  178 + $version_name = $extension[0]."_$major_revision-$minor_revision.$extension[1]";
  179 + // specify path for new file in the /backup/ file of each directory.
  180 + $backuppath = $default->owl_FileDir."/".find_path($parent)."/backup/$version_name";
  181 +
  182 + // Danilo change
  183 +
  184 + if(!is_dir("$default->owl_FileDir/".find_path($parent)."/backup")) {
  185 + mkdir("$default->owl_FileDir/".find_path($parent)."/backup", 0777);
  186 +
  187 + // End Danilo change
  188 +
  189 +
  190 +
  191 + // is there already a backup directory for current dir?
  192 + if(is_dir("$default->owl_FileDir/".find_path($parent)."/backup")) {
  193 + $sql->query("INSERT into $default->owl_folders_table (name, parent, security, groupid, creatorid) values ('backup', '$parent', '50', '$groupid', '$userid')");
  194 + } else {
  195 + printError("$lang_err_backup_folder_create","");
  196 + }
  197 + }
  198 + copy($newpath,$backuppath); // copy existing file to backup folder
  199 + }
  200 + // End Daphne Change
  201 +
  202 + if(!file_exists($newpath) == 1) printError("$lang_err_file_update","");
  203 + copy($userfile['tmp_name'], $newpath);
  204 + unlink($userfile['tmp_name']);
  205 + if(!file_exists($newpath))
  206 + if ($default->debug == true)
  207 + printError($lang_err_upload,$newpath);
  208 + else
  209 + printError($lang_err_upload,"");
  210 + // Begin Daphne Change
  211 + if ($default->owl_version_control == 1) {
  212 + if(!file_exists($backuppath)) die ("$lang_err_backup_file");
  213 +
  214 + // find id of the backup folder you are saving the old file to
  215 + $sql->query("Select id from $default->owl_folders_table where name='backup' and parent='$parent'");
  216 + while($sql->next_record()) {
  217 + $backup_parent = $sql->f("id");
  218 + }
  219 + }
  220 + }
  221 +
  222 + if($versionchange == 'major_revision') {
  223 + // if someone requested a major revision, must
  224 + // make the minor revision go back to 0
  225 + //$versionchange = "minor_revision='0', major_revision";
  226 + //$new_version_num = $major_revision + 1;
  227 + $new_major = $major_revision + 1;
  228 + $new_minor = 0;
  229 + $versionchange = "minor_revision='0', major_revision";
  230 + $new_version_num = $major_revision + 1;
  231 +
  232 + }
  233 + else {
  234 + // simply increment minor revision number
  235 + $new_version_num = $minor_revision + 1;
  236 + $new_minor = $minor_revision + 1;
  237 + $new_major = $major_revision;
  238 + }
  239 +
  240 + // printError("old: $minor_revision", "New: $new_minor");
  241 + // End Daphne Change
  242 +
  243 + $groupid = owlusergroup($userid);
  244 + $modified = date("M d, Y \a\\t h:i a");
  245 + $smodified = date("Y-m-d g:i:s");
  246 +
  247 + // Begin Daphne Change
  248 + if ($default->owl_version_control == 1) {
  249 + if ($default->owl_use_fs)
  250 + {
  251 + // insert entry for backup file
  252 + // WORKING WORKING
  253 + $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);
  254 +
  255 + // update entry for existing file. Bozz's code is repeated underneath,
  256 + // without the versioning attribute included.
  257 +
  258 +
  259 + // BEGIN Bozz Change
  260 + // Added this check, if the policy is allow Read Write NO DELETE
  261 + // we have to make sure that the Creator is not changed.
  262 + // in the case of an updated, that would then allow a user to
  263 + // delete the file. Only the original Creator should be allowed
  264 + // to delete the file.
  265 + if ( getfilepolicy($id) == 5 || getfilepolicy($id) == 6)
  266 + {
  267 + // Daphne addition -- $versionchange = $new_version_num
  268 + $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);
  269 + }
  270 + else
  271 + {
  272 + // Daphne addition -- $versionchange = $new_version_num
  273 + $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);
  274 + }
  275 + } else {
  276 + // BEGIN wes change
  277 + // insert entry for current version of file
  278 + $compressed = '0';
  279 + $userfile = uploadCompat("userfile");
  280 + $fsize = filesize($userfile['tmp_name']);
  281 + $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')");
  282 + $id = $sql->insert_id();
  283 +
  284 +
  285 +
  286 +
  287 +
  288 + if ($default->owl_compressed_database && file_exists($default->gzip_path)) {
  289 + system($default->gzip_path . " " . escapeshellarg($userfile['tmp_name']));
  290 + $fd = fopen($userfile['tmp_name'] . ".gz", 'rb');
  291 + $userfile['tmp_name'] = $userfile['tmp_name'] . ".gz";
  292 + $fsize = filesize($userfile['tmp_name']);
  293 + $compressed = '1';
  294 + } else {
  295 + $fd = fopen($userfile['tmp_name'], 'rb');
  296 + }
  297 + $filedata = addSlashes(fread($fd, $fsize));
  298 + fclose($fd);
  299 +
  300 + if ($id !== NULL && $filedata) {
  301 + $sql->query("insert into $default->owl_files_data_table (id, data, compressed) values ('$id', '$filedata','$compressed')");
  302 + }
  303 + // END wes change
  304 + }
  305 + // END Bozz Change
  306 +
  307 + }
  308 +
  309 + else { // versioning not included in the DB update
  310 + if ($default->owl_use_fs)
  311 + {
  312 + // BEGIN Bozz Change
  313 + if ( getfilepolicy($id) == 5 || getfilepolicy($id) == 6)
  314 + {
  315 + $sql->query("update $default->owl_files_table set size='".$userfile['size']."',modified='$modified',smodified='$smodified' where id='$id'") or unlink($newpath);
  316 + }
  317 + else
  318 + {
  319 + $sql->query("update $default->owl_files_table set size='".$userfile['size']."',creatorid='$userid',modified='$modified',smodified='$smodified' where id='$id'") or unlink($newpath);
  320 + }
  321 + // END Bozz Change
  322 + }
  323 + }
  324 +
  325 + // End Daphne Change
  326 +
  327 + if ($quota_max != "0") $sql->query("update $default->owl_users_table set quota_current = '$new_quota' where id = '$userid'");
  328 +
  329 + //notify_users($groupid,1, find_path($parent),$filename, $title, $newdesc);
  330 + notify_users($groupid,1,$parent,$filename, $title, $newdesc, $type);
  331 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  332 +// END BUG FIX: #433932 Fileupdate and Quotas
  333 + } else {
  334 + include("./lib/header.inc");
  335 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  336 + ?>
  337 + <TR><TD ALIGN=LEFT>
  338 +<?php print("$lang_user: ");
  339 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  340 + print uid_to_name($userid);
  341 + print ("</A>");
  342 +?>
  343 +<FONT SIZE=-1>
  344 +
  345 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  346 + </FONT></TD>
  347 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  348 + </TD></TR></TABLE><BR><BR>
  349 + <?php
  350 + print($lang_noupload);
  351 + }
  352 +}
  353 +
  354 +
  355 +if($action == "file_upload") {
  356 + if(check_auth($parent, "folder_modify", $userid) == 1) {
  357 + //if($title == "") exit($lang_specifyname);
  358 + $groupid = owlusergroup($userid);
  359 + $sql = new Owl_DB;
  360 + $userfile = uploadCompat("userfile");
  361 + if ($type == "url") {
  362 + $modified = date("M d, Y \a\\t h:i a");
  363 + $smodified = date("Y-m-d g:i:s");
  364 + $new_name = $userfile["name"];
  365 + if ($title == "")
  366 + $title = $userfile["name"];
  367 + $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', '".$userfile["name"]."', '".$userfile["size"]."', '$userid', '$parent', '$modified', '$description', '$metadata', '$security', '$groupid','$smodified','$checked_out','$major_revision','1','1')");
  368 + }
  369 + else {
  370 + $sql->query("select * from $default->owl_users_table where id = '$userid'");
  371 + while($sql->next_record()) {
  372 + $quota_max = $sql->f("quota_max");
  373 + $quota_current = $sql->f("quota_current");
  374 + $new_quota = $quota_current + $userfile["size"];
  375 + }
  376 + if (($new_quota > $quota_max) && ($quota_max != "0")) {
  377 +
  378 + die("$lang_err_quota".$new_quota."$lang_err_quota_needed".($quota_max - $quota_current)."$lang_err_quota_avail");
  379 + if(($quota_max - $quota_current) == "0")
  380 + die("$lang_err_quota_exceed");
  381 + }
  382 + $new_name = ereg_replace("[^-A-Za-z0-9._]", "", ereg_replace(" ", "_", ereg_replace("%20|^-", "_", $userfile["name"])));
  383 +
  384 + if ($default->owl_use_fs)
  385 + {
  386 + $newpath = $default->owl_FileDir."/".find_path($parent)."/".$new_name;
  387 + if(file_exists($newpath) == 1)
  388 + if ($default->debug == true)
  389 + printError($lang_fileexists,$newpath);
  390 + else
  391 + printError($lang_fileexists,"");
  392 +
  393 + copy($userfile["tmp_name"], $newpath);
  394 + unlink($userfile["tmp_name"]);
  395 + if(!file_exists($newpath))
  396 + if ($default->debug == true)
  397 + printError($lang_err_upload,$newpath);
  398 + else
  399 + printError($lang_err_upload,"");
  400 + }
  401 + else {
  402 + // is name already used?
  403 + //printError("SQL", "select filename from $default->owl_files_table where filename = '$new_name' and parent='$parent'");
  404 + $sql->query("select filename from $default->owl_files_table where filename = '$new_name' and parent='$parent'");
  405 + while($sql->next_record())
  406 + {
  407 + if ($sql->f("filename")) {
  408 + // can't move...
  409 + printError("<b>File Exists:</b>","There is already a file with the name <i>$new_name</i> in this directory.","");
  410 + // print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'>$lang_return</A><P>");
  411 + // needs to be internationalized
  412 + //exit("<b>File Exists:</b> There is already a file with the name <i>$title</i> in this directory.");
  413 + }
  414 + }
  415 +
  416 + }
  417 + /* BEGIN Bozz Change
  418 + If your not part of the Administartor Group
  419 + the Folder will have your group ID assigned to it */
  420 +
  421 + if ( owlusergroup($userid) != 0 )
  422 + {
  423 + $groupid = owlusergroup($userid);
  424 + }
  425 + // Bozz Change End
  426 +
  427 + $modified = date("M d, Y \a\\t h:i a");
  428 + $smodified = date("Y-m-d g:i:s");
  429 + if($title == "") $title = $new_name;
  430 + if($major_revision == "") $major_revision = 0;
  431 + if($minor_revision == "") $minor_revision = 1;
  432 + if($checked_out == "") $checked_out = 0;
  433 + // WORKING WORKING
  434 +
  435 + $compressed = '0';
  436 + $userfile = uploadCompat("userfile");
  437 + $fsize = $userfile['size'];
  438 + if (!$default->owl_use_fs && $default->owl_compressed_database && file_exists($default->gzip_path)) {
  439 + system($default->gzip_path . " " . escapeshellarg($userfile['tmp_name']));
  440 + $userfile['tmp_name'] = $userfile['tmp_name'] . ".gz";
  441 + $fsize = filesize($userfile['tmp_name']);
  442 + $compressed = '1';
  443 + }
  444 + $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);
  445 +
  446 + if (!$result && $default->owl_use_fs) unlink($newpath);
  447 + // BEGIN wes change
  448 + if (!$default->owl_use_fs) {
  449 + $id = $sql->insert_id();
  450 + $fd = fopen($userfile['tmp_name'], 'rb');
  451 + $filedata = addSlashes(fread($fd, $fsize));
  452 + fclose($fd);
  453 +
  454 + if ($id !== NULL && $filedata) {
  455 + $sql->query("insert into $default->owl_files_data_table (id, data, compressed) values ('$id', '$filedata', '$compressed')");
  456 + }
  457 + }
  458 +
  459 +
  460 + if ($quota_max != "0") $sql->query("update $default->owl_users_table set quota_current = '$new_quota' where id = '$userid'");
  461 + }
  462 +
  463 + notify_users($groupid,0,$parent,$new_name, $title, $description, $type);
  464 +
  465 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  466 + } else {
  467 + include("./lib/header.inc");
  468 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  469 + ?>
  470 + <TR><TD ALIGN=LEFT>
  471 + <?php print("$lang_user: ");
  472 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  473 + print uid_to_name($userid);
  474 + print ("</A>");
  475 + ?>
  476 +<FONT SIZE=-1>
  477 +
  478 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  479 + </FONT></TD>
  480 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  481 + </TD></TR></TABLE><BR><BR><CENTER>
  482 + <?php
  483 + print($lang_noupload);
  484 + }
  485 +}
  486 +
  487 +if($action == "file_modify") {
  488 + if(check_auth($id, "file_modify", $userid) == 1) {
  489 + $sql = new Owl_DB;
  490 + // Begin Bozz Change
  491 + if ( owlusergroup($userid) != 0 && $groupid == "" )
  492 + {
  493 + $groupid = owlusergroup($userid);
  494 + }
  495 +
  496 +
  497 + // BEGIN WES change
  498 + if (!$default->owl_use_fs)
  499 + {
  500 +
  501 + $name = flid_to_name($id);
  502 + if ($name != $title)
  503 + {
  504 + // we're changing the name ... need to roll this to other revisions
  505 + // is name already used?
  506 + $sql->query("select name from $default->owl_files_table where name = '$title' and parent='$parent'");
  507 + while($sql->next_record())
  508 + {
  509 + if ($sql->f("name")) {
  510 + // can't move...
  511 + //print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'>$lang_return</A><P>");
  512 + // needs to be internationalized
  513 + printError("<b>File Exists:</b> There is already a file with the name <i>$title</i> in this directory.","");
  514 + }
  515 + }
  516 + $sql->query("update $default->owl_files_table set name='$title' where parent='$parent' AND name = '$name'");
  517 + }
  518 + }
  519 +
  520 + $sql->query("update $default->owl_files_table set name='$title', security='$security', metadata='$metadata', description='$description',groupid='$groupid', creatorid ='$file_owner' where id = '$id'");
  521 + // End Bozz Change
  522 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  523 + } else {
  524 + include("./lib/header.inc");
  525 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  526 + ?>
  527 + <TR><TD ALIGN=LEFT>
  528 + <?php print("$lang_user: ");
  529 + if(prefaccess($userid)) {
  530 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand&order=$order&$sortorder=$sortname'>");
  531 + }
  532 + print uid_to_name($userid);
  533 + print ("</A>");
  534 + ?>
  535 +<FONT SIZE=-1>
  536 +
  537 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  538 + </FONT></TD>
  539 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  540 + </TD></TR></TABLE><BR><BR><CENTER>
  541 + <?php
  542 + exit($lang_nofilemod);
  543 + }
  544 +}
  545 +
  546 +if($action == "file_delete") {
  547 +if(check_auth($id, "file_delete", $userid) == 1) {
  548 + $sql = new Owl_DB;
  549 + if ($type == "url")
  550 + {
  551 + $sql->query("delete from $default->owl_files_table where id = '$id'");
  552 + }
  553 + else {
  554 + $sql->query("select * from $default->owl_files_table where id = '$id'");
  555 + while($sql->next_record()) {
  556 + $path = find_path($sql->f("parent"));
  557 + $filename = $sql->f("filename");
  558 + $filesize = $sql->f("size");
  559 + $owner = $sql->f("creatorid");
  560 + }
  561 + $sql->query("select * from $default->owl_users_table where id = '$owner'");
  562 + while($sql->next_record()) {
  563 + $quota_current = $sql->f("quota_current");
  564 + $quota_max = $sql->f("quota_max");
  565 + }
  566 + $new_quota = $quota_current - $filesize;
  567 + if($quota_max != "0") $sql->query("update $default->owl_users_table set quota_current = '$new_quota' where id = '$owner'");
  568 +
  569 + if($default->owl_use_fs) {
  570 + unlink($default->owl_FileDir."/".$path."/".$filename);
  571 + } else {
  572 + $sql->query("delete from $default->owl_files_data_table where id = '$id'");
  573 + }
  574 +
  575 + $sql->query("delete from $default->owl_files_table where id = '$id'");
  576 + sleep(.5);
  577 + }
  578 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  579 + } else {
  580 + include("./lib/header.inc");
  581 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  582 + ?>
  583 + <TR><TD ALIGN=LEFT>
  584 +<?php print("$lang_user: ");
  585 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  586 + print uid_to_name($userid);
  587 + print ("</A>");
  588 +?>
  589 +<FONT SIZE=-1>
  590 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  591 + </FONT></TD>
  592 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  593 + </TD></TR></TABLE><BR><BR><CENTER>
  594 + <?php
  595 + exit($lang_nofiledelete);
  596 + }
  597 +}
  598 +// Begin Daphne Change
  599 +// the file policy authorisation has been taken from file_modify
  600 +// (it's assumed that if you can't modify the file you can't check it out)
  601 +
  602 +if($action == "file_lock") {
  603 + if(check_auth($id, "file_modify", $userid) == 1) {
  604 + $sql = new Owl_DB;
  605 + // Begin Bozz Change
  606 + if ( owlusergroup($userid) != 0 )
  607 + {
  608 + $groupid = owlusergroup($userid);
  609 + }
  610 + // check that file hasn't been reserved while updates have gone through
  611 + $sql->query("select checked_out from $default->owl_files_table where id = '$id'");
  612 +
  613 + while($sql->next_record()) {
  614 + $file_lock = $sql->f("checked_out");
  615 + }
  616 +
  617 + if ($file_lock == 0) {
  618 + // reserve the file
  619 + $sql->query("update $default->owl_files_table set checked_out='$userid' where id='$id'");
  620 + }
  621 + else {
  622 + if ($file_lock == $userid) {
  623 + // check the file back in
  624 + $sql->query("update $default->owl_files_table set checked_out='0' where id='$id'");
  625 + }
  626 + else {
  627 + // throw error; someone else is trying to lock the file!
  628 + include("./lib/header.inc");
  629 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  630 + ?>
  631 + <TR><TD ALIGN=LEFT>
  632 + <?php print("$lang_user: ");
  633 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  634 + print uid_to_name($userid);
  635 + print ("</A>");
  636 + ?>
  637 +<FONT SIZE=-1>
  638 +
  639 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  640 + </FONT></TD>
  641 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  642 + </TD></TR></TABLE><BR><BR><CENTER>
  643 + <?php
  644 + exit("$lang_err_file_lock ".uid_to_name($file_lock).".");
  645 + }
  646 + }
  647 +
  648 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  649 +
  650 +
  651 + } else {
  652 + include("./lib/header.inc");
  653 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  654 + ?>
  655 + <TR><TD ALIGN=LEFT>
  656 + <?php print("$lang_user: ");
  657 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  658 + print uid_to_name($userid);
  659 + print ("</A>");
  660 + ?>
  661 +<FONT SIZE=-1>
  662 +
  663 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  664 + </FONT></TD>
  665 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  666 + </TD></TR></TABLE><BR><BR><CENTER>
  667 + <?php
  668 + exit($lang_nofilemod);
  669 + }
  670 +}
  671 +// End Daphne Change
  672 +
  673 +if($action == "file_email") {
  674 +
  675 + if(check_auth($parent, "folder_modify", $userid) == 1) {
  676 +
  677 + $sql = new Owl_DB;
  678 + $path="";
  679 + $filename= flid_to_filename($id);
  680 + if ($default->owl_use_fs) {
  681 + $fID=$parent;
  682 + do {
  683 + $sql->query("select name,parent from $default->owl_folders_table where id='$fID'");
  684 + while($sql->next_record()) {
  685 + $tName = $sql->f("name");
  686 + $fID = $sql->f("parent");
  687 + }
  688 + $path=$tName."/".$path;
  689 + } while ($fID != 0);
  690 + }
  691 + $sql->query("select name, filename, description from $default->owl_files_table where id='$id'");
  692 + $sql->next_record();
  693 + $name= $sql->f("name");
  694 + $desc= $sql->f("description");
  695 + $filename = $sql->f("filename");
  696 +
  697 + $mail = new phpmailer();
  698 +
  699 + $mail->IsSMTP(); // set mailer to use SMTP
  700 + $mail->Host = "$default->owl_email_server"; // specify main and backup server
  701 + $mail->From = "$default->owl_email_from";
  702 + $mail->FromName = "$default->owl_email_fromname";
  703 +
  704 + $r=preg_split("(\;|\,)",$mailto);
  705 + reset ($r);
  706 + while (list ($occ, $email) = each ($r))
  707 + $mail->AddAddress($email);
  708 + if($replyto == "" )
  709 + $mail->AddReplyTo("$default->owl_email_replyto", "OWL Intranet");
  710 + else
  711 + $mail->AddReplyTo("$replyto");
  712 +
  713 + if($ccto != "")
  714 + $mail->AddCC("$ccto");
  715 +
  716 +
  717 + $mail->WordWrap = 50; // set word wrap to 50 characters
  718 + $mail->IsHTML(true); // set email format to HTML
  719 +
  720 + $mail->Subject = "$lang_file: $name -- $subject";
  721 + if ($type != "url") {
  722 + $mail->Body = "$mailbody" . "<BR><BR>" . "$lang_description: <BR><BR>$desc";
  723 + $mail->altBody = "$mailbody" . "\n\n" . "$lang_description: \n\n $desc";
  724 + // BEGIN wes change
  725 + if (!$default->owl_use_fs) {
  726 + if (file_exists("$default->owl_FileDir/$path$filename")) {
  727 + unlink("$default->owl_FileDir/$path$filename");
  728 + }
  729 + $file = fopen("$default->owl_FileDir/$path$filename", 'wb');
  730 + $sql->query("select data,compressed from $default->owl_files_data_table where id='$id'");
  731 + while ($sql->next_record()) {
  732 + if ($sql->f("compressed")) {
  733 +
  734 + $tmpfile = $default->owl_FileDir . "owltmp.$id.gz";
  735 + $uncomptmpfile = $default->owl_FileDir . "owltmp.$id";
  736 + if (file_exists($tmpfile)) unlink($tmpfile);
  737 +
  738 + $fp=fopen($tmpfile,"w");
  739 + fwrite($fp, $sql->f("data"));
  740 + fclose($fp);
  741 +
  742 + system($default->gzip_path . " -df $tmpfile");
  743 +
  744 + $fsize = filesize($uncomptmpfile);
  745 + $fd = fopen($uncomptmpfile, 'rb');
  746 + $filedata = fread($fd, $fsize);
  747 + fclose($fd);
  748 +
  749 + fwrite($file, $filedata);
  750 + unlink($uncomptmpfile);
  751 + } else {
  752 + fwrite($file, $sql->f("data"));
  753 + }
  754 + }
  755 + fclose($file);
  756 + }
  757 +
  758 + $mail->AddAttachment("$default->owl_FileDir/$path$filename");
  759 + }
  760 + else {
  761 + $mail->Body = "$filename" . "<BR><BR>" . "$mailbody" . "<BR><BR>" . "$lang_description: <BR><BR>$desc";
  762 + $mail->altBody = "$filename" . "\n\n" ."$mailbody" . "\n\n" . "$lang_description: \n\n $desc";
  763 + }
  764 +
  765 + if(!$mail->Send())
  766 + {
  767 + printError($lang_err_email, $mail->ErrorInfo);
  768 + //printError("Server:$default->owl_email_server<BR>File:$default->owl_FileDir/$path$filename ", $mail->ErrorInfo);
  769 + }
  770 + if (!$default->owl_use_fs) {
  771 + unlink("$default->owl_FileDir/$path$filename");
  772 + }
  773 +
  774 + }
  775 +}
  776 +
  777 +
  778 +if($action == "folder_create") {
  779 + if(check_auth($parent, "folder_modify", $userid) == 1) {
  780 + $sql = new Owl_DB;
  781 + //we have to be careful with the name just like with the files
  782 + //Comment this one out TRACKER : 603887, this was not done for renaming a folder
  783 + // So lets see if it causes problems while creating folders.
  784 + // Seems it causes a problem, so I put it back.
  785 + $name = ereg_replace("[^-A-Za-z0-9._[:space:]]", "", ereg_replace("%20|^-", " ", $name));
  786 + $sql->query("select * from $default->owl_folders_table where name = '$name' and parent = '$parent'");
  787 + if($sql->num_rows() > 0)
  788 + printError("$lang_err_folder_exist","");
  789 +
  790 + if ( $name == '')
  791 + printError($lang_err_nameempty,"");
  792 +
  793 + if($default->owl_use_fs) {
  794 + $path = find_path($parent);
  795 + mkdir($default->owl_FileDir."/".$path."/".$name, 0777);
  796 + if(!is_dir("$default->owl_FileDir/$path/$name")) {
  797 + if ($default->debug == true)
  798 + printError($lang_err_folder_create,"$default->owl_FileDir/$path/$name");
  799 + else
  800 + printError($lang_err_folder_create,"");
  801 + }
  802 + }
  803 + $sql->query("insert into $default->owl_folders_table (name,parent,security,groupid,creatorid) values ('$name', '$parent', '$policy', '$groupid', '$userid')");
  804 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  805 + } else {
  806 + include("./lib/header.inc");
  807 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  808 + ?>
  809 + <TR><TD ALIGN=LEFT>
  810 + <?php print("$lang_user: ");
  811 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  812 + print uid_to_name($userid);
  813 + print ("</A>");
  814 + ?>
  815 +<FONT SIZE=-1>
  816 +
  817 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  818 + </FONT></TD>
  819 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  820 + </TD></TR></TABLE><BR><BR><CENTER>
  821 + <?php
  822 + exit($lang_nosubfolder);
  823 + }
  824 +}
  825 +
  826 +if($action == "folder_modify") {
  827 + if(check_auth($id, "folder_modify", $userid) == 1) {
  828 + $sql = new Owl_DB;
  829 + $origname = fid_to_name($id);
  830 + $sql->query("select parent from $default->owl_folders_table where id = '$id'");
  831 + while($sql->next_record()) $parent = $sql->f("parent");
  832 + $path = $default->owl_FileDir."/".find_path($parent)."/";
  833 + $source = $path . $origname;
  834 + $name = ereg_replace("[^-A-Za-z0-9._[:space:]]", "", ereg_replace("%20|^-", " ", $name));
  835 + $dest = $path . $name;
  836 +
  837 + if ($default->owl_use_fs) {
  838 + if (!file_exists($path . $name) == 1 || $source == $dest) {
  839 + if (substr(php_uname(), 0, 7) != "Windows") {
  840 + if ($source != $dest) {
  841 + $cmd="mv \"$path$origname\" \"$path$name\" 2>&1";
  842 + $lines=array();$errco=0;
  843 + $result = myExec($cmd,$lines,$errco);
  844 + if ( $errco != 0 )
  845 + printError($lang_err_movecancel, $result);
  846 + }
  847 + }
  848 + else {
  849 + // IF Windows just do a rename and hope for the best
  850 + rename ("$path$origname", "$path$name");
  851 + }
  852 +
  853 + }
  854 + else
  855 + printError($lang_err_folderexists,"");
  856 + }
  857 + else {
  858 + $sql->query("select * from $default->owl_folders_table where parent = '$parent' and name = '$name'");
  859 + if ($sql->num_rows($sql) != 0)
  860 + printError($lang_err_folderexists,"");
  861 + }
  862 + /* BEGIN Bozz Change
  863 + If your not part of the Administartor Group
  864 + the Folder will have your group ID assigned to it */
  865 + if ( owlusergroup($userid) != 0 )
  866 + {
  867 + $sql->query("update $default->owl_folders_table set name='$name', security='$policy' where id = '$id'");
  868 + }
  869 + else
  870 + {
  871 + $sql->query("update $default->owl_folders_table set name='$name', security='$policy', groupid='$groupid' where id = '$id'");
  872 + }
  873 +
  874 +
  875 + // Bozz change End
  876 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  877 + } else {
  878 + include("./lib/header.inc");
  879 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  880 + ?>
  881 + <TR><TD ALIGN=LEFT>
  882 + <?php print("$lang_user: ");
  883 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  884 + print uid_to_name($userid);
  885 + print ("</A>");
  886 + ?>
  887 +<FONT SIZE=-1>
  888 +
  889 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  890 + </FONT></TD>
  891 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  892 + </TD></TR></TABLE><BR><BR><CENTER>
  893 + <?php
  894 + exit($lang_nofoldermod);
  895 + }
  896 +}
  897 +
  898 +if($action == "folder_delete") {
  899 + if(check_auth($id, "folder_delete", $userid) == 1) {
  900 + $sql = new Owl_DB;
  901 + $sql->query("select id,name,parent from $default->owl_folders_table order by name");
  902 + $fCount = ($sql->nf());
  903 + $i = 0;
  904 + while($sql->next_record()) {
  905 + $folderList[$i][0] = $sql->f("id");
  906 + $folderList[$i][2] = $sql->f("parent");
  907 + $i++;
  908 + }
  909 + if ($default->owl_use_fs)
  910 + myDelete($default->owl_FileDir."/".find_path($id));
  911 +
  912 + delTree($id);
  913 + sleep(.5);
  914 + header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  915 + } else {
  916 + include("./lib/header.inc");
  917 + print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
  918 + ?>
  919 + <TR><TD ALIGN=LEFT>
  920 + <?php print("$lang_user: ");
  921 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");
  922 + print uid_to_name($userid);
  923 + print ("</A>");
  924 + ?>
  925 +<FONT SIZE=-1>
  926 +
  927 + <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>
  928 + </FONT></TD>
  929 + <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>
  930 + </TD></TR></TABLE><BR><BR><CENTER>
  931 + <?php
  932 + exit($lang_nofolderdelete);
  933 + }
  934 +}
  935 +
  936 +if($action == "user") {
  937 + //
  938 + // the following should prevent users from changing others passwords.
  939 + //
  940 + $sql = new Owl_DB;
  941 + $sql->query("select * from $default->owl_sessions_table where uid = '$id' and sessid = '$sess'");
  942 + if($sql->num_rows() <> 1)
  943 + {
  944 + die ("$lang_err_unauthorized");
  945 + }
  946 +
  947 + if ($newpassword <> '')
  948 + {
  949 + $sql = new Owl_DB;
  950 + $sql->query("select * from $default->owl_users_table where id = '$id' and password = '" . md5($oldpassword) ."'");
  951 + if($sql->num_rows() == 0)
  952 + die("$lang_err_pass_wrong");
  953 + if ( $newpassword == $confpassword)
  954 + $sql->query("UPDATE $default->owl_users_table SET name='$name',password='" . md5("$newpassword") . "' where id = '$id'");
  955 + else
  956 + die ("$lang_err_pass_missmatch");
  957 + }
  958 + $sql->query("UPDATE $default->owl_users_table SET name='$name', email='$email', notify='$notify', attachfile='$attachfile', language='$newlanguage' where id = '$id'");
  959 +}
  960 +
  961 +
  962 +header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");
  963 +
  964 +?>
... ...
download.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 + * download.php
  5 + *
  6 + * Copyright (c) 1999-2002 The Owl Project Team
  7 + * Licensed under the GNU GPL. For full terms see the file COPYING.
  8 + *
  9 + * $Id$
  10 +*/
  11 +
  12 +require("./config/owl.php");
  13 +require("./lib/owl.lib.php");
  14 +require("./config/html.php");
  15 +require("./lib/security.lib.php");
  16 +
  17 +function find_path($parent) {
  18 + global $parent, $default;
  19 + $path = fid_to_name($parent);
  20 + $sql = new Owl_DB;
  21 + while($parent != 1) {
  22 + $sql->query("select parent from $default->owl_folders_table where id = '$parent'");
  23 + while($sql->next_record()) {
  24 + $path = fid_to_name($sql->f("parent"))."/".$path;
  25 + $parent = $sql->f("parent");
  26 + }
  27 + }
  28 + return $path;
  29 +}
  30 +
  31 +function fid_to_filename($id) {
  32 + global $default;
  33 + $sql = new Owl_DB;
  34 + $sql->query("select filename from $default->owl_files_table where id = '$id'");
  35 + while($sql->next_record()) return $sql->f("filename");
  36 +}
  37 +
  38 +function zip_folder($id, $userid) {
  39 +
  40 + global $default, $sess;
  41 +
  42 + $tmpdir = $default->owl_FileDir . "/owltmpfld_$sess.$id";
  43 + //if (file_exists($tmpdir)) system("rm -rf " . escapeshellarg($tmpdir));
  44 + if (file_exists($tmpdir)) myDelete($tmpdir);
  45 +
  46 + mkdir("$tmpdir", 0777);
  47 + //system("mkdir " . escapeshellarg($tmpdir));
  48 + $sql = new Owl_DB;
  49 + $sql2 = new Owl_DB;
  50 +
  51 + $sql->query("select name, id from $default->owl_folders_table where id = '$id'");
  52 + while($sql->next_record()) {
  53 + $top= $sql->f("name");
  54 + }
  55 + $path = "$tmpdir/$top";
  56 + mkdir("$path", 0777);
  57 + //system("mkdir " . escapeshellarg($path));
  58 +
  59 + folder_loop($sql, $sql2, $id, $path, $userid);
  60 + // get all files in folder
  61 + // GETTING IE TO WORK IS A PAIN!
  62 + if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE"))
  63 + header("Content-Type: application/x-gzip");
  64 + else
  65 + header("Content-Type: application/octet-stream");
  66 +
  67 +
  68 + header("Content-Disposition: attachment; filename=\"$top.tgz\"");
  69 + header("Content-Location: \"$top.tgz\"");
  70 + // header("Content-Length: $fsize");
  71 + header("Expires: 0");
  72 + //header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  73 + //header("Pragma: Public");
  74 +
  75 + if (file_exists($default->tar_path)) {
  76 + if (file_exists($default->gzip_path)) {
  77 + //passthru("$default->tar_path -C ". escapeshellarg($tmpdir) . " -zc " . escapeshellarg($top));
  78 + passthru("$default->tar_path cf - -C ". escapeshellarg($tmpdir) . " " . escapeshellarg($top) . "| " . $default->gzip_path . " -c -9");
  79 + } else {
  80 + //passthru("$default->tar_path -C ". escapeshellarg($tmpdir) . " -zc " . escapeshellarg($top));
  81 + passthru("$default->tar_path cf - -C ". escapeshellarg($tmpdir) . " " . escapeshellarg($top) );
  82 + }
  83 + } else {
  84 + myDelete($tmpdir);
  85 + printError("$default->tar_path was not found","");
  86 + }
  87 + myDelete($tmpdir);
  88 + //system("rm -rf " . escapeshellarg($tmpdir));
  89 +}
  90 +
  91 +
  92 +
  93 +//function folder_loop(&$sql, &$sql2, $id, $tmpdir, $userid) {
  94 +function folder_loop($sql, $sql2, $id, $tmpdir, $userid) {
  95 +
  96 + global $default;
  97 +
  98 + if(check_auth($id, "folder_view", $userid) == 1) {
  99 +
  100 + $sql = new Owl_DB;
  101 + // write out all the files
  102 + $sql->query("select * from $default->owl_files_table where parent = '$id'");
  103 + while($sql->next_record()) {
  104 + $fid = $sql->f("id");
  105 + $filename = $tmpdir . "/" . $sql->f("filename");
  106 + if(check_auth($fid, "file_download", $userid) == 1) {
  107 +
  108 + if ($default->owl_use_fs) {
  109 + $source = $default->owl_FileDir . "/" . get_dirpath($id) . "/" . $sql->f("filename");
  110 + copy($source, $filename);
  111 + }
  112 + else {
  113 + $sql2->query("select data,compressed from " . $default->owl_files_data_table . " where id='$fid'");
  114 + while($sql2->next_record()) {
  115 + if ($sql2->f("compressed")) {
  116 +
  117 + $fp=fopen($filename . ".gz","w");
  118 + fwrite($fp, $sql2->f("data"));
  119 + fclose($fp);
  120 + system($default->gzip_path . " -d " . escapeshellarg($filename) .".gz");
  121 +
  122 + } else {
  123 + $fp=fopen($filename,"w");
  124 + fwrite($fp, $sql2->f("data"));
  125 + fclose($fp);
  126 + } // end if
  127 +
  128 + } // end if
  129 +
  130 + } // end while
  131 +
  132 + } // end if
  133 +
  134 + } // end while
  135 +
  136 + // recurse into directories
  137 + $sql->query("select name, id from $default->owl_folders_table where parent = '$id'");
  138 + while($sql->next_record()) {
  139 + $saved = $tmpdir;
  140 + $tmpdir .= "/" . $sql->f("name");
  141 + mkdir("$tmpdir", 0777);
  142 + //system("mkdir " . escapeshellarg($tmpdir));
  143 + folder_loop($sql, $sql2, $sql->f("id"), $tmpdir, $userid);
  144 + $tmpdir = $saved;
  145 + }
  146 + }
  147 +}
  148 +
  149 +
  150 +
  151 +if ($action == "folder") {
  152 + $abort_status = ignore_user_abort(true);
  153 + zip_folder($id, $userid);
  154 + ignore_user_abort($abort_status);
  155 + exit;
  156 +}
  157 +
  158 +if(check_auth($id, "file_download", $userid) == 1) {
  159 + $filename = fid_to_filename($id);
  160 + $mimeType = "application/octet-stream";
  161 +
  162 + if ($binary != 1) {
  163 + if ($filetype = strrchr($filename,".")) {
  164 + $filetype = substr($filetype,1);
  165 + $sql = new Owl_DB;
  166 + $sql->query("select * from $default->owl_mime_table where filetype = '$filetype'");
  167 + while($sql->next_record()) $mimeType = $sql->f("mimetype");
  168 + }
  169 + }
  170 +
  171 + // BEGIN wes change
  172 +
  173 + if ($default->owl_use_fs) {
  174 + $path = find_path($parent)."/".$filename;
  175 + $fspath = $default->owl_FileDir."/".$path;
  176 + $fsize = filesize($fspath);
  177 + } else {
  178 + $sql->query("select size from " . $default->owl_files_table . " where id='$id'");
  179 + while($sql->next_record()) $fsize = $sql->f("size");
  180 + }
  181 + // END wes change
  182 +
  183 +
  184 + // BEGIN BUG: 495556 File download sends incorrect headers
  185 + // header("Content-Disposition: filename=\"$filename\"");
  186 + header("Content-Disposition: attachment; filename=\"$filename\"");
  187 + header("Content-Location: $filename");
  188 + header("Content-Type: $mimeType");
  189 + header("Content-Length: $fsize");
  190 + //header("Pragma: no-cache");
  191 + header("Expires: 0");
  192 + // END BUG: 495556 File download sends incorrect headers
  193 +
  194 + // BEGIN wes change
  195 + if ($default->owl_use_fs) {
  196 + if (substr(php_uname(), 0, 7) != "Windows")
  197 + $fp=fopen("$fspath","r");
  198 + else
  199 + $fp=fopen("$fspath","rb");
  200 + print fread($fp,filesize("$fspath"));
  201 + fclose($fp);
  202 + } else {
  203 + $sql->query("select data,compressed from " . $default->owl_files_data_table . " where id='$id'");
  204 + while($sql->next_record()) {
  205 + if ($sql->f("compressed")) {
  206 + $tmpfile = $default->owl_FileDir . "owltmp.$id";
  207 + if (file_exists($tmpfile)) unlink($tmpfile);
  208 +
  209 + $fp=fopen($tmpfile,"w");
  210 + fwrite($fp, $sql->f("data"));
  211 + fclose($fp);
  212 + flush(passthru($default->gzip_path . " -dfc $tmpfile"));
  213 + unlink($tmpfile);
  214 + } else {
  215 + print $sql->f("data");
  216 + flush();
  217 + }
  218 + }
  219 + }
  220 + // END wes change
  221 +} else {
  222 + print($lang_nofileaccess);
  223 +}
  224 +
  225 +?>
... ...
graphics/admin_backup.gif 0 → 100644

1.59 KB

graphics/admin_backup_disabled.gif 0 → 100644

1.61 KB

graphics/admin_flush.gif 0 → 100755

1.63 KB

graphics/admin_groups.gif 0 → 100644

1 KB

graphics/admin_html_prefs.gif 0 → 100644

1.45 KB

graphics/admin_site_prefs.gif 0 → 100644

1.55 KB

graphics/admin_system.gif 0 → 100644

1.42 KB

graphics/admin_users.gif 0 → 100644

1.57 KB

graphics/asc.gif 0 → 100755

857 Bytes

graphics/blank.gif 0 → 100755

218 Bytes

graphics/desc.gif 0 → 100755

859 Bytes

graphics/owlftp.gif 0 → 100755

781 Bytes

graphics/rc.gif 0 → 100755

766 Bytes

graphics/star.gif 0 → 100755

577 Bytes

graphics/star10.gif 0 → 100644

1.02 KB

index.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 + * index.php -- Main page
  5 + *
  6 + * Copyright (c) 1999-2002 The Owl Project Team
  7 + * Licensed under the GNU GPL. For full terms see the file COPYING.
  8 + *
  9 + * $Id$
  10 +*/
  11 +require("./config/owl.php");
  12 +require("./lib/owl.lib.php");
  13 +require("./config/html.php");
  14 +
  15 +if (checkrequirements() == 1) {
  16 +exit;
  17 +}
  18 +if(!isset($failure)) $failure = 0;
  19 +if(!$login) $login = 1;
  20 +
  21 +if($loginname && $password) {
  22 + $verified["bit"] = 0;
  23 + $verified = verify_login($loginname, $password);
  24 + if ($verified["bit"] == 1) {
  25 + $session = new Owl_Session;
  26 + $uid = $session->Open_Session(0,$verified["uid"]);
  27 + /*
  28 + $sql = new Owl_DB;
  29 + $sql->query("select * from $default->owl_folders_table where parent = '2' and name = '$loginname'");
  30 + while($sql->next_record()) $id = $sql->f("id");
  31 + */
  32 + $id = 1;
  33 +
  34 +
  35 +
  36 +
  37 + /* BEGIN Bozz Change */
  38 +
  39 + /* If an admin signs on We want to se the admin menu
  40 + Not the File Browser. */
  41 + if ( $verified["group"] == 0)
  42 + {
  43 + if(!isset($fileid))
  44 + header("Location: admin/index.php?sess=". $uid->sessdata["sessid"]);
  45 + else
  46 + header("Location: browse.php?sess=". $uid->sessdata["sessid"]."&parent=$parent&fileid=$fileid");
  47 + }
  48 + else
  49 + {
  50 + if(!isset($fileid))
  51 + header("Location: browse.php?sess=". $uid->sessdata["sessid"]);
  52 + else
  53 + header("Location: browse.php?sess=". $uid->sessdata["sessid"]."&parent=$parent&fileid=$fileid");
  54 + }
  55 + /* END Bozz Change */
  56 +
  57 + } else {
  58 + if ($verified["bit"] == 2)
  59 + header("Location: index.php?login=1&failure=2");
  60 + else if ($verified["bit"] == 3 )
  61 + header("Location: index.php?login=1&failure=3");
  62 + else
  63 + header("Location: index.php?login=1&failure=1");
  64 + }
  65 +}
  66 +
  67 +
  68 +if(($login == 1) || ($failure == 1)) {
  69 + include("./lib/header.inc");
  70 + print("<CENTER>");
  71 +// BUG Number: 457588
  72 +// This is to display the version inforamation
  73 +// BEGIN
  74 + print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/$default->logo'><BR>$lang_engine<BR>$lang_version: $default->version<BR><HR WIDTH=300>");
  75 +// END
  76 + if($failure == 1) print("<BR>$lang_loginfail<BR>");
  77 + if($failure == 2) print("<BR>$lang_logindisabled<BR>");
  78 + if($failure == 3) print("<BR>$lang_toomanysessions<BR>");
  79 + print "<FORM ACTION=index.php METHOD=POST>";
  80 + if (isset($fileid)) {
  81 + print "<INPUT TYPE=HIDDEN NAME=parent value=$parent>";
  82 + print "<INPUT TYPE=HIDDEN NAME=fileid value=$fileid>";
  83 + }
  84 + print "<TABLE><TR><TD>$lang_username:</TD><TD><INPUT TYPE=TEXT NAME=loginname><BR></TD></TR>";
  85 + print "<TR><TD>$lang_password:</TD><TD><INPUT TYPE=PASSWORD NAME=password><BR></TD></TR></TABLE>";
  86 + print "<INPUT TYPE=SUBMIT Value=$lang_login>\n";
  87 + print "<BR><BR><HR WIDTH=300>";
  88 + exit;
  89 +}
  90 +
  91 +if($login == "logout") {
  92 + include("./lib/header.inc");
  93 + print("<CENTER>");
  94 +// BUG Number: 457588
  95 +// This is to display the version inforamation
  96 +// BEGIN
  97 + print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/$default->logo'><BR>$lang_engine<BR>$lang_version: $default->version<BR><HR WIDTH=300>");
  98 +// END
  99 + $sql = new Owl_DB;
  100 + $sql->query("delete from $default->owl_sessions_table where sessid = '$sess'");
  101 + print("<BR>$lang_successlogout<BR>");
  102 + print "<FORM ACTION=index.php METHOD=POST>";
  103 + print "<TABLE><TR><TD>$lang_username:</TD><TD><INPUT TYPE=TEXT NAME=loginname><BR></TD></TR>";
  104 + print "<TR><TD>$lang_password:</TD><TD><INPUT TYPE=PASSWORD NAME=password><BR></TD></TR></TABLE>";
  105 + print "<INPUT TYPE=SUBMIT Value=$lang_login>\n";
  106 + print "<BR><BR><HR WIDTH=300>";
  107 + exit;
  108 +}
  109 +include("./lib/footer.inc");
  110 +?>
... ...
lib/footer.inc 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: footer.inc
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +
  18 +if ($expand == "1") {
  19 + echo "\t<HR ALIGN=CENTER WIDTH=$default->table_expand_width>";
  20 +} else {
  21 + echo "\t<HR ALIGN=CENTER WIDTH=$default->table_collapse_width>";
  22 +}
  23 +
  24 +?>
  25 +
  26 +<?php
  27 +// BUG Number: 457588
  28 +// This is to display the version inforamation
  29 +// BEGIN
  30 +print("<BR>$lang_engine<BR>");
  31 +print("Version: $default->version");
  32 +// END
  33 +?>
  34 +<?php
  35 +if (owlusergroup($userid) == 0) {
  36 + print("<BR><A HREF='$default->owl_root_url/admin/index.php?sess=$sess'>$lang_admin</A><BR>");
  37 +}
  38 +print "<FORM ACTION='$default->owl_root_url/search.php' METHOD=POST><INPUT TYPE=TEXT NAME=query>
  39 +<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess><INPUT TYPE=HIDDEN NAME=parent VALUE=$parent>
  40 +<INPUT TYPE=HIDDEN NAME=expand VALUE=$expand><INPUT TYPE=SUBMIT VALUE=$lang_search></FORM>";
  41 +?>
  42 +</BODY>
  43 +</HTML>
  44 +
... ...
lib/header.inc 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: header.inc
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +
  18 +?>
  19 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
  20 + "http://www.w3.org/TR/REC-html40/loose.dtd">
  21 +<HTML>
  22 + <HEAD>
  23 + <TITLE>Owl Intranet</TITLE>
  24 +<LINK REL="stylesheet" TYPE="text/css" TITLE="style1" HREF="<?php echo($default->styles)?>">
  25 + </HEAD>
  26 +
  27 + <BODY BGCOLOR="<?php echo($default->body_bgcolor) ?>"
  28 + TEXT="<?php echo($default->body_textcolor) ?>"
  29 + LINK="<?php echo($default->body_link) ?>"
  30 + VLINK="<?php echo($default->body_vlink) ?>">
  31 + <CENTER>
  32 + <BR>
  33 + <BR>
... ...
lib/owl.lib.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 + * owl.lib.php
  5 + *
  6 + * Copyright (c) 1999-2002 The Owl Project Team
  7 + * Licensed under the GNU GPL. For full terms see the file COPYING.
  8 + *
  9 + * $Id$
  10 + */
  11 +
  12 +// Support for reg.globals off WES
  13 +
  14 +if (substr(phpversion(),0,5) >= "4.1.0")
  15 + import_request_variables('pgc');
  16 + else {
  17 + if (!EMPTY($_POST)) {
  18 + extract($_POST);
  19 + } else {
  20 + extract($HTTP_POST_VARS);
  21 + }
  22 + if (!EMPTY($_GET)) {
  23 + extract($_GET);
  24 + } else {
  25 + extract($HTTP_GET_VARS);
  26 + }
  27 + if (!EMPTY($_FILE)) {
  28 + extract($_FILE);
  29 + } else {
  30 + extract($HTTP_POST_FILES);
  31 + }
  32 +}
  33 +
  34 +
  35 +if(!isset($sess)) $sess = 0;
  36 +if(!isset($loginname)) $loginname = 0;
  37 +if(!isset($login)) $login = 0;
  38 +
  39 +if(isset($default->owl_lang)) {
  40 + $langdir = "$default->owl_fs_root/locale/$default->owl_lang";
  41 + if(is_dir("$langdir") != 1) {
  42 + die("$lang_err_lang_1 $langdir $lang_err_lang_2");
  43 + } else {
  44 + $sql = new Owl_DB;
  45 + $sql->query("select * from $default->owl_sessions_table where sessid = '$sess'");
  46 + $sql->next_record();
  47 + $numrows = $sql->num_rows($sql);
  48 + $getuid = $sql->f("uid");
  49 + if($numrows == 1) {
  50 + $sql->query("select * from $default->owl_users_table where id = $getuid");
  51 + $sql->next_record();
  52 + $language = $sql->f("language");
  53 + // BEGIN wes fix
  54 + if(!$language) {
  55 + $language = $default->owl_lang;
  56 + }
  57 + // END wes fix
  58 + require("$default->owl_fs_root/locale/$language/language.inc");
  59 + $default->owl_lang = $language;
  60 + }
  61 + else
  62 + require("$default->owl_fs_root/locale/$default->owl_lang/language.inc");
  63 + }
  64 +} else {
  65 + die("$lang_err_lang_notfound");
  66 +}
  67 +
  68 +
  69 +class Owl_DB extends DB_Sql {
  70 + var $classname = "Owl_DB";
  71 +
  72 + // BEGIN wes changes -- moved these settings to config/owl.php
  73 + // Server where the database resides
  74 + var $Host = "";
  75 +
  76 + // Database name
  77 + var $Database = "";
  78 +
  79 + // User to access database
  80 + var $User = "";
  81 +
  82 + // Password for database
  83 + var $Password = "";
  84 +
  85 + function Owl_DB() {
  86 + global $default;
  87 + $this->Host = $default->owl_db_host;
  88 + $this->Database = $default->owl_db_name;
  89 + $this->User = $default->owl_db_user;
  90 + $this->Password = $default->owl_db_pass;
  91 + }
  92 + // END wes changes
  93 +
  94 + function haltmsg($msg) {
  95 + printf("</td></table><b>Database error:</b> %s<br>\n", $msg);
  96 + printf("<b>SQL Error</b>: %s (%s)<br>\n",
  97 + $this->Errno, $this->Error);
  98 + }
  99 +}
  100 +
  101 +
  102 +class Owl_Session {
  103 + var $sessid;
  104 + var $sessuid;
  105 + var $sessdata;
  106 +
  107 +
  108 + function Open_Session($sessid=0, $sessuid=0) {
  109 + global $default;
  110 + $this->sessid = $sessid;
  111 + $this->sessuid = $sessuid;
  112 +
  113 + if($sessid == "0") { // if there is no user loged in, then create a session for them
  114 + $current = time();
  115 + $random = $this->sessuid . $current;
  116 + $this->sessid = md5($random);
  117 + $sql = new Owl_DB;
  118 + if(getenv("HTTP_CLIENT_IP")) {
  119 + $ip = getenv("HTTP_CLIENT_IP");
  120 + } elseif(getenv("HTTP_X_FORWARDED_FOR")) {
  121 + $forwardedip = getenv("HTTP_X_FORWARDED_FOR");
  122 + list($ip,$ip2,$ip3,$ip4)= split (",", $forwardedip);
  123 + } else {
  124 + $ip = getenv("REMOTE_ADDR");
  125 + }
  126 + //$result = $sql->query("insert into active_sessions values ('$this->sessid', '$this->sessuid', '$current', '$ip')");
  127 + $result = $sql->query("insert into $default->owl_sessions_table values ('$this->sessid', '$this->sessuid', '$current', '$ip')");
  128 + if(!'result') die("$lang_err_sess_write");
  129 + }
  130 +
  131 + // else we have a session id, try to validate it...
  132 + $sql = new Owl_DB;
  133 + $sql->query("select * from $default->owl_sessions_table where sessid = '$this->sessid'");
  134 +
  135 + // any matching session ids?
  136 + $numrows = $sql->num_rows($sql);
  137 + if(!$numrows) die("$lang_err_sess_notvalid");
  138 +
  139 + // return if we are a.o.k.
  140 + while($sql->next_record()) {
  141 + $this->sessdata["sessid"] = $sql->f("sessid");
  142 + }
  143 + return $this;
  144 + }
  145 +}
  146 +function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) {
  147 + global $default;
  148 + global $lang_notif_subject_new, $lang_notif_subject_upd, $lang_notif_msg;
  149 + global $lang_title, $lang_description;
  150 + $sql = new Owl_DB;
  151 +// BEGIN BUG 548994
  152 + $path = find_path($parent);
  153 + $sql->query("select id from $default->owl_files_table where filename='$filename' AND parent='$parent'");
  154 + $sql->next_record();
  155 + $fileid = $sql->f("id");
  156 +// END BUG 548994 More Below
  157 + $sql->query("select distinct id, email,language,attachfile from $default->owl_users_table as u, $default->owl_users_grpmem_table as m where notify = 1 and (u.groupid = $groupid or m.groupid = $groupid)");
  158 +
  159 + while($sql->next_record())
  160 + {
  161 +// BEGIN BUG 548994
  162 + if ( check_auth($fileid, "file_download", $sql->f(id)) == 1 ) {
  163 +// END BUG 548994 More Below
  164 + $newpath = ereg_replace(" ","%20",$path);
  165 + $newfilename = ereg_replace(" ","%20",$filename);
  166 + $DefUserLang = $sql->f("language");
  167 + require("$default->owl_fs_root/locale/$DefUserLang/language.inc");
  168 +
  169 + $r=preg_split("(\;|\,)",$sql->f("email"));
  170 + reset ($r);
  171 + while (list ($occ, $email) = each ($r)) {
  172 + $mail = new phpmailer();
  173 + // Create a temporary session id, the user
  174 + // will need to get to this file before
  175 + // the default session timeout
  176 + $session = new Owl_Session;
  177 + $uid = $session->Open_Session(0,$sql->f("id"));
  178 + $tempsess = $uid->sessdata["sessid"];
  179 +
  180 + if ( $flag == 0 ) {
  181 + $mail->IsSMTP(); // set mailer to use SMTP
  182 + $mail->Host = "$default->owl_email_server"; // specify main and backup server
  183 + $mail->From = "$default->owl_email_from";
  184 + $mail->FromName = "$default->owl_email_fromname";
  185 + $mail->AddAddress($email);
  186 + $mail->AddReplyTo("$default->owl_email_replyto", "OWL Intranet");
  187 + $mail->WordWrap = 50; // set word wrap to 50 characters
  188 + $mail->IsHTML(true); // set email format to HTML
  189 + $mail->Subject = "$lang_notif_subject_new";
  190 + if ($type != "url") {
  191 + if ($sql->f("attachfile") == 1) {
  192 + $mail->Body = "$lang_notif_msg<BR><BR>" . "$lang_title: $title" . "<BR><BR>$lang_description: $desc";
  193 + $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc";
  194 + if (!$default->owl_use_fs) {
  195 + if (file_exists("$default->owl_FileDir/$filename")) {
  196 + unlink("$default->owl_FileDir/$filename");
  197 + }
  198 + $file = fopen("$default->owl_FileDir$filename", 'wb');
  199 + $getfile = new Owl_DB;
  200 + $getfile->query("select data,compressed from $default->owl_files_data_table where id='$fileid'");
  201 + while ($getfile->next_record()) {
  202 + if ($getfile->f("compressed")) {
  203 +
  204 + $tmpfile = $default->owl_FileDir . "owltmp.$fileid.gz";
  205 + $uncomptmpfile = $default->owl_FileDir . "owltmp.$fileid";
  206 + if (file_exists($tmpfile)) unlink($tmpfile);
  207 +
  208 + $fp=fopen($tmpfile,"w");
  209 + fwrite($fp, $getfile->f("data"));
  210 + fclose($fp);
  211 +
  212 + system($default->gzip_path . " -df $tmpfile");
  213 +
  214 + $fsize = filesize($uncomptmpfile);
  215 + $fd = fopen($uncomptmpfile, 'rb');
  216 + $filedata = fread($fd, $fsize);
  217 + fclose($fd);
  218 +
  219 + fwrite($file, $filedata);
  220 + unlink($uncomptmpfile);
  221 + } else {
  222 + fwrite($file, $getfile->f("data"));
  223 + }
  224 + }
  225 + fclose($file);
  226 + $mail->AddAttachment("$default->owl_FileDir$newfilename");
  227 + } else {
  228 + $mail->AddAttachment("$default->owl_FileDir/$newpath/$newfilename");
  229 + }
  230 + }
  231 + else {
  232 + $mail->Body = "$lang_notif_msg<BR><BR>" . "$lang_title: $title" . "<BR><BR>URL: $default->owl_notify_link" . "browse.php?sess=$tempsess&parent=$parent&expand=1&fileid=$fileid" . "<BR><BR>$lang_description: $desc";
  233 + $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc";
  234 + }
  235 + }
  236 + else {
  237 + $mail->Body = "URL: $newfilename <BR><BR>$lang_notif_msg<BR><BR>" . "$lang_title: $title" . "<BR><BR>$lang_description: $desc";
  238 + $mail->altBody = "URL: $newfilename \n\n$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc";
  239 + }
  240 +
  241 + }
  242 + else {
  243 + $mail = new phpmailer();
  244 + $mail->IsSMTP(); // set mailer to use SMTP
  245 + $mail->Host = "$default->owl_email_server"; // specify main and backup server
  246 + $mail->From = "$default->owl_email_from";
  247 + $mail->FromName = "$default->owl_email_fromname";
  248 + $mail->AddAddress($email);
  249 + $mail->AddReplyTo("$default->owl_email_replyto", "OWL Intranet");
  250 + $mail->WordWrap = 50; // set word wrap to 50 characters
  251 + $mail->IsHTML(true); // set email format to HTML
  252 + $mail->Subject = "$lang_notif_subject_upd";
  253 + if ($type != "url") {
  254 + if ($sql->f("attachfile") == 1) {
  255 + $mail->Body = "$lang_notif_msg<BR><BR>" . "$lang_title: $title" . "<BR><BR>$lang_description: $desc";
  256 + $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc";
  257 + if (!$default->owl_use_fs) {
  258 + if (file_exists("$default->owl_FileDir/$filename")) {
  259 + unlink("$default->owl_FileDir/$filename");
  260 + }
  261 + $file = fopen("$default->owl_FileDir$filename", 'wb');
  262 + $getfile = new Owl_DB;
  263 + $getfile->query("select data,compressed from $default->owl_files_data_table where id='$fileid'");
  264 + while ($getfile->next_record()) {
  265 + if ($getfile->f("compressed")) {
  266 +
  267 + $tmpfile = $default->owl_FileDir . "owltmp.$fileid.gz";
  268 + $uncomptmpfile = $default->owl_FileDir . "owltmp.$fileid";
  269 + if (file_exists($tmpfile)) unlink($tmpfile);
  270 +
  271 + $fp=fopen($tmpfile,"w");
  272 + fwrite($fp, $getfile->f("data"));
  273 + fclose($fp);
  274 +
  275 + system($default->gzip_path . " -df $tmpfile");
  276 +
  277 + $fsize = filesize($uncomptmpfile);
  278 + $fd = fopen($uncomptmpfile, 'rb');
  279 + $filedata = fread($fd, $fsize);
  280 + fclose($fd);
  281 +
  282 + fwrite($file, $filedata);
  283 + unlink($uncomptmpfile);
  284 + } else {
  285 + fwrite($file, $getfile->f("data"));
  286 + }
  287 + }
  288 + fclose($file);
  289 + $mail->AddAttachment("$default->owl_FileDir$newfilename");
  290 + } else {
  291 + $mail->AddAttachment("$default->owl_FileDir/$newpath/$newfilename");
  292 + }
  293 +
  294 + }
  295 + else {
  296 + $mail->Body = "$lang_notif_msg<BR><BR>" . "$lang_title: $title" . "<BR><BR>URL: $default->owl_notify_link" . "browse.php?sess=$tempsess&parent=$parent&expand=1&fileid=$fileid" . "<BR><BR>$lang_description: $desc";
  297 + $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc";
  298 + }
  299 + }
  300 + else {
  301 + $mail->Body = "URL: $newfilename <BR><BR>$lang_notif_msg<BR><BR>" . "$lang_title: $title" . "<BR><BR>$lang_description: $desc";
  302 + $mail->altBody = "URL: $newfilename \n\n$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc";
  303 + }
  304 + }
  305 + $mail->Send();
  306 + if (!$default->owl_use_fs && $sql->f("attachfile") == 1) {
  307 + unlink("$default->owl_FileDir$newfilename");
  308 + }
  309 +
  310 + }
  311 + }
  312 +// BEGIN BUG 548994
  313 + }
  314 +// END BUG 548994
  315 +}
  316 +
  317 +function verify_login($username, $password) {
  318 + global $default;
  319 + $sql = new Owl_DB;
  320 + $query = "select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'";
  321 + $sql->query("select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'");
  322 + $numrows = $sql->num_rows($sql);
  323 + // Bozz Begin added Password Encryption above, but for now
  324 + // I will allow admin to use non crypted password untile he
  325 + // upgrades all users
  326 + if ($numrows == "1") {
  327 + while($sql->next_record()) {
  328 + if ( $sql->f("disabled") == 1 )
  329 + $verified["bit"] = 2;
  330 + else
  331 + $verified["bit"] = 1;
  332 + $verified["user"] = $sql->f("username");
  333 + $verified["uid"] = $sql->f("id");
  334 + $verified["group"] = $sql->f("groupid");
  335 + $maxsessions = $sql->f("maxsessions") + 1;
  336 + }
  337 + }
  338 + // Remove this else in a future version
  339 + else {
  340 + if ($username == "admin") {
  341 + $sql->query("select * from $default->owl_users_table where username = '$username' and password = '$password'");
  342 + $numrows = $sql->num_rows($sql);
  343 + if ($numrows == "1") {
  344 + while($sql->next_record()) {
  345 + $verified["bit"] = 1;
  346 + $verified["user"] = $sql->f("username");
  347 + $verified["uid"] = $sql->f("id");
  348 + $verified["group"] = $sql->f("groupid");
  349 + $maxsessions = $sql->f("maxsessions") + 1;
  350 + }
  351 + }
  352 + }
  353 + }
  354 +
  355 + // remove stale sessions from the database for the user
  356 + // that is signing on.
  357 + //
  358 + $time = time() - $default->owl_timeout;
  359 + $sql = new Owl_DB; $sql->query("delete from $default->owl_sessions_table where uid = '".$verified["uid"]."' and lastused <= $time ");
  360 + // Check if Maxsessions has been reached
  361 + //
  362 +
  363 + $sql = new Owl_DB;
  364 + $sql->query("select * from $default->owl_sessions_table where uid = '".$verified["uid"]."'");
  365 +
  366 + if ($sql->num_rows($sql) >= $maxsessions && $verified["bit"] != 0) {
  367 + if ( $verified["group"] == 0)
  368 + $verified["bit"] = 1;
  369 + else
  370 + $verified["bit"] = 3;
  371 + }
  372 + return $verified;
  373 +}
  374 +
  375 +function verify_session($sess) {
  376 + getprefs();
  377 + global $default, $lang_sesstimeout, $lang_sessinuse, $lang_clicklogin;
  378 + $sess = ltrim($sess);
  379 + $verified["bit"] = 0;
  380 + $sql = new Owl_DB;
  381 + $sql->query("select * from $default->owl_sessions_table where sessid = '$sess'");
  382 + $numrows = $sql->num_rows($sql);
  383 + $time = time();
  384 + if ($numrows == "1") {
  385 + while($sql->next_record()) {
  386 + if(getenv("HTTP_CLIENT_IP")) {
  387 + $ip = getenv("HTTP_CLIENT_IP");
  388 + } elseif(getenv("HTTP_X_FORWARDED_FOR")) {
  389 + $forwardedip = getenv("HTTP_X_FORWARDED_FOR");
  390 + list($ip,$ip2,$ip3,$ip4)= split (",", $forwardedip);
  391 + } else {
  392 + $ip = getenv("REMOTE_ADDR");
  393 + }
  394 + if ($ip == $sql->f("ip")) {
  395 + if(($time - $sql->f("lastused")) <= $default->owl_timeout) {
  396 + $verified["bit"] = 1;
  397 + $verified["userid"] = $sql->f("uid");
  398 + $sql->query("select * from $default->owl_users_table where id = '".$verified["userid"]."'");
  399 + while($sql->next_record()) $verified["groupid"] = $sql->f("groupid");
  400 + } else {
  401 + // Bozz Bug Fix begin
  402 + if (file_exists("./lib/header.inc")) {
  403 + include("./lib/header.inc");
  404 + } else {
  405 + include("../lib/header.inc");
  406 + }
  407 + // Bozz Buf Fix End
  408 + print("<BR><BR><CENTER>".$lang_sesstimeout);
  409 + if ($parent == "" || $fileid == "")
  410 + print("<A HREF='$default->owl_root_url/index.php'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/btn_login.gif' BORDER=0 ></A>");
  411 + else
  412 + print("<A HREF='$default->owl_root_url/index.php?parent=$parent&fileid=$fileid'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/btn_login.gif' BORDER=0 ></A>");
  413 + exit();
  414 + }
  415 + } else {
  416 + // Bozz Bug Fix begin
  417 + if (file_exists("./lib/header.inc")) {
  418 + include("./lib/header.inc");
  419 + } else {
  420 + include("../lib/header.inc");
  421 + }
  422 + // Bozz Bug Fix End
  423 + print("<BR><BR><CENTER>".$lang_sessinuse);
  424 + exit;
  425 + }
  426 + }
  427 + }
  428 + return $verified;
  429 +}
  430 +
  431 +function fid_to_name($parent) {
  432 + global $default;
  433 + $sql = new Owl_DB; $sql->query("select name from $default->owl_folders_table where id = $parent");
  434 + while($sql->next_record()) return $sql->f("name");
  435 +}
  436 +
  437 +function flid_to_name($id) {
  438 + global $default;
  439 + $sql = new Owl_DB; $sql->query("select name from $default->owl_files_table where id = $id");
  440 + while($sql->next_record()) return $sql->f("name");
  441 +}
  442 +
  443 +function flid_to_filename($id) {
  444 + global $default;
  445 + $sql = new Owl_DB; $sql->query("select filename from $default->owl_files_table where id = $id");
  446 + while($sql->next_record()) return $sql->f("filename");
  447 +}
  448 +
  449 +function owlusergroup($userid) {
  450 + global $default;
  451 + $sql = new Owl_DB; $sql->query("select groupid from $default->owl_users_table where id = '$userid'");
  452 + while($sql->next_record()) $groupid = $sql->f("groupid");
  453 + return $groupid;
  454 +}
  455 +
  456 +function owlfilecreator($fileid) {
  457 + global $default;
  458 + $sql = new Owl_DB; $sql->query("select creatorid from ".$default->owl_files_table." where id = '$fileid'");
  459 + while($sql->next_record()) $filecreator = $sql->f("creatorid");
  460 + return $filecreator;
  461 +}
  462 +
  463 +function owlfoldercreator($folderid) {
  464 + global $default;
  465 + $sql = new Owl_DB; $sql->query("select creatorid from ".$default->owl_folders_table." where id = '$folderid'");
  466 + while($sql->next_record()) $foldercreator = $sql->f("creatorid");
  467 + return $foldercreator;
  468 +}
  469 +
  470 +function owlfilegroup($fileid) {
  471 + global $default;
  472 + $sql = new Owl_DB; $sql->query("select groupid from $default->owl_files_table where id = '$fileid'");
  473 + while($sql->next_record()) $filegroup = $sql->f("groupid");
  474 + return $filegroup;
  475 +}
  476 +
  477 +function owlfoldergroup($folderid) {
  478 + global $default;
  479 + $sql = new Owl_DB; $sql->query("select groupid from $default->owl_folders_table where id = '$folderid'");
  480 + while($sql->next_record()) $foldergroup = $sql->f("groupid");
  481 + return $foldergroup;
  482 +}
  483 +
  484 +function owlfolderparent($folderid) {
  485 + global $default;
  486 + $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$folderid'");
  487 + while($sql->next_record()) $folderparent = $sql->f("parent");
  488 + return $folderparent;
  489 +}
  490 +
  491 +function owlfileparent($fileid) {
  492 + global $default;
  493 + $sql = new Owl_DB; $sql->query("select parent from $default->owl_files_table where id = '$fileid'");
  494 + while($sql->next_record()) $fileparent = $sql->f("parent");
  495 + return $fileparent;
  496 +}
  497 +
  498 +function fid_to_creator($id) {
  499 +
  500 + global $default;
  501 + $sql = new Owl_DB;
  502 + $sql->query("select creatorid from ".$default->owl_files_table." where id = '$id'");
  503 + $sql2 = new Owl_DB;
  504 + while($sql->next_record()) {
  505 + $creatorid = $sql->f("creatorid");
  506 + $sql2->query("select name from $default->owl_users_table where id = '".$creatorid."'");
  507 + $sql2->next_record();
  508 + $name = $sql2->f("name");
  509 + }
  510 + return $name;
  511 +}
  512 +
  513 +function group_to_name($id) {
  514 + global $default;
  515 + $sql = new Owl_DB; $sql->query("select name from $default->owl_groups_table where id = '$id'");
  516 + while($sql->next_record()) return $sql->f("name");
  517 +}
  518 +
  519 +function uid_to_name($id) {
  520 + global $default;
  521 + $sql = new Owl_DB; $sql->query("select name from $default->owl_users_table where id = '$id'");
  522 + while($sql->next_record()) $name = $sql->f("name");
  523 + if ($name == "") $name = "Owl";
  524 + return $name;
  525 +}
  526 +
  527 +function prefaccess($id) {
  528 + global $default;
  529 + $prefaccess = 1;
  530 + $sql = new Owl_DB; $sql->query("select noprefaccess from $default->owl_users_table where id = '$id'");
  531 + while($sql->next_record()) $prefaccess = !($sql->f("noprefaccess"));
  532 + return $prefaccess;
  533 +}
  534 +
  535 +function gen_navbar($parent) {
  536 + global $default;
  537 + global $sess, $expand, $sort, $sortorder, $order;
  538 + $name = fid_to_name($parent);
  539 + $navbar = "<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sort'>$name</A>";
  540 + $new = $parent;
  541 + while ($new != "1") {
  542 + $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$new'");
  543 + while($sql->next_record()) $newparentid = $sql->f("parent");
  544 + $name = fid_to_name($newparentid);
  545 + $navbar = "<A HREF='browse.php?sess=$sess&parent=$newparentid&expand=$expand&order=$order&$sortorder=$sort'>$name</A>/" . $navbar;
  546 + $new = $newparentid;
  547 + }
  548 + return $navbar;
  549 +}
  550 +
  551 +//only get dir path from db
  552 +function get_dirpath($parent) {
  553 + global $default;
  554 + global $sess, $expand;
  555 + $name = fid_to_name($parent);
  556 + $navbar = "$name";
  557 + $new = $parent;
  558 + while ($new != "1") {
  559 + $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$new'");
  560 + while($sql->next_record()) $newparentid = $sql->f("parent");
  561 + $name = fid_to_name($newparentid);
  562 + $navbar = "$name/" . $navbar;
  563 + $new = $newparentid;
  564 + }
  565 + return $navbar;
  566 +}
  567 +
  568 +
  569 +function gen_filesize($file_size) {
  570 + if(ereg("[^0-9]", $file_size)) return $file_size;
  571 +
  572 + if ($file_size >= 1073741824) {
  573 + $file_size = round($file_size / 1073741824 * 100) / 100 . "g";
  574 + } elseif ($file_size >= 1048576) {
  575 + $file_size = round($file_size / 1048576 * 100) / 100 . "m";
  576 + } elseif ($file_size >= 1024) {
  577 + $file_size = round($file_size / 1024 * 100) / 100 . "k";
  578 + } else {
  579 + $file_size = $file_size . "b";
  580 + }
  581 + return $file_size;
  582 +}
  583 +
  584 +function uploadCompat($varname) {
  585 +
  586 + if ($_FILES[$varname]) return $_FILES[$varname];
  587 + if ($HTTP_POST_FILES[$varname]) return $HTTP_POST_FILES[$varname];
  588 + $tmp = "$varname_name"; global $$tmp; $retfile['name'] = $$tmp;
  589 + $tmp = "$varname_type"; global $$tmp; $retfile['type'] = $$tmp;
  590 + $tmp = "$varname_size"; global $$tmp; $retfile['size'] = $$tmp;
  591 + $tmp = "$varname_error"; global $$tmp; $retfile['error'] = $$tmp;
  592 + $tmp = "$varname_tmp_name"; global $$tmp; $retfile['tmp_name'] = $$tmp;
  593 + return $retfile;
  594 +}
  595 +
  596 +
  597 +if ($sess) {
  598 + gethtmlprefs();
  599 + $ok = verify_session($sess);
  600 + $temporary_ok = $ok["bit"];
  601 + $userid = $ok["userid"];
  602 + $usergroupid = $ok["groupid"];
  603 + if ($ok["bit"] != "1") {
  604 + // Bozz Bug Fix begin
  605 + if (file_exists("./lib/header.inc")) {
  606 + include("./lib/header.inc");
  607 + } else {
  608 + include("../lib/header.inc");
  609 + }
  610 + // Bozz Bug Fix end
  611 + print("<BR><BR><CENTER>".$lang_invalidsess);
  612 + if ($parent == "" || $fileid == "")
  613 + print("<A HREF='$default->owl_root_url/index.php'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/btn_login.gif' BORDER=0 ></A>");
  614 + else
  615 + print("<A HREF='$default->owl_root_url/index.php?parent=$parent&fileid=$fileid'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/btn_login.gif' BORDER=0 ></A>");
  616 + exit;
  617 + } else {
  618 + $lastused = time();
  619 + $sql = new Owl_DB;
  620 + $sql->query("update $default->owl_sessions_table set lastused = '$lastused' where uid = '$userid'");
  621 + }
  622 +}
  623 +function checkrequirements()
  624 +{
  625 + global $default, $lang_err_bad_version_1, $lang_err_bad_version_2, $lang_err_bad_version_3;
  626 +
  627 + if (substr(phpversion(),0,5) < $default->phpversion) {
  628 + print("<CENTER><H3>$lang_err_bad_version_1<BR>");
  629 + print("$default->phpversion<BR>");
  630 + print("$lang_err_bad_version_2<BR>");
  631 + print phpversion();
  632 + print("<BR>$lang_err_bad_version_3</H3></CENTER>");
  633 + return 1;
  634 + }
  635 + else {
  636 + return 0;
  637 + }
  638 +}
  639 +
  640 +function myExec($_cmd, &$lines, &$errco) {
  641 + $cmd = "$_cmd ; echo $?";
  642 + exec($cmd, $lines);
  643 + // Get rid of the last errco line...
  644 + $errco = (integer) array_pop($lines);
  645 + if (count($lines) == 0) {
  646 + return "";
  647 + } else {
  648 + return $lines[count($lines) - 1];
  649 + }
  650 +}
  651 +
  652 +function myDelete($file) {
  653 + if (file_exists($file)) {
  654 + chmod($file,0777);
  655 + if (is_dir($file)) {
  656 + $handle = opendir($file);
  657 + while($filename = readdir($handle)) {
  658 + if ($filename != "." && $filename != "..") {
  659 + myDelete($file."/".$filename);
  660 + }
  661 + }
  662 + closedir($handle);
  663 + rmdir($file);
  664 + } else {
  665 + unlink($file);
  666 + }
  667 + }
  668 +}
  669 +
  670 +function printError($message, $submessage) {
  671 + global $default;
  672 + global $sess, $parent, $expand, $order, $sortorder ,$sortname, $userid;
  673 + global $language;
  674 +
  675 + require("$default->owl_fs_root/locale/$default->owl_lang/language.inc");
  676 + include("./lib/header.inc");
  677 +
  678 + if(check_auth($parent, "folder_view", $userid) != "1") {
  679 + $sql = new Owl_DB;
  680 + $sql->query("select * from $default->owl_folders_table where id = '$parent'");
  681 + $sql->next_record();
  682 + $parent = $sql->f("parent");
  683 + }
  684 +
  685 + echo("<TABLE WIDTH=$default->table_expand_width BGCOLOR=\"#d0d0d0\" CELLSPACING=0 CELLPADDING=0 BORDER=0 HEIGHT=30>");
  686 + echo("<TR><TD ALIGN=LEFT>");
  687 + print("$lang_user: ");
  688 + print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand&order=$order&sortname=$sortname'>");
  689 + print uid_to_name($userid);
  690 + print ("</A><FONT SIZE=-1>");
  691 + print("<A HREF='index.php?login=logout&sess=$sess'> $lang_logout</A>");
  692 + print("</FONT></TD>");
  693 + print("<TD ALIGN=RIGHT><A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>");
  694 + print("</TD></TR></TABLE><BR><BR><CENTER>");
  695 + print $message;
  696 + print("<BR>");
  697 + print $submessage;
  698 + include("./lib/footer.inc");
  699 + exit();
  700 +}
  701 +
  702 +function getprefs ( )
  703 +{
  704 + global $default;
  705 +
  706 + $sql = new Owl_DB;
  707 + //$sql->query("select * from $default->owl_prefs_table");
  708 + $sql->query("select * from prefs");
  709 + $sql->next_record();
  710 +
  711 + $default->owl_email_from = $sql->f("email_from");
  712 + $default->owl_email_fromname = $sql->f("email_fromname");
  713 + $default->owl_email_replyto = $sql->f("email_replyto");
  714 + $default->owl_email_server = $sql->f("email_server");
  715 + $default->owl_LookAtHD = $sql->f("lookathd");
  716 + $default->owl_def_file_security = $sql->f("def_file_security");
  717 + $default->owl_def_file_group_owner= $sql->f("def_file_group_owner");
  718 + $default->owl_def_file_owner = $sql->f("def_file_owner");
  719 + $default->owl_def_file_title = $sql->f("def_file_title");
  720 + $default->owl_def_file_meta = $sql->f("def_file_meta");
  721 + $default->owl_def_fold_security = $sql->f("def_fold_security");
  722 + $default->owl_def_fold_group_owner= $sql->f("def_fold_group_owner");
  723 + $default->owl_def_fold_owner = $sql->f("def_fold_owner");
  724 + $default->max_filesize = $sql->f("max_filesize");
  725 + $default->owl_timeout = $sql->f("timeout");
  726 + $default->expand = $sql->f("expand");
  727 + $default->owl_version_control = $sql->f("version_control");
  728 + $default->restrict_view = $sql->f("restrict_view");
  729 + $default->dbdump_path = $sql->f("dbdump_path");
  730 + $default->gzip_path = $sql->f("gzip_path");
  731 + $default->tar_path = $sql->f("tar_path");
  732 +
  733 +
  734 +};
  735 +
  736 +
  737 +function gethtmlprefs ( )
  738 +{
  739 + global $default;
  740 +
  741 + $sql = new Owl_DB;
  742 + $sql->query("select * from $default->owl_html_table");
  743 + $sql->next_record();
  744 +
  745 + $default->table_border = $sql->f("table_border");
  746 + $default->table_header_bg = $sql->f("table_header_bg");
  747 + $default->table_cell_bg = $sql->f("table_cell_bg");
  748 + $default->table_cell_bg_alt = $sql->f("table_cell_bg_alt");
  749 + $default->table_expand_width = $sql->f("table_expand_width");
  750 + $default->table_collapse_width = $sql->f("table_collapse_width");
  751 + $default->main_header_bgcolor = $sql->f("main_header_bgcolor");
  752 + $default->body_bgcolor = $sql->f("body_bgcolor");
  753 + $default->body_textcolor = $sql->f("body_textcolor");
  754 + $default->body_link = $sql->f("body_link");
  755 + $default->body_vlink = $sql->f("body_vlink");
  756 +
  757 +};
  758 +
  759 +function printfileperm($currentval, $namevariable, $printmessage, $type) {
  760 + global $default;
  761 + global $lang_everyoneread, $lang_everyonewrite, $lang_everyonewrite_nod, $lang_groupread, $lang_groupwrite, $lang_groupwrite_nod, $lang_groupwrite_worldread, $lang_groupwrite_worldread_nod, $lang_onlyyou;
  762 + global $lang_everyoneread_ad, $lang_everyonewrite_ad, $lang_everyonewrite_ad_nod, $lang_groupread_ad, $lang_groupwrite_ad, $lang_groupwrite_ad_nod, $lang_groupwrite_worldread_ad, $lang_groupwrite_worldread_ad_nod, $lang_onlyyou_ad;
  763 +
  764 +
  765 + $file_perm[0][0] = 0;
  766 + $file_perm[1][0] = 1;
  767 + $file_perm[2][0] = 2;
  768 + $file_perm[3][0] = 3;
  769 + $file_perm[4][0] = 4;
  770 + $file_perm[5][0] = 5;
  771 + $file_perm[6][0] = 6;
  772 + $file_perm[7][0] = 7;
  773 + $file_perm[8][0] = 8;
  774 + if ($type == "admin") {
  775 + $file_perm[0][1] = "$lang_everyoneread_ad";
  776 + $file_perm[1][1] = "$lang_everyonewrite_ad";
  777 + $file_perm[2][1] = "$lang_groupread_ad";
  778 + $file_perm[3][1] = "$lang_groupwrite_ad";
  779 + $file_perm[4][1] = "$lang_onlyyou_ad";
  780 + $file_perm[5][1] = "$lang_groupwrite_ad_nod";
  781 + $file_perm[6][1] = "$lang_everyonewrite_ad_nod";
  782 + $file_perm[7][1] = "$lang_groupwrite_worldread_ad";
  783 + $file_perm[8][1] = "$lang_groupwrite_worldread_ad_nod";
  784 + }
  785 + else {
  786 + $file_perm[0][1] = "$lang_everyoneread";
  787 + $file_perm[1][1] = "$lang_everyonewrite";
  788 + $file_perm[2][1] = "$lang_groupread";
  789 + $file_perm[3][1] = "$lang_groupwrite";
  790 + $file_perm[4][1] = "$lang_onlyyou";
  791 + $file_perm[5][1] = "$lang_groupwrite_nod";
  792 + $file_perm[6][1] = "$lang_everyonewrite_nod";
  793 + $file_perm[7][1] = "$lang_groupwrite_worldread";
  794 + $file_perm[8][1] = "$lang_groupwrite_worldread_nod";
  795 + }
  796 +
  797 + print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$printmessage</TD><TD align=left><SELECT NAME=$namevariable>");
  798 + foreach($file_perm as $fp) {
  799 + print("<OPTION VALUE=$fp[0] ");
  800 + if($fp[0] == $currentval)
  801 + print("SELECTED");
  802 + print(">$fp[1]");
  803 + }
  804 + print("</SELECT></TD></TR>");
  805 +
  806 +
  807 +};
  808 +
  809 +function printFileIcons ($fid, $filename, $checked_out, $url, $allicons, $ext)
  810 +{
  811 + global $default;
  812 + global $sess, $parent, $expand, $order, $sortorder ,$sortname, $userid;
  813 + global $lang_log_file, $lang_reallydelete, $lang_del_file_alt, $lang_mod_file_alt;
  814 + global $lang_move_file_alt,$lang_upd_file_alt,$lang_get_file_alt,$lang_lock_file,$lang_email_alt,$lang_view_file_alt;
  815 +
  816 + if ($allicons == 1)
  817 + {
  818 + if ($url != "1")
  819 + print("<a href='log.php?sess=$sess&id=".$fid."&filename=".$filename."&parent=$parent&expand=$expand&order=$order&sortname=$sortname'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/log.gif' BORDER=0 ALT='$lang_log_file' TITLE='$lang_log_file'></a>");
  820 + }
  821 +
  822 + if (($checked_out == 0) || ($checked_out == $userid)) {
  823 + // *****************************************************************************
  824 + // Don't Show the delete icon if the user doesn't have delete access to the file
  825 + // *****************************************************************************
  826 +
  827 + if (check_auth($fid, "file_delete", $userid) == 1)
  828 + if ($url == "1")
  829 + print("\t<A HREF='dbmodify.php?sess=$sess&action=file_delete&type=url&id=".$fid."&parent=$parent&expand=$expand&order=$order&sortname=$sortname'\tonClick='return confirm(\"$lang_reallydelete ".$filename."?\");'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/trash.gif' ALT='$lang_del_file_alt' TITLE='$lang_del_file_alt'\tBORDER=0></A>");
  830 + else
  831 + print("\t<A HREF='dbmodify.php?sess=$sess&action=file_delete&id=".$fid."&parent=$parent&expand=$expand&order=$order&sortname=$sortname'\tonClick='return confirm(\"$lang_reallydelete ".$filename."?\");'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/trash.gif' ALT='$lang_del_file_alt' TITLE='$lang_del_file_alt'\tBORDER=0></A>");
  832 +
  833 + // *****************************************************************************
  834 + // Don't Show the modify icon if the user doesn't have modify access to the file
  835 + // *****************************************************************************
  836 +
  837 + if(check_auth($fid, "file_modify", $userid) == 1)
  838 + print("<A HREF='modify.php?sess=$sess&action=file_modify&id=".$fid."&parent=$parent&expand=$expand&order=$order&sortname=$sortname'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/edit.gif' BORDER=0 ALT='$lang_mod_file_alt' TITLE='$lang_mod_file_alt'></A>");
  839 +
  840 + // *****************************************************************************
  841 + // Don't Show the move modify icon if the user doesn't have move access to the file
  842 + // *****************************************************************************
  843 +
  844 + if(check_auth($fid, "file_modify", $userid) == 1)
  845 + if ($url == "1")
  846 + print("<A HREF='move.php?sess=$sess&id=".$fid."&parent=$parent&expand=$expand&action=file&type=url&order=$order&sortname=$sortname'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/move.gif' BORDER=0 ALT='$lang_move_file_alt' TITLE='$lang_move_file_alt'></A>");
  847 + else
  848 + print("<A HREF='move.php?sess=$sess&id=".$fid."&parent=$parent&expand=$expand&action=file&order=$order&sortname=$sortname'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/move.gif' BORDER=0 ALT='$lang_move_file_alt' TITLE='$lang_move_file_alt'></A>");
  849 + // *****************************************************************************
  850 + // Don't Show the file update icon if the user doesn't have update access to the file
  851 + // *****************************************************************************
  852 +
  853 + if(check_auth($fid, "file_modify", $userid) == 1)
  854 + if ($url != "1")
  855 + print("<A HREF='$default->owl_root_url/modify.php?sess=$sess&expand=$expand&action=file_update&order=$order&sortname=$sortname&id=".$fid."&parent=".$parent."'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/update.gif' BORDER=0 ALT='$lang_upd_file_alt' TITLE='$lang_upd_file_alt'></A>");
  856 +
  857 + // *****************************************************************************
  858 + // Don't Show the file dowload icon if the user doesn't have download access to the file
  859 + // *****************************************************************************
  860 +
  861 + if(check_auth($fid, "file_download", $userid) == 1)
  862 + if ($url != "1")
  863 + print("<A HREF='$default->owl_root_url/download.php?sess=$sess&id=".$fid."&parent=".$parent."&binary=1'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/bin.gif' BORDER=0 ALT='$lang_get_file_alt' TITLE='$lang_get_file_alt'></A>");
  864 +
  865 + if ($allicons == 1)
  866 + {
  867 + // *****************************************************************************
  868 + // Don't Show the lock icon if the user doesn't have access to the file
  869 + // *****************************************************************************
  870 + if(check_auth($fid, "file_modify", $userid) == 1)
  871 + if ($url != "1")
  872 + print("<A HREF='dbmodify.php?sess=$sess&action=file_lock&id=".$fid."&parent=$parent&expand=$expand&order=$order&sortname=$sortname'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/lock.gif' BORDER=0 ALT='$lang_lock_file' TITLE='$lang_lock_file'></a>");
  873 + }
  874 +
  875 + // *****************************************************************************
  876 + // Don't Show the email icon if the user doesn't have access to email the file
  877 + // *****************************************************************************
  878 +
  879 + if(check_auth($fid, "file_modify", $userid) == 1)
  880 + if ($url == "1")
  881 + print("<A HREF='$default->owl_root_url/modify.php?sess=$sess&expand=$expand&action=file_email&type=url&order=$order&sortname=$sortname&id=".$fid."&parent=".$parent."'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/email.gif' BORDER=0 ALT='$lang_email_alt' TITLE='$lang_email_alt'></A>");
  882 + else
  883 + print("<A HREF='$default->owl_root_url/modify.php?sess=$sess&expand=$expand&action=file_email&order=$order&sortname=$sortname&id=".$fid."&parent=".$parent."'><IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/email.gif' BORDER=0 ALT='$lang_email_alt' TITLE='$lang_email_alt'></A>");
  884 +
  885 + // *****************************************************************************
  886 + // Don't Show the view icon if the user doesn't have download access to the file
  887 + // *****************************************************************************
  888 +
  889 + if(check_auth($fid, "file_download", $userid) == 1)
  890 + if ($url != "1") {
  891 + $imgfiles = array("jpg","gif");
  892 + if ($ext != "" && preg_grep("/$ext/", $imgfiles)) {
  893 + print("<A HREF='view.php?sess=$sess&id=".$fid."&parent=$parent&action=image_preview&expand=$expand&order=$order&sortname=$sortname'>&nbsp;<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/mag.jpg' BORDER=0 ALT='$lang_view_file_alt' TITLE='$lang_view_file_alt'></A>");
  894 + }
  895 + $htmlfiles = array("html","htm",xml);
  896 + if ($ext != "" && preg_grep("/$ext/", $htmlfiles)) {
  897 + print("<A HREF='view.php?sess=$sess&id=".$fid."&parent=$parent&action=html_show&expand=$expand&order=$order&sortname=$sortname'>&nbsp;<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/mag.jpg' BORDER=0 ALT='$lang_view_file_alt' TITLE='$lang_view_file_alt'></A>");
  898 + }
  899 + $txtfiles = array("txt","text","README", "readme", "sh", "c", "cpp", "php", "php3", "pl", "perl", "sql", "py");
  900 + if ($ext != "" && preg_grep("/$ext/", $txtfiles)) {
  901 + print("<A HREF='view.php?sess=$sess&id=".$fid."&parent=$parent&action=text_show&expand=$expand&order=$order&sortname=$sortname'>&nbsp;<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/mag.jpg' BORDER=0 ALT='$lang_view_file_alt' TITLE='$lang_view_file_alt'></A>");
  902 + }
  903 + if (substr(php_uname(), 0, 7) != "Windows") {
  904 + $zipfiles = array("tar.gz", "tgz", "tar", "gz");
  905 + if ($ext != "" && preg_grep("/$ext/", $zipfiles))
  906 + print("<A HREF='view.php?sess=$sess&id=".$fid."&parent=$parent&action=zip_preview&expand=$expand&order=$order&sortname=$sortname'>&nbsp;<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/mag.jpg' BORDER=0 ALT='$lang_view_file_alt' TITLE='$lang_view_file_alt'></A>");
  907 + }
  908 + }
  909 + }
  910 +};
  911 +
  912 +function printgroupperm($currentval, $namevariable, $printmessage, $type) {
  913 + global $default;
  914 + global $lang_geveryoneread, $lang_geveryonewrite, $lang_geveryonewrite_nod, $lang_ggroupread, $lang_ggroupwrite, $lang_ggroupwrite_nod, $lang_ggroupwrite_worldread, $lang_ggroupwrite_worldread_nod, $lang_gonlyyou;
  915 + global $lang_geveryoneread_ad, $lang_geveryonewrite_ad, $lang_geveryonewrite_ad_nod, $lang_ggroupread_ad, $lang_ggroupwrite_ad, $lang_ggroupwrite_ad_nod, $lang_ggroupwrite_worldread_ad, $lang_ggroupwrite_worldread_ad_nod, $lang_gonlyyou_ad;
  916 +
  917 +
  918 + $group_perm[0][0] = 50;
  919 + $group_perm[1][0] = 51;
  920 + $group_perm[2][0] = 52;
  921 + $group_perm[3][0] = 53;
  922 + $group_perm[4][0] = 54;
  923 + $group_perm[5][0] = 55;
  924 + $group_perm[6][0] = 56;
  925 + $group_perm[7][0] = 57;
  926 + $group_perm[8][0] = 58;
  927 + if ($type == "admin") {
  928 + $group_perm[0][1] = "$lang_geveryoneread_ad";
  929 + $group_perm[1][1] = "$lang_geveryonewrite_ad";
  930 + $group_perm[2][1] = "$lang_ggroupread_ad";
  931 + $group_perm[3][1] = "$lang_ggroupwrite_ad";
  932 + $group_perm[4][1] = "$lang_gonlyyou_ad";
  933 + $group_perm[5][1] = "$lang_ggroupwrite_ad_nod";
  934 + $group_perm[6][1] = "$lang_geveryonewrite_ad_nod";
  935 + $group_perm[7][1] = "$lang_ggroupwrite_worldread_ad";
  936 + $group_perm[8][1] = "$lang_ggroupwrite_worldread_ad_nod";
  937 +
  938 + }
  939 + else {
  940 + $group_perm[0][1] = "$lang_geveryoneread";
  941 + $group_perm[1][1] = "$lang_geveryonewrite";
  942 + $group_perm[2][1] = "$lang_ggroupread";
  943 + $group_perm[3][1] = "$lang_ggroupwrite";
  944 + $group_perm[4][1] = "$lang_gonlyyou";
  945 + $group_perm[5][1] = "$lang_ggroupwrite_nod";
  946 + $group_perm[6][1] = "$lang_geveryonewrite_nod";
  947 + $group_perm[7][1] = "$lang_ggroupwrite_worldread";
  948 + $group_perm[8][1] = "$lang_ggroupwrite_worldread_nod";
  949 + }
  950 +
  951 + print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$printmessage</TD><TD align=left><SELECT NAME=$namevariable>");
  952 + foreach($group_perm as $fp) {
  953 + print("<OPTION VALUE=$fp[0] ");
  954 + if($fp[0] == $currentval)
  955 + print("SELECTED");
  956 + print(">$fp[1]");
  957 + }
  958 + print("</SELECT></TD></TR>");
  959 +
  960 +};
  961 +
  962 +
  963 +if (!$sess && !$loginname && !$login)
  964 + if(!isset($fileid))
  965 + header("Location: " . $default->owl_root_url . "/index.php?login=1");
  966 + else
  967 + header("Location: " . $default->owl_root_url . "/index.php?login=1&fileid=$fileid&parent=$parent");
  968 +
  969 +?>
... ...
lib/readhd.php 0 → 100755
  1 +<?php
  2 +
  3 +#Ugly code by Anders Axesson.
  4 +# Adapted to OWL global config file by B0zz
  5 +
  6 +function GetFromHD($GetWhat, $ThePath) {
  7 + if ($Dir = opendir($ThePath)) {
  8 + $FileCount = 0;
  9 + $DirCount = 0;
  10 + while($file = readdir($Dir)) {
  11 + $PathFile = $ThePath . "/" . $file; //must test with full path (is_file etc)
  12 +
  13 + if(($file <> ".") and ($file <> "..")) {
  14 + if (!is_file($PathFile)) { //check if it is a folder (dir) or file (dont check if it is a link)
  15 + $DirCount++;
  16 + $Dirs[$DirCount] = $file;
  17 + }else{
  18 + $FileCount++;
  19 + $Files[$FileCount] = $file;
  20 + }
  21 + }
  22 + }
  23 + if ($GetWhat == 'file') {
  24 + $FileCount++;
  25 + $Files[$FileCount] = "[END]"; //stop looping @ this
  26 + return $Files;
  27 + }
  28 +
  29 + if ($GetWhat == 'folder') {
  30 + $DirCount++;
  31 + $Dirs[$DirCount] = "[END]"; //stop looping @ this
  32 + return $Dirs;
  33 + }
  34 +
  35 + }
  36 +}
  37 +
  38 +function GetFileInfo($PathFile) {
  39 + $TheFileSize = filesize($PathFile); //get filesize
  40 + $TheFileTime = date("Y-m-d H:i:s", filemtime($PathFile)); //get and fix time of last modifikation
  41 + $TheFileTime2 = date("M d, Y \a\\t h:i a", filemtime($PathFile)); //get and fix time of last modifikation
  42 +
  43 +
  44 + $FileInfo[1] = $TheFileSize;
  45 + $FileInfo[2] = $TheFileTime; //s$modified
  46 + $FileInfo[3] = $TheFileTime2; //modified
  47 +
  48 + return $FileInfo;
  49 +}
  50 +
  51 +function CompareDBnHD($GetWhat, $ThePath, $DBList, $parent, $DBTable) { //compare files or folders in database with files on harddrive
  52 + $F = GetFromHD($GetWhat, $ThePath);
  53 +
  54 +$RefreshPage = false; //if filez/Folderz are found the page need to be refreshed in order to see them.
  55 +
  56 +if(is_array($F)) {
  57 +
  58 + for($HDLoopCount = 1; $F[$HDLoopCount] !== "[END]";$HDLoopCount++) {
  59 +
  60 + for($DBLoopCount = 1; $DBList[$DBLoopCount] !== "[END]";$DBLoopCount++) {
  61 + if($F[$HDLoopCount] == $DBList[$DBLoopCount]) {
  62 + unset($F[$HDLoopCount]); //removing file/folder that is in db from list of filez on disc (leaving list of filez on disc but not in db)
  63 + break;
  64 + }
  65 + }
  66 + }
  67 +
  68 + for($HDLoopCount = 1; $F[$HDLoopCount] !== "[END]";$HDLoopCount++) {
  69 + if(ord($F[$HDLoopCount]) !== 0) { //if not the file/folder name is empty...
  70 + if($GetWhat == "file") {
  71 + $RefreshPage = true;
  72 + InsertHDFilezInDB($F[$HDLoopCount], $parent, $ThePath, $DBTable); //call function that inserts the filez-on-disc-but-not-in-db into the db.
  73 + }else{
  74 + $RefreshPage = false;
  75 + }
  76 +
  77 + if($GetWhat == "folder") {
  78 + $RefreshPage = true;
  79 + InsertHDFolderzInDB($F[$HDLoopCount], $parent, $ThePath, $DBTable); //call function that inserts the folderz-on-disc-but-not-in-db into the db.
  80 + }
  81 + }
  82 + }
  83 +
  84 +}
  85 +
  86 + return $RefreshPage;
  87 +
  88 +}
  89 +
  90 +function InsertHDFolderzInDB($TheFolder, $parent, $ThePath, $DBTable) {
  91 + global $default;
  92 +
  93 + $sql = new Owl_DB; //create new db connection
  94 +
  95 + $SQL = "insert into $DBTable (name,parent,security,groupid,creatorid) values ('$TheFolder', '$parent', '$default->owl_def_fold_security', '$default->owl_def_fold_group_owner', '$default->owl_def_fold_owner')";
  96 +
  97 + $sql->query($SQL);
  98 +}
  99 +
  100 +
  101 +function InsertHDFilezInDB($TheFile, $parent, $ThePath, $DBTable) {
  102 +
  103 + global $default;
  104 + $sql = new Owl_DB; //create new db connection
  105 +
  106 + $FileInfo = GetFileInfo($ThePath . "/" . $TheFile); //get file size etc. 2=File size, 2=File time (smodified), 3=File time 2 (modified)
  107 +
  108 + if ($default->owl_def_file_title == "")
  109 + {
  110 + $title_name = $TheFile;
  111 + }
  112 + else
  113 + {
  114 + $title_name = $default->owl_def_file_title;
  115 + }
  116 +
  117 + $SQL = "insert into $DBTable (name,filename,size,creatorid,parent,modified,description,metadata,security,groupid,smodified) values ('$title_name', '$TheFile', '$FileInfo[1]', '$default->owl_def_file_owner', '$parent', '$FileInfo[3]', '$TheFile', '$default->owl_def_file_meta', '$default->owl_def_file_security', '$default->owl_def_file_group_owner','$FileInfo[2]')";
  118 + $sql->query($SQL);
  119 +
  120 +}
  121 +
  122 +?>
... ...
lib/security.lib.php 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: security.lib.php
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +
  18 +function getfolderpolicy($id) {
  19 + global $default;
  20 + $sql = new Owl_DB; $sql->query("select security from $default->owl_folders_table where id = '$id'");
  21 + while ($sql->next_record()) return $sql->f("security");
  22 +}
  23 +
  24 +function getfilepolicy($id) {
  25 + global $default;
  26 + $sql = new Owl_DB; $sql->query("select security from $default->owl_files_table where id = '$id'");
  27 + while ($sql->next_record()) return $sql->f("security");
  28 +}
  29 +
  30 +//
  31 +// This function is simple...it returns either a 1 or 0
  32 +// If the authentication is good, it returns 1
  33 +// If the authentication is bad, it returns 0
  34 +//
  35 +// Policy key for FILES:
  36 +//
  37 +// 0 = World read
  38 +// 1 = World edit
  39 +// 6 = World edit no delete
  40 +// 2 = Group read
  41 +// 3 = Group edit
  42 +// 5 = Group edit no delete
  43 +// 4 = Creator edit
  44 +// 7 = Group edit, World read
  45 +// 8 = Group edit, World read - no delete
  46 +//
  47 +// Policy key for FOLDERS:
  48 +//
  49 +// 50 = Anyone can read
  50 +// 51 = Anyone can upload/create folders
  51 +// 56 = Anyone can upload/create folders but not delete
  52 +// 52 = Only the group can read
  53 +// 53 = Only the group can upload/create folders
  54 +// 55 = Only the group can upload/create folders but not delete; except the creator
  55 +// 54 = Only the creator can upload/create folders
  56 +// 57 = Only the group can upload/create folders but anyone can read
  57 +// 58 = Only the group can upload/create folders (no delete) but anyone can read
  58 +//
  59 +
  60 +function check_auth($id, $action, $userid) {
  61 + global $default;
  62 + $usergroup = owlusergroup($userid);
  63 + $filecreator = owlfilecreator($id);
  64 + $foldercreator = owlfoldercreator($id);
  65 + $filegroup = owlfilegroup($id);
  66 + $foldergroup = owlfoldergroup($id);
  67 +// print "Action is $action<br>";
  68 +// print "filecreation username is $filecreator<br>";
  69 +// print "filecreation groupname is $filegroup<br>";
  70 +// print "folder group is $foldergroup<br>";
  71 +// print "userid is $userid<br>";
  72 +// print "dbusername is $dbuser<br>";
  73 +// print "usergroup is $usergroup<br>";
  74 +
  75 + if (($action == "folder_modify") ||
  76 + ($action == "folder_view") ||
  77 + ($action == "folder_delete") ||
  78 + ($action == "folder_property")) {
  79 + $policy = getfolderpolicy($id);
  80 + } else {
  81 + $policy = getfilepolicy($id);
  82 + }
  83 +// print "Policy is $policy<br>";
  84 + if ($policy == "0") {
  85 + if (($action == "file_delete") || ($action == "file_modify")) {
  86 + if ($userid != $filecreator) {
  87 + $authorization = "0";
  88 + } else {
  89 + $authorization = "1";
  90 + }
  91 + } else {
  92 + $authorization = "1";
  93 + }
  94 + }
  95 + if ($policy == "1") {
  96 + $authorization = "1";
  97 + }
  98 + if ($policy == "2") {
  99 + if (($action == "file_delete") || ($action == "file_modify")) {
  100 + if ($userid != $filecreator) {
  101 + $authorization = "0";
  102 + } else {
  103 + $authorization = "1";
  104 + }
  105 + } else {
  106 + // Bozz Change Begin
  107 + $sql = new Owl_DB;
  108 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$filegroup'");
  109 + if ($filegroup == $usergroup || $sql->num_rows($sql) > 0) {
  110 + // Bozz Change End
  111 + $authorization = "1";
  112 + } else {
  113 + $authorization = "0";
  114 + }
  115 + }
  116 +
  117 + }
  118 + if ($policy == "3") {
  119 + if (($action == "file_delete") || ($action == "file_modify") || ($action == "file_download")) {
  120 + // Bozz Change Begin
  121 + $sql = new Owl_DB;
  122 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$filegroup'");
  123 + // Bozz Change End
  124 + if ($usergroup != $filegroup && $sql->num_rows($sql) == 0) {
  125 + $authorization = "0";
  126 + } else {
  127 + $authorization = "1";
  128 + }
  129 +
  130 + }
  131 + }
  132 + if ($policy == "4") {
  133 + if ($filecreator == $userid) {
  134 + $authorization = "1";
  135 + } else {
  136 + $authorization = "0";
  137 + }
  138 + }
  139 + if ($policy == "5") {
  140 + if (($action == "file_modify") || ($action == "file_download")) {
  141 + // Bozz Change Begin
  142 + $sql = new Owl_DB;
  143 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$filegroup'");
  144 + // Bozz Change End
  145 + if ($usergroup != $filegroup && $sql->num_rows($sql) == 0) {
  146 + $authorization = "0";
  147 + } else {
  148 + $authorization = "1";
  149 + }
  150 + }
  151 + if ($action == "file_delete") {
  152 + if ($filecreator == $userid) {
  153 + $authorization = "1";
  154 + } else {
  155 + $authorization = "0";
  156 + }
  157 + }
  158 + }
  159 + if ($policy == "6") {
  160 + $authorization = "1";
  161 + if ($action == "file_delete") {
  162 + if ($filecreator == $userid) {
  163 + $authorization = "1";
  164 + } else {
  165 + $authorization = "0";
  166 + }
  167 + }
  168 + }
  169 + if ($policy == "7") {
  170 + if (($action == "file_delete") || ($action == "file_modify")) {
  171 + $sql = new Owl_DB;
  172 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$filegroup'");
  173 + if ($usergroup != $filegroup && $sql->num_rows($sql) == 0) {
  174 + $authorization = "0";
  175 + } else {
  176 + $authorization = "1";
  177 + }
  178 +
  179 + }
  180 + if ($action == "file_download") {
  181 + $authorization = "1";
  182 + }
  183 + }
  184 +
  185 + if ($policy == "8") {
  186 + if ($action == "file_modify") {
  187 + $sql = new Owl_DB;
  188 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$filegroup'");
  189 + if ($usergroup != $filegroup && $sql->num_rows($sql) == 0) {
  190 + $authorization = "0";
  191 + } else {
  192 + $authorization = "1";
  193 + }
  194 + }
  195 + if ($action == "file_download") {
  196 + $authorization = "1";
  197 + }
  198 + if ($action == "file_delete") {
  199 + if ($filecreator == $userid) {
  200 + $authorization = "1";
  201 + } else {
  202 + $authorization = "0";
  203 + }
  204 + }
  205 + }
  206 +
  207 + if ($policy == "50") {
  208 + if (($action == "folder_delete") ||
  209 + ($action == "folder_property") ||
  210 + ($action == "folder_modify")) {
  211 + if ($userid != $foldercreator) {
  212 + $authorization = "0";
  213 + } else {
  214 + $authorization = "1";
  215 + }
  216 + } else {
  217 + $authorization = "1";
  218 + }
  219 + }
  220 + if ($policy == "51") {
  221 + $authorization = "1";
  222 + }
  223 + if ($policy == "52") {
  224 + if (($action == "folder_delete") ||
  225 + ($action == "folder_property") ||
  226 + ($action == "folder_modify")) {
  227 + if ($userid != $foldercreator) {
  228 + $authorization = "0";
  229 + } else {
  230 + $authorization = "1";
  231 + }
  232 + } else {
  233 + // Bozz Change Begin
  234 + $sql = new Owl_DB;
  235 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$foldergroup'");
  236 + if ($foldergroup == $usergroup || $sql->num_rows($sql) > 0) {
  237 + // Bozz Change End
  238 + $authorization = "1";
  239 + } else {
  240 + $authorization = "0";
  241 + }
  242 + }
  243 +
  244 + }
  245 + if ($policy == "53") {
  246 + if (($action == "folder_delete") ||
  247 + ($action == "folder_modify") ||
  248 + ($action == "folder_property") ||
  249 + ($action == "folder_view")) {
  250 + // Bozz Change Begin
  251 + $sql = new Owl_DB;
  252 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$foldergroup'");
  253 + if ($usergroup != $foldergroup && $sql->num_rows($sql) == 0) {
  254 + // Bozz Change End
  255 + $authorization = "0";
  256 + } else {
  257 + $authorization = "1";
  258 + }
  259 + }
  260 + }
  261 + if ($policy == "54") {
  262 + if ($foldercreator == $userid) {
  263 + $authorization = "1";
  264 + } else {
  265 + $authorization = "0";
  266 + }
  267 + }
  268 + if ($policy == "55") {
  269 + if (($action == "folder_modify") || ($action == "folder_view")) {
  270 + // Bozz Change Begin
  271 + $sql = new Owl_DB;
  272 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$foldergroup'");
  273 + if ($usergroup != $foldergroup && $sql->num_rows($sql) == 0) {
  274 + // Bozz Change End
  275 + $authorization = "0";
  276 + } else {
  277 + $authorization = "1";
  278 + }
  279 + }
  280 + if (($action == "folder_delete") ||
  281 + ($action == "folder_property")) {
  282 + if ($foldercreator == $userid) {
  283 + $authorization = "1";
  284 + } else {
  285 + $authorization = "0";
  286 + }
  287 + }
  288 + }
  289 + if ($policy == "56") {
  290 + $authorization = "1";
  291 + if (($action == "folder_delete") ||
  292 + ($action == "folder_property")) {
  293 + if ($foldercreator == $userid) {
  294 + $authorization = "1";
  295 + } else {
  296 + $authorization = "0";
  297 + }
  298 + }
  299 + }
  300 +
  301 + if ($policy == "57") {
  302 + if (($action == "folder_modify") || ($action == "folder_delete")) {
  303 + $sql = new Owl_DB;
  304 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$foldergroup'");
  305 + if (($usergroup != $foldergroup) && ($sql->num_rows($sql) == 0)) {
  306 + $authorization = "0";
  307 + } else {
  308 + $authorization = "1";
  309 + }
  310 + }
  311 + if ($action == "folder_property") {
  312 + if ($foldercreator == $userid) {
  313 + $authorization = "1";
  314 + } else {
  315 + $authorization = "0";
  316 + }
  317 + }
  318 + if ($action == "folder_view") {
  319 + $authorization = "1";
  320 + }
  321 + }
  322 +
  323 + if ($policy == "58") {
  324 + if ($action == "folder_modify") {
  325 + $sql = new Owl_DB;
  326 + $sql->query("SELECT * FROM $default->owl_users_grpmem_table WHERE userid = '$userid' and groupid = '$foldergroup'");
  327 + if ($usergroup != $foldergroup && $sql->num_rows($sql) == 0) {
  328 + $authorization = "0";
  329 + } else {
  330 + $authorization = "1";
  331 + }
  332 + }
  333 + if ($action == "folder_property") {
  334 + if ($foldercreator == $userid) {
  335 + $authorization = "1";
  336 + } else {
  337 + $authorization = "0";
  338 + }
  339 + }
  340 + if ($action == "folder_delete") {
  341 + if ($foldercreator == $userid) {
  342 + $authorization = "1";
  343 + } else {
  344 + $authorization = "0";
  345 + }
  346 + }
  347 + if ($action == "folder_view") {
  348 + $authorization = "1";
  349 + }
  350 + }
  351 +
  352 +// Bozz Change Begin
  353 +// I Think that the Admin Group should
  354 +// have the same rights as the admin user
  355 + if ($userid == 1 || $usergroup == 0) {
  356 +// Bozz Change End
  357 + $authorization = "1";
  358 + }
  359 +// cv change bug #504298
  360 +// this call must be recursive through the parent directories
  361 +
  362 + // continue recursion?
  363 + if( $authorization == 1 ) {
  364 + if( ($policy > 49) && ($id == 1) ) {
  365 + // stop if we are at the doc root
  366 + return $authorization;
  367 + } else {
  368 + // continue;
  369 + if($policy < 50) {
  370 + $parent = owlfileparent($id);
  371 + } else {
  372 + $parent = owlfolderparent($id);
  373 + }
  374 + return check_auth($parent, "folder_view", $userid);
  375 + }
  376 + } else {
  377 + // dont continue because authorization is 0
  378 + return $authorization;
  379 + }
  380 +}
... ...
lib/styles.css 0 → 100755
  1 +. {
  2 +font-size : 9pt;
  3 +font-family : Verdana, sans-serif;
  4 +font-weight : lighter;
  5 +font-style : normal;
  6 +color : #000000;
  7 +text-decoration: none;
  8 +}
  9 +
  10 +P {
  11 +font-size : 9pt;
  12 +font-family : Verdana, sans-serif;
  13 +font-weight : lighter;
  14 +font-style : normal;
  15 +color : #000000;
  16 +text-decoration: none;
  17 +
  18 +
  19 +}
  20 +
  21 +P.footer {
  22 +font-size : 9pt;
  23 +font-family : Verdana, sans-serif;
  24 +font-weight : lighter;
  25 +font-style : normal;
  26 +color : #999999;
  27 +text-decoration: none;
  28 +
  29 +
  30 +}
  31 +
  32 +P.title {
  33 +font-size : 9pt;
  34 +font-family : Verdana, sans-serif;
  35 +font-weight : inherit;
  36 +font-style : normal;
  37 +color : #ffffff;
  38 +text-decoration: none;
  39 +}
  40 +
  41 +
  42 +A {
  43 +font-size : 10pt;
  44 +font-family : Verdana, sans-serif;
  45 +font-style : normal;
  46 +color : #000000;
  47 +text-decoration: none;
  48 +}
  49 +
  50 +
  51 +A:Visited {
  52 +font-size : 10pt;
  53 +font-family : Verdana, sans-serif;
  54 +font-style : normal;
  55 +color : #000000;
  56 +text-decoration: none;
  57 +}
  58 +
  59 +A:Active {
  60 +color : #000000;
  61 +font-size : 10pt;
  62 +font-family : Verdana, sans-serif;
  63 +font-style : normal;
  64 +text-decoration: none;
  65 +}
  66 +
  67 +A:hover {
  68 +color : #000000;
  69 +font-size : 10pt;
  70 +font-family : Verdana,sans-serif;
  71 +font-style : normal;
  72 +text-decoration: none;
  73 +background-color : #FFFACD;
  74 +}
  75 +
... ...
locale/Chinese/graphics/btn_add_file.gif 0 → 100755

1.76 KB

locale/Chinese/graphics/btn_add_folder.gif 0 → 100755

1.59 KB

locale/Chinese/graphics/btn_add_url.gif 0 → 100644

1.67 KB

locale/Chinese/graphics/btn_browse.gif 0 → 100755

1.29 KB

locale/Chinese/graphics/btn_collapse_view.gif 0 → 100755

1.82 KB

locale/Chinese/graphics/btn_expand_view.gif 0 → 100755

1.76 KB

locale/Chinese/graphics/btn_login.gif 0 → 100755

1.62 KB

locale/Chinese/graphics/btn_logout.gif 0 → 100755

1.16 KB

locale/Chinese/graphics/edit.gif 0 → 100755

94 Bytes

locale/Chinese/graphics/email.gif 0 → 100755

133 Bytes

locale/Chinese/graphics/icons/bin.gif 0 → 100755

835 Bytes

locale/Chinese/graphics/icons/blank.gif 0 → 100755

85 Bytes

locale/Chinese/graphics/icons/bmp.jpg 0 → 100755

816 Bytes

locale/Chinese/graphics/icons/doc.jpg 0 → 100755

954 Bytes

locale/Chinese/graphics/icons/file.gif 0 → 100755

116 Bytes

locale/Chinese/graphics/icons/folder_closed.gif 0 → 100755

142 Bytes

locale/Chinese/graphics/icons/folder_gray.gif 0 → 100755

144 Bytes

locale/Chinese/graphics/icons/gif.jpg 0 → 100755

806 Bytes

locale/Chinese/graphics/icons/gz.jpg 0 → 100755

217 Bytes

locale/Chinese/graphics/icons/htm.jpg 0 → 100755

778 Bytes

locale/Chinese/graphics/icons/html.jpg 0 → 100755

937 Bytes

locale/Chinese/graphics/icons/jpg.jpg 0 → 100755

803 Bytes

locale/Chinese/graphics/icons/link.gif 0 → 100755

111 Bytes

locale/Chinese/graphics/icons/mag.jpg 0 → 100755

874 Bytes

locale/Chinese/graphics/icons/mdb.jpg 0 → 100755

965 Bytes

locale/Chinese/graphics/icons/move.gif 0 → 100755

155 Bytes

locale/Chinese/graphics/icons/mp3.jpg 0 → 100644

236 Bytes

locale/Chinese/graphics/icons/pdf.jpg 0 → 100755

953 Bytes

locale/Chinese/graphics/icons/ppt.jpg 0 → 100755

936 Bytes

locale/Chinese/graphics/icons/tar.jpg 0 → 100755

1 KB

locale/Chinese/graphics/icons/url.gif 0 → 100644

635 Bytes

locale/Chinese/graphics/icons/xls.jpg 0 → 100755

927 Bytes

locale/Chinese/graphics/icons/zip.jpg 0 → 100755

841 Bytes

locale/Chinese/graphics/ife.gif 0 → 100755

4.41 KB

locale/Chinese/graphics/lock.gif 0 → 100755

864 Bytes

locale/Chinese/graphics/log.gif 0 → 100755

907 Bytes

locale/Chinese/graphics/mag.jpg 0 → 100755

874 Bytes

locale/Chinese/graphics/owl.gif 0 → 100755

11.2 KB

locale/Chinese/graphics/trash.gif 0 → 100755

80 Bytes

locale/Chinese/graphics/update.gif 0 → 100755

844 Bytes

locale/Chinese/language.inc 0 → 100755
  1 +<?php
  2 +
  3 +/*
  4 +
  5 + File: language.inc
  6 + Author: Chris
  7 + Date: 2000/12/14
  8 +
  9 + Owl: Copyright Chris Vincent <cvincent@project802.net>
  10 +
  11 + You should have received a copy of the GNU Public
  12 + License along with this package; if not, write to the
  13 + Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14 + Boston, MA 02111-1307, USA.
  15 +
  16 +*/
  17 +
  18 +$lang_logout = "(登出)";
  19 +$lang_login = "登入";
  20 +$lang_successlogout = "你已經成功登出了";
  21 +$lang_loginfail = "登入失敗";
  22 +$lang_logindisabled = "Account has been DISABLED, contact the System Adminstrator";
  23 +$lang_sessinuse = "目前有別的電腦以這個帳號登入 , 所以無法存取 , 請重新<A HREF='$default->owl_root_url/'>登入</A>";
  24 +$lang_invalidsess = "錯誤的連線代碼 , 請重新";
  25 +$lang_sesstimeout = "您閒置的時間太久了 , 請重新<BR>";
  26 +
  27 +$lang_addingfolder = "新增目錄至 ";
  28 +$lang_addingfile = "新增檔案至 ";
  29 +$lang_modifying = "修改 ";
  30 +$lang_reallydelete = "真的要刪除";
  31 +
  32 +$lang_title = "標題";
  33 +$lang_userlang = "Language";
  34 +// begin Daphne change
  35 +$lang_held = "Held"; // for version control
  36 +$lang_ver = "Ver."; // for version control
  37 +// end Daphne change
  38 +$lang_file = "檔案";
  39 +$lang_size = "大小";
  40 +$lang_postedby = "張貼者";
  41 +$lang_modified = "修改日期";
  42 +$lang_actions = "動作";
  43 +$lang_ownership = "所有人";
  44 +$lang_newpolicy = "新的權限";
  45 +$lang_policy = "權限";
  46 +
  47 +$lang_sendthisfile = "傳送這個檔案";
  48 +$lang_sendthisurl = "Send this URL";
  49 +$lang_sendfile = "傳送檔案";
  50 +$lang_keywords = "關鍵字";
  51 +$lang_permissions = "權限";
  52 +$lang_newpermissions = "New Permissions";
  53 +$lang_description = "說明";
  54 +$lang_change = "更改";
  55 +$lang_reset = "重設";
  56 +$lang_create = "建立";
  57 +// begin Daphne change
  58 +$lang_vertype = "Revision type"; // for modify.php when uploading
  59 +$lang_vermajor = "Major Revision";
  60 +$lang_verminor = "Minor Revision";
  61 +$lang_verdescription = "Description<br>of changes";
  62 +// end Daphne change
  63 +
  64 +$lang_everyoneread = "全部的人可以讀取/下載";
  65 +$lang_everyonewrite = "全部的人可以讀取/寫入/下載";
  66 +$lang_everyonewrite_nod = "Everyone can read/write/download, NO DELETE";
  67 +$lang_groupread = "只有自己的群組可以讀取/下載";
  68 +$lang_groupwrite = "只有自己的群組可以讀取/寫入/下載";
  69 +$lang_groupwrite_nod = "Your group can read/write/download, NO DELETE";
  70 +$lang_onlyyou = "只有自己可以讀取/寫入/下載";
  71 +$lang_groupwrite_worldread = "Your group can read/write/download & everyone else can read";
  72 +$lang_groupwrite_worldread_nod = "Your group can read/write/download (NO DELETE) & everyone else can read";
  73 +$lang_ggroupwrite_worldread = "Your group can upload files and delete this folder & everyone else can view contents";
  74 +$lang_ggroupwrite_worldread_nod = "Your group can upload files to this folder & everyone else can view contents, NO DELETE";
  75 +
  76 +// BEGIN BUG FIX: #449394 add document policy bugs for admin
  77 +
  78 +$lang_everyoneread_ad = "全部的人可以讀取及下載";
  79 +$lang_everyonewrite_ad = "全部的人可以讀取/寫入/下載";
  80 +$lang_everyonewrite_ad_nod = "Everyone can read/write/download, NO DELETE";
  81 +$lang_groupread_ad = "選擇的群組可以讀取/下載";
  82 +$lang_groupwrite_ad = "選擇的群組可以讀取/寫入/下載";
  83 +$lang_groupwrite_ad_nod = "The selected group can read/write/download, NO DELETE";
  84 +$lang_onlyyou_ad = "只有自己可以讀取/寫入/下載";
  85 +$lang_groupwrite_worldread_ad = "The selected group can read/write/download & everyone else can read";
  86 +$lang_groupwrite_worldread_ad_nod = "The selected group can read/write/download (NO DELETE) & everyone else can read";
  87 +$lang_ggroupwrite_worldread_ad = "Selected group can upload files and delete this folder & everyone else can view contents";
  88 +$lang_ggroupwrite_worldread_ad_nod = "Selected group can upload files to this folder & everyone else can view contents, NO DELETE";
  89 +
  90 +
  91 +// END BUG FIX: #449394 add document policy bugs for admin
  92 +
  93 +$lang_geveryoneread = "全部的人都可以讀取這個目錄";
  94 +$lang_geveryonewrite = "全部的人可以上傳檔案及刪除這個目錄";
  95 +$lang_geveryonewrite_nod= "Everyone can upload files to this folder";
  96 +$lang_ggroupread = "只有自己的群組可以讀取這個目錄";
  97 +$lang_ggroupwrite = "只有自己的群組可以上傳檔案及刪除這個目錄";
  98 +$lang_ggroupwrite_nod = "Your group can upload files to this folder";
  99 +$lang_gonlyyou = "只有自己可以上傳檔案及刪除這個目錄";
  100 +
  101 +$lang_geveryoneread_ad = "全部的人可以讀取這個目錄";
  102 +$lang_geveryonewrite_ad = "全部的人可以上傳檔案及刪除這個目錄";
  103 +$lang_geveryonewrite_ad_nod = "Everyone can upload files to this folder";
  104 +$lang_ggroupread_ad = "選擇的群組可以讀取這個目錄";
  105 +$lang_ggroupwrite_ad = "選擇的群組可以上傳檔案及刪除目錄";
  106 +$lang_ggroupwrite_ad_nod= "The selected group can upload files to this folder";
  107 +$lang_gonlyyou_ad = "只有自己可以上傳檔案及刪除目錄";
  108 +
  109 +$lang_nofolderaccess = "您沒有存取這個目錄的權限";
  110 +$lang_nofileaccess = "您沒有存取這個檔案的權限";
  111 +$lang_nofilemod = "您沒有修改這個檔案的權限";
  112 +$lang_nofiledelete = "您沒有刪除這個檔案的權限";
  113 +$lang_noupload = "您沒有上傳檔案到這個目錄的權限";
  114 +$lang_nosubfolder = "您沒有建立目錄的權限";
  115 +$lang_nofoldermod = "您沒有修改這個目錄的權限";
  116 +$lang_nofolderdelete = "您沒有刪除這個目錄的權限";
  117 +$lang_noemail = "You do not have access to email this file";
  118 +$lang_fileexists = "這個檔案已經存在了";
  119 +$lang_specifyname = "請回上頁修改名稱";
  120 +
  121 +$lang_users = "使用者";
  122 +$lang_groups = "群組";
  123 +$lang_group = "主要群組";
  124 +$lang_groupmember = "Member Group";
  125 +$lang_username = "使用者名稱";
  126 +$lang_password = "登入密碼";
  127 +$lang_newpassword = "New Password";
  128 +$lang_oldpassword = "Old Password";
  129 +$lang_confpassword = "Confirm New Password";
  130 +$lang_email = "Email Address";
  131 +$lang_emailing = "Emailing";
  132 +$lang_email_to = "Mail To";
  133 +$lang_email_cc = "CC";
  134 +$lang_email_reply_to = "Reply To";
  135 +$lang_email_subject = "Subject";
  136 +$lang_email_body = "Message";
  137 +$lang_notification = "Receive Notifications";
  138 +$lang_attach_file = "Attach File";
  139 +$lang_change = "修改";
  140 +$lang_deleteuser = "刪除使用者";
  141 +$lang_deletegroup = "刪除群組";
  142 +$lang_saved = "儲存";
  143 +$lang_add = "Add";
  144 +$lang_quota = "配額";
  145 +$lang_disableuser = "Disable User";
  146 +$lang_noprefaccess = "Disable Pref";
  147 +$lang_toomanysessions = "Maximum sessions for user reached, contact the System Administraor";
  148 +$lang_maxsessions = "Max No. Sessions";
  149 +$lang_preference = "Preferences";
  150 +$lang_moving = "Moving";
  151 +$lang_select = "Please select new folder:";
  152 +$lang_updating = "Updating";
  153 +$lang_cancel_button = "Cancel";
  154 +
  155 +// Bozz Change Begin
  156 +$lang_email_alt = "Email this File";
  157 +$lang_del_folder_alt = "刪除目錄 (是/否)";
  158 +$lang_mod_folder_alt = "修改目錄屬性";
  159 +$lang_move_folder_alt = "移動目錄";
  160 +
  161 +$lang_del_file_alt = "刪除檔案 (是/否)";
  162 +$lang_mod_file_alt = "修改檔案屬性";
  163 +$lang_move_file_alt = "移動檔案";
  164 +$lang_upd_file_alt = "更新檔案";
  165 +$lang_get_file_alt = "下載檔案";
  166 +$lang_view_file_alt = "檢視檔案";
  167 +$lang_newuser_alt = "Create a new user";
  168 +$lang_newgroup_alt = "Create a new group";
  169 +$lang_flush_sessions_alt = "flush hanging sessions";
  170 +$lang_edthtml_alt = "Edit Site HTML Preferences";
  171 +$lang_edprefs_alt = "Edit Site Features and Settings";
  172 +$lang_backup_alt = "Backup SQL Database";
  173 +$lang_backup_dis_alt = "Backup Tool or gzip was not found";
  174 +
  175 +// Bozz Change End
  176 +// begin Daphne change
  177 +$lang_log_file = "File Log";
  178 +$lang_lock_file = "Check file in/out";
  179 +// end Daphne Change
  180 +$lang_notif_subject_new = "New OWL Intranet File";
  181 +$lang_notif_subject_upd = "An OWL Intranet File was updated";
  182 +$lang_notif_msg = "THIS IS AN AUTOMATED MESSAGE FROM OWL Intranet\n\nFind the new/updated file attached to this Email\n\n";
  183 +
  184 +// Diego Bugfix
  185 +$lang_admin = "Admin";
  186 +$lang_user = "User";
  187 +$lang_search = "Search";
  188 +$lang_search_results_for = "Search results for";
  189 +$lang_score = "Score";
  190 +$lang_ownergroup = "Owner (Group)";
  191 +$lang_name = "Name";
  192 +//Diego Bugfix end
  193 +$lang_query_empty = "Empty Search String";
  194 +
  195 +$lang_err_file_update = "Updating a file requires the filename to remain the same, please try again using the same filename";
  196 +$lang_err_quota = "You do not have enough quota space to upload this file: ";
  197 +$lang_err_quota_needed = " needed ";
  198 +$lang_err_quota_avail = " available.";
  199 +$lang_err_quota_exceed = "You have exceeded your quota";
  200 +$lang_err_upload = "Upload error";
  201 +$lang_err_folder_exist = "This folder already exists";
  202 +$lang_err_folder_create = "Folder Creation error";
  203 +//Begin Daphne Change - backup folder and file creation errors
  204 +$lang_err_backup_folder_create = "Backup Folder Creation error";
  205 +$lang_err_backup_file = "Error backing up existing file";
  206 +$lang_err_file_lock = "You cannot check this file out, it is currently held by";
  207 +// end Daphne change
  208 +$lang_err_unauthorized = "Unauthorized";
  209 +$lang_err_unauth_area = "You are not authorized to use this area";
  210 +$lang_err_pass_wrong = "Old Password is wrong";
  211 +$lang_err_pass_missmatch= "New Password and Confirm Password don't Match";
  212 +$lang_err_user_exists = "Username exists";
  213 +$lang_err_general = "An Error has occured";
  214 +$lang_err_lang_1 = "Language has been spedified, but ";
  215 +$lang_err_lang_2 = " has not been found";
  216 +$lang_err_lang_notfound = "Unable to find language, please specify in owl.lib.php";
  217 +$lang_err_sess_write = "Error writing session information to database";
  218 +$lang_err_sess_notvalid = "Session id is not valid";
  219 +$lang_err_bad_version_1 = "Owl Intranet Requires as a minimum PHP Version";
  220 +$lang_err_bad_version_2 = "You are running Version";
  221 +$lang_err_bad_version_3 = "Install a newer version of php and try again";
  222 +
  223 +$lang_err_folderexists = "Rename was Canceled<BR>Folder with the same name exists.";
  224 +$lang_err_movecancel = "Move was Canceled<BR>";
  225 +$lang_err_email = "Message could not be sent";
  226 +$lang_err_fileexists = "Move was Canceled<BR>File with the same name already exists.";
  227 +$lang_err_nameempty = "Folder name cannot be empty";
  228 +
  229 +//janu's change BEGIN
  230 +$lang_engine = "Owl Intranet Engine";
  231 +$lang_version = "Version";
  232 +$lang_username = "Username";
  233 +$lang_password = "Password";
  234 +$lang_owl_admin = "Owl Administration";
  235 +$lang_upg_MD5 = "Upgrade Users to MD5 Passwords";
  236 +//janu's change END
  237 +
  238 +$lang_viewlog = "Viewing Log For ";
  239 +$lang_viewing = "Viewing ";
  240 +$lang_flushed = "Session table flushed, user can now log in again.<BR>";
  241 +
  242 +// Edit HTML Properties Messages
  243 +
  244 +$lang_ht_tbl_border_sz = "Table Border Size:";
  245 +$lang_ht_tbl_hd_bg = "Header Background:";
  246 +$lang_ht_tbl_cell_bg_cl = "Table Cell Background Colour:";
  247 +$lang_ht_tbl_cell_bg_al = "Table Cell Background Colour Alternate:";
  248 +$lang_ht_tbl_bg_cl = "Table Background Colour:";
  249 +$lang_ht_expand_width = "Expanded View Width:";
  250 +$lang_ht_collapse_width = "Collapse View Width:";
  251 +$lang_ht_bd_bg_cl = "Body Background Color:";
  252 +$lang_ht_bd_txt_cl = "Body Text Colour:";
  253 +$lang_ht_bd_lnk_cl = "Body Link Colour:";
  254 +$lang_ht_bd_vlnk_cl = "Body Visited Link Colour:";
  255 +$lang_ht_main_hd_bg_cl = "Main Header Background Color:";
  256 +
  257 +// Edit Prefs Properties Messages
  258 +
  259 +$lang_owl_title_email = "EMAIL SETTINGS";
  260 +$lang_owl_email_from = "Email From Address:";
  261 +$lang_owl_email_fromname= "Email From Name:";
  262 +$lang_owl_email_replyto = "Email Reply To Address:";
  263 +$lang_owl_email_server = "Email Delivery Server Address:";
  264 +$lang_owl_title_HD = "LOOK AT HD FOR NEW FILES SETINGS";
  265 +$lang_owl_lookAtHD = "Disable Look at hd:";
  266 +$lang_owl_def_file_security= "Default File Security:";
  267 +$lang_owl_def_file_group_owner= "Default File Group Owner:";
  268 +$lang_owl_def_file_owner= "Default File Owner:";
  269 +$lang_owl_def_file_title= "Default File Title:";
  270 +$lang_owl_def_file_meta = "Default File Meta Data:";
  271 +$lang_owl_def_fold_sec = "Default Folder Security:";
  272 +$lang_owl_def_fold_group_owner = "Default Folder Group Owner:";
  273 +$lang_owl_def_fold_owner = "Default Folder Owner:";
  274 +$lang_owl_title_other = "OTHER SETINGS";
  275 +$lang_owl_max_filesize = "Maximum Upload File Size:";
  276 +$lang_owl_owl_timeout = "Session Timeout in Seconds:";
  277 +$lang_owl_owl_expand = "Default Browser View (Expand):";
  278 +$lang_owl_version_control= "Enable Version Control Feature:";
  279 +$lang_owl_restrict_view = "Enable Restricted View Feature:";
  280 +$lang_owl_title_tools = "DB BACKUP/GZIP TOOLS";
  281 +$lang_owl_dbdump_path = "DB Dump Tool Path:";
  282 +$lang_owl_gzip_path = "gzip Path:";
  283 +$lang_owl_tar_path = "tar Path:";
  284 +?>
... ...
locale/Danish/graphics/btn_add_file.gif 0 → 100755

1.76 KB

locale/Danish/graphics/btn_add_folder.gif 0 → 100755

1.59 KB

locale/Danish/graphics/btn_add_url.gif 0 → 100644

1.67 KB

locale/Danish/graphics/btn_browse.gif 0 → 100755

1.29 KB

locale/Danish/graphics/btn_collapse_view.gif 0 → 100755

1.82 KB

locale/Danish/graphics/btn_expand_view.gif 0 → 100755

1.76 KB

locale/Danish/graphics/btn_login.gif 0 → 100755

1.62 KB

locale/Danish/graphics/btn_logout.gif 0 → 100755

1.16 KB

locale/Danish/graphics/edit.gif 0 → 100755

94 Bytes

locale/Danish/graphics/email.gif 0 → 100755

133 Bytes

locale/Danish/graphics/icons/bin.gif 0 → 100755

835 Bytes

locale/Danish/graphics/icons/blank.gif 0 → 100755

85 Bytes

locale/Danish/graphics/icons/bmp.jpg 0 → 100755

816 Bytes

locale/Danish/graphics/icons/doc.jpg 0 → 100755

954 Bytes

locale/Danish/graphics/icons/file.gif 0 → 100755

116 Bytes

locale/Danish/graphics/icons/folder_closed.gif 0 → 100755

142 Bytes

locale/Danish/graphics/icons/folder_gray.gif 0 → 100755

144 Bytes

locale/Danish/graphics/icons/gif.jpg 0 → 100755

806 Bytes

locale/Danish/graphics/icons/gz.jpg 0 → 100755

217 Bytes

locale/Danish/graphics/icons/htm.jpg 0 → 100755

778 Bytes

locale/Danish/graphics/icons/html.jpg 0 → 100755

937 Bytes

locale/Danish/graphics/icons/jpg.jpg 0 → 100755

803 Bytes

locale/Danish/graphics/icons/link.gif 0 → 100755

111 Bytes

locale/Danish/graphics/icons/mag.jpg 0 → 100755

874 Bytes

locale/Danish/graphics/icons/mdb.jpg 0 → 100755

965 Bytes

locale/Danish/graphics/icons/move.gif 0 → 100755

155 Bytes