[aur-dev] [PATCH 11/13] Use URL rewriting for user account update page

canyonknight canyonknight at gmail.com
Sat Sep 15 12:38:16 EDT 2012


The "UpdateAccount" page displays information as to whether an account
update was successful. All POST account info goes to this page, so use
it with sane URLs.

Before:
AUR_URL/account/?Action=UpdateAccount&U=userfoo

After:
AUR_URL/account/userfoo/update

Signed-off-by: canyonknight <canyonknight at gmail.com>
---
 web/html/index.php                 | 2 ++
 web/template/account_edit_form.php | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/web/html/index.php b/web/html/index.php
index 8013362..0e36883 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -55,6 +55,8 @@ if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
 		if (isset($tokens[3])) {
 			if ($tokens[3] == 'edit') {
 				$_REQUEST['Action'] = "DisplayAccount";
+			} elseif ($tokens[3] == 'update') {
+				$_REQUEST['Action'] = "UpdateAccount";
 			} else {
 				$_REQUEST['Action'] = "AccountInfo";
 			}
diff --git a/web/template/account_edit_form.php b/web/template/account_edit_form.php
index 7da8e33..9b5b1d8 100644
--- a/web/template/account_edit_form.php
+++ b/web/template/account_edit_form.php
@@ -1,4 +1,4 @@
-<form action="<?php echo get_uri('/account/'); ?>" method="post">
+<form action="<?php echo get_user_uri($U) . 'update/'; ?>" method="post">
 	<fieldset>
 		<input type="hidden" name="Action" value="<?php echo $A ?>" />
 		<?php if ($UID): ?>
-- 
1.7.12



More information about the aur-dev mailing list