return NOT_FOUND unless( $ok );
my $prettyAddr = encode( $address->pretty() );
genHtmlHead( $req, "$prettyAddr - add new item", undef );
+ print "<div class='top'>\n";
print "<h1>$prettyAddr - add new item</h1>\n";
genLocMenu( $req, $args, [ logItem( $auth ), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ] ] );
+ print "<div class='clear'></div></div>\n";
print "<div class='error'>$error</div>\n" if( defined $error );
print "<form name='newitem' id='newitem' method='POST' action=''>\n<table>";
genFormEx( [ [ 'input', 'Id:', 'text', 'id', 'maxlength="50"' ],
my( $result, $comName ) = $tables->submitItem( $data, $auth );
if( $result eq 'exists' ) {
genHtmlHead( $req, 'ID collision', undef );
+ print "<div class='top'>\n";
print '<h1>ID collision</h1>';
my $addr = PciIds::Address::new( $req->uri() );
genCustomMenu( $req, $addr, $args, [ logItem( $auth ), [ 'Add other item', 'newitem' ], $addr->canDiscuss() ? [ 'Discuss', 'newhistory' ] : () ] );
genPath( $req, $data->{'address'}, 1 );
+ print "<div class='clear'></div></div>\n";
print '<p>Sorry, this ID already exists.';
genHtmlTail();
return OK;
return NOT_FOUND unless( $ok );
my $prettyAddr = encode( $address->pretty() );
genHtmlHead( $req, "$prettyAddr - discuss", undef );
+ print "<div class='top'>\n";
print "<h1>$prettyAddr - discuss</h1>\n";
genLocMenu( $req, $args, [ logItem( $auth ), $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newhistory' ] ] );
+ print "<div class='clear'></div></div>\n";
print "<div class='error'>$error</div>\n" if( defined $error );
print "<form name='newhistory' id='newhistory' method='POST' action=''>\n<table>";
genFormEx( [ [ 'textarea', 'Text:', undef, 'text', 'rows="5" cols="50"' ],
sub genRegisterForm( $$$$ ) {
my( $req, $args, $error, $values ) = @_;
genHtmlHead( $req, 'Register a new user', undef );
+ print "<div class='top'>\n";
print '<h1>Register a new user</h1>';
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<div class="error">'.$error.'</div>' if( defined $error );
print '<form name="register" id="register" method="POST" action="">
<table>';
"\nThank you\n".
"\n(This is an autogenerated email, do not respond to it)" );
genHtmlHead( $req, 'Registration email sent', undef );
+ print "<div class='top'>\n";
print "<h1>Registration email sent</h1>\n";
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<p>
An email containing further information has been sent to you.
Please follow these instruction to finish the registration process.';
sub genConfirmForm( $$$$ ) {
my( $req, $args, $error, $values ) = @_;
genHtmlHead( $req, 'Confirm registration', undef );
+ print "<div class='top'>\n";
print '<h1>Confirm registration</h1>';
genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<div class="error">'.$error.'</div>' if( defined $error );
print '<p>Email address: '.encode( $values->{'email'} );
print '<form name="register-confirm" id="register-confirm" method="POST" action="">';
sub usedAddress( $$ ) {
my( $req, $args ) = @_;
genHtmlHead( $req, 'Used address', undef );
+ print "<div class='top'>\n";
print "<h1>Used address</h1>\n";
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Reset password', 'respass' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<div class="error">
<p>
An account for this address is already registered.
return OK;
}
genHtmlHead( $req, 'Registered', undef );
+ print "<div class='top'>\n";
print "<h1>Registered</h1>\n";
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<p>
You have registered successfully.';
genHtmlTail();
my( $req, $args, $error, $values ) = @_;
$req->headers_out->add( 'Set-Cookie' => new CGI::Cookie( -name => 'cookie-test', -value => 1 ) );
genHtmlHead( $req, 'Login', undef );
+ print "<div class='top'>\n";
print '<h1>Login</h1>';
genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Reset password', 'respass' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<div class="error"><p>'.$error.'</div>' if( defined $error );
print '<form name="login" id="login" method="POST" action="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=login"><table>';
genForm( [ [ 'Login name or email:', 'text', 'login', 'maxlength="255"' ],
my $prefix = ( !defined( $args->{'action'} ) or ( $args->{'action'} eq '' ) or ( $args->{'action'} eq 'list' ) ) ? 'read' : 'mods';
my $url = "http://".$req->hostname().setAddrPrefix( $req->uri(), $prefix ).buildExcept( 'redirectaction', $args );
genHtmlHead( $req, 'Logged in', undef );
+ print "<div class='top'>\n";
print '<h1>Logged in</h1>';
genPath( $req, PciIds::Address::new( $req->uri() ), 1 );
+ print "<div class='clear'></div></div>\n";
print "<p>You are logged in" . ( defined $args->{'redirectaction'} ? ", continue with your <a href='$url'>action</a>.\n" : ".\n" );
print '<div class="lastlog"><p>'.encode( $last ).'</div>' if( defined( $last ) );
genHtmlTail();
sub genResetPasswdForm( $$$$ ) {
my( $req, $args, $error, $values ) = @_;
genHtmlHead( $req, 'Reset password', undef );
+ print "<div class='top'>\n";
print "<h1>Reset password</h1>\n";
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print "<p>If you forgot your password (or didn't create one yet), you can reset it to a new value here.\n";
print "Provide your email address here and further instructions will be sent to you.\n";
print '<div class="error">'.$error.'</div>' if( defined $error );
"\n\nThank you\n".
"\n(This is an autogenerated email, do not respond to it)" );
genHtmlHead( $req, 'Reset password', undef );
+ print "<div class='top'>\n";
print "<h1>Reset password</h1>\n";
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print "<p>An email with information has been sent to your address.\n";
genHtmlTail();
return OK;
sub genResetPasswdConfigForm( $$$$$$ ) {
my( $req, $args, $error, $values, $email, $hash ) = @_;
genHtmlHead( $req, 'Reset password', undef );
+ print "<div class='top'>\n";
print "<h1>Reset password</h1>\n";
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<div class="error">'.$error.'</div>' if( defined $error );
print "<p>You can enter new password here:\n";
print '<form name="respass-confirm" id="respass-confirm" method="POST" action="">
if( defined( $myHash ) && ( $myHash eq $hash ) ) {
changePasswd( $tables, $id, $data->{'password'}, $email );
genHtmlHead( $req, 'Reset password', undef );
+ print "<div class='top'>\n";
print "<h1>Reset password</h1>\n";
genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+ print "<div class='clear'></div></div>\n";
print "<p>Your password was successfuly changed.\n";
genHtmlTail();
return OK;
delete $data->{'current_password'};
delete $data->{'confirm_password'};
delete $data->{'password'};
+ print "<div class='top'>\n";
print "<h1>User profile</h1>\n";
genLocMenu( $req, $args, [ logItem( $auth ), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'profile' ] ] );
+ print "<div class='clear'></div></div>\n";
print '<div class="error"><p>'.$error.'</div>' if defined $error;
print "<div class='info'><p>$info</div>\n" if defined $info;
print '<form name="profile" id="profile" method="POST" action=""><table>';