* Add the style sheet in the content.html
[freeradius.git] / dialup_admin / htdocs / find.php3
1 <?php
2 require('../conf/config.php3');
3 $selected[$search_IN] = 'selected';
4 $selected[$radius_attr] = 'selected';
5 $max = ($max_results) ? $max_results : 40;
6 ?>
7 <html>
8 <head>
9 <title>Find User Page</title>
10 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
11 <link rel="stylesheet" href="style.css">
12 </head>
13 <body>
14 <center>
15 <table border=0 width=550 cellpadding=0 cellspacing=0>
16 <tr valign=top>
17 <td align=center><img src="images/title2.gif"></td>
18 </tr>
19 </table>
20 <table border=0 width=400 cellpadding=0 cellspacing=2>
21 </table>
22 <br>
23 <table border=0 width=540 cellpadding=1 cellspacing=1>
24 <tr valign=top>
25 <td width=340></td>
26 <td bgcolor="black" width=200>
27         <table border=0 width=100% cellpadding=2 cellspacing=0>
28         <tr bgcolor="#907030" align=right valign=top><th>
29         <font color="white">Find User Page</font>&nbsp;
30         </th></tr>
31         </table>
32 </td></tr>
33 <tr bgcolor="black" valign=top><td colspan=2>
34         <table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
35         <tr><td>
36
37 <?php
38 if ($find_user == 1){
39         unset($found_users);
40         if (is_file("../lib/$config[general_lib_type]/find.php3"))
41                 include("../lib/$config[general_lib_type]/find.php3");
42         if (isset($found_users)){
43                 $num = 0;
44                 $msg .= <<<EOM
45 <p>
46         <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
47         <tr bgcolor="#d0ddb0">
48         <th>#</th><th>user</th>
49         </tr>
50 EOM;
51                 foreach ($found_users as $user){
52                         if ($user == '')
53                                 $user = '-';
54                         $num++;
55                         $msg .= <<<EOM
56                         <tr align=center>
57                                 <td>$num</td>
58                                 <td><a href="user_admin.php3?login=$user" title="Edit user $user">$user</a></td>
59                         </tr>
60 EOM;
61                 }
62                 $msg .= "</table>\n";
63         }
64         else
65                 $msg = "<b>No users found</b><br>\n";
66 }
67 ?>
68    <form method=post>
69       <input type=hidden name=find_user value="0">
70         <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
71 <tr>
72 <td align=right bgcolor="#d0ddb0">
73 Search Criteria
74 </td>
75 <td>
76
77 <?php
78 echo <<<EOM
79 <select name="search_IN" editable onChange="this.form.submit();">
80 <option $selected[username] value="username">User Name
81 <option $selected[name]  value="name">User Full Name
82 <option $selected[department] value="department">User Department
83 <option $selected[radius] value="radius">User Radius Attribute
84 EOM;
85 ?>
86
87 </select>
88 </td>
89 </tr>
90 <?php
91 if ($search_IN == 'radius'){
92         require('../lib/attrshow.php3');
93         echo <<<EOM
94 <tr>
95 <td align=right bgcolor="#d0ddb0">
96 RADIUS Attribute
97 </td>
98 <td>
99 <select name="radius_attr" editable>
100 EOM;
101         foreach($show_attrs as $key => $desc)
102                 echo "<option $selected[$key] value=\"$key\">$desc\n";          
103         echo <<<EOM
104 </select>
105 </td>
106 </tr>
107 EOM;
108 }
109 ?>
110 <tr>
111 <td align=right bgcolor="#d0ddb0">
112 Criteria Contains
113 </td>
114 <td>
115 <input type=text name="search" value="<?php echo $search ?>" size=25>
116 </td>
117 </tr>
118 <tr>
119 <td align=right bgcolor="#d0ddb0">
120 Max Results
121 </td>
122 <td>
123 <input type=text name="max_results" value="<?php echo $max ?>" size=25>
124 </td>
125 </tr>
126         </table>
127 <br>
128 <input type=submit class=button value="Find User" OnClick="this.form.find_user.value=1">
129 </form>
130 <?php
131 if ($find_user == 1){
132         echo <<<EOM
133 <br>
134 $msg
135 EOM;
136 }
137 ?>
138         </td></tr>
139 </table>
140 </tr>
141 </table>
142 </body>
143 </html>