* Fix a small bug in lib/ldap/create_user.php3. Unset the mod array before adding any values to it.
* Fix a small problem with debugging
* Do a write lock in radacct before truncating it in truncate_radacct
+* In user_new show a select box with all the available groups. Based on an idea by Karel Stadler (kstadler)
Ver 1.61:
* Add a string encoder for greek
* If general_decode_normal_attributes is set then encode attributes in lib/ldap/change_info. In the near future
EOM;
if ($config[general_lib_type] == 'sql'){
if (isset($member_groups))
- $group = $member_groups[0];
+ $selected[$member_groups[0]] = 'selected';
echo <<<EOM
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Group
</td><td>
- <input type=text name="Fgroup" value="$group" size=35>
+ <select name="Fgroup">
+EOM;
+ foreach ($member_groups as $group)
+ echo "<option value=\"$group\" $selected[$group]>$group\n";
+
+ echo <<<EOM
+ </select>
</td>
</tr>
EOM;
echo "<b>Could not connect to SQL database</b><br>\n";
}while($stop == 0);
}
+else{
+ if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php3"))
+ include_once("../lib/sql/drivers/$config[sql_type]/functions.php3");
+ else{
+ echo "<b>Could not include SQL library</b><br>\n";
+ exit();
+ }
+ unset($member_groups);
+ $link = @da_sql_pconnect($config);
+ if ($link){
+ $res = @da_sql_query($link,$config,
+ "SELECT DISTINCT GroupName FROM $config[sql_usergroup_table];");
+ if ($res){
+ while(($row = @da_sql_fetch_array($res,$config)))
+ $member_groups[] = $row[GroupName];
+ }
+ else
+ echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
+ }
+ else
+ echo "<b>Could not connect to SQL database</b><br>\n";
+}
?>