* In the buttons toolbar Edit User should not be clickable.
* Add an arrow gif in htdocs/images to be used in the buttons page when adding multiple finger pages
* In snmpfinger also consider '-' as a valid character for a username
+* Add support for realm in username and allow for realm striping in the web pages and in log_badlogins
Ver 1.59:
* Small html fixes in user_edit.php3 and password.php3
* Show number of failed logins in the last 7 days in the user admin page
$sql_password = $val if ($key eq 'sql_password');
$sql_database = $val if ($key eq 'sql_database');
$sql_accounting_table = $val if ($key eq 'sql_accounting_table');
+ $realm_strip = $val if ($key eq 'general_strip_realms');
+ $realm_del = $val if ($key eq 'general_realm_delimiter');
+ $realm_for = $val if ($key eq 'general_realm_format');
}
close CONF;
+$realm_del = '@' if ($realm_del eq '');
+$realm_for = 'suffix' if ($realm_for eq '');
$pass = ($sql_password ne '') ? "-p$sql_password" : '';
open LOG, "<$file"
$addr = gethostbyname $nas;
($a,$b,$c,$d)=unpack('C4',$addr);
$addr = "$a.$b.$c.$d";
+ if ($user ne '' && $realm_strip eq 'yes'){
+ ($one,$two) = (split /$realm_del/, $user)[0,1];
+ if ($two ne ''){
+ $user = ($realm_for eq 'suffix') ? $one : $two;
+ }
+ }
open TMP, ">$tmpfile"
or die "Could not open temporary file\n";
print TMP "INSERT INTO $sql_accounting_table (UserName,NASIPAddress,NASPortId,AcctStartTime,AcctStopTime,AcctSessionTime,AcctInputOctets,AcctOutputOctets,CallingStationId,AcctTerminateCause) VALUES ('$user','$addr','$port','$time','$time','0','0','0','$caller','$cause');";
general_most_recent_fl: 30
#
+# Realm setup
+#
+# Set general_strip_realms to yes in order to stip realms from usernames.
+# By default realms are not striped
+#general_strip_realms : yes
+#
+# The delimiter used in realms. Default is @
+#
+general_realm_delimiter: @
+#
+# The format of the realms. Can be either suffix (realm is after the username)
+# or prefix (realm is before the username). Default is suffix
+#
+general_realm_format: suffix
+#
+
+
general_ldap_attrmap: %{general_radiusd_base_dir}/etc/raddb/ldap.attrmap
general_sql_attrmap: %{general_base_dir}/conf/sql.attrmap
general_extra_ldap_attrmap: %{general_base_dir}/conf/extra.ldap-attrmap
// Start session
@session_start();
}
+if ($login != '' && $config[general_strip_realms] == 'yes'){
+ $realm_del = ($config[general_realm_delimiter] != '') ? $config[general_realm_delimiter] : '@';
+ $realm_for = ($config[general_realm_format] != '') ? $config[general_realm_format] : 'suffix';
+ $new = explode($realm_del,$login,2);
+ if (count($new) == 2)
+ $login = ($realm_for == 'suffix') ? $new[0] : $new[1];
+}
?>