credentials (that way there can be more than one administrator usernames, each with different privileges
on the sql database).
server (pap or chap).
* Replace single quotes with double quotes in log_badlogins
* Add a missing <?php tag. Bug noted by Simon Burns <simon@ababa.org>
+* Add sql_use_http_credentials configuration directive to connect to the sql database using the http user
+ credentials (that way there can be more than one administrator usernames, each with different privileges
+ on the sql database).
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
sql_groupcheck_table: radgroupcheck
sql_groupreply_table: radgroupreply
sql_usergroup_table: usergroup
+#
+# If set to yes then the HTTP credentials (http authentication)
+# will be used to connect to the sql server instead of sql_username
+# and sql_password. That way multiple admins with different rights
+# on the sql database can connect through one dialup_admin interface.
+#sql_use_http_credentials: yes
+
#
# true or false
<?php
function da_sql_connect($config)
{
- return @mysql_connect("$config[sql_server]:$config[sql_port]",$config[sql_username],
- $config[sql_password]);
+ if ($config[sql_use_http_credentials] == 'yes'){
+ global $HTTP_SERVER_VARS;
+ $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
+ $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"];
+ }
+ else{
+ $SQL_user = $config[sql_username];
+ $SQL_passwd = $config[sql_password];
+ }
+
+ return @mysql_connect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd);
}
function da_sql_pconnect($config)
<?php
function da_sql_connect($config)
{
+ if ($config[sql_use_http_credentials] == 'yes'){
+ global $HTTP_SERVER_VARS;
+ $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
+ $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"];
+ }
+ else{
+ $SQL_user = $config[sql_username];
+ $SQL_passwd = $config[sql_password];
+ }
return @pg_connect("host=$config[sql_server] port=$config[sql_port]
- dbname=$config[sql_database] user=$config[sql_username]
- password=$config[sql_password]");
+ dbname=$config[sql_database] user=$SQL_user
+ password=$SQL_passwd");
}
function da_sql_pconnect($config)