f83ac7e81d252ff44da17d98c8ef711eac82b2d8
[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                         $User = urlencode($user);
55                         $num++;
56                         $msg .= <<<EOM
57                         <tr align=center>
58                                 <td>$num</td>
59                                 <td><a href="user_admin.php3?login=$User" title="Edit user $user">$user</a></td>
60                         </tr>
61 EOM;
62                 }
63                 $msg .= "</table>\n";
64         }
65         else
66                 $msg = "<b>No users found</b><br>\n";
67 }
68 ?>
69    <form method=post>
70       <input type=hidden name=find_user value="0">
71         <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
72 <tr>
73 <td align=right bgcolor="#d0ddb0">
74 Search Criteria
75 </td>
76 <td>
77
78 <?php
79 echo <<<EOM
80 <select name="search_IN" editable onChange="this.form.submit();">
81 <option $selected[username] value="username">User Name
82 <option $selected[name]  value="name">User Full Name
83 <option $selected[department] value="department">User Department
84 <option $selected[radius] value="radius">User Radius Attribute
85 EOM;
86 ?>
87
88 </select>
89 </td>
90 </tr>
91 <?php
92 if ($search_IN == 'radius'){
93         require('../lib/attrshow.php3');
94         echo <<<EOM
95 <tr>
96 <td align=right bgcolor="#d0ddb0">
97 RADIUS Attribute
98 </td>
99 <td>
100 <select name="radius_attr" editable>
101 EOM;
102         foreach($show_attrs as $key => $desc)
103                 echo "<option $selected[$key] value=\"$key\">$desc\n";          
104         echo <<<EOM
105 </select>
106 </td>
107 </tr>
108 EOM;
109 }
110 ?>
111 <tr>
112 <td align=right bgcolor="#d0ddb0">
113 Criteria Contains
114 </td>
115 <td>
116 <input type=text name="search" value="<?php echo $search ?>" size=25>
117 </td>
118 </tr>
119 <tr>
120 <td align=right bgcolor="#d0ddb0">
121 Max Results
122 </td>
123 <td>
124 <input type=text name="max_results" value="<?php echo $max ?>" size=25>
125 </td>
126 </tr>
127         </table>
128 <br>
129 <input type=submit class=button value="Find User" OnClick="this.form.find_user.value=1">
130 </form>
131 <?php
132 if ($find_user == 1){
133         echo <<<EOM
134 <br>
135 $msg
136 EOM;
137 }
138 ?>
139         </td></tr>
140 </table>
141 </tr>
142 </table>
143 </body>
144 </html>