]> mj.ucw.cz Git - pciids.git/commitdiff
Use empty URLs for POST forms
authorMichal Vaner <vorner@ucw.cz>
Fri, 15 Aug 2008 12:49:23 +0000 (14:49 +0200)
committerMichal Vaner <vorner@ucw.cz>
Fri, 15 Aug 2008 12:49:23 +0000 (14:49 +0200)
It will use the same url as the current one.

PciIds/Html/Admin.pm
PciIds/Html/Changes.pm
PciIds/Html/Notifications.pm
PciIds/Html/Users.pm
TODO

index a1b6cb1e036fc6afde7abfff3b354107586ae908..e945bd7ffb9bba024047cd27a3cd40f9c3c508b3 100644 (file)
@@ -14,7 +14,7 @@ sub genNewAdminForm( $$$$ ) {
        genHtmlHead( $req, 'Administration ‒ pending events', undef );
        print "<h1>Administration ‒ pending events</h1>\n";
        print "<div class='error'>".$error."</div>\n" if( defined $error );
-       print '<form name="admin" id="admin" class="admin" method="POST" action="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args )."?action=admin\">\n";
+       print "<form name='admin' id='admin' class='admin' method='POST' action=''>\n";
        my $lastId;
        my $started = 0;
        my $cnt = 0;
index ff5242b126f8fc048554075aa30ae48e1db3f5e4..d31c916039311a0dfb1265fc3bc22f9708700e51 100644 (file)
@@ -16,7 +16,7 @@ sub genNewItemForm( $$$$$ ) {
        genHtmlHead( $req, "$prettyAddr - add new item", undef );
        print "<h1>$prettyAddr - add new item</h1>\n";
        print "<div class='error'>$error</div>\n" if( defined $error );
-       print "<form name='newitem' id='newitem' method='POST' action='".setAddrPrefix( $req->uri(), "mods" ).buildExcept( 'action', $args )."?action=newitem'>\n<table>";
+       print "<form name='newitem' id='newitem' method='POST' action=''>\n<table>";
        genFormEx( [ [ 'input', 'Id:', 'text', 'id', 'maxlength="50"' ],
                [ 'input', 'Name:', 'text', 'name', 'maxlength="200"' ],
                [ 'input', 'Description*:', 'text', 'description', 'maxlength="1024"' ],
@@ -85,7 +85,7 @@ sub genNewCommentForm( $$$$$ ) {
        genHtmlHead( $req, "$prettyAddr - add a comment to discussion", undef );
        print "<h1>$prettyAddr - add a comment to discussion</h1>\n";
        print "<div class='error'>$error</div>\n" if( defined $error );
-       print "<form name='newcomment' id='newitem' method='POST' action='".setAddrPrefix( $req->uri(), "mods" ).buildExcept( 'action', $args )."?action=newcomment'>\n<table>";
+       print "<form name='newcomment' id='newitem' method='POST' action=''>\n<table>";
        genFormEx( [ [ 'textarea', 'Text:', undef, 'text', 'rows="5" cols="50"' ],
                [ 'input', 'Name*:', 'text', 'name', 'maxlength="200"' ],
                [ 'input', 'Description*:', 'text', 'description', 'maxlength="1024"' ],
index 8dcdaed5281756ce3f1307d19f0cfadd127da600..042f06445cef8b2ad756073d46a6c252af94be3f 100644 (file)
@@ -27,7 +27,7 @@ sub genNotifForm( $$$$$$ ) {
                }
        }
        print "</ul></div>\n" if( $started );
-       print "<form name='notifications' id='notifications' method='POST' action='".setAddrPrefix( $req->uri(), "mods" ).buildExcept( 'action', $args )."?action=notifications'>\n";
+       print "<form name='notifications' id='notifications' method='POST' action=''>\n";
        print "<p><input type='checkbox' value='recursive' name='recursive'".( $data->{'recursive'} ? " checked='checked'" : "" )."> Recursive\n";
        print "<h3>Notification level</h3>\n";
        print "<p>\n";
index bea6669599086c26025e5cf9dbf5819fd1592023..c5ed90ebd20f0e4415909abbabdcd2abccf5275d 100644 (file)
@@ -20,7 +20,7 @@ sub genRegisterForm( $$$$ ) {
        genHtmlHead( $req, 'Register a new user', undef );
        print '<h1>Register a new user</h1>';
        print '<div class="error">'.$error.'</div>' if( defined $error );
-       print '<form name="register" id="register" method="POST" action="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=register">
+       print '<form name="register" id="register" method="POST" action="">
                <table>';
        genForm( [ [ 'Email:', 'text', 'email', 'maxlength="255"' ],
                [ '', 'submit', 'register', 'value="Register"' ] ], $values );
@@ -83,7 +83,7 @@ sub genConfirmForm( $$$$ ) {
        print '<h1>Confirm registration</h1>';
        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="'.setAddrPrefix( $req->uri(), 'mods' ).'?action=register-confirm">';
+       print '<form name="register-confirm" id="register-confirm" method="POST" action="">';
        print '<div class="hidden"><p><input type="hidden" value="'.encode( $values->{'email'} ).'" name="email"><input type="hidden" value="'.encode( $values->{'confirm'} ).'" name="confirm"></div>';
        print '<table>';
        genForm( [ [ 'Login (Optional):', 'text', 'login', 'maxlength="50"' ],
@@ -182,7 +182,7 @@ sub genLoginForm( $$$$ ) {
        my $addr = PciIds::Address::new( $req->uri() );
        genCustomMenu( $addr, $args, [ [ 'Register', 'register' ], [ 'Reset password', 'respass' ] ] );
        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>';
+       print '<form name="login" id="login" method="POST" action=""><table>';
        genForm( [ [ 'Login name or email:', 'text', 'login', 'maxlength="255"' ],
                [ 'Password:', 'password', 'password' ],
                [ '', 'submit', 'login', 'value="Login"' ] ], $values );
@@ -260,7 +260,7 @@ sub genResetPasswdForm( $$$$ ) {
        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 );
-       print '<form name="respass" id="respass" method="POST" action="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=respass">
+       print '<form name="respass" id="respass" method="POST" action="">
                <table>';
        genForm( [ [ 'Email:', 'text', 'email', 'maxlength="255"' ],
                [ '', 'submit', 'respass', 'value="Send"' ] ], $values );
@@ -308,7 +308,7 @@ sub genResetPasswdConfigForm( $$$$$$ ) {
        print "<h1>Reset password</h1>\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="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=respass-confirm">
+       print '<form name="respass-confirm" id="respass-confirm" method="POST" action="">
                <table>';
        genForm( [ [ 'Password:', 'password', 'password' ],
                [ 'Confirm password:', 'password', 'confirm_password' ],
@@ -376,7 +376,7 @@ sub genProfileForm( $$$$$ ) {
        print "<h1>User profile</h1>\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="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=profile"><table>';
+       print '<form name="profile" id="profile" method="POST" action=""><table>';
        genForm( [ [ 'Email:', 'text', 'email', 'maxlength="255"' ],
                [ 'Login:', 'text', 'login', 'maxlength="50"' ],
                [ 'Xmpp:', 'text', 'xmpp', 'maxlength="255"' ],
diff --git a/TODO b/TODO
index 4931dab331ba1c491bdfbe25b176b3bd998970a6..5e660d5f95fc5da6e5773949f54891d04b3fe6a0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,2 @@
 • deescape data from URL
 • In query, what do ? mean? Are they allowed?
-• POST forms can be empty urls