height: 83px;
margin: 0px;
padding: 0px;
- display: block;
+ width: 100%
+}
+
+#commitfestHeader tr {
+ vertical-align: top
}
#commitfestHeaderLogo {
#commitfestHeaderLogo img { border: 0px; }
-#commitfestNavSearchContainer {
- padding-bottom: 2px;
-}
-
#commitfestNav {
position: relative;
- text-align: left;
+ text-align: right;
margin-left: 10px;
margin-top: 5px;
- color: #666;
- font-size: 0.95em;
-}
-
-#commitfestSearch {
- position: relative;
- text-align: right;
- padding: 0;
- margin: 0;
- color: #666;
-}
-
-#commitfestTextSize {
- text-align: right;
- white-space: nowrap;
- margin-top: 7px;
- font-size: 0.95em;
-}
-
-#commitfestSearch form {
- position: relative;
- top: 5px;
- right: 0;
- margin: 0; /* need for IE Mac */
- text-align: right; /* need for IE Mac */
- white-space: nowrap; /* for Opera */
-}
-
-#commitfestSearch form label { color: #666; font-size: 0.95em; }
-#commitfestSearch form input { font-size: 0.95em; }
-
-#commitfestSearch form #submit {
- font-size: 0.95em;
- background: #7A7A7A;
- color: #fff;
- border-right: 1px solid #7A7A7A;
- border-bottom: 1px solid #7A7A7A;
- border-top: 1px solid #7A7A7A;
- border-left: 1px solid #7A7A7A;
- padding: 1px 4px;
-}
-
-#commitfestSearch form #q {
- width: 170px;
- font-size: 0.95em;
- border: 1px solid #7A7A7A;
- background: #E1E1E1;
- color: #000000;
- padding: 2px;
-}
-
-.frmDocSearch {
- padding: 0;
- margin: 0;
- display: inline;
-}
-
-.inpDocSearch {
- padding: 0;
- margin: 0;
- color: #000;
+ color: #fff;
+ font-weight: bold;
+ font-size: 0.95em
}
#commitfestContent {
margin-right: 10px;
}
-#commitfestComments {
- margin-top: 10px;
-}
-
-#commitfestClear {
- clear: both;
- margin: 0;
- padding: 0;
-}
-
/* Heading Definitions */
h1 {
line-height: 1.5em;
}
-.txtCommentsWrap {
- border: 2px solid #F5F5F5;
- width: 100%;
-}
-
-.txtCommentsContent {
- background: #F5F5F5;
- padding: 3px;
-}
-
-.txtCommentsPoster {
- float: left;
-}
-
-.txtCommentsDate {
- float: right;
-}
-
-.txtCommentsComment {
- padding: 3px;
-}
-
/* Link Styles */
#commitfestNav a {
- font-weight: bold;
+ color: #ffffff
}
while (my ($k, $v) = each %$criteria) {
if (ref $v) {
push @where,
- $self->{'dbh'}->quote_identifier($table) . ' = ' . $$v;
+ $self->{'dbh'}->quote_identifier($k) . ' = ' . $$v;
}
else {
push @where,
- $self->{'dbh'}->quote_identifier($table) . ' = ?';
+ $self->{'dbh'}->quote_identifier($k) . ' = ?';
push @bind, $v;
}
}
sysread(RANDOM_BITS, $random_bits, 16);
close(RANDOM_BITS);
my $session_cookie = unpack("H*", $random_bits);
- $r->db->{'trace'} = 1;
$r->db->insert('session', { 'id' => $session_cookie,
'username' => $u->{'username'} });
$r->db->commit;
- $r->header('Set-Cookie', "session=$session_cookie");
+ $r->header('Set-Cookie', "session=$session_cookie; path=/");
$r->redirect($value{'uri'} ne '' ? $value{'uri'} : '/');
}
else {
$r->render_template('login');
}
+sub logout {
+ my ($r) = @_;
+ $r->header('Set-Cookie', "session=; path=/");
+ my $session = $r->cookie('session');
+ if (defined $r->cookie('session')) {
+ $r->db->delete('session', { 'id' => $r->cookie('session') });
+ $r->db->commit();
+ }
+ $r->redirect('/');
+}
+
1;
%stash = %$vars if defined $vars;
$stash{'control'} = $self->{'control'};
$template->process('header.tt2', {
+ 'authenticate' => $self->authenticate(),
'link' => $self->{'link'},
'title' => $self->{'title'},
'error_list' => $self->{'error_list'},
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr">
<head>
- <title>PostgreSQL CommitFest Management[% IF title != '' %]: [% title %][% END %]</title>
+ <title>PostgreSQL CommitFest Management[% IF title != '' %]: [% title | htmlsafe %][% END %]</title>
<style type="text/css" media="screen" title="Normal Text">@import url("/layout/css/blue/commitfest.css");</style>
<script type="text/javascript" src="/layout/js/geckostyle.js"></script>
</head>
<body>
-<div id="commitfestHeader">
- <div id="commitfestHeaderLogo">
- <a href="/" title="PostgreSQL"><img src="/layout/images/docs/hdr_logo.png" width="206" height="80" alt="PostgreSQL" /></a>
- </div>
-</div>
+<table id="commitfestHeader">
+ <tr>
+ <td>
+ <div id="commitfestHeaderLogo">
+ <a href="/" title="PostgreSQL"><img src="/layout/images/docs/hdr_logo.png" width="206" height="80" alt="PostgreSQL" /></a>
+ </div>
+ </td>
+ <td id="commitfestNav">
+ [% IF authenticate.username.defined %]Welcome, [% authenticate.username | htmlsafe %] - <a href='/action/logout'>Log Out</a>
+ [% ELSE %]<a href='/action/login'>Log In</a>
+ [% END %]
+ </td>
+ </tr>
+</table>
<div id="commitfestContent">
<table cellspacing='0' cellpadding='0' border='0' width='100%'>