import from HEAD
[freeradius.git] / dialup_admin / htdocs / group_new.php3
1 <?php
2 require('../conf/config.php3');
3 if ($show == 1){
4         header("Location: group_admin.php3?login=$login");
5         exit;
6 }
7
8 if ($config[general_lib_type] != 'sql'){
9         echo <<<EOM
10 <title>New group creation page</title>
11 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
12 <link rel="stylesheet" href="style.css">
13 </head>
14 <body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
15 <center>
16 <b>This page is only available if you are using sql as general library type</b>
17 </body>
18 </html>
19 EOM;
20         exit();
21 }
22
23 require('../lib/attrshow.php3');
24 require('../lib/defaults.php3');
25
26 if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
27         $colspan=2;
28         $show_ops=1;
29 }else{
30         $show_ops = 0;
31         $colspan=1;
32 }
33
34 ?>
35
36 <html>
37 <head>
38 <title>New group creation page</title>
39 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
40 <link rel="stylesheet" href="style.css">
41 </head>
42 <body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
43 <center>
44 <table border=0 width=550 cellpadding=0 cellspacing=0>
45 <tr valign=top>
46 <td align=center><img src="images/title2.gif"></td>
47 </tr>
48 </table>
49
50 <br>
51 <table border=0 width=540 cellpadding=1 cellspacing=1>
52 <tr valign=top>
53 <td width=340></td>
54 <td bgcolor="black" width=200>
55         <table border=0 width=100% cellpadding=2 cellspacing=0>
56         <tr bgcolor="#907030" align=right valign=top><th>
57         <font color="white">Preferences for new group</font>&nbsp;
58         </th></tr>
59         </table>
60 </td></tr>
61 <tr bgcolor="black" valign=top><td colspan=2>
62         <table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
63         <tr><td>
64    
65 <?php
66 if (is_file("../lib/$config[general_lib_type]/group_info.php3"))
67         include("../lib/$config[general_lib_type]/group_info.php3");
68 if ($create == 1){
69         if ($group_exists != "no"){
70                 echo <<<EOM
71 <b>The group <i>$login</i> already exists in the group database</b>
72 EOM;
73         }
74         else{
75                 if (is_file("../lib/$config[general_lib_type]/create_group.php3"))
76                         include("../lib/$config[general_lib_type]/create_group.php3");
77                 if (is_file("../lib/$config[general_lib_type]/group_info.php3"))
78                         include("../lib/$config[general_lib_type]/group_info.php3");
79         }
80 }
81 ?>
82    <form method=post>
83       <input type=hidden name=create value="0">
84       <input type=hidden name=show value="0">
85         <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
86 <?php
87         echo <<<EOM
88         <tr>
89                 <td align=right colspan=$colspan bgcolor="#d0ddb0">
90                 Group name
91                 </td><td>
92                 <input type=text name="login" value="$login" size=35>
93                 </td>
94         </tr>
95         <tr>
96                 <td align=right colspan=$colspan bgcolor="#d0ddb0">
97                 First member(s)<br>Separate group members<br> by whitespace or newline
98                 </td><td>
99                 <textarea name=members cols="15" wrap="PHYSICAL" rows=5></textarea>
100                 </td>
101         </tr>
102                 
103 EOM;
104         foreach($show_attrs as $key => $desc){
105                 $name = $attrmap["$key"];
106                 if ($name == 'none')
107                         continue;
108                 $oper_name = $name . '_op';
109                 $val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0];
110                 print <<<EOM
111 <tr>
112 <td align=right bgcolor="#d0ddb0">
113 $desc
114 </td>
115 EOM;
116
117                 if ($show_ops)
118                         print <<<EOM
119 <td>
120 <select name=$oper_name>
121 <option selected value="=">=
122 <option value=":=">:=
123 <option value="+=">+=
124 <option value="==">==
125 <option value="!=">!=
126 <option value=">">&gt;
127 <option value=">=">&gt;=
128 <option value="<">&lt;
129 <option value="<=">&lt;=
130 <option value="=~">=~
131 <option value="!~">!~
132
133 </select>
134 </td>
135 EOM;
136
137                 print <<<EOM
138 <td>
139 <input type=text name="$name" value="$val" size=35>
140 </td>
141 </tr>
142 EOM;
143         }
144 ?>
145         </table>
146 <br>
147 <input type=submit class=button value="Create" OnClick="this.form.create.value=1">
148 <br><br>
149 <input type=submit class=button value="Show Group" OnClick="this.form.show.value=1">
150 </form>
151         </td></tr>
152 </table>
153 </tr>
154 </table>
155 </body>
156 </html>