]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
Add more error messages when interacting with the SQL database
authorkkalev <kkalev>
Sat, 28 Dec 2002 11:33:20 +0000 (11:33 +0000)
committerkkalev <kkalev>
Sat, 28 Dec 2002 11:33:20 +0000 (11:33 +0000)
21 files changed:
Changelog
htdocs/accounting.php3
htdocs/badusers.php3
htdocs/failed_logins.php3
htdocs/show_groups.php3
htdocs/stats.php3
htdocs/user_accounting.php3
htdocs/user_admin.php3
htdocs/user_finger.php3
lib/sql/change_attrs.php3
lib/sql/change_info.php3
lib/sql/change_passwd.php3
lib/sql/create_group.php3
lib/sql/create_user.php3
lib/sql/defaults.php3
lib/sql/delete_group.php3
lib/sql/delete_user.php3
lib/sql/find.php3
lib/sql/group_admin.php3
lib/sql/group_info.php3
lib/sql/user_info.php3

index 4a6ccf7045ebe65fb32cce1a40371d5c1f35e4ed..4969a6c8c73bc39eb22554732e8d469dd7e7516b 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -19,6 +19,7 @@ Ver 1.62:
 * 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).
+* Add more error messages when interacting with 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
index 53e9c6886d99f81523f4e606451e6c97cef88b5e..4fc570939f589ef00702370a42a6421e1ba580b4 100644 (file)
@@ -260,6 +260,8 @@ EOM;
                        echo "</tr>\n";
                }
        }
+       else
+               echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
 echo <<<EOM
        </table>
        </td></tr>
index f05d4ca3d07d757166337aedff40ff03f04fe1b9..be7e5be616a57598e2284430ad172dae29950c25 100644 (file)
@@ -107,7 +107,11 @@ if ($link){
 EOM;
                }
        }
+       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";
 echo <<<EOM
        </table>
 <tr><td>
index 15a166bce6a0874d66021a42eaaccf266e61991f..7f8736e0c764915547401e13ff10a99d6af94e1c 100644 (file)
@@ -134,7 +134,11 @@ if ($link){
 EOM;
                }
        }
+       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";
 echo <<<EOM
        </table>
 <tr><td>
index 02edd9680dbf04e70df982559e48f37cb46693fc..4e269425c0ec142318b94e59650108cc1447c6c3 100644 (file)
@@ -76,7 +76,7 @@ EOM;
                        echo "<b>Could not find any groups</b><br>\n";
        }
        else
-               echo "<b>Search failed. SQL Error: " . da_sql_error($link,$config) . "</b><br>\n";
+               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";
index 709d6fa90e1ef400b208665914a07a260637f401..5dd6d04170d3341ea4313cae67ff60d0bb4d1942 100644 (file)
@@ -103,8 +103,12 @@ if ($link){
                        $data[sum][3] += $row["$res[3]"];
                        $num[3] = ($data[$day][3]) ? $num[3] + 1 : $num[3];
                }
+               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";
 
 $num[1] = ($num[1]) ? $num[1] : 1;
 $num[2] = ($num[2]) ? $num[2] : 1;
index 86547f3a6c2653e03f2ff1d91c1c60b66d4631ed..57c6689c1ec9e21cdcf1e6c255ddc2f0ce18a439 100644 (file)
@@ -147,7 +147,11 @@ EOM;
                $acct_upload_sum = bytes2str($acct_upload_sum);
                $acct_download_sum = bytes2str($acct_download_sum);
        }
+       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";
 echo <<<EOM
                        <tr bgcolor="lightyellow">
                        <td colspan=3 align="right">Page Total</td>
index dfd147d9bb31b50b1935cffbebfe590ea0c829ef..be0d475f7c2e6bd51323b0979cb130e228e7bb12 100644 (file)
@@ -100,6 +100,8 @@ if ($link){
                $avg_output = bytes2str($row['avg(AcctOutputOctets)']);
                $tot_conns = $row['COUNT(*)'];
        }
+       else
+               echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
        $search = @da_sql_query($link,$config,
        "SELECT COUNT(*) FROM $config[sql_accounting_table] WHERE UserName = '$login'
        AND AcctStopTime >= '$week_str' AND AcctStopTime <= '$now_str'
@@ -110,6 +112,8 @@ if ($link){
                $row = @da_sql_fetch_array($search,$config);
                $tot_badlogins = $row['COUNT(*)'];
        }
+       else
+               echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
        for($i = 0; $i <=6; $i++){
                if ($days[$i] == '')
                        continue;
@@ -139,6 +143,8 @@ if ($link){
                                        $daily_used = "<font color=red>$daily_used</font>";
                        }
                }
+               else
+                       echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
        }
        if ($weekly_limit != 'none'){
                $tmp = $weekly_limit - $weekly_used;
@@ -192,6 +198,8 @@ if ($link){
                                $lastlog_output = 'not available';
                }
        }
