From: nbk Date: Mon, 7 Jan 2008 09:31:48 +0000 (+0000) Subject: Merge the patches sent by the dialupadmin users in the past for X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=ce7c2dcaaad01447fb4a1c2fc905b3b7ed9e4a38;p=freeradius-dialup-admin.git Merge the patches sent by the dialupadmin users in the past for the 1.x series. --- diff --git a/Changelog b/Changelog index 600a0da..d47c90b 100644 --- a/Changelog +++ b/Changelog @@ -106,6 +106,23 @@ Ver 1.72: * Fix a small error in lib/sql/find.php3. This closes bug #103 * Add a small note in the FAQ about checking for sql/ldap driver availability in PHP if the user get's a blank white page back. + +Ver 1.70.3: +* Test for unset variable, rather than empty variable in clean_radacct, + monthly_tot_stats and truncate_radacct. + +Ver 1.70.2: +* Fix redirects in dialup-admin pages on servers with register_globals + turned off. +* HTTP form fields will always fail is_int, use in_numeric instead. + +Ver 1.70.1: +* Report correct data transfer statistics for users. +* Lower-case sql column names to match creation scripts. +* Fix creation of empty groups. +* Put quote around usernames in HTML output. +* Properly notice when we've got a blank password to SQL. + Ver 1.70: * Add the /bin postgresql compatibility patch from Guy Fraser * Add ldap_userdn as a configuration directive. If set we use that for diff --git a/bin/clean_radacct b/bin/clean_radacct index 168af3f..7ff8211 100755 --- a/bin/clean_radacct +++ b/bin/clean_radacct @@ -29,7 +29,7 @@ die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ - $sql_password = ($sql_password eq '') ? '' : "-p$sql_password"; + $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; diff --git a/bin/log_badlogins b/bin/log_badlogins index 402b28b..d44dbb6 100755 --- a/bin/log_badlogins +++ b/bin/log_badlogins @@ -95,7 +95,7 @@ close CLIENTS; $realm_del = '@' if ($realm_del eq ''); $realm_for = 'suffix' if ($realm_for eq ''); if ($sql_type eq 'mysql'){ - $pass = ($sql_password ne '') ? "-p$sql_password" : ''; + $pass = (!$sql_password) ? '' : "-p$sql_password"; } else{ $pass = $sql_password; diff --git a/bin/monthly_tot_stats b/bin/monthly_tot_stats index 38ffcab..69bddc6 100755 --- a/bin/monthly_tot_stats +++ b/bin/monthly_tot_stats @@ -30,7 +30,7 @@ die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ - $sql_password = ($sql_password eq '') ? '' : "-p$sql_password"; + $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; diff --git a/bin/tot_stats b/bin/tot_stats index f5659e7..bc3a472 100755 --- a/bin/tot_stats +++ b/bin/tot_stats @@ -29,7 +29,7 @@ die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ - $sql_password = ($sql_password eq '') ? '' : "-p$sql_password"; + $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; diff --git a/bin/truncate_radacct b/bin/truncate_radacct index 09f9193..a2eb545 100755 --- a/bin/truncate_radacct +++ b/bin/truncate_radacct @@ -29,7 +29,7 @@ die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ - $sql_password = ($sql_password eq '') ? '' : "-p$sql_password"; + $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; diff --git a/htdocs/group_admin.php3 b/htdocs/group_admin.php3 index 49e7a17..58326f8 100644 --- a/htdocs/group_admin.php3 +++ b/htdocs/group_admin.php3 @@ -89,7 +89,7 @@ if ($do_changes == 1){
- > + diff --git a/htdocs/user_delete.php3 b/htdocs/user_delete.php3 index 35f2128..32ab293 100644 --- a/htdocs/user_delete.php3 +++ b/htdocs/user_delete.php3 @@ -80,7 +80,7 @@ EOM; } ?> - > +
diff --git a/htdocs/user_edit.php3 b/htdocs/user_edit.php3 index bdb32a9..a4754e8 100644 --- a/htdocs/user_edit.php3 +++ b/htdocs/user_edit.php3 @@ -104,7 +104,7 @@ else if ($badusers == 1){ ?> - > + > diff --git a/lib/sql/create_group.php3 b/lib/sql/create_group.php3 index 0539b99..f16a644 100644 --- a/lib/sql/create_group.php3 +++ b/lib/sql/create_group.php3 @@ -27,9 +27,15 @@ if ($link){ $da_abort=1; } } + } else { + $res = @da_sql_query($link,$config, + "INSERT INTO $config[sql_usergroup_table] (groupname) + VALUES ('$login');"); + if (!$res || !@da_sql_affected_rows($link,$res,$config)){ + echo "Unable to create group $login: " . da_sql_error($link,$config) . "
\n"; + $da_abort=1; + } } - else - echo "Members list is empty!!
\n"; if (!$da_abort){ foreach($show_attrs as $key => $attr){ if ($attrmap["$key"] == 'none')