Selaa lähdekoodia

remove test fields

Roman Dmitriev 2 vuotta sitten
vanhempi
sitoutus
04c4ab000b
3 muutettua tiedostoa jossa 3 lisäystä ja 30 poistoa
  1. 0 16
      html/inc/common.php
  2. 0 13
      scripts/eyelib/mysql.pm
  3. 3 1
      updates/2-4-14/user_auth.sql

+ 0 - 16
html/inc/common.php

@@ -4204,14 +4204,6 @@ function update_record($db, $table, $filter, $newvalue)
         'alias' => '1',
     ];
 
-    if ($table === "User_auth") {
-        if (empty($newvalue["ip"])) { $newvalue["subnet_id"]=0; } else {
-            $newvalue['ip_int']=ip2long($newvalue["ip"]);
-            $auth_subnet=get_ip_subnet($db,$newvalue["ip"]);
-            if (empty($auth_subnet)) { $newvalue['subnet_id']=0; } else { $newvalue['subnet_id']=$auth_subnet['id']; }
-        }
-    }
-
     foreach ($newvalue as $key => $value) {
         if (!isset($value)) {
             $value = '';
@@ -4426,14 +4418,6 @@ function insert_record($db, $table, $newvalue)
         return;
     }
 
-    if ($table === "User_auth") {
-        if (empty($newvalue["ip"])) { $newvalue["subnet_id"]=0; } else {
-            $newvalue['ip_int']=ip2long($newvalue["ip"]);
-            $auth_subnet=get_ip_subnet($db,$newvalue["ip"]);
-            if (empty($auth_subnet)) { $newvalue['subnet_id']=0; } else { $newvalue['subnet_id']=$auth_subnet['id']; }
-        }
-    }
-
     $changed_log = '';
     $field_list = '';
     $value_list = '';

+ 0 - 13
scripts/eyelib/mysql.pm

@@ -431,13 +431,6 @@ my $dns_changed = 0;
 $rec_id = $old_record->{'id'} if ($old_record->{'id'});
 
 if ($table eq "User_auth") {
-
-    if (!$record->{'ip'}) { $record->{'subnet_id'}=0; } else {
-            $record->{'ip_int'}=StrToIp($record->{'ip'});
-            my $auth_subnet=get_ip_subnet($db,$record->{'ip'});
-            if (!$auth_subnet) { $record->{'subnet_id'}=0; } else { $record->{'subnet_id'}=$auth_subnet->{'id'}; }
-        }
-
     foreach my $field (keys %$record) {
         if (exists $acl_fields{$field}) { $record->{changed}="1"; }
         if (exists $dhcp_fields{$field}) { $record->{dhcp_changed}="1"; }
@@ -538,12 +531,6 @@ my $new_str='';
 my $dns_changed = 0;
 
 if ($table eq "User_auth") {
-    if (!$record->{'ip'}) { $record->{'subnet_id'}=0; } else {
-            $record->{'ip_int'}=StrToIp($record->{'ip'});
-            my $auth_subnet=get_ip_subnet($db,$record->{'ip'});
-            if (!$auth_subnet) { $record->{'subnet_id'}=0; } else { $record->{'subnet_id'}=$auth_subnet->{'id'}; }
-    }
-
     foreach my $field (keys %$record) {
         if (exists $acl_fields{$field}) { $record->{changed}="1"; }
         if (exists $dhcp_fields{$field}) { $record->{dhcp_changed}="1"; }

+ 3 - 1
updates/2-4-14/user_auth.sql

@@ -1,3 +1,5 @@
 ALTER TABLE `User_auth` CHANGE `dhcp_changed` `dhcp_changed` INT(11) NOT NULL DEFAULT '0';
 ALTER TABLE `User_auth` CHANGE `dns_name` `dns_name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;
-ALTER TABLE `User_auth` ADD `subnet_id` INT NULL DEFAULT NULL AFTER `ip_int`;
+ALTER TABLE `User_auth` DROP IF EXISTS `802_1x`;
+ALTER TABLE `User_auth` DROP IF EXISTS `subnet_id`;
+ALTER TABLE `User_auth` DROP IF EXISTS `dns_changed`;