+       else
+               echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
        if (! $logged_now){
                $search = @da_sql_query($link,$config,
                "SELECT * FROM $config[sql_accounting_table]
@@ -218,8 +226,12 @@ if ($link){
                        else
                                $not_known = 1;
                }
+               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";
 
 $monthly_limit = (is_numeric($monthly_limit)) ? time2str($monthly_limit) : $monthly_limit;
 $weekly_limit = (is_numeric($weekly_limit)) ? time2str($weekly_limit) : $weekly_limit;
index fbcf78a0e04d4d4adcdaba1b21463b224e92b91b..570885bb760727c308703e31369d3cb81db40571 100644 (file)
@@ -109,6 +109,8 @@ if ($link){
                $server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown';
        }
 }
+else
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
 
 <body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
index 6ec9d19e6e6c2f9f3fc7f3974b059637c823dede..3f9ea6f127d1fcfb4e4f944ce0e0746dfcb6fa97 100644 (file)
@@ -95,4 +95,4 @@ if ($link){
        }
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
index b00ca6fb1aff96a0d9566c9c4d9bebb7c3d040e5..b50c0a6a6ae5adf717f5a366dd6a4638fc6eed8c 100644 (file)
@@ -46,5 +46,5 @@ if ($link){
        
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index c0be03a02ea0e1ae4c8497b03b0eb3ad3de2d119..26dae6d473ea905fe65e3d0ea81eb6f086aa5714 100644 (file)
@@ -47,5 +47,5 @@ if ($link){
                echo "<b>Could not open encryption library file</b><br>\n";
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index 7c7bac0cca4737807e762373c0feca6e7653bdc2..335d8ef622681a14a4df815102909b687d437deb 100644 (file)
@@ -65,5 +65,5 @@ if ($link){
        echo "<b>Group created successfully</b><br>\n";
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index 8e16d134db6531d8024d8914ff46db8b9eced2c7..1ec8ca9dc3d18595e98358ebc3f890fa0fe9c539 100644 (file)
@@ -105,5 +105,5 @@ if ($link){
                echo "<b>Could not open encryption library file</b><br>\n";
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index 9b1f5f9dacb94f6788ea0ada8459892abccb6e0f..bd2a701eff46f9e9c4688cc004fca0cd0d11dc41 100644 (file)
@@ -107,7 +107,7 @@ if ($login != ''){
                        }
                }
                else
-                       echo "<b>Could not connect to database</b><br>\n";
+                       echo "<b>Could not connect to SQL database</b><br>\n";
        }while($stop == 0);
 }
 ?>
index cad79b69f907f7f4c64799f5fac16881cde0ee24..b400586974db8507e6109f77d7b16e526bde290a 100644 (file)
@@ -27,5 +27,5 @@ if ($link){
                echo "<b>Error deleting group $login from group reply table: " . da_sql_error($link,$config) . "</b><br>\n";
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index b7431a6fe762e4b74fa3a04ec7b3c8c478ab20ba..97109de2435cd0a0c51deb7b65f0fd58f5ad8158 100644 (file)
@@ -33,5 +33,5 @@ if ($link){
                echo "<b>Error deleting user $login from reply table: " . da_sql_error($link,$config) . "</b><br>\n";
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index 2c638193927cccd38c71eb9f512908d9c32826a9..d4291f191b17d58c61e9d3517c516c5a2b518b91 100644 (file)
@@ -39,5 +39,5 @@ if ($link){
        }
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index 94b78cc77452de8f95efa7eb0269ffc75e890d28..012b4e086e6ffb7a85d53f8b24248c440a26d714 100644 (file)
@@ -40,5 +40,5 @@ if ($link){
        }
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index eb29d740972e2f3917a0e90e7fb085c7bd6e1c95..d9cd06046dca5df169cab3da0ac571db42f31d65 100644 (file)
@@ -87,5 +87,5 @@ if ($link){
                echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>
index 81abcfb40d28b2019521947830be00bb26900a69..415ad331db5a0fc395f06248efc330ab76f69f53 100644 (file)
@@ -116,5 +116,5 @@ if ($link){
                echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
 }
 else
-       echo "<b>Could not connect to database</b><br>\n";
+       echo "<b>Could not connect to SQL database</b><br>\n";
 ?>