mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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: canyonknight <canyonknight@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
98b6ba9479
commit
5c0de7825d
2 changed files with 10 additions and 2 deletions
|
@ -51,8 +51,16 @@ if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
|||
} elseif (isset($tokens[1]) && '/' . $tokens[1] == get_user_route()) {
|
||||
if (isset($tokens[2])) {
|
||||
$_REQUEST['U'] = $tokens[2];
|
||||
|
||||
if (isset($tokens[3])) {
|
||||
if ($tokens[3] == 'edit') {
|
||||
$_REQUEST['Action'] = "DisplayAccount";
|
||||
} else {
|
||||
$_REQUEST['Action'] = "AccountInfo";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
include get_route('/' . $tokens[1]);
|
||||
} elseif (get_route($path) !== NULL) {
|
||||
include get_route($path);
|
||||
|
|
|
@ -50,7 +50,7 @@ else:
|
|||
print " ";
|
||||
else:
|
||||
?>
|
||||
<a href="<?php echo get_uri('/account/'); ?>?Action=DisplayAccount&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; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Add table
Reference in a new issue