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