Changeset 407 for trunk


Ignore:
Timestamp:
10/05/12 12:45:23 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Check and fix addGroup and delGroup in dns-rpc.cgi. See #43.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r405 r407  
    173173
    174174  _commoncheck(\%args, 'y');
    175 
    176 # not sure how to usefully represent permissions from any further out from DNSDB.pm :/
     175  die "Missing new group name\n" if !$args{groupname};
     176  die "Missing parent group ID\n" if !$args{parent_id};
     177
     178# not sure how to usefully represent permissions via RPC.  :/
    177179# not to mention, permissions are checked at the UI layer, not the DB layer.
    178180  my $perms = {domain_edit => 1, domain_create => 1, domain_delete => 1,
     
    189191
    190192  _commoncheck(\%args, 'y');
     193  die "Missing group ID or name to remove\n" if !$args{group};
    191194
    192195  my ($code,$msg);
     
    196199  } else {
    197200    my $grpid = DNSDB::groupID($dbh, $args{group});
    198     die "Can't find group" if !$grpid;
     201    die "Can't find group\n" if !$grpid;
    199202    ($code,$msg) = DNSDB::delGroup($dbh, $grpid);
    200203  }
    201204  die $msg if $code eq 'FAIL';
     205  return $msg;
    202206}
    203207
Note: See TracChangeset for help on using the changeset viewer.