]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
Also use da_sql_error when reporting errors
authorkkalev <kkalev>
Tue, 13 Aug 2002 16:18:21 +0000 (16:18 +0000)
committerkkalev <kkalev>
Tue, 13 Aug 2002 16:18:21 +0000 (16:18 +0000)
lib/sql/change_attrs.php3
lib/sql/create_user.php3
lib/sql/defaults.php3
lib/sql/group_info.php3
lib/sql/user_info.php3

index fce0ba47e4d0c8c3af3618f6042f071abdbd1359..617caba36634a98e626275f3f66dae44a3a00857 100644 (file)
@@ -54,7 +54,7 @@ if ($link){
                                "UPDATE $table SET op = '$op_val' WHERE $query_key = '$login'
                                AND Attribute = '$sql_attr' AND Value = '$val';");
                                if (!$res || !@da_sql_affected_rows($link,$res,$config))
-                                       echo "<b>Operator change failed for attribute $key</b><br>\n";
+                                       echo "<b>Operator change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
                        }
 
        //      if value is the same as that in the sql database do nothing
@@ -65,7 +65,7 @@ if ($link){
                                $res = @da_sql_query($link,$config,
                                "DELETE FROM $table WHERE $query_key = '$login' AND Attribute = '$sql_attr';");
                                if (!$res || !@da_sql_affected_rows($link,$res,$config))
-                                       echo "<b>Delete failed for attribute $key</b><br>\n";
+                                       echo "<b>Delete failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
                        }
        //      if value is null then don't add it 
                        else if ($val == '')
@@ -83,7 +83,7 @@ if ($link){
                                        "INSERT INTO $table ($query_key,Attribute,Value $text2)
                                        VALUES ('$login','$sql_attr','$val' $op_val2);");
                                if (!$res || !@da_sql_affected_rows($link,$res,$config))
-                                       echo "<b>Change failed for attribute $key</b><br>\n";   
+                                       echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
                        }
                }
        }
index 19f996bdae0473a57d4e56af09a3eeacde4990bc..dd3b38457f09660bfeff7f25f8b930f4990caf51 100644 (file)
@@ -40,7 +40,7 @@ if ($link){
                                        echo "<b>User already exists in user info table.</b><br>\n";
                        }
                        else
-                               echo "<b>Could not add user information in user info table: " . da_sql_error($link,config) . "</b><br>\n";
+                               echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
                }
                if ($Fgroup != ''){
                        $res = @da_sql_query($link,$config,
index a997b36d3aa3de029a0df5b7a3df50358284b09b..1e4debcffee16dce3b05e79d0672bd8d6c50ff79 100644 (file)
@@ -56,10 +56,10 @@ if ($login != ''){
                                                }
                                        }
                                        else
-                                               echo "<b>Database query failed partially</b><br>\n";
+                                               echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
                                }
                                else
-                                       echo "<b>Database query failed</b><br>\n";      
+                                       echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
                                foreach($attrmap as $key => $val){
                                        if (isset($tmp[$val])){
                                                if ($tmp[$val][0] != '')
index 684e517438417808544ea6f4c65d72d932b6f38c..d26a9128aba7c6bbc332f1cab5c549c282bf5f33 100644 (file)
@@ -51,7 +51,7 @@ if ($link){
                        }
                }
                else
-                       echo "<b>Database query failed partially</b><br>\n";
+                       echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
                $res = @da_sql_query($link,$config,
                "SELECT UserName FROM $config[sql_usergroup_table] WHERE GroupName = '$login' ORDER BY UserName;");
                if ($res){
@@ -63,7 +63,7 @@ if ($link){
                        }
                }       
                else
-                       echo "<b>Database query failed partially</b><br>\n";
+                       echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
                foreach($attrmap as $key => $val){
                        if (isset($tmp[$val])){
                                $item_vals["$key"] = $tmp[$val];
@@ -76,7 +76,7 @@ if ($link){
 
        }
        else
-               echo "<b>Database query failed</b><br>\n";      
+               echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
 }
 else
        echo "<b>Could not connect to database</b><br>\n";
index b1704382c23175bb30bf795b9623ea90369909cd..e8bfdec388a15469196e93ceb0205d01d174be0a 100644 (file)
@@ -84,10 +84,12 @@ if ($link){
                                                $mobile = ($row[Mobile] != '') ? $row[Mobile] : '-';
                                        }
                                }                       
+                               else
+                                       echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
                        }
                }
                else
-                       echo "<b>Database query failed partially</b><br>\n";
+                       echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
                foreach($attrmap as $key => $val){
                        if (isset($tmp[$val])){
                                $item_vals["$key"] = $tmp[$val];
@@ -100,7 +102,7 @@ if ($link){
 
        }
        else
-               echo "<b>Database query failed</b><br>\n";      
+               echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
 }
 else
        echo "<b>Could not connect to database</b><br>\n";