Commit 187d64c7d1984b4f9d3cdd58b5740a77ac6a5346

Authored by Michael Joseph
1 parent 3d456920

removing owl sources


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1032 c91229c3-7414-0410-bfa2-8a42b809f60b
admin.php deleted
1 -<?php  
2 -require_once("$default->owl_fs_root/presentation/webPageTemplate.inc");  
3 -  
4 -  
5 -?>  
6 -  
admin/admin_dbmodify.php deleted
1 -<?php  
2 -  
3 -/* admin_dbmodify.php  
4 - *  
5 - * this is used to modify the db  
6 - *  
7 - * Copyright (c) 1999-2002 The Owl Project Team  
8 - * Licensed under the GNU GPL. For full terms see the file COPYING.  
9 - * @version v 1.1.1.1 2002/12/04  
10 - * @author michael  
11 - * @package Owl  
12 -*/  
13 -  
14 -require("../config/owl.php");  
15 -require("../lib/owl.lib.php");  
16 -require("../config/html.php");  
17 -  
18 -// if not authorised exit from area  
19 -if(owlusergroup($userid) != 0)  
20 -{  
21 - exit("$lang_err_unauth_area");  
22 -}  
23 -  
24 -// action selected is user  
25 -if($action == "user")  
26 -{  
27 - //increment sessions  
28 - $maxsessions = $maxsessions - 1; // always is stored - 1  
29 - //open connection  
30 - $sql = new Owl_DB;  
31 - $sql->query("SELECT * FROM $default->owl_users_table WHERE id = '$id'");  
32 - $sql->next_record();  
33 - $newpass = $sql->f("password");  
34 -  
35 - // update password  
36 - if ($newpass == $password)  
37 - {  
38 - $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'");  
39 - }  
40 - else  
41 - {  
42 - $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'");  
43 - }  
44 - // Bozz Change BEGIN  
45 -  
46 - // Clean Up the member group table first  
47 - $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id");  
48 -  
49 - // Insert the new Choices the member group table with selected groups  
50 - for ( $i = 0 ; $i <= $no_groups_displayed; $i++ )  
51 - {  
52 - $checkboxfields = 'group' . $i;  
53 - if($$checkboxfields != '')  
54 - {  
55 - $checkboxvalue = $$checkboxfields;  
56 - $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$id', '$checkboxvalue')");  
57 - }  
58 - }  
59 - /* Bozz Change END */  
60 - header("Location: index.php?sess=$sess&action=users&owluser=$id&change=1");  
61 -}  
62 -  
63 -// if action selected is group  
64 -if($action == "group")  
65 -{  
66 - //update the group table  
67 - global $default;  
68 - $sql = new Owl_DB;  
69 - $sql->query("UPDATE $default->owl_groups_table SET name='$name' where id = '$id'");  
70 - header("Location: index.php?sess=$sess&action=groups&group=$id&change=1");  
71 -}  
72 -  
73 -// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php  
74 -  
75 -// if action is delete user  
76 -if($action == $lang_deleteuser)  
77 -{  
78 -// END BUG FIX: #448232 mistake in admin_dbmodify.php  
79 -  
80 - //delete the user  
81 - $sql = new Owl_DB;  
82 - $sql->query("DELETE FROM $default->owl_users_table WHERE id = '$id'");  
83 - // Bozz Change Begin  
84 - // Also Clean up the groupmember table when a user is deleted  
85 - $sql->query("DELETE FROM $default->owl_users_grpmem_table WHERE userid = $id");  
86 - // Bozz Change End  
87 - header("Location: index.php?sess=$sess&action=users");  
88 -}  
89 -  
90 -// if action is edit html  
91 -if($action == "edhtml")  
92 -{  
93 - //update html settings  
94 - $sql = new Owl_DB;  
95 - $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' ");  
96 -  
97 - header("Location: index.php?sess=$sess&action=edhtml&change=1");  
98 -  
99 -}  
100 -  
101 -//if action is edit prefernces  
102 -if($action == "edprefs") {  
103 - $sql = new Owl_DB;  
104 -  
105 - //update the preferences  
106 - if ($lookAtHD != "false" )  
107 - $lookAtHD = "true";  
108 - if ($owl_expand != "1")  
109 - $owl_expand = "0";  
110 - if ($version_control != "1")  
111 - $version_control = "0";  
112 -  
113 - $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'");  
114 -  
115 - header("Location: index.php?sess=$sess&action=edprefs&change=1");  
116 -}  
117 -  
118 -// BEGIN BUG FIX: #448232 mistake in admin_dbmodify.php  
119 -// if action is delete group  
120 -if($action == $lang_deletegroup )  
121 -{  
122 -// END BUG FIX: #448232 mistake in admin_dbmodify.php  
123 -  
124 - //delete specified group  
125 - global $default;  
126 - $sql = new Owl_DB;  
127 - $sql->query("DELETE FROM $default->owl_groups_table WHERE id = '$id'");  
128 - header("Location: index.php?sess=$sess&action=groups");  
129 -}  
130 -  
131 -// if action selected is add  
132 -if($action == "add")  
133 -{  
134 - // if user to be added insert user into db  
135 - if($type == "user")  
136 - {  
137 - $maxsessions = $maxsessions - 1; // always is stored - 1  
138 - $sql = new Owl_DB;  
139 - $sql->query("SELECT * FROM $default->owl_users_table WHERE username = '$loginname'");  
140 -  
141 - //check if user exists  
142 - if($sql->num_rows($sql) > 0)  
143 - {  
144 - die ("$lang_err_user_exists");  
145 - }  
146 -  
147 - $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')");  
148 - // Bozz Change BEGIN  
149 - // Populated the member group table with selected groups  
150 - $sql->query("SELECT id FROM $default->owl_users_table WHERE username = '$loginname'");  
151 - $sql->next_record();  
152 - $newuid = $sql->f("id");  
153 -  
154 - for ( $i = 0 ; $i <= $no_groups_displayed; $i++ )  
155 - {  
156 - $checkboxfields = 'group' . $i;  
157 - if($$checkboxfields != '')  
158 - {  
159 - $checkboxvalue = $$checkboxfields;  
160 - $sql->query("INSERT INTO $default->owl_users_grpmem_table (userid,groupid) VALUES ('$newuid', '$checkboxvalue')");  
161 - }  
162 - }  
163 - /* Bozz Change END */  
164 -  
165 - // set home folder????  
166 - if($home == "1")  
167 - {  
168 - $sql->query("select * from $default->owl_users_table where username = '$loginname'");  
169 - while($sql->next_record()) $id = $sql->f("id");  
170 - $sql->query("insert into $default->owl_folders_table values (0, '$loginname', '2', '54', '$groupid', '$id')");  
171 - mkdir($default->owl_fs_root."/".fid_to_name("1")."/Home/$loginname", 0777);  
172 - }  
173 - header("Location: index.php?sess=$sess");  
174 - }  
175 - elseif($type == "group")  
176 - {  
177 - $sql = new Owl_DB;  
178 - $sql->query("INSERT INTO $default->owl_groups_table (name) VALUES ('$name')");  
179 - header("Location: index.php?sess=$sess");  
180 - }  
181 -}  
182 -  
183 -?>  
admin/index.php deleted
1 -<?php  
2 -  
3 -/**  
4 - * $Id$  
5 - *  
6 - * This is the index page for the admin  
7 - *  
8 - * Copyright (c) 1999-2002 The Owl Project Team  
9 - * Licensed under the GNU GPL. For full terms see the file COPYING.  
10 - * @version $Revision$  
11 - * @author michael  
12 - * @package Owl  
13 - */  
14 -  
15 -require("../config/owl.php");  
16 -require("../lib/owl.lib.php");  
17 -require("../config/html.php");  
18 -  
19 -// action selected is to backup then doBackup function is called  
20 -if($action == "backup") {  
21 - dobackup();  
22 -}  
23 -  
24 -include("../lib/header.inc");  
25 -print("<CENTER>");  
26 -  
27 -// if usergroupid invalid then unauthorised view and exit  
28 -if($usergroupid != "0") {  
29 - die("$lang_err_unauthorized");  
30 -}  
31 -  
32 -// if not action set ..set action to users  
33 -if(!isset($action)) {  
34 - $action = "users";  
35 -}  
36 -  
37 -//-------------------------------------------------------------  
38 -/**  
39 - * Function PrintUsers  
40 - *  
41 - * Prints the users out  
42 - *  
43 - */  
44 -//-------------------------------------------------------------  
45 -// Semi-Usable - Interface based  
46 -function printusers()  
47 -{  
48 - global $sess, $default, $lang_users;  
49 -  
50 - //create a new connection  
51 - $sql = new Owl_DB;  
52 - // create a new active session  
53 - $sql_active_sess = new Owl_DB;  
54 -  
55 -  
56 - $sql->query("select username,name,id,maxsessions from $default->owl_users_table order by name");  
57 -  
58 -  
59 - /* print("<TABLE><TR><TD BGCOLOR=$default->table_header_bg>$lang_users</TD></TR>");  
60 -  
61 -  
62 - print("<tr><td><form method=post action=index.php?sess=$sess&action=users>");  
63 - print("<input type=hidden name=sess value=$sess>");  
64 - print("<input type=hidden name=action value=users>");  
65 - print("<tr><td><select name=owluser>");  
66 -  
67 - while($sql->next_record()) {  
68 - $uid = $sql->f("id");  
69 - $username = $sql->f("username");  
70 - $name = $sql->f("name");  
71 - $maxsess = $sql->f("maxsessions") + 1;  
72 - $numrows = 0;  
73 -  
74 - $sql_active_sess->query("select * from $default->owl_sessions_table where uid = $uid");  
75 - $sql_active_sess->next_record();  
76 - $numrows = $sql_active_sess->num_rows($sql_active_sess);  
77 -  
78 - if ($name == "")  
79 - print("<option value=".$uid.">".$username."</option>");  
80 - else  
81 - if ($uid == $owluser)  
82 - print("<option value=".$uid." SELECTED>(".$numrows."/".$maxsess.") ".$name."</option>");  
83 - else  
84 - print("<option value=".$uid." >(".$numrows."/".$maxsess.") ".$name."</option>");  
85 - }  
86 - print("</select><input type=submit value=Go></td></tr></table>"); */  
87 -  
88 -  
89 - 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>");  
90 -  
91 -  
92 - while($sql->next_record()) {  
93 - // loop through record getting user information  
94 - $uid = $sql->f("id");  
95 - $username = $sql->f("username");  
96 - $name = $sql->f("name");  
97 - $maxsess = $sql->f("maxsessions") + 1;  
98 - $numrows = 0;  
99 -  
100 - // find active sessions  
101 - $sql_active_sess->query("select * from $default->owl_sessions_table where uid = $uid");  
102 - $sql_active_sess->next_record();  
103 - $numrows = $sql_active_sess->num_rows($sql_active_sess);  
104 -  
105 - // print out information ->not usable  
106 - if ($name == "")  
107 - print("<TR><TD align=left><A HREF='index.php?sess=$sess&action=users&owluser=".$uid."'>".$username."</A></TD>");  
108 - else  
109 - print("<TR><TD align=left><A HREF='index.php?sess=$sess&action=users&owluser=".$uid."'>".$name."</A></TD>");  
110 - print("<TD align='right'>(".$numrows."/".$maxsess.")</TD></TR>");  
111 - }  
112 - print("</TABLE>");  
113 -}  
114 -  
115 -//-------------------------------------------------------------  
116 -/**  
117 - * Function PrintGroups  
118 - *  
119 - * Prints the Groups out  
120 - *  
121 - */  
122 -//-------------------------------------------------------------  
123 -// Semi-Usable -> Interface Based  
124 -function printgroups()  
125 -{// print out all groups  
126 - global $sess, $lang_groups, $default;  
127 - $sql = new Owl_DB;  
128 - $sql->query("select name,id from $default->owl_groups_table order by name");  
129 - print("<TABLE BORDER=$default->table_border><TR><TD BGCOLOR=$default->table_header_bg>$lang_groups</TD></TR>");  
130 -  
131 - while($sql->next_record())  
132 - {  
133 - print("<TR><TD align=left><A HREF='index.php?sess=$sess&action=groups&group=".$sql->f("id")."'>".$sql->f("name")."</A></TD></TR>");  
134 - }  
135 - print("</TABLE>");  
136 -}  
137 -  
138 -//-------------------------------------------------------------  
139 -/**  
140 - * Function PrintUsr($id)  
141 - *  
142 - * Prints the User out  
143 - *  
144 - * @param $id  
145 - * The Id of the user who's info is to be printed  
146 - *  
147 - */  
148 -//-------------------------------------------------------------  
149 -// Semi-Usable -> Interface Based  
150 -function printuser($id)  
151 -{ //declare globals  
152 - 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;  
153 - global $lang_flush_sessions_alt, $lang_flushed, $lang_deleteuser, $lang_email, $lang_notification, $default, $flush;  
154 -  
155 - if($change == 1)  
156 - {  
157 - print("$lang_saved<BR>");  
158 - }  
159 -  
160 - if ($flush == 1)  
161 - {  
162 - flushsessions($id, $sess);  
163 - print($lang_flushed);  
164 - }  
165 -  
166 - $sql = new Owl_DB;  
167 - $sql->query("select id,name from $default->owl_groups_table order by name");  
168 - $i=0;  
169 -  
170 - // store groups in array  
171 - while($sql->next_record())  
172 - {  
173 - $groups[$i][0] = $sql->f("id");  
174 - $groups[$i][1] = $sql->f("name");  
175 - $i++;  
176 - }  
177 - $sql->query("select * from $default->owl_users_table where id = '$id'");  
178 -  
179 - //post to dbmodify any changes and their values  
180 - while($sql->next_record())  
181 - {  
182 - print("<FORM ACTION='admin_dbmodify.php' METHOD=POST>");  
183 - print("<INPUT TYPE=HIDDEN NAME=id VALUE=".$sql->f("id").">");  
184 - print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");  
185 - print("<INPUT TYPE=HIDDEN name=action VALUE=user>");  
186 - 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>");  
187 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_group</TD><TD align=left><SELECT NAME=groupid>");  
188 - print("<OPTION VALUE=".$sql->f("groupid").">".group_to_name($sql->f("groupid")));  
189 - foreach($groups as $g)  
190 - {  
191 - print("<OPTION VALUE=$g[0]>$g[1]");  
192 - }  
193 - print("</SELECT></TD></TR>");  
194 - //*******************************  
195 - // Display the Language dropdown  
196 - //*******************************  
197 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_userlang</TD><TD align=left><SELECT NAME=newlanguage>");  
198 - print("<OPTION VALUE=".$sql->f("language").">".$sql->f("language"));  
199 - $dir = dir($default->owl_LangDir);  
200 - $dir->rewind();  
201 -  
202 - while($file=$dir->read())  
203 - {  
204 - if ($file != "." and $file != "..")  
205 - print("<OPTION VALUE=$file>$file");  
206 - }  
207 - $dir->close();  
208 - print("</SELECT></TD></TR>");  
209 - // Bozz Change begin  
210 - //This is to allow a user to be part of more than one group  
211 -  
212 - // assign a user to more than one group  
213 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_groupmember</TD><TD align=left>");  
214 - $i=0;  
215 - $sqlmemgroup = new Owl_DB;  
216 - foreach($groups as $g)  
217 - {  
218 - $is_set_gid = $g[0];  
219 - $sqlmemgroup->query("select userid from $default->owl_users_grpmem_table where userid = '$id' and groupid = '$is_set_gid'");  
220 - $sqlmemgroup->next_record();  
221 -  
222 - if ($sqlmemgroup->num_rows($sqlmemgroup) > 0)  
223 - {  
224 - print("<input type='checkbox' name='group$i' value=$g[0] checked>$g[1]<BR>");  
225 - }  
226 - else  
227 - {  
228 - print("<input type='checkbox' name='group$i' value=$g[0]>$g[1]<BR>");  
229 - }  
230 - $i++;  
231 - }  
232 - // This hidden field is to store the nubmer of displayed groups for future use  
233 - // when the records are saved to the db  
234 -  
235 -  
236 - print("<INPUT TYPE=HIDDEN NAME=no_groups_displayed VALUE=$i>");  
237 - // Bozz Change End  
238 -  
239 - 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>");  
240 - 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>");  
241 - 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).">  
242 - <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>");  
243 - 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>");  
244 - 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>");  
245 -  
246 - // if notify is on ..set its value to checked  
247 - if ( $sql->f("notify") == 1)  
248 - {  
249 - 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>");  
250 - }  
251 - else  
252 - {  
253 - 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>");  
254 - }  
255 -  
256 - // if attachfile is on ..set its value to checked  
257 - if ( $sql->f("attachfile") == 1)  
258 - {  
259 - 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>");  
260 - }  
261 - else  
262 - {  
263 - 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>");  
264 - }  
265 -  
266 -  
267 - if ($id != 1)  
268 - {  
269 - // if disabled is on ..set its value to checked  
270 - if ( $sql->f("disabled") == 1)  
271 - {  
272 - 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>");  
273 - }  
274 - else  
275 - {  
276 - 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>");  
277 - }  
278 -  
279 - // if noprefaccess is on ..set its value to checked  
280 - if ( $sql->f("noprefaccess") == 1)  
281 - {  
282 - 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>");  
283 - }  
284 - else  
285 - {  
286 - 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>");  
287 - }  
288 - }  
289 -  
290 - print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change>");  
291 -  
292 - // delete user if id != 1  
293 - if ($sql->f("id") != 1)  
294 - {  
295 - print("<INPUT TYPE=SUBMIT NAME=action VALUE='$lang_deleteuser'>");  
296 - }  
297 -  
298 - print("</FORM>");  
299 - }  
300 -}  
301 -  
302 -//-------------------------------------------------------------  
303 -/**  
304 - * Function flushsessions($id, $sess)  
305 - *  
306 - * Flushes the session variable form the db  
307 - *  
308 - * @param $id  
309 - * The Id of the user  
310 - * @param $sess  
311 - * The session variable  
312 -*/  
313 -//-------------------------------------------------------------  
314 -// Usable  
315 -function flushsessions($id, $sess)  
316 -{  
317 - global $default;  
318 - $sql= new Owl_DB;  
319 - $sql->query("delete from $default->owl_sessions_table where uid='$id' AND sessid!='$sess'");  
320 -}  
321 -  
322 -  
323 -//-------------------------------------------------------------  
324 -/**  
325 - * Function printgroup($id)  
326 - *  
327 - * Prints out the group  
328 - *  
329 - * @param $id  
330 - * The Id of the user  
331 - *  
332 -*/  
333 -//-------------------------------------------------------------  
334 -// Semi-Usable -> interface based  
335 -  
336 -function printgroup($id)  
337 -{  
338 - global $sess,$change,$lang_title,$lang_change,$lang_deletegroup,$lang_saved,$default;  
339 -  
340 - if(isset($change))  
341 - {  
342 - print("$lang_saved<BR>");  
343 - }  
344 -  
345 - $sql = new Owl_DB;  
346 - $sql->query("select id,name from $default->owl_groups_table where id = '$id'");  
347 -  
348 - // post to dbmodify with several values  
349 - while($sql->next_record())  
350 - {  
351 - print("<FORM ACTION='admin_dbmodify.php' METHOD=POST>");  
352 - print("<INPUT TYPE=HIDDEN NAME=id VALUE=".$sql->f("id").">");  
353 - print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");  
354 - print("<INPUT TYPE=HIDDEN name=action VALUE=group>");  
355 - 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>");  
356 - print("<BR><INPUT TYPE=SUBMIT VALUE=$lang_change>");  
357 -  
358 - // delete the group  
359 - if($sql->f("id") != 0)  
360 - {  
361 - print("<INPUT TYPE=SUBMIT NAME=action VALUE='$lang_deletegroup'>");  
362 - }  
363 - print("</FORM>");  
364 - }  
365 -}  
366 -  
367 -//-------------------------------------------------------------  
368 -/**  
369 - * Function printnewgroup()  
370 - *  
371 - * Prints out a new group  
372 - *  
373 -  
374 -*/  
375 -//-------------------------------------------------------------  
376 -// NOT Usable  
377 -function printnewgroup()  
378 -{  
379 - global $default, $sess,$lang_title,$lang_add;  
380 - print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");  
381 - print("<INPUT TYPE=HIDDEN NAME=action VALUE=add>");  
382 - print("<INPUT TYPE=HIDDEN NAME=type VALUE=group>");  
383 - print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");  
384 - 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>");  
385 -}  
386 -  
387 -//-------------------------------------------------------------  
388 -/**  
389 - * Function printnewuserr()  
390 - *  
391 - * Prints out a new user  
392 - *  
393 -*/  
394 -//-------------------------------------------------------------  
395 -// Semi-Usable  
396 -function printnewuser() {  
397 - global $sess,$lang_title,$lang_username,$lang_group,$lang_password,$lang_add,$default, $lang_quota,$lang_groupmember;  
398 - global $lang_email, $lang_notification, $lang_noprefaccess, $lang_disableuser, $lang_userlang, $lang_maxsessions, $lang_attach_file;  
399 - $sql = new Owl_DB;  
400 - $sql->query("select id,name from $default->owl_groups_table order by name");  
401 - $i=0;  
402 - // get all groups  
403 - while($sql->next_record())  
404 - {  
405 - $groups[$i][0] = $sql->f("id");  
406 - $groups[$i][1] = $sql->f("name");  
407 - $i++;  
408 - }  
409 - print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");  
410 - print("<INPUT TYPE=HIDDEN NAME=action VALUE=add>");  
411 - print("<INPUT TYPE=HIDDEN NAME=type VALUE=user>");  
412 - print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");  
413 - 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>");  
414 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_username</TD><TD align=left><INPUT TYPE=TEXT NAME=loginname></TD></TR>");  
415 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_group</TD><TD align=left><SELECT NAME=groupid>");  
416 -  
417 - foreach($groups as $g)  
418 - {  
419 - print("<OPTION VALUE=$g[0]>$g[1]");  
420 - }  
421 - print("</SELECT></TD></TR>");  
422 - //*******************************  
423 - // Display the Language dropdown  
424 - //*******************************  
425 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_userlang</TD><TD align=left><SELECT NAME=newlanguage>");  
426 - $dir = dir($default->owl_LangDir);  
427 - $dir->rewind();  
428 -  
429 - while($file=$dir->read())  
430 - {  
431 - if ($file != "." and $file != "..")  
432 - {  
433 - //janu's change BEGIN  
434 - print("<OPTION VALUE=$file");  
435 - if ($file == $default->owl_lang)  
436 - print (" SELECTED");  
437 - print(">$file");  
438 - //janu's change END  
439 - }  
440 - }  
441 - $dir->close();  
442 - print("</SELECT></TD></TR>");  
443 -  
444 - // Bozz Change begin  
445 - //This is to allow a user to be part of more than one group  
446 -  
447 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_groupmember</TD><TD align=left>");  
448 - $i=0;  
449 - foreach($groups as $g)  
450 - {  
451 - print("<input type='checkbox' name='group$i' value=$g[0]>$g[1]<BR>");  
452 - $i++;  
453 - }  
454 - // This hidden field is to store the nubmer of displayed groups for future use  
455 - // when the records are saved to the db  
456 -  
457 - print("<INPUT TYPE=HIDDEN NAME=no_groups_displayed VALUE=$i>");  
458 - // Bozz Change End  
459 - 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>");  
460 - 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>");  
461 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_password</TD><TD align=left><INPUT TYPE=PASSWORD NAME=password></TD></TR>");  
462 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_email</TD><TD align=left><INPUT TYPE=TEXT NAME=email></TD></TR>");  
463 - 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>");  
464 - 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>");  
465 - 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>");  
466 - print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_add></FORM>");  
467 -}  
468 -  
469 -//-------------------------------------------------------------  
470 -/**  
471 - * Function printHTML()  
472 - *  
473 - * Prints out the required HTML  
474 - *  
475 - */  
476 -//-------------------------------------------------------------  
477 -// NOT Usable  
478 -function printhtml() {  
479 - global $default, $sess, $lang_add, $lang_change, $change, $lang_saved;  
480 - 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;  
481 - if(isset($change)) print("$lang_saved<BR>");  
482 - print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");  
483 - print("<INPUT TYPE=HIDDEN NAME=action VALUE=edhtml>");  
484 - print("<INPUT TYPE=HIDDEN NAME=type VALUE=html>");  
485 - print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");  
486 - print("<TABLE BORDER=$default->table_border>");  
487 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_border_sz</TD>  
488 - <TD align=left><INPUT TYPE=TEXT NAME=border VALUE='$default->table_border'></TD></TR>");  
489 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_hd_bg</TD>  
490 - <TD align=left><INPUT TYPE=TEXT NAME=header_bg VALUE=$default->table_header_bg></TD></TR>");  
491 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_cell_bg_cl</TD>  
492 - <TD align=left><INPUT TYPE=TEXT NAME=cell_bg VALUE='$default->table_cell_bg'></TD></TR>");  
493 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_tbl_cell_bg_al</TD>  
494 - <TD align=left><INPUT TYPE=TEXT NAME=cell_bg_alt VALUE='$default->table_cell_bg_alt'></TD></TR>");  
495 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_expand_width</TD>  
496 - <TD align=left><INPUT TYPE=TEXT NAME=expand_width VALUE='$default->table_expand_width'></TD></TR>");  
497 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_collapse_width</TD>  
498 - <TD align=left><INPUT TYPE=TEXT NAME=collapse_width VALUE='$default->table_collapse_width'></TD></TR>");  
499 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>Main Header Background Color</TD>  
500 - <TD align=left><INPUT TYPE=TEXT NAME=main_header_bgcolor VALUE='$default->main_header_bgcolor'></TD></TR>");  
501 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_bg_cl</TD>  
502 - <TD align=left><INPUT TYPE=TEXT NAME=body_bgcolor VALUE='$default->body_bgcolor'></TD></TR>");  
503 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_txt_cl</TD>  
504 - <TD align=left><INPUT TYPE=TEXT NAME=body_textcolor VALUE='$default->body_textcolor'></TD></TR>");  
505 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_lnk_cl</TD>  
506 - <TD align=left><INPUT TYPE=TEXT NAME=body_link VALUE='$default->body_link'></TD></TR>");  
507 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_ht_bd_vlnk_cl</TD>  
508 - <TD align=left><INPUT TYPE=TEXT NAME=body_vlink VALUE='$default->body_vlink'></TD></TR>");  
509 - print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change></FORM>");  
510 -}  
511 -//-------------------------------------------------------------  
512 -/**  
513 - * Function printPrefs()  
514 - *  
515 - * Prints out the preferences in a specific format  
516 - *  
517 - */  
518 -//-------------------------------------------------------------  
519 -// NOT Usable  
520 -function printprefs() {  
521 - global $default, $sess, $lang_add, $lang_change, $change, $lang_saved;  
522 - 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 ;  
523 - global $lang_owl_title_tools, $lang_owl_dbdump_path,$lang_owl_gzip_path, $lang_owl_tar_path;  
524 -  
525 - if(isset($change)) print("$lang_saved<BR>");  
526 - print("<FORM ACTION='admin_dbmodify.php' METHOD=post>");  
527 - print("<INPUT TYPE=HIDDEN NAME=action VALUE=edprefs>");  
528 - print("<INPUT TYPE=HIDDEN NAME=type VALUE=html>");  
529 - print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");  
530 - print("<TABLE BORDER=$default->table_border>");  
531 - print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_email</TD></TR>");  
532 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_from</TD>  
533 - <TD align=left><INPUT TYPE=TEXT NAME=email_from VALUE='$default->owl_email_from' size=30></TD></TR>");  
534 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_fromname</TD>  
535 - <TD align=left><INPUT TYPE=TEXT NAME=email_fromname VALUE='$default->owl_email_fromname' size=30></TD></TR>");  
536 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_replyto</TD>  
537 - <TD align=left><INPUT TYPE=TEXT NAME=email_replyto VALUE='$default->owl_email_replyto' size=30></TD></TR>");  
538 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_email_server</TD>  
539 - <TD align=left><INPUT TYPE=TEXT NAME=email_server VALUE='$default->owl_email_server' size=30></TD></TR>");  
540 - print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_HD</TD></TR>");  
541 -  
542 - if ( $default->owl_LookAtHD == "false" )  
543 - {  
544 - 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>");  
545 - print("<INPUT TYPE=HIDDEN NAME=def_file_security VALUE='$default->owl_def_file_security'>");  
546 - print("<INPUT TYPE=HIDDEN NAME=def_file_group_owner VALUE='$default->owl_def_file_group_owner'>");  
547 - print("<INPUT TYPE=HIDDEN NAME=def_file_owner VALUE='$default->owl_def_file_owner'>");  
548 - print("<INPUT TYPE=HIDDEN NAME=def_file_title VALUE='$default->owl_def_file_title'>");  
549 - print("<INPUT TYPE=HIDDEN NAME=def_file_meta VALUE='$default->owl_def_file_meta'>");  
550 - print("<INPUT TYPE=HIDDEN NAME=def_fold_security VALUE='$default->owl_def_fold_security'>");  
551 - print("<INPUT TYPE=HIDDEN NAME=def_fold_group_owner VALUE='$default->owl_def_fold_group_owner'>");  
552 - print("<INPUT TYPE=HIDDEN NAME=def_fold_owner VALUE='$default->owl_def_fold_owner'>");  
553 - }  
554 - else  
555 - {  
556 - 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>");  
557 - printfileperm($default->owl_def_file_security, "def_file_security", $lang_owl_def_file_security, "user");  
558 -  
559 - $sql = new Owl_DB;  
560 - $sql->query("select id,name from $default->owl_groups_table");  
561 - $i=0;  
562 - // get all groups  
563 - while($sql->next_record())  
564 - {  
565 - $groups[$i][0] = $sql->f("id");  
566 - $groups[$i][1] = $sql->f("name");  
567 - $i++;  
568 - }  
569 - 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>");  
570 -  
571 - // loop through all groups  
572 - foreach($groups as $g)  
573 - {  
574 - print("<OPTION VALUE=$g[0] ");  
575 - if($g[0] == $default->owl_def_file_group_owner)  
576 - print("SELECTED");  
577 - print(">$g[1]");  
578 - }  
579 - print("</SELECT></TD></TR>");  
580 - $sql = new Owl_DB;  
581 - $sql->query("select id,name from $default->owl_users_table");  
582 - $i=0;  
583 -  
584 - // get all users  
585 - while($sql->next_record())  
586 - {  
587 - $users[$i][0] = $sql->f("id");  
588 - $users[$i][1] = $sql->f("name");  
589 - $i++;  
590 - }  
591 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_owl_def_file_owner</TD><TD align=left><SELECT NAME=def_file_owner>");  
592 -  
593 - // loop through users  
594 - foreach($users as $g)  
595 - {  
596 - print("<OPTION VALUE=$g[0] ");  
597 - if($g[0] == $default->owl_def_file_owner)  
598 - print("SELECTED");  
599 - print(">$g[1]");  
600 - }  
601 - print("</SELECT></TD></TR>");  
602 -  
603 -  
604 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_def_file_title</TD>  
605 - <TD align=left><INPUT TYPE=TEXT NAME=def_file_title VALUE='$default->owl_def_file_title' size=40></TD></TR>");  
606 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_def_file_meta</TD>  
607 - <TD align=left><INPUT TYPE=TEXT NAME=def_file_meta VALUE='$default->owl_def_file_meta' size=40></TD></TR>");  
608 -  
609 - printgroupperm($default->owl_def_fold_security, "def_fold_security", $lang_owl_def_fold_sec, "user");  
610 -  
611 - 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>");  
612 - foreach($groups as $g)  
613 - {  
614 - print("<OPTION VALUE=$g[0] ");  
615 - if($g[0] == $default->owl_def_fold_group_owner)  
616 - print("SELECTED");  
617 - print(">$g[1]");  
618 - }  
619 - print("</SELECT></TD></TR>");  
620 -  
621 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_owl_def_fold_owner</TD><TD align=left><SELECT NAME=def_fold_owner>");  
622 - foreach($users as $g)  
623 - {  
624 - print("<OPTION VALUE=$g[0] ");  
625 - if($g[0] == $default->owl_def_fold_owner)  
626 - print("SELECTED");  
627 - print(">$g[1]");  
628 - }  
629 - print("</SELECT></TD></TR>");  
630 -  
631 - }  
632 - print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_other</TD></TR>");  
633 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_max_filesize</TD>  
634 - <TD align=left><INPUT TYPE=TEXT NAME=max_filesize VALUE='$default->max_filesize'></TD></TR>");  
635 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_owl_timeout</TD>  
636 - <TD align=left><INPUT TYPE=TEXT NAME=owl_timeout VALUE='$default->owl_timeout'></TD></TR>");  
637 -  
638 - //if expansion is true  
639 - if ( $default->expand == 1 )  
640 - {  
641 - 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>");  
642 - }  
643 - else  
644 - {  
645 - 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>");  
646 - }  
647 -  
648 - // if version control checked  
649 - if ( $default->owl_version_control == 1 )  
650 - {  
651 - 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>");  
652 - }  
653 - else  
654 - {  
655 - 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>");  
656 - }  
657 -  
658 - // restrict view checked if true  
659 - if ( $default->restrict_view == 1 )  
660 - {  
661 - 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>");  
662 - }  
663 - else  
664 - { 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>");  
665 - }  
666 -  
667 - print("<TR><TD BGCOLOR=$default->main_header_bgcolor align=CENTER colspan=2>$lang_owl_title_tools</TD></TR>");  
668 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_dbdump_path</TD>  
669 - <TD align=left><INPUT TYPE=TEXT NAME=dbdump_path VALUE='$default->dbdump_path' size=30></TD></TR>");  
670 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_gzip_path</TD>  
671 - <TD align=left><INPUT TYPE=TEXT NAME=gzip_path VALUE='$default->gzip_path' size=30></TD></TR>");  
672 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_owl_tar_path</TD>  
673 - <TD align=left><INPUT TYPE=TEXT NAME=tar_path VALUE='$default->tar_path' size=30></TD></TR>");  
674 - print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change></FORM>");  
675 -}  
676 -  
677 -//-------------------------------------------------------------  
678 -/**  
679 - * Function DoBackup()  
680 - *  
681 - * Does a backup by zipping relevant data  
682 - *  
683 - */  
684 -//-------------------------------------------------------------  
685 -// NOT Usable  
686 -function dobackup() {  
687 - global $default;  
688 -  
689 - $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";  
690 - $date = date("Ymd.Hms");  
691 -  
692 - header("Content-Disposition: attachment; filename=\"" . $default->owl_db_name . "-$date.sql.gz\"");  
693 - header("Content-Location: " . $default->owl_db_name . "-$date.sql.gz");  
694 - header("Content-Type: application/octet-stream");  
695 - //header("Content-Length: $fsize");  
696 - //header("Pragma: no-cache");  
697 - header("Expires: 0");  
698 - passthru($command);  
699 - exit();  
700 -  
701 -}  
702 -  
703 -  
704 -// if action has been selected..do it..  
705 -if($action) {  
706 - print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
707 - print("<TR><TD WIDTH=200 VALIGN=TOP>");  
708 - print("<TR>");  
709 - print("<TD ALIGN=LEFT WIDTH=33%>");  
710 - print uid_to_name($userid);  
711 - print(" : <A HREF='../index.php?login=logout&sess=$sess'>$lang_logout</A></TD>");  
712 - print("<TD ALIGN=CENTER WIDTH=33%> $lang_owl_admin</TD>");  
713 - 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>");  
714 - print("</TR>");  
715 - print("</TABLE>");  
716 - print("<HR WIDTH=$default->table_expand_width><BR>");  
717 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border><TR><TD WIDTH=200 VALIGN=TOP>");  
718 - print("<TABLE BORDER=$default->table_border><TR><TD align=left>");  
719 - 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>");  
720 - 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>");  
721 - 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>");  
722 - 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>");  
723 -  
724 - if (file_exists($default->dbdump_path) && file_exists($default->gzip_path))  
725 - {  
726 - 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>");  
727 - }  
728 - else {  
729 - 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>");  
730 - }  
731 -  
732 -// print("<A HREF='upgrade-users.php?sess=$sess'>$lang_upg_MD5</A><BR><BR>");  
733 - printusers();  
734 - print("<BR><BR>");  
735 - printgroups();  
736 - print("</TD></TR></TABLE>");  
737 - print("</TD><TD VALIGN=TOP>");  
738 - // if user action selected..print user  
739 - if(isset($owluser))  
740 - {  
741 - printuser($owluser);  
742 - }  
743 -  
744 - //if group action selected print group  
745 - if(isset($group))  
746 - {  
747 - printgroup($group);  
748 - }  
749 -  
750 - // if newgroup action slelected print the new group  
751 - if($action == "newgroup")  
752 - {  
753 - printnewgroup();  
754 - }  
755 -  
756 - // if the newuser action print the new user  
757 - if($action == "newuser")  
758 - {  
759 - printnewuser();  
760 - }  
761 -  
762 - //if the edit html action has been selected run the printHTML  
763 - if($action == "edhtml")  
764 - {  
765 - printhtml();  
766 - }  
767 -  
768 - // if edit preferences selected print the preferences  
769 - if($action == "edprefs")  
770 - {  
771 - printprefs();  
772 - }  
773 - print("</TD></TR></TABLE>");  
774 -}  
775 -else  
776 -{  
777 - exit("$lang_err_general");  
778 -}  
779 -  
780 -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>");  
781 -?>  
782 -<!-- BEGIN BUG FIX: #448241 HTML-Syntax-Error in admin/index.php -->  
783 -</BODY>  
784 -</HTML>  
785 -<!-- BEGIN BUG FIX: #448241 HTML-Syntax-Error in admin/index.php -->  
admin/upgrade-users.php deleted
1 -<?php  
2 -  
3 -/**  
4 - * upgrade-users.php  
5 - *  
6 - * This is used to upgrade a user's password  
7 - *  
8 - * Copyright (c) 1999-2002 The Owl Project Team  
9 - * Licensed under the GNU GPL. For full terms see the file COPYING.  
10 - * @version v 1.1.1.1 2002/12/04  
11 - * @author michael  
12 - * @package Owl  
13 - */  
14 -  
15 -require("../config/owl.php");  
16 -require("../lib/owl.lib.php");  
17 -require("../config/html.php");  
18 -  
19 -// this page is used to upgrade a user's password  
20 -print("<CENTER>");  
21 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
22 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
23 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
24 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
25 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
26 -print("<BR>DO NOT RUN THIS AGAIN</CENTER><BR><BR>");  
27 -print("Running through $default->owl_users_table<BR>");  
28 -$sql = new Owl_DB;  
29 -$sql->query("select * from $default->owl_users_table");  
30 -$sqlupd = new Owl_DB;  
31 -while($sql->next_record())  
32 -{  
33 - $userid = $sql->f("id");  
34 - $password = $sql->f("password");  
35 - if (strlen($password) <> 32)  
36 - {  
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 - }  
40 - else  
41 - {  
42 - print "ALREADY UPGRADED -> $userid: ".$sql->f("username")."<BR>";  
43 - }  
44 -}  
45 -print("DONE<BR><BR><CENTER>");  
46 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
47 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
48 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
49 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
50 -print("********************** WARNING WARNING WARNING ****************************<BR>");  
51 -print("<BR>DO NOT RUN THIS AGAIN</CENTER><BR>");  
browse.php deleted
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 -?>  
dbmodify.php deleted
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 deleted
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 -?>  
index.php deleted
1 -<?php  
2 -  
3 -/**  
4 - * index.php -- Main page  
5 - *  
6 - * This is the main login page  
7 - * Does some user verification and authentication as well as  
8 - * Determining the Role of the User logging in (i.e. Admin or user)  
9 - *  
10 - * Creates a new session for the user for duration of usage  
11 - *  
12 - * Licensed under the GNU GPL. For full terms see the file COPYING.  
13 - *  
14 - * @version v 1.1.1.1 2002/12/04  
15 - * @Copyright (c) 1999-2002 The Owl Project Team  
16 - * @author michael  
17 - * @package test  
18 - */  
19 -  
20 -require("./config/owl.php");  
21 -require("./lib/owl.lib.php");  
22 -require("./config/html.php");  
23 -  
24 -//check the requirements  
25 -if (checkrequirements() == 1)  
26 -{  
27 -exit;  
28 -}  
29 -/*  
30 -* $failure is a counter to the number of times the user has tried to  
31 -* login.  
32 -*/  
33 -if(!isset($failure))  
34 -{  
35 - $failure = 0;  
36 -}  
37 -if(!$login)  
38 -{  
39 - $login = 1;  
40 -}  
41 -  
42 -// if requirements are met  
43 -if($loginname && $password)  
44 -{  
45 - //Verifies the Login and password of the user  
46 - $verified["bit"] = 0;  
47 - $verified = verify_login($loginname, $password);  
48 - if ($verified["bit"] == 1)  
49 - {  
50 - // if verified open a new session  
51 - $session = new Owl_Session;  
52 - $uid = $session->Open_Session(0,$verified["uid"]);  
53 - /*  
54 - $sql = new Owl_DB;  
55 - $sql->query("select * from $default->owl_folders_table where parent = '2' and name = '$loginname'");  
56 - while($sql->next_record()) $id = $sql->f("id");  
57 - */  
58 - $id = 1;  
59 -  
60 - /* BEGIN Admin Change */  
61 -  
62 - /* If an admin signs on We want to se the admin menu  
63 - Not the File Browser. */  
64 - if ( $verified["group"] == 0)  
65 - {  
66 - // if admin logs on..goto the admin main page  
67 - // else goto the normal file browser page  
68 - if(!isset($fileid))  
69 - {  
70 - header("Location: admin/index.php?sess=". $uid->sessdata["sessid"]);  
71 - }  
72 - else  
73 - {  
74 - header("Location: browse.php?sess=". $uid->sessdata["sessid"]."&parent=$parent&fileid=$fileid");  
75 - }  
76 - }  
77 - else  
78 - {  
79 - if(!isset($fileid))  
80 - {  
81 - header("Location: browse.php?sess=". $uid->sessdata["sessid"]);  
82 - }  
83 - else  
84 - {  
85 - header("Location: browse.php?sess=". $uid->sessdata["sessid"]."&parent=$parent&fileid=$fileid");  
86 - }  
87 - }  
88 - /* END Admin Change */  
89 -  
90 - }  
91 - else  
92 - {//normal user..check failures  
93 - if ($verified["bit"] == 2)  
94 - {  
95 - header("Location: index.php?login=1&failure=2");  
96 - }  
97 - else if ($verified["bit"] == 3 )  
98 - {  
99 - header("Location: index.php?login=1&failure=3");  
100 - }  
101 - else  
102 - {  
103 - header("Location: index.php?login=1&failure=1");  
104 - }  
105 - }  
106 -}  
107 -  
108 -//  
109 -if(($login == 1) || ($failure == 1))  
110 - {  
111 - include("./lib/header.inc");  
112 - print("<CENTER>");  
113 -// BUG Number: 457588  
114 -// This is to display the version inforamation  
115 -// BEGIN  
116 - 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>");  
117 -// END  
118 - if($failure == 1)  
119 - {  
120 - print("<BR>$lang_loginfail<BR>");  
121 - }  
122 - if($failure == 2)  
123 - {  
124 - print("<BR>$lang_logindisabled<BR>");  
125 - }  
126 - if($failure == 3)  
127 - {  
128 - print("<BR>$lang_toomanysessions<BR>");  
129 - }  
130 - print "<FORM ACTION=index.php METHOD=POST>";  
131 -  
132 - if (isset($fileid))  
133 - {  
134 - print "<INPUT TYPE=HIDDEN NAME=parent value=$parent>";  
135 - print "<INPUT TYPE=HIDDEN NAME=fileid value=$fileid>";  
136 - }  
137 -  
138 - print "<TABLE><TR><TD>$lang_username:</TD><TD><INPUT TYPE=TEXT NAME=loginname><BR></TD></TR>";  
139 - print "<TR><TD>$lang_password:</TD><TD><INPUT TYPE=PASSWORD NAME=password><BR></TD></TR></TABLE>";  
140 - print "<INPUT TYPE=SUBMIT Value=$lang_login>\n";  
141 - print "<BR><BR><HR WIDTH=300>";  
142 - exit;  
143 -}  
144 -// when the user logouts the session is deleted from the session table  
145 -if($login == "logout")  
146 -{  
147 - include("./lib/header.inc");  
148 - print("<CENTER>");  
149 -// BUG Number: 457588  
150 -// This is to display the version inforamation  
151 -// BEGIN  
152 - 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>");  
153 -// END  
154 - $sql = new Owl_DB;  
155 - $sql->query("delete from $default->owl_sessions_table where sessid = '$sess'");  
156 - print("<BR>$lang_successlogout<BR>");  
157 - print "<FORM ACTION=index.php METHOD=POST>";  
158 - print "<TABLE><TR><TD>$lang_username:</TD><TD><INPUT TYPE=TEXT NAME=loginname><BR></TD></TR>";  
159 - print "<TR><TD>$lang_password:</TD><TD><INPUT TYPE=PASSWORD NAME=password><BR></TD></TR></TABLE>";  
160 - print "<INPUT TYPE=SUBMIT Value=$lang_login>\n";  
161 - print "<BR><BR><HR WIDTH=300>";  
162 - exit;  
163 -}  
164 -include("./lib/footer.inc");  
165 -?>  
log.php deleted
1 -<?php  
2 -  
3 -/**  
4 - * log.php  
5 - *  
6 - * Used for Revision history and logs when the changes occurred  
7 - *  
8 - * Copyright (c) 1999-2002 The Owl Project Team  
9 - * Licensed under the GNU GPL. For full terms see the file COPYING.  
10 - * @version v 1.1.1.1 2002/12/04  
11 - * @author michael  
12 - * @package test  
13 - */  
14 -  
15 -  
16 -require("./config/owl.php");  
17 -require("./lib/owl.lib.php");  
18 -require("./config/html.php");  
19 -require("./lib/security.lib.php");  
20 -include("./lib/header.inc");  
21 -  
22 -// store file name and extension separately  
23 -$filesearch = explode('.',$filename);  
24 -  
25 -// Begin 496814 Column Sorts are not persistant  
26 -// + ADDED &order=$order&$sortorder=$sortname to  
27 -// all browse.php? header and HREF LINES  
28 -  
29 -// responsible for determining the order of information  
30 -switch ($order) {  
31 - case "name":  
32 - $sortorder = 'sortname';  
33 - break;  
34 - case "major_revision":  
35 - $sortorder = 'sortver';  
36 - break;  
37 - case "filename" :  
38 - $sortorder = 'sortfilename';  
39 - break;  
40 - case "size" :  
41 - $sortorder = 'sortsize';  
42 - break;  
43 - case "creatorid" :  
44 - $sortorder = 'sortposted';  
45 - break;  
46 - case "smodified" :  
47 - $sortorder = 'sortmod';  
48 - break;  
49 - case "checked_out":  
50 - $sortorder = 'sortcheckedout';  
51 - break;  
52 - default:  
53 - break;  
54 -}  
55 -  
56 -// END 496814 Column Sorts are not persistant  
57 -print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
58 -?>  
59 -<TR><TD ALIGN=LEFT>  
60 -<?php print("$lang_user: ");  
61 -  
62 - if(prefaccess($userid))  
63 - {  
64 - print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand&order=$order&sortname=$sortname'>");  
65 - }  
66 - print uid_to_name($userid);  
67 - print ("</A>");  
68 -?>  
69 -  
70 -<FONT SIZE=-1>  
71 -<?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>  
72 - </FONT></TD><TD ALIGN=RIGHT>  
73 -<?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>");?>  
74 - </A></TD></TR></TABLE>  
75 -<?php  
76 -  
77 -print("<CENTER>");  
78 - // generates a navigation bar and provides details for the docs  
79 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>");  
80 - print("<TR><TD align=left>$lang_viewlog ".gen_navbar($parent)."/".flid_to_name($id)."</TD></TR>");  
81 - print("</TABLE><HR WIDTH=$default->table_expand_width><BR>$filename");  
82 -  
83 - print ("<TABLE width=$default->table_expand_width border=$default->table_border cellpadding=3 cellspacing=0>  
84 - <TR><TD BGCOLOR='$default->table_header_bg' width=5%>$lang_ver</td>  
85 - <TD BGCOLOR='$default->table_header_bg' width=10%>$lang_user</TD>  
86 - <TD BGCOLOR='$default->table_header_bg' width=60%>$lang_log_file</TD>  
87 - <TD BGCOLOR='$default->table_header_bg' width=25%>$lang_modified</TD></TR>");  
88 -  
89 - $sql = new Owl_DB;  
90 -  
91 -  
92 -// SPECIFIC SQL LOG QUERY - NOT USED (problematic)  
93 -// This SQL log query is designed for repository assuming there is only 1  
94 -// digit in major revision, and noone decides to have a "_x-" in their  
95 -// filename.  
96 -//  
97 -// Has to be changed if the naming structure changes.  
98 -// Also a problem that it didn't catch the "current"  
99 -// file because of the "_x-" matching (grr)  
100 -//  
101 -//$sql->query("select * from $default->owl_files_table where filename LIKE '$filesearch[0]\__-%$filesearch[1]' order by major_revision desc, minor_revision desc");  
102 -  
103 -// GENERIC SQL LOG QUERY - currently used.  
104 -// prone to errors when people name a set of docs  
105 -// Blah.doc  
106 -// Blah_errors.doc  
107 -// Blah_standards.doc  
108 -// etc. and search for a log on Blah.doc (it brings up all 3 docs)  
109 -  
110 -//$sql->query("select * from $default->owl_files_table where filename LIKE '$filesearch[0]%$filesearch[1]' order by major_revision desc, minor_revision desc");  
111 -//$SQL = "select * from $default->owl_files_table where filename LIKE '$filesearch[0]%$filesearch[1]' order by major_revision desc, minor_revision desc";  
112 -//printError("PARENT: $parent",$SQL);  
113 -  
114 -if ($default->owl_use_fs)  
115 -{  
116 - $sql->query("Select id from $default->owl_folders_table where name='backup' and parent='$parent'");  
117 - while($sql->next_record()) {  
118 - $backup_parent = $sql->f("id");  
119 - }  
120 - $sql->query("select * from $default->owl_files_table where filename LIKE '$filesearch[0]%$filesearch[1]' AND (parent = $backup_parent OR parent = $parent) order by major_revision desc, minor_revision desc");  
121 -  
122 -}  
123 -else  
124 -{  
125 -// name based query -- assuming that the given name for the file doesn't change...  
126 -  
127 - $name = flid_to_name($id);  
128 - $sql->query("select * from $default->owl_files_table where name='$name' AND parent='$parent' order by major_revision desc, minor_revision desc");  
129 -}  
130 -  
131 -//global $sess;  
132 -// prints out all the relevant information on the specific document  
133 - while($sql->next_record())  
134 - {  
135 - $choped = split("\.", $sql->f("filename"));  
136 - $pos = count($choped);  
137 - $ext = strtolower($choped[$pos-1]);  
138 -  
139 - print("<TR><TD valign=top>".$sql->f("major_revision").".".$sql->f("minor_revision")."</TD>  
140 - <TD valign=top>".uid_to_name($sql->f("creatorid"))."</TD>  
141 - <TD valign=top align=left><font size=2 style='font-weight:bold'>");  
142 - printFileIcons($sql->f("id"),$sql->f("filename"),$sql->f("checked_out"),$sql->f("url"),$default->owl_version_control,$ext);  
143 - print("&nbsp&nbsp[ ".$sql->f("filename")." ]</font><br>  
144 - <pre>".$sql->f("description")."</></TD>  
145 - <TD valign=top>".$sql->f("modified")."</TD></TR>");  
146 - }  
147 -  
148 - //print("<TR><TD valign=top>".$sql->f("major_revision").".".$sql->f("minor_revision")."</TD>  
149 - //<TD valign=top>".uid_to_name($sql->f("creatorid"))."</TD>  
150 - //<TD valign=top><font style='font-weight:bold'>[ ".$sql->f("filename")." ]</font><br>  
151 - //<pre>".$sql->f("description")."</></TD>  
152 - //<TD valign=top>".$sql->f("modified")."</TD></TR>");  
153 - //}  
154 - print("</TABLE>");  
155 - include("./lib/footer.inc");  
156 -  
157 -?>  
modify.php deleted
1 -<?php  
2 -  
3 -/*  
4 - * modify.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 -//print("<H1>MODIFY Sess: $sess<BR> Loginname: $loginname<BR> Login:$login</H1>");  
13 -  
14 -require("./config/owl.php");  
15 -require("./lib/owl.lib.php");  
16 -require("./config/html.php");  
17 -require("./lib/security.lib.php");  
18 -  
19 -include("./lib/header.inc");  
20 -// Begin 496814 Column Sorts are not persistant  
21 -// + ADDED &order=$order&$sortorder=$sortname to  
22 -// all browse.php? header and HREF LINES  
23 -  
24 -  
25 -switch ($order) {  
26 - case "name":  
27 - $sortorder = 'sortname';  
28 - break;  
29 - case "major_revision":  
30 - $sortorder = 'sortver';  
31 - break;  
32 - case "filename" :  
33 - $sortorder = 'sortfilename';  
34 - break;  
35 - case "size" :  
36 - $sortorder = 'sortsize';  
37 - break;  
38 - case "creatorid" :  
39 - $sortorder = 'sortposted';  
40 - break;  
41 - case "smodified" :  
42 - $sortorder = 'sortmod';  
43 - break;  
44 - case "checked_out":  
45 - $sortorder = 'sortcheckedout';  
46 - break;  
47 - default:  
48 - break;  
49 -}  
50 -  
51 -// END 496814 Column Sorts are not persistant  
52 -  
53 -print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
54 -?>  
55 -<TR><TD ALIGN=LEFT>  
56 -<?php print("$lang_user: ");  
57 - if(prefaccess($userid)) {  
58 - print("<A HREF='prefs.php?owluser=$userid&sess=$sess&parent=$parent&expand=$expand&order=$order&sortname=$sortname'>");  
59 - }  
60 - //print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");  
61 - print uid_to_name($userid);  
62 - print ("</A>");  
63 -?>  
64 -<FONT SIZE=-1>  
65 -  
66 -<?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>  
67 - </FONT></TD><TD ALIGN=RIGHT>  
68 -<?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>");?>  
69 - </A></TD></TR></TABLE>  
70 -<?php  
71 -  
72 -print("<CENTER>");  
73 -  
74 -if ($action == "file_update") {  
75 - if(check_auth($id, "file_modify", $userid) == 1) {  
76 - print("<BR>");  
77 - $expand = 1;  
78 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>");  
79 - print("<TR><TD align=left>$lang_updating ".gen_navbar($parent)."/".flid_to_name($id)."</TD></TR>");  
80 - print("</TABLE><HR WIDTH=$default->table_expand_width><BR>");  
81 - print("<FORM enctype='multipart/form-data' ACTION='dbmodify.php' METHOD=POST>  
82 - <INPUT TYPE=HIDDEN NAME=order VALUE='$order'>  
83 - <INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>  
84 - <INPUT TYPE=HIDDEN NAME=sess VALUE='$sess'>  
85 - <INPUT TYPE=HIDDEN NAME=parent VALUE=$parent>  
86 - <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE='$default->max_filesize'>  
87 - <INPUT TYPE=HIDDEN NAME=action VALUE=file_update>  
88 - <INPUT TYPE=HIDDEN NAME=id VALUE='$id'>");  
89 -// BUG FIX: #449395 expanded/collapse view bugs  
90 - print("<INPUT TYPE=HIDDEN NAME=expand VALUE='$expand'>");  
91 -// END BUG FIX: #449395 expanded/collapse view bugs  
92 - print("<TABLE BORDER=$default->table_border><TR><TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_sendthisfile</TD><TD align=left><input name='userfile' type='file'></TD></TR>");  
93 - // begin Daphne change - version control  
94 - if ($default->owl_version_control == 1) {  
95 - print("<TR align=left><TD ALIGN=RIGHT bgcolor=$default->table_header_bg valign=top>$lang_vertype</td>  
96 - <td><SELECT NAME=versionchange>  
97 - <OPTION VALUE=major_revision>$lang_vermajor  
98 - <OPTION selected VALUE=minor_revision>$lang_verminor</select></td></tr>");  
99 - print("<tr><TD align=right bgcolor=$default->table_header_bg valign=top>$lang_verdescription  
100 - </td>  
101 - <td align=left><textarea name=newdesc rows=5 cols=30 wrap=hard></textarea></tr>");  
102 - }  
103 - // End Daphne Change  
104 - print("</TABLE><INPUT TYPE=SUBMIT VALUE='$lang_sendfile'></FORM>");  
105 - include("./lib/footer.inc");  
106 - } else {  
107 - print($lang_noupload);  
108 - }  
109 -}  
110 -  
111 -if ($action == "file_upload") {  
112 -  
113 - if(check_auth($parent, "folder_modify", $userid) == 1) {  
114 - $expand = 1;  
115 -  
116 - /* BEGIN Bozz Change  
117 - Retrieve Group information if the user is in the  
118 - Administrator group */  
119 -  
120 - if ( owlusergroup($userid) == 0 ) {  
121 - $sql = new Owl_DB;  
122 - $sql->query("select id,name from $default->owl_groups_table");  
123 - $i=0;  
124 - while($sql->next_record()) {  
125 - $groups[$i][0] = $sql->f("id");  
126 - $groups[$i][1] = $sql->f("name");  
127 - $i++;  
128 - }  
129 - }  
130 - else {  
131 - $sql = new Owl_DB;  
132 - $sql->query("select userid,groupid from $default->owl_users_grpmem_table where userid = $userid ");  
133 - if ($sql->num_rows($sql) == 0)  
134 - $sql->query("SELECT u.groupid as groupid, g.name as name from $default->owl_users_table as u join $default->owl_groups_table as g where u.id = $userid and u.groupid = g.id");  
135 - $i=0;  
136 - while($sql->next_record()) {  
137 - $groups[$i][0] = $sql->f("groupid");  
138 - $groups[$i][1] = group_to_name($sql->f("groupid"));  
139 - $i++;  
140 - }  
141 - }  
142 - /* END Bozz Change */  
143 -  
144 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>");  
145 - print("<TR><TD align=left>$lang_addingfile".gen_navbar($parent)."</TD></TR>");  
146 - print("</TABLE><HR WIDTH=$default->table_expand_width><BR>");  
147 - print("<FORM enctype= 'multipart/form-data' ACTION='dbmodify.php' METHOD=POST>  
148 - <INPUT TYPE=HIDDEN NAME=sess VALUE='$sess'><INPUT TYPE=HIDDEN NAME=parent VALUE=$parent>  
149 - <INPUT TYPE=HIDDEN NAME=order VALUE='$order'>  
150 - <INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>  
151 - <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE='$default->max_filesize'>  
152 - <INPUT TYPE=HIDDEN NAME=action VALUE=file_upload>  
153 - <INPUT TYPE=HIDDEN NAME=expand VALUE=$expand>  
154 - <INPUT TYPE=HIDDEN NAME=type VALUE=$type>  
155 - <TABLE BORDER=$default->table_border><TR>");  
156 -  
157 - if ($type == "url")  
158 - print("<TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_sendthisurl:</TD><TD align=left><input name='userfile' type='text'size='80'></TD></TR>");  
159 - else  
160 - print("<TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_sendthisfile:</TD><TD align=left><input name='userfile' type='file'></TD></TR>");  
161 -  
162 - print("<TR><TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_title:</TD><TD align=left><INPUT TYPE=TEXT NAME=title></TD></TR>  
163 - <TR><TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_keywords:</TD><TD align=left><INPUT TYPE=TEXT NAME=metadata></TD></TR>");  
164 -  
165 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownergroup:</TD><TD align=left><SELECT NAME=groupid>");  
166 - if(isset($groupid))  
167 - {  
168 - print("<OPTION VALUE=".$sql->f("groupid").">".group_to_name($sql->f("groupid")));  
169 - }  
170 - foreach($groups as $g) {  
171 - print("<OPTION VALUE=$g[0]>$g[1]");  
172 - }  
173 - printfileperm("4", "security", $lang_permissions, "admin");  
174 -  
175 - print("<TR><TD ALIGN=RIGHT VALIGN=TOP bgcolor=$default->table_header_bg>");  
176 - // Daphne Change - add wrap=hard to textarea for logs  
177 - print("$lang_description:</TD><TD align=left><TEXTAREA NAME=description ROWS=10 COLS=50 WRAP=hard></TEXTAREA></TD></TR>  
178 - </TABLE><INPUT TYPE=SUBMIT VALUE='$lang_sendfile'></FORM>");  
179 - include("./lib/footer.inc");  
180 - } else {  
181 - print($lang_noupload);  
182 - }  
183 -}  
184 -  
185 -if ($action == "file_modify") {  
186 - if(check_auth($id, "file_modify", $userid) == 1) {  
187 - $expand = 1;  
188 -  
189 - /* BEGIN Bozz Change  
190 - Retrieve Group information if the user is in the  
191 - Administrator group */  
192 -  
193 - if ( owlusergroup($userid) == 0 ) {  
194 - $sql = new Owl_DB;  
195 - $sql->query("select id,name from $default->owl_groups_table");  
196 - $i=0;  
197 - while($sql->next_record()) {  
198 - $groups[$i][0] = $sql->f("id");  
199 - $groups[$i][1] = $sql->f("name");  
200 - $i++;  
201 - }  
202 - $sql->query("select id,name from $default->owl_users_table");  
203 - $i=0;  
204 - while($sql->next_record()) {  
205 - $users[$i][0] = $sql->f("id");  
206 - $users[$i][1] = $sql->f("name");  
207 - $i++;  
208 - }  
209 - }  
210 - else {  
211 - if (uid_to_name($userid) == fid_to_creator($id)) {  
212 - $sql = new Owl_DB;  
213 - $sql->query("select userid,groupid from $default->owl_users_grpmem_table where userid = $userid ");  
214 - if ($sql->num_rows($sql) == 0)  
215 - $sql->query("SELECT u.groupid as groupid, g.name as name from $default->owl_users_table as u join $default->owl_groups_table as g where u.id = $userid and u.groupid = g.id");  
216 - $i=0;  
217 - while($sql->next_record()) {  
218 - $groups[$i][0] = $sql->f("groupid");  
219 - $groups[$i][1] = group_to_name($sql->f("groupid"));  
220 - $i++;  
221 - }  
222 - $mygroup = owlusergroup($userid);  
223 - $sql->query("select id,name from $default->owl_users_table where groupid='$mygroup'");  
224 - $i=0;  
225 - while($sql->next_record()) {  
226 - $users[$i][0] = $sql->f("id");  
227 - $users[$i][1] = $sql->f("name");  
228 - $i++;  
229 - }  
230 - }  
231 - }  
232 -  
233 - /* END Bozz Change */  
234 -  
235 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>");  
236 - print("<TR><TD align=left>$lang_modifying".gen_navbar($parent)."/".flid_to_name($id)."</TD></TR>");  
237 - print("</TABLE><HR WIDTH=$default->table_expand_width><BR>");  
238 - $sql = new Owl_DB; $sql->query("select * from $default->owl_files_table where id = '$id'");  
239 - while($sql->next_record()) {  
240 - print("<TABLE WIDTH=66% BORDER=$default->table_border><FORM ACTION='dbmodify.php'><TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>  
241 - $lang_title:</TD><TD align=left><INPUT TYPE=TEXT NAME=title VALUE=\"".$sql->f("name")."\"></TD></TR>  
242 - <TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_file:</TD><TD align=left>".$sql->f("filename")."&nbsp;(".gen_filesize($sql->f("size")).")</TD></TR>");  
243 - // Bozz Change Begin  
244 -  
245 -  
246 -  
247 - $security = $sql->f("security");  
248 - $current_groupid = owlfilegroup($id);  
249 - $current_owner = owlfilecreator($id);  
250 -  
251 - if ( owlusergroup($userid) == 0 || uid_to_name($userid) == fid_to_creator($id))  
252 - {  
253 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownership:</TD><TD align=left><SELECT NAME=file_owner>");  
254 - foreach($users as $g) {  
255 - print("<OPTION VALUE=$g[0] ");  
256 - if($g[0] == owlfilecreator($id))  
257 - print("SELECTED");  
258 - print(">$g[1]");  
259 - }  
260 - print("</SELECT></TD></TR>");  
261 -  
262 -print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownergroup:</TD><TD align=left><SELECT NAME=groupid>");  
263 - //print("<OPTION VALUE=$groupid>".group_to_name($sql->f("groupid")));  
264 - foreach($groups as $g) {  
265 - print("<OPTION VALUE=$g[0] ");  
266 - if($g[0] == $current_groupid)  
267 - print("SELECTED");  
268 - print(">$g[1]");  
269 - }  
270 - print("</SELECT></TD></TR>");  
271 - printfileperm($security, "security", "$lang_permissions:","admin");  
272 - }  
273 - else  
274 - {  
275 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownership:</TD><TD align=left>".fid_to_creator($id)."&nbsp;(".group_to_name(owlfilegroup($id)).")</TD></TR>");  
276 - print("<INPUT TYPE=HIDDEN NAME=file_owner VALUE='$current_owner'>");  
277 - print("<INPUT TYPE=HIDDEN NAME=security VALUE='$security'>");  
278 - print("<INPUT TYPE=HIDDEN NAME=groupid VALUE='$current_groupid'>");  
279 - }  
280 - // Bozz change End  
281 - //print("</SELECT></TD></TR>  
282 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_keywords:</TD><TD align=left><INPUT TYPE=TEXT NAME=metadata VALUE='".$sql->f("metadata")."'></TD></TR>  
283 - <TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg VALIGN=TOP>  
284 - $lang_description:</TD><TD align=left><TEXTAREA NAME=description ROWS=10 COLS=50>".$sql->f("description")."</TEXTAREA>  
285 - <INPUT TYPE=HIDDEN NAME=action VALUE=file_modify>  
286 - <INPUT TYPE=HIDDEN NAME=order VALUE='$order'>  
287 - <INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>  
288 - <INPUT TYPE=HIDDEN NAME=id VALUE=$id>  
289 - <INPUT TYPE=HIDDEN NAME=sess VALUE='$sess'>  
290 - <INPUT TYPE=HIDDEN NAME=parent VALUE=$parent></TD></TR></TABLE>  
291 - <INPUT TYPE=HIDDEN NAME=expand VALUE=$expand>  
292 - <BR><INPUT TYPE=SUBMIT VALUE=$lang_change><INPUT TYPE=RESET VALUE=$lang_reset></FORM>");  
293 - include("./lib/footer.inc");  
294 - }  
295 - } else {  
296 - print("<BR><BR>".$lang_nofilemod);  
297 - }  
298 -}  
299 -  
300 -if ($action == "folder_create") {  
301 - if(check_auth($parent, "folder_modify", $userid) == 1) {  
302 - $expand=1;  
303 -  
304 - /* BEGIN Bozz Change  
305 - Retrieve Group information if the user is in the  
306 - Administrator group */  
307 -  
308 -  
309 -  
310 - $sql = new Owl_DB;  
311 - if ( owlusergroup($userid) == 0 ) {  
312 - $sql->query("SELECT id,name from $default->owl_groups_table");  
313 - }  
314 - else {  
315 - $sql->query("SELECT * from $default->owl_users_grpmem_table join $default->owl_groups_table where id = groupid and userid = $userid");  
316 - if ($sql->num_rows($sql) == 0)  
317 - $sql->query("SELECT u.groupid as id, g.name as name from $default->owl_users_table as u join $default->owl_groups_table as g where u.id = $userid and u.groupid = g.id");  
318 - }  
319 - $i=0;  
320 - while($sql->next_record()) {  
321 - $groups[$i][0] = $sql->f("id");  
322 - $groups[$i][1] = $sql->f("name");  
323 - $i++;  
324 - }  
325 -  
326 - /* END Bozz Change */  
327 -  
328 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border><TR><TD align=left>$lang_addingfolder ".gen_navbar($parent)."</TD></TR></TABLE><HR WIDTH=$default->table_expand_width><BR>  
329 - <TABLE WIDTH=50% BORDER=$default->table_border><TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_name:</TD><TD align=left><FORM ACTION='dbmodify.php'>  
330 - <INPUT TYPE=HIDDEN NAME=parent VALUE=$parent><INPUT TYPE=HIDDEN NAME=expand VALUE=$expand>  
331 - <INPUT TYPE=HIDDEN NAME=action VALUE=folder_create><INPUT TYPE=TEXT NAME=name></TD></TR>  
332 - <INPUT TYPE=HIDDEN NAME=sess VALUE='$sess'>  
333 - <INPUT TYPE=HIDDEN NAME=order VALUE='$order'>  
334 - <INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>  
335 - <INPUT TYPE=HIDDEN NAME=expand VALUE='$expand'>");  
336 -  
337 - /* BEGIN Bozz Change  
338 - Display Retrieved Group information if the user is in the  
339 - Administrator group */  
340 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownergroup:</TD><TD align=left><SELECT NAME=groupid>");  
341 - foreach($groups as $g) {  
342 - print("<OPTION VALUE=$g[0]>$g[1]");  
343 - }  
344 - if ( owlusergroup($userid) == 0 )  
345 - printgroupperm(54, "policy", $lang_policy, "admin");  
346 - else  
347 - printgroupperm(54, "policy", $lang_policy, "user");  
348 - /* END Bozz Change */  
349 - print("</TABLE><INPUT TYPE=SUBMIT VALUE=$lang_create></FORM>");  
350 - include("./lib/footer.inc");  
351 - } else {  
352 - print($lang_nosubfolder);  
353 - }  
354 -}  
355 -  
356 -if ($action == "folder_modify") {  
357 - if(check_auth($id, "folder_property", $userid) == 1) {  
358 - $expand=1;  
359 -  
360 - /* BEGIN Bozz Change  
361 - Retrieve Group information if the user is in the  
362 - Administrator group */  
363 -  
364 - if ( owlusergroup($userid) == 0 ) {  
365 - $sql = new Owl_DB;  
366 - $sql->query("select id,name from $default->owl_groups_table");  
367 - $i=0;  
368 - while($sql->next_record()) {  
369 - $groups[$i][0] = $sql->f("id");  
370 - $groups[$i][1] = $sql->f("name");  
371 - $i++;  
372 - }  
373 - }  
374 - /* END Bozz Change */  
375 -  
376 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>");  
377 - print("<TR><TD align=left>$lang_modifying ".gen_navbar($id)."</TD></TR>");  
378 - print("</TABLE><HR WIDTH=$default->table_expand_width><BR><TABLE WIDTH=50% BORDER=$default->table_border>");  
379 - $sql = new Owl_DB; $sql->query("select * from $default->owl_folders_table where id = '$id'");  
380 - while($sql->next_record()) {  
381 - $security = $sql->f("security");  
382 -  
383 - print("<FORM ACTION='dbmodify.php'><INPUT TYPE=HIDDEN NAME=action VALUE=folder_modify>");  
384 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_name:</TD><TD align=left><INPUT TYPE=TEXT NAME=name VALUE='".$sql->f("name")."'></TD></TR>");  
385 - //print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_policy:</TD><TD align=left>$security</TD></TR>");  
386 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownership:</TD><TD align=left>".uid_to_name(owlfoldercreator($id))."&nbsp;(".group_to_name(owlfoldergroup($id)).")</TD></TR>  
387 - <INPUT TYPE=HIDDEN NAME=id VALUE=$id>  
388 - <INPUT TYPE=HIDDEN NAME=order VALUE='$order'>  
389 - <INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>  
390 - <INPUT TYPE=HIDDEN NAME=parent VALUE=$parent>  
391 - <INPUT TYPE=HIDDEN NAME=expand VALUE=$expand>");  
392 -  
393 - /* BEGIN Bozz Change  
394 - Display Retrieved Group information if the user is in the  
395 - Administrator group */  
396 - if ( owlusergroup($userid) == 0 )  
397 - {  
398 - print("<TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownergroup:</TD><TD align=left><SELECT NAME=groupid>");  
399 - print("<OPTION VALUE=".$sql->f("groupid").">".group_to_name($sql->f("groupid")));  
400 - foreach($groups as $g) {  
401 - print("<OPTION VALUE=$g[0]>$g[1]");  
402 - }  
403 - printgroupperm($security, "policy", $lang_policy, "admin");  
404 - }  
405 - else  
406 - {  
407 - printgroupperm($security, "policy", $lang_policy, "user");  
408 - }  
409 - /* END Bozz Change */  
410 -  
411 - print("</TABLE><INPUT TYPE=SUBMIT VALUE=$lang_change><INPUT TYPE=RESET VALUE=$lang_reset>  
412 - <INPUT TYPE=HIDDEN NAME=sess VALUE='$sess'></FORM></TABLE>");  
413 - include("./lib/footer.inc");  
414 -  
415 - }  
416 - } else {  
417 - print($lang_nofoldermod);  
418 - }  
419 -}  
420 -  
421 -if ($action == "file_email") {  
422 - if(check_auth($id, "file_modify", $userid) == 1) {  
423 - print("<BR>");  
424 - $expand = 1;  
425 -  
426 - $sql = new Owl_DB;  
427 - $sql->query("select * from $default->owl_users_table where id = '$userid'");  
428 - $sql->next_record();  
429 - $default_reply_to = $sql->f("email");  
430 -  
431 - print("<FORM ACTION='./dbmodify.php' METHOD=POST>");  
432 - print("<INPUT TYPE=HIDDEN NAME=id VALUE=".$sql->f("id").">");  
433 -  
434 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>");  
435 - print("<TR><TD align=left>$lang_emailing ".gen_navbar($parent)."/".flid_to_name($id)."</TD></TR>");  
436 - print("</TABLE><HR WIDTH=$default->table_expand_width><BR>");  
437 - print("<FORM enctype='multipart/form-data' ACTION='dbmodify.php' METHOD=POST>  
438 - <INPUT TYPE=HIDDEN NAME=order VALUE='$order'>  
439 - <INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>  
440 - <INPUT TYPE=HIDDEN NAME=sess VALUE='$sess'>  
441 - <INPUT TYPE=HIDDEN NAME=parent VALUE=$parent>  
442 - <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE='$default->max_filesize'>  
443 - <INPUT TYPE=HIDDEN NAME=action VALUE=file_email>  
444 - <INPUT TYPE=HIDDEN NAME=type VALUE='$type'>  
445 - <INPUT TYPE=HIDDEN NAME=id VALUE='$id'>");  
446 -  
447 - print("<INPUT TYPE=HIDDEN NAME=expand VALUE='$expand'>");  
448 - print("<TABLE BORDER=$default->table_border><TR><TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_email_to</TD><TD align=left><INPUT TYPE=TEXT NAME=mailto></TD></TR>  
449 - <TR><TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_email_cc</TD><TD align=left><INPUT TYPE=TEXT NAME=ccto></TD></TR>  
450 - <TR><TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_email_reply_to</TD><TD align=left><INPUT TYPE=TEXT NAME=replyto VALUE='$default_reply_to'></TD></TR>  
451 - <TR><TD ALIGN=RIGHT bgcolor=$default->table_header_bg>$lang_email_subject</TD><TD align=left><INPUT TYPE=TEXT NAME=subject size=80></TD></TR>");  
452 - print("<tr><TD align=right bgcolor=$default->table_header_bg valign=top>$lang_email_body</td>  
453 - <td align=left><textarea name=mailbody rows=20 cols=80 wrap=hard></textarea></tr>");  
454 - print("</TABLE><INPUT TYPE=SUBMIT VALUE='$lang_sendfile'></FORM>");  
455 - include("./lib/footer.inc");  
456 - } else {  
457 - print($lang_noemail);  
458 - }  
459 -}  
460 -  
461 -?>  
move.php deleted
1 -<?php  
2 -  
3 -/*  
4 - * move.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 -//  
18 -global $order, $sortorder, $sortname;  
19 -switch ($order) {  
20 - case "name":  
21 - $sortorder = 'sortname';  
22 - break;  
23 - case "major_revision":  
24 - $sortorder = 'sortver';  
25 - break;  
26 - case "filename" :  
27 - $sortorder = 'sortfilename';  
28 - break;  
29 - case "size" :  
30 - $sortorder = 'sortsize';  
31 - break;  
32 - case "creatorid" :  
33 - $sortorder = 'sortposted';  
34 - break;  
35 - case "smodified" :  
36 - $sortorder = 'sortmod';  
37 - break;  
38 - case "checked_out":  
39 - $sortorder = 'sortcheckedout';  
40 - break;  
41 - default:  
42 - break;  
43 -}  
44 -  
45 -// END 496814 Column Sorts are not persistant  
46 -  
47 -  
48 -if($action == "file") {  
49 - if(check_auth($id, "file_modify", $userid) == 0) {  
50 - include("./lib/header.inc");  
51 - print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
52 - ?>  
53 - <TR><TD ALIGN=LEFT>  
54 - <?php print("$lang_user: ");  
55 - if(prefaccess($userid)) {  
56 - print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand&order=$order&sortname=$sortname'>");  
57 - }  
58 - print uid_to_name($userid);  
59 - print ("</A>");  
60 - ?>  
61 - <FONT SIZE=-1>  
62 -  
63 - <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>  
64 - </FONT></TD>  
65 - <TD ALIGN=RIGHT><?php print("<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname'>  
66 - <IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A>"); ?>  
67 - </TD></TR></TABLE><BR><BR><CENTER>  
68 - <?php  
69 - exit($lang_nofilemod);  
70 - }  
71 -} else {  
72 - if(check_auth($id, "folder_modify", $userid) == 0) {  
73 - include("./lib/header.inc");  
74 - print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
75 - ?>  
76 - <TR><TD ALIGN=LEFT>  
77 - <?php print("$lang_user: ");  
78 - if(prefaccess($userid)) {  
79 - print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand&order=$order&sortname=$sortname'>");  
80 - }  
81 - print uid_to_name($userid);  
82 - print ("</A>");  
83 - ?>  
84 - <FONT SIZE=-1>  
85 -  
86 - <?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>  
87 - </FONT></TD>  
88 - <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>"); ?>  
89 - </TD></TR></TABLE><BR><BR><CENTER>  
90 - <?php  
91 - exit($lang_nofilemod);  
92 - }  
93 -}  
94 -  
95 -function checkForNewFolder() {  
96 - global $HTTP_POST_VARS, $newFolder;  
97 - if (!is_array($HTTP_POST_VARS)) return;  
98 - while (list($key, $value) = each ($HTTP_POST_VARS)) {  
99 - if (substr($key,0,2)=="ID") {  
100 - $newFolder = intval(substr($key,2));  
101 - break;  
102 - }  
103 - }  
104 -}  
105 -  
106 -function showFoldersIn($fid, $folder) {  
107 - global $folderList, $fCount, $fDepth, $excludeID, $action, $id, $default, $userid ;  
108 - for ($c=0 ;$c < ($fDepth-1) ; $c++) print "<img src='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/blank.gif' height=16 width=18 align=top>";  
109 - if ($fDepth) print "<img src='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/link.gif' height=16 width=16 align=top>";  
110 -  
111 - $gray=0; // Work out when to gray out folders ...  
112 - if ($fid==$excludeID) $gray=1; // current parent for all moves  
113 - if (($action=="folder") && ($fid==$id)) $gray=1; // subtree for folder moves  
114 - if (check_auth($fid, "folder_modify", $userid) == 0) $gray = 1; // check for permissions  
115 -  
116 -  
117 - if ($gray) {  
118 - print "<img src='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/folder_gray.gif' height=16 width=16 align=top>";  
119 - print " <font color=\"silver\">$folder</font><br>\n";  
120 - } else {  
121 - print "<input type='image' border=0 src='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/folder_closed.gif' height=16 width=16 align=top name=\"ID";  
122 - print "$fid\"> $folder<br>\n";  
123 - }  
124 -  
125 - if (($action=="folder") && ($fid==$id)) return; // Don't show subtree of selected folder as target for folder move  
126 - for ($c=0; $c<$fCount; $c++) {  
127 - if ($folderList[$c][2]==$fid) {  
128 - $fDepth++;  
129 - showFoldersIn( $folderList[$c][0] , $folderList[$c][1] );  
130 - $fDepth--;  
131 - }  
132 - }  
133 -}  
134 -  
135 -if ($action=="$lang_cancel_button") {  
136 - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");  
137 - exit();  
138 -}  
139 -  
140 -checkForNewFolder();  
141 -if (isset($newFolder)) {  
142 - $sql = new Owl_DB;  
143 -  
144 - $source="";  
145 - $fID=$parent;  
146 - do {  
147 - $sql->query("select name,parent from $default->owl_folders_table where id='$fID'");  
148 - while($sql->next_record()) {  
149 - $tName = $sql->f("name");  
150 - $fID = $sql->f("parent");  
151 - }  
152 - $source=$tName."/".$source;  
153 - } while ($fID != 0);  
154 -  
155 - $dest="";  
156 - $fID=$newFolder;  
157 - do {  
158 - $sql->query("select name,parent from $default->owl_folders_table where id='$fID'");  
159 - while($sql->next_record()) {  
160 - $tName = $sql->f("name");  
161 - $fID = $sql->f("parent");  
162 - }  
163 - $dest=$tName."/".$dest;  
164 - } while ($fID != 0);  
165 -  
166 - if ($action=="file") {  
167 - $sql = new Owl_DB;  
168 - $sql->query("select filename, parent from $default->owl_files_table where id = '$id'");  
169 - while($sql->next_record()) {  
170 - $fname = $sql->f("filename");  
171 - $parent = $sql->f("parent");  
172 - }  
173 - } else {  
174 - $sql = new Owl_DB;  
175 - $sql->query("select name, parent from $default->owl_folders_table where id='$id'");  
176 - while($sql->next_record()) {  
177 - $fname = $sql->f("name");  
178 - $parent = $sql->f("parent");  
179 - }  
180 - }  
181 -  
182 -  
183 - if($default->owl_use_fs) {  
184 - if ($type != "url") {  
185 - if (!file_exists("$default->owl_FileDir/$dest$fname")) {  
186 - if (substr(php_uname(), 0, 7) != "Windows") {  
187 - $cmd="mv \"$default->owl_FileDir/$source$fname\" \"$default->owl_FileDir/$dest\" 2>&1";  
188 - $lines=array();$errco=0;  
189 - $result = myExec($cmd,$lines,$errco);  
190 - if ( $errco != 0 )  
191 - printError($lang_err_movecancel, $result);  
192 - }  
193 - else {  
194 - // IF Windows just do a rename and hope for the best  
195 - rename ("$default->owl_FileDir/$source$fname", "$default->owl_FileDir/$dest/$fname");  
196 - }  
197 - }  
198 - else  
199 - printError($lang_err_fileexists,$result);  
200 - }  
201 - }  
202 -  
203 -  
204 - if ($action=="file") {  
205 - $sql->query("update $default->owl_files_table set parent='$newFolder' where id='$id'");  
206 - } else {  
207 - $sql->query("update $default->owl_folders_table set parent='$newFolder' where id='$id'");  
208 - }  
209 -  
210 -  
211 - header("Location: browse.php?sess=$sess&parent=$parent&expand=$expand&order=$order&$sortorder=$sortname");  
212 -}  
213 -  
214 -  
215 - // First time through. Generate screen for selecting target directory  
216 -  
217 -include("./lib/header.inc");  
218 -print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
219 -?>  
220 -<TR><TD ALIGN=LEFT>  
221 -<?php print("$lang_user: ");  
222 - if(prefaccess($userid)) {  
223 - print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand&order=$order&sortname=$sortname'>");  
224 - }  
225 - print uid_to_name($userid);  
226 - print ("</A>");  
227 -?>  
228 -<FONT SIZE=-1>  
229 -  
230 -<?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>  
231 - </FONT></TD><TD ALIGN=RIGHT>  
232 -<?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>");?>  
233 - </A></TD></TR></TABLE>  
234 -<?php  
235 -  
236 -print("<CENTER>");  
237 -  
238 - // Get information about file or directory we want to move  
239 -  
240 -if ($action=="file") {  
241 - $sql = new Owl_DB;  
242 - $sql->query("select filename, parent from $default->owl_files_table where id='$id'");  
243 -} else {  
244 - $sql = new Owl_DB;  
245 - $sql->query("select name, parent from $default->owl_folders_table where id='$id'");  
246 -}  
247 -  
248 -while($sql->next_record()) {  
249 - if($action == "file") $fname = $sql->f("filename");  
250 - if($action == "folder") $fname = $sql->f("name");  
251 - $parent = $sql->f("parent");  
252 -}  
253 -  
254 -//print "<p>$lang_moving $action $fname. $lang_select</p>";  
255 -print "<p>$lang_moving $fname. $lang_select</p>";  
256 -?>  
257 -<div align="center">  
258 -<form method="POST">  
259 -<input type="hidden" name="parent" value="<?php print $parent; ?>">  
260 -<input type="hidden" name="expand" value="<?php print $expand; ?>">  
261 -<input type="hidden" name="order" value="<?php print $order; ?>">  
262 -<input type="hidden" name="action" value="<?php print $action; ?>">  
263 -<input type="hidden" name="fname" value="<?php print $fname; ?>">  
264 -<input type="hidden" name="id" value="<?php print $id; ?>">  
265 -<table cellspacing=0 border=1 cellpadding=4><tr><td align=left><p>  
266 -<?php  
267 -  
268 - // Get list of folders sorted by name  
269 -  
270 -$sql->query("select id,name,parent from $default->owl_folders_table order by name");  
271 -  
272 -$i=0;  
273 -while($sql->next_record()) {  
274 - $folderList[$i][0] = $sql->f("id");  
275 - $folderList[$i][1] = $sql->f("name");  
276 - $folderList[$i][2] = $sql->f("parent");  
277 - $i++;  
278 -}  
279 -  
280 -$fCount = count($folderList);  
281 -  
282 -$fDepth=0;  
283 -$excludeID=$parent; // current location should not be a offered as a target  
284 -showFoldersIn(1, fid_to_name("1"));  
285 -  
286 -?>  
287 -</p></td></tr></table>  
288 -<br>  
289 -<input TYPE="submit" name="action" VALUE="<?php print $lang_cancel_button; ?>">  
290 -  
291 -</form>  
292 -</div>  
293 -  
294 -<?php  
295 -include("./lib/footer.inc");  
296 -?>  
prefs.php deleted
1 -<?php  
2 -  
3 -/**  
4 - * prefs.php -- Main page  
5 - *  
6 - * This is the preferences page  
7 - *  
8 - * This page displays the various preference of the specific user  
9 - * It Allows for ordering of informatio nas well as the changing  
10 - * Of specific information e.g. passwords etc  
11 - *  
12 - * Licensed under the GNU GPL. For full terms see the file COPYING.  
13 - *  
14 - * @version v 1.1.1.1 2002/12/04  
15 - * @Copyright (c) 1999-2002 The Owl Project Team  
16 - * @author michael  
17 - * @package test  
18 - */  
19 -  
20 -require("./config/owl.php");  
21 -require("./lib/owl.lib.php");  
22 -require("./config/html.php");  
23 -include("./lib/header.inc");  
24 -  
25 -// Begin 496814 Column Sorts are not persistant  
26 -// + ADDED &order=$order&$sortorder=$sortname to  
27 -// all browse.php? header and HREF LINES  
28 -// Begin 496814 Column Sorts are not persistant  
29 -  
30 -// This handles the sorting order of information  
31 -switch ($order)  
32 -{  
33 - case "name":  
34 - $sortorder = 'sortname';  
35 - break;  
36 - case "major_revision":  
37 - $sortorder = 'sortver';  
38 - break;  
39 - case "filename" :  
40 - $sortorder = 'sortfilename';  
41 - break;  
42 - case "size" :  
43 - $sortorder = 'sortsize';  
44 - break;  
45 - case "creatorid" :  
46 - $sortorder = 'sortposted';  
47 - break;  
48 - case "smodified" :  
49 - $sortorder = 'sortmod';  
50 - break;  
51 - case "checked_out":  
52 - $sortorder = 'sortcheckedout';  
53 - break;  
54 - default:  
55 - $sort="ASC";  
56 - break;  
57 -}  
58 -  
59 -// END 496814 Column Sorts are not persistant  
60 -// BEGIN BUG FIX: #433932 Fileupdate and Quotas  
61 -  
62 -print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
63 -?>  
64 -  
65 -<TR><TD ALIGN=LEFT><?php print "$lang_user: "; print uid_to_name($userid);?> <FONT SIZE=-1>  
66 -<?  
67 - php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");  
68 -?>  
69 - </FONT></TD><TD ALIGN=RIGHT>  
70 -<?php  
71 - 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>");?>  
72 - </A></TD></TR></TABLE>  
73 -  
74 - <?php print $lang_preference; ?><br><hr width=50%>  
75 -<?php  
76 -  
77 -if(!$action)  
78 -{  
79 - $action = "users";  
80 -}  
81 -  
82 -//-------------------------------------------------------------  
83 -/**  
84 - * Function Printuser($id)  
85 - *  
86 - * Displays the user information  
87 - *  
88 - * @param $id  
89 - * The UserId of the user that is currently logged on  
90 -*/  
91 -//-------------------------------------------------------------  
92 -// Not Usable - Interface has to Change  
93 -function printuser($id)  
94 - {  
95 - // declare some global variables  
96 - global $order, $sortname, $sort;  
97 - global $sess,$change,$lang_saved,$lang_title,$lang_group,$lang_username,$lang_change,$lang_quota,$lang_groupmember;  
98 - global $lang_deleteuser, $default, $expand, $parent, $lang_oldpassword, $lang_newpassword, $lang_confpassword;  
99 - global $lang_email, $lang_notification, $lang_userlang,$lang_attach_file;  
100 -  
101 - if(isset($change))  
102 - {  
103 - print("$lang_saved<BR>");  
104 - }  
105 -  
106 - // get the id and name from the groups table  
107 - $sql = new Owl_DB;  
108 - $sql->query("select id,name from $default->owl_groups_table");  
109 - $i=0;  
110 -  
111 - // store in a double array  
112 - while($sql->next_record())  
113 - {  
114 - $groups[$i][0] = $sql->f("id");  
115 - $groups[$i][1] = $sql->f("name");  
116 - $i++;  
117 - }  
118 -  
119 - //get all information from the users table based on the group id  
120 - $sql->query("select * from $default->owl_users_table where id = '$id'");  
121 - // loop through the recordset  
122 - while($sql->next_record())  
123 - {  
124 - print("<FORM ACTION='./dbmodify.php' METHOD=POST>");  
125 - print("<INPUT TYPE=HIDDEN NAME=id VALUE=".$sql->f("id").">");  
126 - print("<INPUT TYPE=HIDDEN NAME=order VALUE='$order'>");  
127 - print("<INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>");  
128 - print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");  
129 - print("<INPUT TYPE=HIDDEN name=action VALUE=user>");  
130 - print("<INPUT TYPE=HIDDEN name=expand VALUE=$expand>");  
131 - print("<INPUT TYPE=HIDDEN name=parent VALUE=$parent>");  
132 - print("<TABLE><TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_title</TD><TD><INPUT TYPE=text NAME=name VALUE='".$sql->f("name")."'></TD></TR>");  
133 -  
134 - //*******************************  
135 - // Display the Language dropdown  
136 - //*******************************  
137 -  
138 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_userlang</TD><TD align=left><SELECT NAME=newlanguage>");  
139 - print("<OPTION VALUE=".$sql->f("language").">".$sql->f("language"));  
140 -  
141 - $dir = dir($default->owl_LangDir);  
142 - $dir->rewind();  
143 -  
144 - while($file=$dir->read())  
145 - {  
146 - if ($file != "." and $file != "..")  
147 - {  
148 - print("<OPTION VALUE=$file>$file");  
149 - }  
150 - }  
151 - $dir->close();  
152 -  
153 - // get values if password is to be changed  
154 - print("</SELECT></TD></TR>");  
155 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_oldpassword</TD><TD><INPUT TYPE=PASSWORD NAME=oldpassword VALUE=></TD></TR>");  
156 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_newpassword</TD><TD><INPUT TYPE=PASSWORD NAME=newpassword VALUE=></TD></TR>");  
157 - print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_confpassword</TD><TD><INPUT TYPE=PASSWORD NAME=confpassword VALUE=></TD></TR>");  
158 - 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>");  
159 -  
160 - // check if notification has been checked on  
161 - if ( $sql->f("notify") == 1)  
162 - {  
163 - 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>");  
164 - }  
165 - else  
166 - {  
167 - 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>");  
168 - }  
169 -  
170 - // check if attachfile has been checked  
171 - if ( $sql->f("attachfile") == 1)  
172 - {  
173 - 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>");  
174 - }  
175 - else  
176 - 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>");  
177 - print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change>");  
178 - print("</FORM>");  
179 - }  
180 -}  
181 -  
182 -//-------------------------------------------------------------  
183 -// if an action has occurred, check if user is set and then print out user preferences  
184 -if($action)  
185 -{  
186 - if(isset($owluser))  
187 - {  
188 - printuser($owluser);  
189 - }  
190 -}  
191 -else  
192 -{  
193 - exit("$lang_err_general");  
194 -}  
195 -  
196 -$expand = 0;  
197 -include("./lib/footer.inc");  
198 -  
199 -?>  
search.php deleted
1 -<?php  
2 -/**  
3 - * Search.php  
4 - *  
5 - * Copyright (c) 1999-2002 The Owl Project Team  
6 - * Licensed under the GNU GPL. For full terms see the file COPYING.  
7 - * This class is just random php used as a example.  
8 - *  
9 - * @version 1.1.1.1 2002/12/04  
10 - * @author Michael  
11 - * @package Owl  
12 - */  
13 -  
14 -require("./config/owl.php");  
15 -require("./lib/owl.lib.php");  
16 -require("./config/html.php");  
17 -require("./lib/security.lib.php");  
18 -  
19 -  
20 -//-------------------------------------------------------------  
21 -/**  
22 - * Function find_path($parent)  
23 - *  
24 - * Retrieves the parent folder from the DB  
25 - *  
26 - * @param $parent  
27 - * The parent folder id of the parent folder that needs to be retrieved  
28 - * @return $path  
29 - * Returns the path of the parent folder  
30 -*/  
31 -//-------------------------------------------------------------  
32 -// Usable  
33 -function find_path($parent)  
34 -{  
35 - global $default;  
36 - $path = fid_to_name($parent);  
37 - $sql = new Owl_DB;  
38 - while($parent != 1)  
39 - {// retrieve the parent from the folders table that corresponds to the parent id param  
40 - $sql->query("select parent from $default->owl_folders_table where id = '$parent'");  
41 - while($sql->next_record())  
42 - {  
43 - $path = fid_to_name($sql->f("parent"))."/".$path;  
44 - $parent = $sql->f("parent");  
45 - }  
46 - }  
47 - return $path;  
48 -}  
49 -  
50 -// This Layout section will not be needed as it is going to change  
51 -  
52 -// BEGIN patch Scott Tigr  
53 -// patch for layout  
54 -include("./lib/header.inc");  
55 -  
56 - print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
57 - print("<TR><TD WIDTH=200 VALIGN=TOP>");  
58 - print("<TR>");  
59 - print("<TD ALIGN=LEFT WIDTH=33%>");  
60 - print uid_to_name($userid);  
61 - print(" : <A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A></TD>");  
62 - print("<TD ALIGN=CENTER WIDTH=33%>&nbsp</TD>");  
63 - 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>");  
64 - print("</TR>");  
65 - print("</TABLE>");  
66 -  
67 -print "<center>";  
68 -print "<br>";  
69 -if ($expand == 1)  
70 -{ // long view  
71 - print("\t\t<TABLE WIDTH=\"".$default->table_expand_width."\" border=\"0\">\n");  
72 -}  
73 -else  
74 -{  
75 - print("\t\t<TABLE WIDTH=$default->table_collapse_width>\n");  
76 -}  
77 -  
78 - print("\t\t\t<tr><td align=\"left\"><b style=\"color:#0000aa;\">".$lang_search.":</b> ");  
79 -  
80 - print(gen_navbar($parent) . "</td></tr></table>");  
81 -  
82 -// END patch Scott Tigr  
83 -  
84 -$groupid = owlusergroup($userid);  
85 -  
86 -// first we have to find out what we can search  
87 -// we need a list of all folder that can be searched  
88 -// so we need to see which folders the user can read  
89 -$sql = new Owl_DB;  
90 -$sql->query("SELECT id,creatorid,groupid,security FROM $default->owl_folders_table");  
91 -  
92 -//  
93 -// get all the folders that the user can read  
94 -while($sql->next_record())  
95 -{  
96 - $id = $sql->f("id");  
97 - if(check_auth($id, "folder_view", $userid) == 1) $folders[$id] = $id;  
98 -}  
99 -  
100 -//  
101 -// get all the files in those folders that the user can read  
102 -foreach($folders as $item)  
103 -{  
104 - $sql->query("SELECT * FROM $default->owl_files_table where parent = '$item'");  
105 - while($sql->next_record())  
106 - {  
107 - $id = $sql->f("id");  
108 -  
109 - if(check_auth($id, "file_download", $userid) == 1)  
110 - {  
111 - $files[$id][id] = $id;  
112 - $files[$id][n] = $sql->f("name");  
113 - $files[$id][m] = explode(" ", $sql->f("metadata"));  
114 - $files[$id][d] = explode(" ", $sql->f("description"));  
115 - $files[$id][f] = $sql->f("filename");  
116 - $files[$id][c] = $sql->f("checked_out");  
117 - $files[$id][u] = $sql->f("url");  
118 - $files[$id][p] = $sql->f("parent");  
119 - $files[$id][score] = 0;  
120 - }  
121 - }  
122 -}  
123 -  
124 -//  
125 -// right now we have the array $files with all possible files that the user has read access to  
126 -  
127 -// BEGIN bufix Scott Tigr  
128 -// error_handler if query empty  
129 -  
130 -if (strlen(trim($query))>0) {  
131 -  
132 -// END bugfix Scott Tigr  
133 -  
134 -//  
135 -// break up our query string  
136 -$query = explode(" ", $query);  
137 -  
138 -//  
139 -// the is the meat of the matching  
140 -if(sizeof($files) > 0) {  
141 -foreach($query as $keyword)  
142 - {  
143 - foreach(array_keys($files) as $key)  
144 - {  
145 - // BEGIN enhancement Sunil Savkar  
146 - // if the $parent string contains a keyword to be searched, then the score is  
147 - // adjusted. This takes into account the hierarchy.  
148 -  
149 - // if keyword is found in the path  
150 - if(eregi("$keyword", find_path($files[$key][p])))  
151 - {  
152 - $files[$key][score] = $files[$key][score] + 4;  
153 - }  
154 -  
155 - //if keyword is found in the files array  
156 - if(eregi("$keyword", $files[$key][n]))  
157 - {  
158 - $files[$key][score] = $files[$key][score] + 4;  
159 - }  
160 -  
161 - if(eregi("$keyword", $files[$key][f]))  
162 - {  
163 - $files[$key][score] = $files[$key][score] + 3;  
164 - }  
165 - // if keyword is found in metadata  
166 - foreach($files[$key][m] as $metaitem)  
167 - {  
168 - // add 2 to the score if we find it in metadata (key search items)  
169 - if(eregi("$keyword", $metaitem))  
170 - {  
171 - $files[$key][score] = $files[$key][score] + 2;  
172 - }  
173 - }  
174 -  
175 - // if keyword is found in description  
176 - foreach($files[$key][d] as $descitem)  
177 - {  
178 - // only add 1 for regular description matches  
179 - if(eregi("$keyword", $descitem))  
180 - {  
181 - $files[$key][score] = $files[$key][score] + 1;  
182 - }  
183 - }  
184 - }  
185 -}  
186 -}  
187 -//  
188 -// gotta find order to the scores...any better ideas?  
189 -print "$lang_search_results_for \"".implode(" ", $query)."\"<BR><BR><HR WIDTH=200 ALIGN=CENTER><BR>";  
190 -$max = 30;  
191 -$hit = 1;  
192 -$CountLines = 0;  
193 -$iconfiles = array("html","htm","gif","jpg","bmp","zip","tar","doc","mdb","xls","ppt","pdf","gz","mp3","tgz");  
194 -  
195 -//if array exists print out the results based on their score of relavence  
196 -// This section will have to change as the interface is changing  
197 -if(sizeof($files) > 0)  
198 -{  
199 - while($max > 0)  
200 - {  
201 - foreach(array_keys($files) as $key)  
202 - {  
203 - if($files[$key][score] == $max)  
204 - {  
205 - $name = find_path($files[$key][p])."/".$files[$key][n];  
206 - $filename = $files[$key][f];  
207 - $choped = split("\.", $filename);  
208 - $pos = count($choped);  
209 - $ext = strtolower($choped[$pos-1]);  
210 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border CELLSPACING=1 CELLPADDING=1>");  
211 -  
212 - $CountLines++;  
213 - $PrintLines = $CountLines % 2;  
214 - if ($PrintLines == 0)  
215 - {  
216 - print("<TR BGCOLOR='$default->table_cell_bg_alt'>");  
217 - }  
218 - else  
219 - print("<TR BGCOLOR='$default->table_cell_bg'>");  
220 - print "<TD ALIGN=CENTER width=5%>";  
221 - //for ($i=$max; $i>0; $i--) {  
222 -  
223 - //}  
224 -  
225 - // display results based on relevance (different graphics) and score  
226 - $t_score = $max;  
227 - for ($c=$max; $c>=1; $c--)  
228 - {  
229 - if ( $t_score >= 10)  
230 - {  
231 - if ( 0 == ($c % 10))  
232 - {  
233 - print "<IMG SRC='$default->owl_root_url/graphics/star10.gif' BORDER=0>";  
234 - $t_score = $t_score - 10;  
235 - }  
236 - }  
237 - else  
238 - {  
239 - if ( (0 == ($t_score % 2)) && $t_score > 0 )  
240 - {  
241 - print "<IMG SRC='$default->owl_root_url/graphics/star.gif' BORDER=0>";  
242 - }  
243 - $t_score = $t_score - 1;  
244 - }  
245 -  
246 - }  
247 -  
248 - //print "<BR>($lang_score $max)";  
249 - print "</TD>";  
250 - print("<TD ALIGN=LEFT WIDTH=40%>");  
251 - print "$hit. <A HREF='download.php?sess=$sess&id=".$files[$key][id]."&parent=".$files[$key][p]."'>".$name."</A></TD>";  
252 - print("<TD ALIGN=LEFT WIDTH=15%>");  
253 -  
254 - if ($files[$key][u] == "1")  
255 - print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/url.gif' BORDER=0>&nbsp;");  
256 - else {  
257 - if (preg_grep("/$ext/",$iconfiles))  
258 - print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/$ext.jpg' BORDER=0>&nbsp;");  
259 - else  
260 - print("<IMG SRC='$default->owl_root_url/locale/$default->owl_lang/graphics/icons/file.gif' BORDER=0>&nbsp;");  
261 - }  
262 -  
263 - print("&nbsp $filename</TD>");  
264 - print("<TD ALIGN=LEFT width=10%>");  
265 - printFileIcons($files[$key][id],$name,$files[$key][c],$files[$key][u],$default->owl_version_control,$ext);  
266 - print("</TD></TR></TABLE>");  
267 - //print "<TABLE><TR><TD WIDTH=10></TD><TD Align=left>".implode(" ", $files[$key][d])."</TD></TR></TABLE><BR>";  
268 - $hit++;  
269 - }  
270 - }  
271 - $max--;  
272 - }  
273 -}  
274 -print "<HR WIDTH=\"".$default->table_expand_width."\" ALIGN=\"center\"><BR>";  
275 -print "<A HREF='browse.php?sess=$sess&parent=$parent&expand=$expand'><IMG SRC='$default->owl_root_url/locale/$language/graphics/btn_browse.gif' BORDER=0></A><P></P>";  
276 -  
277 -// BEGIN bugfix Scott Tigr  
278 -// error_handler if query empty  
279 -} // end of check strlen(query)  
280 -else { // if query was empty  
281 -  
282 -  
283 -  
284 -print("<p>" . $lang_query_empty . "</p>");  
285 -  
286 -}  
287 -  
288 -include("./lib/footer.inc");  
289 -  
290 -// END bugfix Scott Tigr  
291 -?>  
test.php deleted
1 -<?php  
2 -require_once ("./config/dmsDefaults.php");  
3 -require_once ("./lib/owl.lib.php");  
4 -require_once ("./lib/visualpatterns/PatternMainPage.inc");  
5 -require_once ("./lib/visualpatterns/PatternImage.inc");  
6 -require_once ("./lib/visualpatterns/PatternTableLinks.inc");  
7 -require_once ("./lib/visualpatterns/PatternTableSqlQuery.inc");  
8 -  
9 -  
10 -/* North west image */  
11 -$img = new PatternImage("file://C:/temp/test/al.jpg");  
12 -  
13 -/* build the top menu of links */  
14 -$aTopMenuLinks = array(0=>"www.google.com",1=>"www.yahoo.com",2=>"www.msn.com");  
15 -$aTopMenuText = array(0=>"google",1=>"yahoo",2=>"msn");  
16 -$oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, $aTopMenuText, 3, 1);  
17 -  
18 -/* build the central grid for paging through results */  
19 -$aCentralPageColumns = array(0=>"name",1=>"parent",2=>"security");  
20 -$aColumnTypes = array(0=>1,1=>2,2=>1);  
21 -$oTableSqlQuery = & new PatternTableSqlQuery("Folders", $aCentralPageColumns, $aColumnTypes);  
22 -($HTTP_GET_VARS["fStartIndex"]) ? $oTableSqlQuery->setStartIndex($HTTP_GET_VARS["fStartIndex"]) : $oTableSqlQuery->setStartIndex(0);  
23 -$oTableSqlQuery->setLinkType(1);  
24 -  
25 -  
26 -  
27 -/* get a page */  
28 -$tmp = new PatternMainPage();  
29 -  
30 -/* put the page together */  
31 -$tmp->setNorthWestPayload($img);  
32 -$tmp->setNorthPayload($oPatternTableLinks);  
33 -$tmp->setCentralPayload($oTableSqlQuery);  
34 -$tmp->setFormAction("Navigate.inc");  
35 -$tmp->render();  
36 -  
37 -  
38 -  
39 -?>  
view.php deleted
1 -<?php  
2 -  
3 -/*  
4 - * view.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 -// cv change for security, should deny documents directory  
18 -// added image_show that passes the image through  
19 -  
20 -if($action != "image_show") {  
21 - include("./lib/header.inc");  
22 -}  
23 -  
24 -// Begin 496814 Column Sorts are not persistant  
25 -// + ADDED &order=$order&$sortorder=$sortname to  
26 -// all browse.php? header and HREF LINES  
27 -  
28 -switch ($order) {  
29 - case "name":  
30 - $sortorder = 'sortname';  
31 - break;  
32 - case "major_revision":  
33 - $sortorder = 'sortver';  
34 - break;  
35 - case "filename" :  
36 - $sortorder = 'sortfilename';  
37 - break;  
38 - case "size" :  
39 - $sortorder = 'sortsize';  
40 - break;  
41 - case "creatorid" :  
42 - $sortorder = 'sortposted';  
43 - break;  
44 - case "smodified" :  
45 - $sortorder = 'sortmod';  
46 - break;  
47 - case "checked_out":  
48 - $sortorder = 'sortcheckedout';  
49 - break;  
50 - default:  
51 - break;  
52 -}  
53 -  
54 -// END 496814 Column Sorts are not persistant  
55 -  
56 -function find_path($parent) {  
57 - global $default;  
58 - $path = fid_to_name($parent);  
59 - $sql = new Owl_DB;  
60 - while($parent != 1) {  
61 - $sql->query("select parent from $default->owl_folders_table where id = '$parent'");  
62 - while($sql->next_record()) {  
63 - $path = fid_to_name($sql->f("parent"))."/".$path;  
64 - $parent = $sql->f("parent");  
65 - }  
66 - }  
67 - return $path;  
68 -}  
69 -  
70 -function fid_to_filename($id) {  
71 - global $default;  
72 - $sql = new Owl_DB;  
73 - $sql->query("select filename from $default->owl_files_table where id = '$id'");  
74 - while($sql->next_record()) return $sql->f("filename");  
75 -}  
76 -  
77 -if($action == "image_show") {  
78 - if(check_auth($id, "file_download", $userid) == 1) {  
79 - if ($default->owl_use_fs) {  
80 - $path = $default->owl_FileDir."/".find_path($parent)."/".fid_to_filename($id);  
81 - readfile("$path");  
82 - }  
83 - else {  
84 - $sql = new Owl_DB;  
85 - $filename = fid_to_filename($id);  
86 - if ($filetype = strrchr($filename,".")) {  
87 - $filetype = substr($filetype,1);  
88 - $sql->query("select * from $default->owl_mime_table where filetype = '$filetype'");  
89 - while($sql->next_record()) $mimeType = $sql->f("mimetype");  
90 - }  
91 - if ($mimeType) {  
92 - header("Content-Type: $mimeType");  
93 - $sql->query("select data,compressed from " . $default->owl_files_data_table . " where id='$id'");  
94 - while($sql->next_record()) {  
95 - if ($sql->f("compressed")) {  
96 - $tmpfile = $default->owl_FileDir . "owltmp.$id";  
97 - if (file_exists($tmpfile)) unlink($tmpfile);  
98 - $fp=fopen($tmpfile,"w");  
99 - fwrite($fp, $sql->f("data"));  
100 - fclose($fp);  
101 - flush(passthru($default->gzip_path . " -dfc $tmpfile"));  
102 - unlink($tmpfile);  
103 - } else {  
104 - print $sql->f("data");  
105 - }  
106 - }  
107 - }  
108 - }  
109 - } else {  
110 - print($lang_nofileaccess);  
111 - }  
112 - die;  
113 -}  
114 -print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");  
115 -?>  
116 -<TR><TD ALIGN=LEFT>  
117 -<?php print("$lang_user: ");  
118 - if(prefaccess($userid)) {  
119 - print("<A HREF='prefs.php?owluser=$userid&sess=$sess&expand=$expand'>");  
120 - }  
121 - print uid_to_name($userid);  
122 - print ("</A>");  
123 -?>  
124 -<FONT SIZE=-1>  
125 -<?php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");?>  
126 - </FONT></TD><TD ALIGN=RIGHT>  
127 -<?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>");?>  
128 - </A></TD></TR></TABLE>  
129 -<?php  
130 -if($action == "file_details") {  
131 - if(check_auth($parent, "folder_view", $userid) == 1) {  
132 - $expand = 1;  
133 - print("<TABLE WIDTH=$default->table_expand_width BORDER=$default->table_border>");  
134 - print("<TR><TD align=left>".gen_navbar($parent)."/".flid_to_name($id)."</TD></TR>");  
135 - print("</TABLE><HR WIDTH=$default->table_expand_width><BR>");  
136 - $sql = new Owl_DB; $sql->query("select * from $default->owl_files_table where id = '$id'");  
137 - while($sql->next_record()) {  
138 - $security = $sql->f("security");  
139 - if ($security == "0") $security = $lang_everyoneread;  
140 - if ($security == "1") $security = $lang_everyonewrite;  
141 - if ($security == "2") $security = $lang_groupread;  
142 - if ($security == "3") $security = $lang_groupwrite;  
143 - if ($security == "4") $security = $lang_onlyyou;  
144 - if ($security == "5") $security = $lang_groupwrite_nod;  
145 - if ($security == "6") $security = $lang_everyonewrite_nod;  
146 - if ($security == "7") $security = $lang_groupwrite_worldread;  
147 - if ($security == "8") $security = $lang_groupwrite_worldread_nod;  
148 -  
149 - print("<TABLE WIDTH=66% BORDER=$default->table_border><TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>  
150 - $lang_title:</TD><TD align=left>".$sql->f("name")."</TD></TR>  
151 - <TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_file:</TD><TD align=left>".$sql->f("filename")."&nbsp;(".gen_filesize($sql->f("size")).")</TD></TR>  
152 - <TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_ownership:</TD>  
153 - <TD align=left>".fid_to_creator($id)."&nbsp;(".group_to_name(owlfilegroup($id)).")</TD></TR>  
154 - <TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_permissions:</TD><TD align=left>$security</TD></TR>  
155 - <TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg>$lang_keywords:</TD><TD align=left>".$sql->f("metadata")."</TD></TR>  
156 - <TR><TD ALIGN=RIGHT BGCOLOR=$default->table_header_bg VALIGN=TOP>$lang_description:</TD><TD align=left><TEXTAREA NAME=description ROWS=10  
157 - COLS=50>".$sql->f("description")."</TEXTAREA></TABLE><BR>");  
158 - include("./lib/footer.inc");  
159 - }  
160 - }  
161 -}  
162 -  
163 -if($action == "image_preview") {  
164 - if(check_auth($id, "file_download", $userid) == 1) {  
165 - $path = find_path($parent)."/".fid_to_filename($id);  
166 - print("$lang_viewing". gen_navbar($parent) . "/" . fid_to_filename($id) ."<HR WIDTH=50%><BR><BR>");  
167 - print("<IMG SRC='$PHP_SELF?sess=$sess&id=$id&action=image_show&parent=$parent'>");  
168 - } else {  
169 - print($lang_nofileaccess);  
170 - }  
171 -}  
172 -  
173 -if($action == "zip_preview") {  
174 - if(check_auth($id, "file_download", $userid) == 1) {  
175 - $name = fid_to_filename($id);  
176 -  
177 - if ($default->owl_use_fs) {  
178 - $path = find_path($parent)."/".$name;  
179 - } else {  
180 - $path = $name;  
181 - if (file_exists($default->owl_FileDir. "/$path")) unlink($default->owl_FileDir. "/$path");  
182 - $file = fopen($default->owl_FileDir. "/$path", 'wb');  
183 - $sql->query("select data,compressed from $default->owl_files_data_table where id='$id'");  
184 - while($sql->next_record()) {  
185 - if ($sql->f("compressed")) {  
186 -  
187 - $tmpfile = $default->owl_FileDir . "owltmp.$id.gz";  
188 - $uncomptmpfile = $default->owl_FileDir . "owltmp.$id";  
189 - if (file_exists($tmpfile)) unlink($tmpfile);  
190 -  
191 - $fp=fopen($tmpfile,"w");  
192 - fwrite($fp, $sql->f("data"));  
193 - fclose($fp);  
194 -  
195 - system($default->gzip_path . " -df $tmpfile");  
196 -  
197 - $fsize = filesize($uncomptmpfile);  
198 - $fd = fopen($uncomptmpfile, 'rb');  
199 - $filedata = fread($fd, $fsize);  
200 - fclose($fd);  
201 -  
202 - fwrite($file, $filedata);  
203 - unlink($uncomptmpfile);  
204 - } else {  
205 - fwrite($file, $sql->f("data"));  
206 - }  
207 - fclose($file);  
208 - }  
209 -  
210 - }  
211 -  
212 - //$path = find_path($parent)."/".$name;  
213 - $expr = "-t";  
214 - if(ereg("gz", $name)) $expr .= "z";  
215 - print("$lang_viewing". gen_navbar($parent) . "/" . fid_to_filename($id) ."<HR WIDTH=50%><BR><BR>");  
216 - print("<TABLE BORDER=$default->table_border CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=LEFT><PRE>");  
217 - passthru("$default->tar_path $expr < $default->owl_FileDir/$path | sort");  
218 - unlink($default->owl_FileDir. "/$path");  
219 - print("</PRE></TD></TR></TABLE>");  
220 - } else {  
221 - print($lang_nofileaccess);  
222 - }  
223 -}  
224 -  
225 -// BEGIN wes change  
226 -if($action == "html_show" || $action == "text_show") {  
227 - if(check_auth($id, "file_download", $userid) == 1) {  
228 - if ($default->owl_use_fs) {  
229 - $path = $default->owl_FileDir."/".find_path($parent)."/".fid_to_filename($id);  
230 - print("<BR>$lang_viewing". gen_navbar($parent) . "/" . fid_to_filename($id) ."<HR WIDTH=50%><BR><BR></CENTER>");  
231 - if ($action == "text_show") print("<xmp>");  
232 - readfile("$path");  
233 - } else {  
234 - print("$lang_viewing /".find_path($parent)."/".fid_to_filename($id)."<HR WIDTH=50%><BR><BR></CENTER>");  
235 - if ($action == "text_show") print("<xmp>");  
236 -  
237 - $sql->query("select data,compressed from " . $default->owl_files_data_table . " where id='$id'");  
238 -  
239 - while($sql->next_record()) {  
240 -  
241 - if ($sql->f("compressed")) {  
242 -  
243 - $tmpfile = $default->owl_FileDir . "owltmp.$id";  
244 - if (file_exists($tmpfile)) unlink($tmpfile);  
245 -  
246 - $fp=fopen($tmpfile,"w");  
247 - fwrite($fp, $sql->f("data"));  
248 - fclose($fp);  
249 - flush(passthru($default->gzip_path . " -dfc $tmpfile"));  
250 - unlink($tmpfile);  
251 - } else {  
252 - print $sql->f("data");  
253 - }  
254 - }  
255 - }  
256 - $path = find_path($parent)."/".fid_to_filename($id);  
257 - } else {  
258 - print($lang_nofileaccess);  
259 - }  
260 -}  
261 -// end wes change  
262 -  
263 -?>