Changeset 788 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
10/08/15 17:49:27 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Update IP assignment update and IP delete for backup data. See #52.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r787 r788  
    11161116        );
    11171117
     1118  # Check to see if user is allowed to do anything with sensitive data
     1119  if ($IPDBacl{$authuser} =~ /s/) {
     1120    $updargs{privdata} = $webvar{privdata};
     1121    for my $bkfield (qw(brand model type src user vpass epass port)) {
     1122      $updargs{"bk$bkfield"} = $webvar{"bk$bkfield"};
     1123    }
     1124    $updargs{backupfields} = $webvar{backupfields};
     1125  } else {
     1126    # If the user doesn't have permissions to monkey with NOC-things, pass
     1127    # a flag so we don't treat it as "backup data removed"
     1128    $updargs{ignorebk} = 1;
     1129  }
     1130
    11181131  # Semioptional values
    1119   $updargs{privdata} = $webvar{privdata} if $IPDBacl{$authuser} =~ /s/;
    11201132  $updargs{node} = $webvar{node} if $webvar{node};
    11211133
     
    11821194  $page->param(desc => $webvar{desc});
    11831195  $page->param(notes => $webvar{notes});
    1184   $page->param(privdata => $webvar{privdata})
    1185         if $IPDBacl{$authuser} =~ /s/;
     1196  if ($IPDBacl{$authuser} =~ /s/) {
     1197    $page->param(nocling  => 1);
     1198    $page->param(privdata => $webvar{privdata});
     1199    if ($binfo->{hasbk}) {
     1200      $page->param(hasbackup => $binfo->{hasbk});
     1201      for my $bkfield (qw(brand model type src user vpass epass port)) {
     1202        $page->param("bk$bkfield" => $binfo->{"bk$bkfield"});
     1203      }
     1204    }
     1205  }
    11861206
    11871207} # update()
Note: See TracChangeset for help on using the changeset viewer.