Changeset 163
- Timestamp:
- 11/04/11 16:30:51 (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r160 r163 113 113 templatedir => 'templates/', 114 114 # fmeh. this is a real web path, not a logical internal one. hm.. 115 # cssdir => 'templates/'; 115 # cssdir => 'templates/', 116 117 # Session params 118 timeout => '3600' # 1 hour default 116 119 ); 117 120 … … 189 192 $config{mailsender} = $1 if /^mailsender\s*=\s*([a-z0-9_.@-]+)/i; 190 193 $config{mailname} = $1 if /^mailname\s*=\s*([a-z0-9\s_.-]+)/i; 194 # session - note this is fed directly to CGI::Session 195 $config{timeout} = $1 if /^[tT][iI][mM][eE][oO][uU][tT]\s*=\s*(\d+[smhdwMy]?)/; 191 196 } 192 197 close CFG; -
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, -
trunk/templates/dns.css
r146 r163 33 33 } 34 34 35 table.login {36 text-align: center;37 border: thin solid #000000;38 background-color: #CCCCFF;39 }40 35 table.list { 41 36 background-color: #F0F0F0; … … 231 226 } 232 227 #login { 233 margin-top: 50px; 234 margin-bottom: 50px; 228 margin: 50px auto; 235 229 padding: 3px; 236 230 border: thin solid #000000; -
trunk/templates/login.tmpl
r125 r163 2 2 <fieldset> 3 3 <input type="hidden" name="action" value="login" /> 4 <input type="hidden" name="sid" value="<TMPL_VAR NAME=sid>" />5 4 <input type="hidden" name="page" value="login" /> 6 5
Note:
See TracChangeset
for help on using the changeset viewer.