Changeset 310 for trunk


Ignore:
Timestamp:
04/18/12 17:30:41 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Minor code review in dns.cgi

  • remove some stale commented code
  • clean up a minor ##fixme by keeping state on "Make domain active?" and target group for a new domain
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r308 r310  
    228228    # Snag ACL/permissions here too
    229229
    230 #    my $sth = $dbh->prepare("SELECT user_id,group_id,password,firstname,lastname FROM users WHERE username=?");
    231 #    $sth->execute($webvar{username});
    232 #
    233 #    if (my ($uid,$gid,$pass,$fname,$lname) = $sth->fetchrow_array) {
    234 #      $webvar{password} = '' if !$webvar{password};
    235 #
    236 #      if ($pass =~ m|^\$1\$([A-Za-z0-9/.]+)\$|) {
    237 #        # native passwords (crypt-md5)
    238 #        $webvar{loginfailed} = 1 if $pass ne unix_md5_crypt($webvar{password},$1);
    239 #      } elsif ($pass =~ /^[0-9a-f]{32}$/) {
    240 #        # VegaDNS import (hex-coded MD5)
    241 #        $webvar{loginfailed} = 1 if $pass ne md5_hex($webvar{password});
    242 #      } else {
    243 #        # plaintext (convenient now and then)
    244 #        $webvar{loginfailed} = 1 if $pass ne $webvar{password};
    245 #      }
    246 
    247230    my $userdata = login($dbh, $webvar{username}, $webvar{password});
    248231
     
    313296  $page->param(loginfailed => 1) if $webvar{loginfailed};
    314297  $page->param(sessexpired => 1) if $webvar{sessexpired};
    315 #  $page->param(orgname => $config{orgname}) if $config{orgname} ne 'Example Corp';
    316298  $page->param(version => $DNSDB::VERSION);
    317299
     
    355337        unless ($permissions{admin} || $permissions{domain_create});
    356338
    357   fill_grouplist("grouplist");
     339  $webvar{group} = $curgroup if !$webvar{group};
     340  fill_grouplist("grouplist", $webvar{group});
    358341
    359342  if ($session->param('add_failed')) {
     
    363346    $session->clear('errmsg');
    364347    $page->param(domain => $webvar{domain});
     348    $page->param(addinactive => $webvar{makeactive} eq 'n');
    365349  }
    366350
     
    391375    $session->param('add_failed', 1);
    392376##fixme:  domain a security risk for XSS?
    393 ##fixme:  keep active/inactive state, group selection
    394     changepage(page => "newdomain", domain => $webvar{domain}, errmsg => $msg);
     377    changepage(page => "newdomain", domain => $webvar{domain}, errmsg => $msg,
     378        makeactive => ($webvar{makeactive} ? 'y' : 'n'), group => $webvar{group});
    395379  }
    396380
  • trunk/templates/newdomain.tmpl

    r205 r310  
    3030        </tr>
    3131        <tr class="datalinelight">
    32                 <td>Make domain active on next DNS propagation</td><td><input type="checkbox" name="makeactive" checked="checked" /></td>
     32                <td>Make domain active on next DNS propagation</td><td><input type="checkbox" name="makeactive"<TMPL_UNLESS addinactive> checked="checked"</TMPL_UNLESS> /></td>
    3333        </tr>
    3434        <tr><td colspan="2" class="tblsubmit"><input type="submit" value="Add domain" /></td></tr>
Note: See TracChangeset for help on using the changeset viewer.