Commit 5c0de782 authored by canyonknight's avatar canyonknight Committed by Lukas Fleischer
Browse files

Use URL rewriting for user editing page



Allows for easier account editing and saner URLs. Update account editing links
to use new URL.

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

After:
AUR_URL/account/userfoo/edit
Signed-off-by: default avatarcanyonknight <canyonknight@gmail.com>
Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 98b6ba94
...@@ -51,7 +51,15 @@ if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { ...@@ -51,7 +51,15 @@ if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
} elseif (isset($tokens[1]) && '/' . $tokens[1] == get_user_route()) { } elseif (isset($tokens[1]) && '/' . $tokens[1] == get_user_route()) {
if (isset($tokens[2])) { if (isset($tokens[2])) {
$_REQUEST['U'] = $tokens[2]; $_REQUEST['U'] = $tokens[2];
$_REQUEST['Action'] = "AccountInfo";
if (isset($tokens[3])) {
if ($tokens[3] == 'edit') {
$_REQUEST['Action'] = "DisplayAccount";
} else {
$_REQUEST['Action'] = "AccountInfo";
}
}
} }
include get_route('/' . $tokens[1]); include get_route('/' . $tokens[1]);
} elseif (get_route($path) !== NULL) { } elseif (get_route($path) !== NULL) {
......
...@@ -50,7 +50,7 @@ else: ...@@ -50,7 +50,7 @@ else:
print "&nbsp;"; print "&nbsp;";
else: else:
?> ?>
<a href="<?php echo get_uri('/account/'); ?>?Action=DisplayAccount&amp;ID=<?php echo $row["ID"] ?>"><?php echo __("Edit") ?></a> <a href="<?php echo get_user_uri($row["Username"]) . "edit/" ?>"><?php echo __("Edit") ?></a>
<?php endif; ?> <?php endif; ?>
</td> </td>
</tr> </tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment