prefs.php
7.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?php
/**
* prefs.php -- Main page
*
* This is the preferences page
*
* This page displays the various preference of the specific user
* It Allows for ordering of informatio nas well as the changing
* Of specific information e.g. passwords etc
*
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* @version v 1.1.1.1 2002/12/04
* @Copyright (c) 1999-2002 The Owl Project Team
* @author michael
* @package test
*/
require("./config/owl.php");
require("./lib/owl.lib.php");
require("./config/html.php");
include("./lib/header.inc");
// Begin 496814 Column Sorts are not persistant
// + ADDED &order=$order&$sortorder=$sortname to
// all browse.php? header and HREF LINES
// Begin 496814 Column Sorts are not persistant
// This handles the sorting order of information
switch ($order)
{
case "name":
$sortorder = 'sortname';
break;
case "major_revision":
$sortorder = 'sortver';
break;
case "filename" :
$sortorder = 'sortfilename';
break;
case "size" :
$sortorder = 'sortsize';
break;
case "creatorid" :
$sortorder = 'sortposted';
break;
case "smodified" :
$sortorder = 'sortmod';
break;
case "checked_out":
$sortorder = 'sortcheckedout';
break;
default:
$sort="ASC";
break;
}
// END 496814 Column Sorts are not persistant
// BEGIN BUG FIX: #433932 Fileupdate and Quotas
print("<TABLE WIDTH=$default->table_expand_width BGCOLOR=$default->main_header_bgcolor CELLSPACING=0 CELLPADDING=0 BORDER=$default->table_border HEIGHT=30>");
?>
<TR><TD ALIGN=LEFT><?php print "$lang_user: "; print uid_to_name($userid);?> <FONT SIZE=-1>
<?
php print("<A HREF='index.php?login=logout&sess=$sess'>$lang_logout</A>");
?>
</FONT></TD><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></TD></TR></TABLE>
<?php print $lang_preference; ?><br><hr width=50%>
<?php
if(!$action)
{
$action = "users";
}
//-------------------------------------------------------------
/**
* Function Printuser($id)
*
* Displays the user information
*
* @param $id
* The UserId of the user that is currently logged on
*/
//-------------------------------------------------------------
// Not Usable - Interface has to Change
function printuser($id)
{
// declare some global variables
global $order, $sortname, $sort;
global $sess,$change,$lang_saved,$lang_title,$lang_group,$lang_username,$lang_change,$lang_quota,$lang_groupmember;
global $lang_deleteuser, $default, $expand, $parent, $lang_oldpassword, $lang_newpassword, $lang_confpassword;
global $lang_email, $lang_notification, $lang_userlang,$lang_attach_file;
if(isset($change))
{
print("$lang_saved<BR>");
}
// get the id and name from the groups table
$sql = new Owl_DB;
$sql->query("select id,name from $default->owl_groups_table");
$i=0;
// store in a double array
while($sql->next_record())
{
$groups[$i][0] = $sql->f("id");
$groups[$i][1] = $sql->f("name");
$i++;
}
//get all information from the users table based on the group id
$sql->query("select * from $default->owl_users_table where id = '$id'");
// loop through the recordset
while($sql->next_record())
{
print("<FORM ACTION='./dbmodify.php' METHOD=POST>");
print("<INPUT TYPE=HIDDEN NAME=id VALUE=".$sql->f("id").">");
print("<INPUT TYPE=HIDDEN NAME=order VALUE='$order'>");
print("<INPUT TYPE=HIDDEN NAME=sortname VALUE='$sortname'>");
print("<INPUT TYPE=HIDDEN NAME=sess VALUE=$sess>");
print("<INPUT TYPE=HIDDEN name=action VALUE=user>");
print("<INPUT TYPE=HIDDEN name=expand VALUE=$expand>");
print("<INPUT TYPE=HIDDEN name=parent VALUE=$parent>");
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>");
//*******************************
// Display the Language dropdown
//*******************************
print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_userlang</TD><TD align=left><SELECT NAME=newlanguage>");
print("<OPTION VALUE=".$sql->f("language").">".$sql->f("language"));
$dir = dir($default->owl_LangDir);
$dir->rewind();
while($file=$dir->read())
{
if ($file != "." and $file != "..")
{
print("<OPTION VALUE=$file>$file");
}
}
$dir->close();
// get values if password is to be changed
print("</SELECT></TD></TR>");
print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_oldpassword</TD><TD><INPUT TYPE=PASSWORD NAME=oldpassword VALUE=></TD></TR>");
print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_newpassword</TD><TD><INPUT TYPE=PASSWORD NAME=newpassword VALUE=></TD></TR>");
print("<TR><TD BGCOLOR=$default->table_header_bg align=right>$lang_confpassword</TD><TD><INPUT TYPE=PASSWORD NAME=confpassword VALUE=></TD></TR>");
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>");
// check if notification has been checked on
if ( $sql->f("notify") == 1)
{
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>");
}
else
{
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>");
}
// check if attachfile has been checked
if ( $sql->f("attachfile") == 1)
{
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>");
}
else
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>");
print("</TABLE><BR><INPUT TYPE=SUBMIT VALUE=$lang_change>");
print("</FORM>");
}
}
//-------------------------------------------------------------
// if an action has occurred, check if user is set and then print out user preferences
if($action)
{
if(isset($owluser))
{
printuser($owluser);
}
}
else
{
exit("$lang_err_general");
}
$expand = 0;
include("./lib/footer.inc");
?>