From 6ed951505ca2dbca98a3bdec7982412e5dfbbd91 Mon Sep 17 00:00:00 2001 From: Flaviu Mates Date: Fri, 5 Jun 2020 09:06:55 +0200 Subject: [PATCH] Revert "TT#76111 - Refresh DB admins when executing ngcpcfg apply" This reverts commit 2fa57561b06bec1ee0ef9b0ed79c0b45c6508550. Reason for revert: Feature was partially backported and lawful intercept admins were deleted from databse. Feature needs redesign. Change-Id: Ie83bb5888474bd0f7e8af15b518be8723c01592c --- helper/sync-db | 76 -------------------------------------------------- 1 file changed, 76 deletions(-) diff --git a/helper/sync-db b/helper/sync-db index bc4b8c04..af662a2c 100755 --- a/helper/sync-db +++ b/helper/sync-db @@ -56,8 +56,6 @@ exit 1 unless(sync_general_timezone($dbh, exit 1 unless(sync_db_timezones($dbh)); -exit 1 unless(sync_li_admins($dbh, $config->{www_admin}->{lawful_intercept_admins})); - $dbh->disconnect; exit 0; @@ -255,78 +253,4 @@ SQL return 1; } -## add LI admins into MariaDB ############################## -sub sync_li_admins { - my ($dbh, $cfg_admins) = @_; - - my $sql = ''; - eval { - $dbh->begin_work() or die "Cannot start tx: $DBI::errstr\n"; - $dbh->do('USE billing') - or die "Cannot use billing database: $DBI::errstr\n"; - - my $existent_admins = $dbh->selectall_hashref(<{username} && $li_admin->{email}) { - print "A Lawful Intercept Administrator does not have username or password set\n"; - next; - } - if (!exists $existent_admins->{$li_admin->{username}} || - !$existent_admins->{$li_admin->{username}}->{email} || ($li_admin->{email} ne $existent_admins->{$li_admin->{username}}->{email})) { - #new admin or updated email - $vals and $vals .= ","; - $vals .= "('".$li_admin->{username}."','".$li_admin->{email}."','".$password."', 1, 1, 1, 1)"; - } - #delete all admins that have been found in config.yml and use the remaining ones for the delete statement - delete $existent_admins->{$li_admin->{username}}; - } - if ($vals) { - #insert new admins or update email - $dbh->do(<do(<rollback(); - return; - } - $dbh->commit(); - - return 1; -} - ## END OF FILE #################################################################