Parcourir la source

fixed delete_record function

root il y a 1 an
Parent
commit
a4bb764
1 fichiers modifiés avec 6 ajouts et 4 suppressions
  1. 6 4
      html/inc/sql.php

+ 6 - 4
html/inc/sql.php

@@ -616,7 +616,7 @@ function delete_record($db, $table, $filter)
         if (!$sql_result) {
             LOG_ERROR($db, "UPDATE Request (from delete): " . mysqli_error($db));
             return;
-        }
+            }
         //dns
         if (!empty($old['dns_name']) and !empty($old['ip'])) {
             $del_dns['name_type'] = 'A';
@@ -625,13 +625,15 @@ function delete_record($db, $table, $filter)
             $del_dns['type'] = 'del';
             if (!empty($rec_id)) {
                 $del_dns['auth_id'] = $rec_id;
-            }
+                }
             insert_record($db, 'dns_queue', $del_dns);
+            }
+        LOG_VERBOSE($db, "Deleted FROM table $table WHERE $filter $changed_log");
+        return $changed_log;
         }
-    }
 
     //never delete permanent user
-    if ($table === 'User_list' and $old['permanent']) { $delete_it = 0; }
+    if ($table === 'User_list' and $old['permanent']) { return; }
 
     //remove aliases
     if ($table === 'User_auth_alias') {