Changeset 163 for trunk/dns.cgi
- Timestamp:
- 11/04/11 16:30:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r162 r163 51 51 my %webvar = $q->Vars; 52 52 53 # load some local system defaults (mainly DB connect info) 54 # note this is not *absolutely* fatal, since there's a default dbname/user/pass in DNSDB.pm 55 # we'll catch a bad DB connect string once we get to trying that 56 ##fixme: pass params to loadConfig, and use them there, to allow one codebase to support multiple sites 57 if (!loadConfig()) { 58 warn "Using default configuration; unable to load custom settings: $DNSDB::errstr"; 59 } 60 53 61 # persistent stuff needed on most/all pages 54 62 my $sid = ($webvar{sid} ? $webvar{sid} : undef); … … 59 67 # init stuff. can probably axe this down to just above if'n'when user manipulation happens 60 68 $sid = $session->id(); 69 $session->expire($config{timeout}); 61 70 # need to know the "upper" group the user can deal with; may as well 62 71 # stick this in the session rather than calling out to the DB every time. … … 78 87 # Just In Case. Stale sessions should not be resurrectable. 79 88 if ($sid ne $session->id()) { 89 $sid = ''; 90 changepage(page=> "login", sessexpired => 1); 91 } 92 93 # normal expiry, more or less 94 if ($session->is_expired) { 95 $sid = ''; 80 96 changepage(page=> "login", sessexpired => 1); 81 97 } … … 139 155 my $sortby = "domain"; 140 156 my $sortorder = "ASC"; 141 142 # now load some local system defaults (mainly DB connect info)143 # note this is not *absolutely* fatal, since there's a default dbname/user/pass in DNSDB.pm144 # we'll catch a bad DB connect string a little further down.145 ##fixme: pass params to loadConfig, and use them there, to allow one codebase to support multiple sites146 if (!loadConfig()) {147 warn "Using default configuration; unable to load custom settings: $DNSDB::errstr";148 }149 157 150 158 ##fixme: quit throwing the database handle around, and put all the SQL and direct DB fiddling into DNSDB.pm … … 243 251 initPermissions($dbh,$session->param('uid')); 244 252 245 $page->param(sid => $sid) ;253 $page->param(sid => $sid) unless $webvar{page} eq 'login'; # no session ID on the login page 246 254 247 255 if ($webvar{page} eq 'login') { 248 256 249 257 $page->param(loginfailed => 1) if $webvar{loginfailed}; 250 ##fixme: set up session init to actually *check* for session timeout 251 $page->param(timeout => 1) if $webvar{sesstimeout}; 258 $page->param(sessexpired => 1) if $webvar{sessexpired}; 252 259 253 260 } elsif ($webvar{page} eq 'domlist' or $webvar{page} eq 'index') { … … 780 787 ##fixme: need to clean up log when deleting a major container 781 788 logaction(0, $session->param("username"), $webvar{curgroup}, "Deleted group $deleteme"); 782 # success. go back to the domain list, do not pass "GO"783 789 changepage(page => "grpman", resultmsg => "Deleted group $deleteme"); 784 790 } … … 832 838 ##fixme push the SQL and direct database fiddling off into a sub in DNSDB.pm 833 839 ##fixme 834 835 ##fixme: un-hardcode the limit?836 # $perpage = 50;837 840 838 841 my $sth = $dbh->prepare("SELECT count(*) FROM domains WHERE group_id=?"); … … 1363 1366 1364 1367 ##fixme put in some real log-munching stuff 1365 ##fixme need to add bits to *create* log entries...1366 1368 my $sql = "SELECT user_id, email, name, entry, date_trunc('second',stamp) FROM log WHERE "; 1367 1369 my $id = $curgroup; # we do this because the group log may be called from (almost) any page,
Note:
See TracChangeset
for help on using the changeset viewer.