Changeset 411 for trunk/dns-rpc.cgi


Ignore:
Timestamp:
10/05/12 14:04:00 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Check and munge state in DNSDB::updateUser(), same as addUser().
Clean up copy-paste job for dns-rpc.cgi updateUser and make sure it
works. See #43.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r409 r411  
    244244  die "Missing UID\n" if !$args{uid};
    245245
    246 # not sure how to usefully represent permissions from any further out from DNSDB.pm :/
    247 # not to mention, permissions are checked at the UI layer, not the DB layer.
    248   my $perms = {domain_edit => 1, domain_create => 1, domain_delete => 1,
    249         record_edit => 1, record_create => 1, record_delete => 1
    250         };
    251246  # bend and twist;  get those arguments in in the right order!
     247  $args{type} = 'u' if !$args{type};
    252248  my @userargs = ($args{uid}, $args{username}, $args{group}, $args{pass}, $args{state}, $args{type});
    253249  for my $argname ('fname','lname','phone') {
     
    257253##fixme:  also underlying in DNSDB::updateUser():  no way to just update this or that attribute;
    258254#         have to pass them all in to be overwritten
    259   my ($code,$msg) = DNSDB::addUser($dbh, @userargs);
     255  my ($code,$msg) = DNSDB::updateUser($dbh, @userargs);
    260256  die $msg if $code eq 'FAIL';
    261257}
Note: See TracChangeset for help on using the changeset viewer.