Merge the patches sent by the dialupadmin users in the past for
authornbk <nbk>
Mon, 7 Jan 2008 09:31:48 +0000 (09:31 +0000)
committernbk <nbk>
Mon, 7 Jan 2008 09:31:48 +0000 (09:31 +0000)
the 1.x series.

dialup_admin/Changelog
dialup_admin/bin/clean_radacct
dialup_admin/bin/log_badlogins
dialup_admin/bin/monthly_tot_stats
dialup_admin/bin/tot_stats
dialup_admin/bin/truncate_radacct
dialup_admin/htdocs/group_admin.php3
dialup_admin/htdocs/user_delete.php3
dialup_admin/htdocs/user_edit.php3
dialup_admin/lib/sql/create_group.php3

index 600a0da..d47c90b 100644 (file)
@@ -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
index 168af3f..7ff8211 100755 (executable)
@@ -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;
 
index 402b28b..d44dbb6 100755 (executable)
@@ -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;
index 38ffcab..69bddc6 100755 (executable)
@@ -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;
 
index f5659e7..bc3a472 100755 (executable)
@@ -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;
 
index 09f9193..a2eb545 100755 (executable)
@@ -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;
 
index 49e7a17..58326f8 100644 (file)
@@ -89,7 +89,7 @@ if ($do_changes == 1){
 
 
    <form method=post>
-      <input type=hidden name=login value=<?php echo $login ?>>
+      <input type=hidden name=login value="<?php echo $login ?>">
       <input type=hidden name=do_changes value=0>
       <input type=hidden name=show value=0>
        <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
index 35f2128..32ab293 100644 (file)
@@ -80,7 +80,7 @@ EOM;
 }
 ?>
    <form method=post>
-      <input type=hidden name=login value=<?php print $login ?>>
+      <input type=hidden name=login value="<?php print $login ?>">
       <input type=hidden name=delete_user value="0">
        <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
 <tr>
index bdb32a9..a4754e8 100644 (file)
@@ -104,7 +104,7 @@ else if ($badusers == 1){
 
 ?>
    <form name="edituser" method=post>
-      <input type=hidden name=login value=<?php print $login ?>>
+      <input type=hidden name=login value="<?php print $login ?>">
       <input type=hidden name=user_type value=<?php print $user_type ?>>
       <input type=hidden name=change value="0">
       <input type=hidden name=add value="0">
index 0539b99..f16a644 100644 (file)
@@ -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 "<b>Unable to create group $login: " . da_sql_error($link,$config) . "</b><br>\n";
+                       $da_abort=1;
+               }
        }
-       else
-               echo "<b>Members list is empty!!</b><br>\n";
        if (!$da_abort){
                foreach($show_attrs as $key => $attr){
                        if ($attrmap["$key"] == 'none')