[aur-dev] [PATCH 3/6] Use virtual path feature for links

Lukas Fleischer archlinux at cryptocrack.de
Sun Jul 15 17:23:52 EDT 2012


Use virtual paths in links (e.g. link to "/packages/" instead of
"/packages.php" etc.) if the virtual path feature is enabled.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/html/addvote.php                    |  2 +-
 web/html/home.php                       |  2 +-
 web/html/login.php                      |  4 ++--
 web/html/logout.php                     |  2 +-
 web/html/passreset.php                  |  6 +++---
 web/html/pkgsubmit.php                  |  4 ++--
 web/html/tu.php                         |  8 ++++----
 web/html/voters.php                     |  4 ++--
 web/lib/acctfuncs.inc.php               |  4 ++--
 web/lib/pkgfuncs.inc.php                |  6 +++---
 web/template/account_details.php        |  2 +-
 web/template/account_edit_form.php      |  2 +-
 web/template/account_search_results.php |  8 ++++----
 web/template/actions_form.php           |  2 +-
 web/template/header.php                 | 20 ++++++++++----------
 web/template/pkg_comments.php           |  4 ++--
 web/template/pkg_details.php            | 14 +++++++-------
 web/template/pkg_search_form.php        |  2 +-
 web/template/pkg_search_results.php     | 10 +++++-----
 web/template/search_accounts_form.php   |  2 +-
 web/template/stats/updates_table.php    |  2 +-
 web/template/stats/user_table.php       |  4 ++--
 web/template/tu_details.php             |  4 ++--
 web/template/tu_list.php                |  4 ++--
 24 files changed, 61 insertions(+), 61 deletions(-)

diff --git a/web/html/addvote.php b/web/html/addvote.php
index d3bd7d4..d1cd809 100644
--- a/web/html/addvote.php
+++ b/web/html/addvote.php
@@ -68,7 +68,7 @@ if ($atype == "Trusted User" || $atype == "Developer") {
 <div class="box">
 	<h2><?php print __("Submit a proposal to vote on.") ?></h2>
 
-	<form action="addvote.php" method="post">
+	<form action="<?php echo get_uri('/addvote/'); ?>" method="post">
 		<p>
 			<b><?php print __("Applicant/TU") ?></b>
 			<input type="text" name="user" value="<?php if (!empty($_POST['user'])) { print htmlentities($_POST['user'], ENT_QUOTES); } ?>" />
diff --git a/web/html/home.php b/web/html/home.php
index 48f5e00..df112b8 100644
--- a/web/html/home.php
+++ b/web/html/home.php
@@ -91,7 +91,7 @@ $dbh = db_connect();
 </div>
 <div id="content-right">
 	<div id="pkgsearch" class="widget">
-		<form id="pkgsearch-form" method="get" action="packages.php">
+		<form id="pkgsearch-form" method="get" action="<?php get_uri('/packages/'); ?>">
 			<fieldset>
 				<label for="pkgsearch-field">Package Search:</label>
 				<input type="hidden" name="O" value="0" />
diff --git a/web/html/login.php b/web/html/login.php
index 7f4f342..9c6a546 100644
--- a/web/html/login.php
+++ b/web/html/login.php
@@ -17,7 +17,7 @@ html_header('AUR ' . __("Login"));
 	<?php if (isset($_COOKIE["AURSID"])): ?>
 	<p>
 		<?php echo __("Logged-in as: %s", '<strong>' . username_from_sid($_COOKIE["AURSID"]) . '</strong>'); ?>
-		<a href="logout.php">[<?php print __("Logout"); ?>]</a>
+		<a href="<?php get_uri('/logout/'); ?>">[<?php print __("Logout"); ?>]</a>
 	</p>
 	<?php elseif (!$DISABLE_HTTP_LOGIN || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'])): ?>
 	<form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES) ?>">
@@ -40,7 +40,7 @@ html_header('AUR ' . __("Login"));
 			</p>
 			<p>
 				<input type="submit" class="button" value="<?php  print __("Login"); ?>" />
-				<a href="passreset.php">[<?php echo __('Forgot Password') ?>]</a>
+				<a href="<?php echo get_uri('/passreset/') ?>">[<?php echo __('Forgot Password') ?>]</a>
 			</p>
 		</fieldset>
 	</form>
diff --git a/web/html/logout.php b/web/html/logout.php
index fe8ffb0..835f1c9 100644
--- a/web/html/logout.php
+++ b/web/html/logout.php
@@ -20,5 +20,5 @@ if (isset($_COOKIE["AURSID"])) {
 	clear_expired_sessions($dbh);
 }
 
-header('Location: index.php');
+header('Location: /');
 
diff --git a/web/html/passreset.php b/web/html/passreset.php
index cb88e5a..9fca505 100644
--- a/web/html/passreset.php
+++ b/web/html/passreset.php
@@ -8,7 +8,7 @@ set_lang();                 # this sets up the visitor's language
 check_sid();                # see if they're still logged in
 
 if (isset($_COOKIE["AURSID"])) {
-	header('Location: index.php');
+	header('Location: /');
 	exit();
 }
 
@@ -48,14 +48,14 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir
 		           'your password follow the link below, otherwise ignore '.
 		           'this message and nothing will happen.').
 		           "\n\n".
-		           "{$AUR_LOCATION}/passreset.php?".
+			   "{$AUR_LOCATION}/" . get_uri('/passreset/') . "?".
 		           "resetkey={$resetkey}";
 		$body = wordwrap($body, 70);
 		$headers = "Reply-to: nobody at archlinux.org\nFrom:aur-notify at archlinux.org\nX-Mailer: PHP\nX-MimeOLE: Produced By AUR";
 		@mail($email, 'AUR Password Reset', $body, $headers);
 
 	}
-	header('Location: passreset.php?step=confirm');
+	header('Location: ' . get_uri('/passreset/') . '?step=confirm');
 	exit();
 }
 
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 65e2f6d..8c93b0c 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -400,7 +400,7 @@ if ($uid):
 			# Entire package creation process is atomic
 			end_atomic_commit($dbh);
 
-			header('Location: packages.php?ID=' . $packageID);
+			header('Location: ' . get_uri('/packages/') . '?ID=' . $packageID);
 		}
 
 		chdir($cwd);
@@ -429,7 +429,7 @@ html_header("Submit");
 			$pkg_categories = pkgCategories();
 ?>
 
-<form action="pkgsubmit.php" method="post" enctype="multipart/form-data">
+<form action="<?php echo get_uri('/submit/'); ?>" method="post" enctype="multipart/form-data">
 	<fieldset>
 		<div>
 			<input type="hidden" name="pkgsubmit" value="1" />
diff --git a/web/html/tu.php b/web/html/tu.php
index 8619903..084a223 100644
--- a/web/html/tu.php
+++ b/web/html/tu.php
@@ -116,17 +116,17 @@ if ($atype == "Trusted User" || $atype == "Developer") {
 		$nextresult = proposal_count();
 ?>
 <div class="box">
-	<p><a href="addvote.php"><?php print __("Add Proposal") ?></a></p>
+	<p><a href="<?php echo get_uri('/addvote/'); ?>"><?php print __("Add Proposal") ?></a></p>
 
 	<?php if ($result):
 		$by = htmlentities($by, ENT_QUOTES); ?>
 		<?php if ($off != 0):
 			$back = (($off - $limit) <= 0) ? 0 : $off - $limit; ?>
-			<a href='tu.php?off=<?php print $back ?>&by=<?php print $by ?>'><?php print __("Back") ?></a>
+			<a href='<?php echo get_uri('/tu/'); ?>?off=<?php print $back ?>&by=<?php print $by ?>'><?php print __("Back") ?></a>
 		<?php endif; ?>
 		<?php if (($off + $limit) < $nextresult):
 			$forw = $off + $limit; ?>
-		<a href="tu.php?off=<?php print $forw ?>&by=<?php print $by ?>"><?php print __("Next") ?></a>
+		<a href="<?php echo get_uri('/tu/'); ?>?off=<?php print $forw ?>&by=<?php print $by ?>"><?php print __("Next") ?></a>
 		<?php endif; ?>
 	<?php endif; ?>
 </div>
@@ -134,7 +134,7 @@ if ($atype == "Trusted User" || $atype == "Developer") {
 	}
 }
 else {
-	header('Location: index.php');
+	header('Location: /');
 }
 
 html_footer(AUR_VERSION);
diff --git a/web/html/voters.php b/web/html/voters.php
index 231e323..378e605 100644
--- a/web/html/voters.php
+++ b/web/html/voters.php
@@ -15,12 +15,12 @@ if ($atype == 'Trusted User' || $atype== 'Developer'):
 ?>
 
 <div class="box">
-	<h2>Votes for <a href="packages.php?ID=<?php echo $pkgid ?>"><?php echo pkgname_from_id($pkgid) ?></a></h2>
+	<h2>Votes for <a href="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $pkgid ?>"><?php echo pkgname_from_id($pkgid) ?></a></h2>
 	<div class="boxbody">
 
 <?php
 	while (list($indx, $row) = each($votes)): ?>
-		<a href="account.php?Action=AccountInfo&ID=<?php echo $row['UsersID'] ?>"><?php echo htmlspecialchars($row['Username']) ?></a><br />
+		<a href="<?php echo get_uri('/account/'); ?>?Action=AccountInfo&ID=<?php echo $row['UsersID'] ?>"><?php echo htmlspecialchars($row['Username']) ?></a><br />
 	<?php endwhile; ?>
 	</div>
 </div>
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index a41a4e7..fcc6a60 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -545,7 +545,7 @@ function password_reset($hash, $salt, $resetkey, $email, $dbh=NULL) {
 		$error = __('Invalid e-mail and reset key combination.');
 		return $error;
 	} else {
-		header('Location: passreset.php?step=complete');
+		header('Location: ' . get_uri('/passreset/') . '?step=complete');
 		exit();
 	}
 }
@@ -817,7 +817,7 @@ function voter_list($voteid, $dbh=NULL) {
 	$result = db_query($q, $dbh);
 	if ($result) {
 		while ($row = mysql_fetch_assoc($result)) {
-			$whovoted.= '<a href="account.php?Action=AccountInfo&ID='.$row['UserID'].'">'.$row['Username'].'</a> ';
+			$whovoted.= '<a href="' . get_uri('/accounts/') . '?Action=AccountInfo&ID='.$row['UserID'].'">'.$row['Username'].'</a> ';
 		}
 	}
 	return $whovoted;
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 0009b93..bdf8976 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -238,7 +238,7 @@ function add_package_comment($pkgid, $uid, $comment, $dbh=NULL) {
 		# Simply making these strings translatable won't work, users would be
 		# getting emails in the language that the user who posted the comment was in
 		$body =
-		'from ' . $AUR_LOCATION . '/packages.php?ID='
+		'from ' . $AUR_LOCATION . '/' . get_uri('/packages/') . '?ID='
 		. $pkgid . "\n"
 		. username_from_sid($_COOKIE['AURSID'], $dbh) . " wrote:\n\n"
 		. $comment
@@ -744,7 +744,7 @@ function pkg_flag ($atype, $ids, $action=true, $dbh=NULL) {
 		if (mysql_num_rows($result)) {
 			while ($row = mysql_fetch_assoc($result)) {
 				# construct email
-				$body = "Your package " . $row['Name'] . " has been flagged out of date by " . $f_name . " [1]. You may view your package at:\n" . $AUR_LOCATION . "/packages.php?ID=" . $row['ID'] . "\n\n[1] - " . $AUR_LOCATION . "/account.php?Action=AccountInfo&ID=" . $f_uid;
+				$body = "Your package " . $row['Name'] . " has been flagged out of date by " . $f_name . " [1]. You may view your package at:\n" . $AUR_LOCATION . "/" . get_uri('/packages/') . "?ID=" . $row['ID'] . "\n\n[1] - " . $AUR_LOCATION . "/" . get_uri('/accounts/') . "?Action=AccountInfo&ID=" . $f_uid;
 				$body = wordwrap($body, 70);
 				$headers = "Reply-to: nobody at archlinux.org\nFrom:aur-notify at archlinux.org\nX-Mailer: PHP\nX-MimeOLE: Produced By AUR\n";
 				@mail($row['Email'], "AUR Out-of-date Notification for ".$row['Name'], $body, $headers);
@@ -813,7 +813,7 @@ function pkg_delete ($atype, $ids, $mergepkgid, $dbh=NULL) {
 			$body = "";
 			if ($mergepkgid) {
 				$body .= username_from_sid($_COOKIE['AURSID']) . " merged \"".$pkgname."\" into \"$mergepkgname\".\n\n";
-				$body .= "You will no longer receive notifications about this package, please go to https://aur.archlinux.org/packages.php?ID=".$mergepkgid." and click the Notify button if you wish to recieve them again.";
+				$body .= "You will no longer receive notifications about this package, please go to https://aur.archlinux.org/" . get_uri('/packages/') . "?ID=".$mergepkgid." and click the Notify button if you wish to recieve them again.";
 			} else {
 				$body .= username_from_sid($_COOKIE['AURSID']) . " deleted \"".$pkgname."\".\n\n";
 				$body .= "You will no longer receive notifications about this package.";
diff --git a/web/template/account_details.php b/web/template/account_details.php
index f4c31c6..8551533 100644
--- a/web/template/account_details.php
+++ b/web/template/account_details.php
@@ -51,7 +51,7 @@
 	</tr>
 
 	<tr>
-		<td colspan="2"><a href="packages.php?K=<?php echo $row['Username'] ?>&SeB=m"><?php echo __("View this user's packages") ?></a></td>
+		<td colspan="2"><a href="<?php echo get_uri('/packages/'); ?>?K=<?php echo $row['Username'] ?>&SeB=m"><?php echo __("View this user's packages") ?></a></td>
 	</tr>
 
 </table>
diff --git a/web/template/account_edit_form.php b/web/template/account_edit_form.php
index c32eb94..fd58f84 100644
--- a/web/template/account_edit_form.php
+++ b/web/template/account_edit_form.php
@@ -1,4 +1,4 @@
-<form action="account.php" method="post">
+<form action="<?php echo get_uri('/account/'); ?>" method="post">
 	<fieldset>
 		<input type="hidden" name="Action" value="<?php echo $A ?>" />
 		<?php if ($UID): ?>
diff --git a/web/template/account_search_results.php b/web/template/account_search_results.php
index f2ed62e..cc2a1c2 100644
--- a/web/template/account_search_results.php
+++ b/web/template/account_search_results.php
@@ -28,7 +28,7 @@ else:
 			?>
 				<tbody>
 				<tr class ="<?php echo $c ?>">
-					<td><a href="packages.php?SeB=m&K=<?php echo $row["Username"] ?>"><?php echo $row["Username"] ?></a></td>
+					<td><a href="<?php echo get_uri('/packages/'); ?>?SeB=m&K=<?php echo $row["Username"] ?>"><?php echo $row["Username"] ?></a></td>
 					<td><?php echo $row["AccountType"] ?></td>
 					<td>
 						<?php
@@ -50,7 +50,7 @@ else:
 							print " ";
 						else:
 					?>
-						<a href="account.php?Action=DisplayAccount&ID=<?php echo $row["ID"] ?>"><?php echo __("Edit") ?></a>
+						<a href="<?php echo get_uri('/account/'); ?>?Action=DisplayAccount&ID=<?php echo $row["ID"] ?>"><?php echo __("Edit") ?></a>
 					<?php endif; ?>
 					</td>
 				</tr>
@@ -63,7 +63,7 @@ else:
 	<table class="results">
 		<tr>
 			<td align="left">
-				<form action="account.php" method="post">
+			<form action="<?php echo get_uri('/account/'); ?>" method="post">
 					<fieldset>
 						<input type="hidden" name="Action" value="SearchAccounts" />
 						<input type="hidden" name="O" value="<?php echo ($OFFSET-$HITS_PER_PAGE) ?>" />
@@ -78,7 +78,7 @@ else:
 				</form>
 			</td>
 			<td align="right">
-				<form action="account.php" method="post">
+				<form action="<?php echo get_uri('/account/'); ?>" method="post">
 					<fieldset>
 						<input type="hidden" name="Action" value="SearchAccounts" />
 						<input type="hidden" name="O" value="<?php echo ($OFFSET+$HITS_PER_PAGE) ?>" />
diff --git a/web/template/actions_form.php b/web/template/actions_form.php
index ff0fd4e..9cd5024 100644
--- a/web/template/actions_form.php
+++ b/web/template/actions_form.php
@@ -1,5 +1,5 @@
 <div class="box">
-	<form action="packages.php?ID=<?php echo $row['ID'] ?>" method="post">
+	<form action="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $row['ID'] ?>" method="post">
 		<fieldset>
 			<input type="hidden" name="IDs[<?php echo $row['ID'] ?>]" value="1" />
 			<input type="hidden" name="ID" value="<?php echo $row['ID'] ?>" />
diff --git a/web/template/header.php b/web/template/header.php
index 246b304..52c0ab8 100644
--- a/web/template/header.php
+++ b/web/template/header.php
@@ -8,7 +8,7 @@
 	<link rel='stylesheet' type='text/css' href='/css/archweb.css' />
 	<link rel='stylesheet' type='text/css' href='/css/aur.css' />
 	<link rel='shortcut icon' href='/images/favicon.ico' />
-	<link rel='alternate' type='application/rss+xml' title='Newest Packages RSS' href='rss.php' />
+	<link rel='alternate' type='application/rss+xml' title='Newest Packages RSS' href='<?php echo get_uri('/rss/'); ?>' />
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   </head>
 	<body>
@@ -50,17 +50,17 @@
 			</div>
 			<div id="archdev-navbar">
 				<ul>
-					<li><a href="index.php">AUR <?php print __("Home"); ?></a></li>
-					<li><a href="packages.php"><?php print __("Packages"); ?></a></li>
+					<li><a href="<?php echo get_uri('/'); ?>">AUR <?php print __("Home"); ?></a></li>
+					<li><a href="<?php echo get_uri('/packages/'); ?>"><?php print __("Packages"); ?></a></li>
 					<?php if (isset($_COOKIE['AURSID'])): ?>
-						<li><a href="packages.php?SeB=m&K=<?php print username_from_sid($_COOKIE["AURSID"]); ?>"><?php print __("My Packages"); ?></a></li>
-						<li><a href="pkgsubmit.php"><?php print __("Submit"); ?></a></li>
-						<li><a href="account.php"><?php print __("Accounts"); ?></a></li>
-						<?php if (check_user_privileges()): ?><li><a href="tu.php"><?php print __("Trusted User"); ?></a></li><?php endif; ?>
-						<li><a href="logout.php"><?php print __("Logout"); ?></a></li>
+						<li><a href="<?php echo get_uri('/packages/'); ?>?SeB=m&K=<?php print username_from_sid($_COOKIE["AURSID"]); ?>"><?php print __("My Packages"); ?></a></li>
+						<li><a href="<?php echo get_uri('/submit/'); ?>"><?php print __("Submit"); ?></a></li>
+						<li><a href="<?php echo get_uri('/accounts/'); ?>"><?php print __("Accounts"); ?></a></li>
+						<?php if (check_user_privileges()): ?><li><a href="<?php echo get_uri('/tu/'); ?>"><?php print __("Trusted User"); ?></a></li><?php endif; ?>
+						<li><a href="<?php echo get_uri('/logout/'); ?>"><?php print __("Logout"); ?></a></li>
 					<?php else: ?>
-						<li><a href="account.php"><?php print __("Register"); ?></a></li>
-						<li><a href="login.php"><?php print __("Login"); ?></a></li>
+						<li><a href="<?php echo get_uri('/register/'); ?>"><?php print __("Register"); ?></a></li>
+						<li><a href="<?php echo get_uri('/login/'); ?>"><?php print __("Login"); ?></a></li>
 					<?php endif; ?>
 				</ul>
 			</div><!-- #archdev-navbar -->
diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index b2d9ca5..5b5f610 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -10,11 +10,11 @@ $count = package_comments_count($_GET['ID']);
 
 	<?php while (list($indx, $row) = each($comments)): ?>
 		<?php if ($SID):
-			$row['UserName'] = "<a href=\"account.php?Action=AccountInfo&ID={$row['UsersID']}\">{$row['UserName']}</a>";
+			$row['UserName'] = "<a href=\"<?php echo get_uri('/account/'); ?>?Action=AccountInfo&ID={$row['UsersID']}\">{$row['UserName']}</a>";
 		endif; ?>
 		<h4>
 			<?php if (canDeleteCommentArray($row, $atype, $uid)): ?>
-				<form method="post" action="packages.php?ID=<?php echo $row['ID'] ?>">
+				<form method="post" action="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $row['ID'] ?>">
 					<fieldset style="display:inline;">
 						<input type="hidden" name="action" value="do_DeleteComment" />
 						<input type="hidden" name="comment_id" value="<?php echo $row['ID'] ?>" />
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index b41fded..4cb8602 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -57,7 +57,7 @@ if ($SID && ($uid == $row["MaintainerUID"] ||
 	($atype == "Developer" || $atype == "Trusted User"))):
 ?>
 			<td>
-				<form method="post" action="packages.php?ID=<?php echo $pkgid ?>">
+				<form method="post" action="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $pkgid ?>">
 					<div>
 						<input type="hidden" name="action" value="do_ChangeCategory" />
 						<?php if ($SID): ?>
@@ -75,7 +75,7 @@ if ($SID && ($uid == $row["MaintainerUID"] ||
 				</form>
 <?php else: ?>
 			<td>
-				<a href="packages.php?C=<?php echo $row['CategoryID'] ?>"><?php print $row['Category'] ?></a>
+				<a href="<?php echo get_uri('/packages/'); ?>?C=<?php echo $row['CategoryID'] ?>"><?php print $row['Category'] ?></a>
 <?php endif; ?>
 			</td>
 		<tr>
@@ -88,7 +88,7 @@ if ($SID && ($uid == $row["MaintainerUID"] ||
 if ($row["SubmitterUID"]):
 	if ($SID):
 ?>
-			<td><a href="account.php?Action=AccountInfo&ID=<?php echo htmlspecialchars($row['SubmitterUID'], ENT_QUOTES) ?>" title="<?php echo __('View account information for')?> <?php echo htmlspecialchars($submitter) ?>"><?php echo htmlspecialchars($submitter) ?></a></td>
+			<td><a href="<?php echo get_uri('/account/'); ?>?Action=AccountInfo&ID=<?php echo htmlspecialchars($row['SubmitterUID'], ENT_QUOTES) ?>" title="<?php echo __('View account information for')?> <?php echo htmlspecialchars($submitter) ?>"><?php echo htmlspecialchars($submitter) ?></a></td>
 <?php else: ?>
 		<td><?php echo htmlspecialchars($submitter) ?></td>
 	<?php endif; ?>
@@ -101,7 +101,7 @@ if ($row["SubmitterUID"]):
 if ($row["MaintainerUID"]):
 	if ($SID):
 ?>
-			<td><a href="account.php?Action=AccountInfo&ID=<?php echo htmlspecialchars($row['MaintainerUID'], ENT_QUOTES) ?>" title="<?php echo __('View account information for')?> <?php echo htmlspecialchars($maintainer) ?>"><?php echo htmlspecialchars($maintainer) ?></a></td>
+			<td><a href="<?php echo get_uri('/account/'); ?>?Action=AccountInfo&ID=<?php echo htmlspecialchars($row['MaintainerUID'], ENT_QUOTES) ?>" title="<?php echo __('View account information for')?> <?php echo htmlspecialchars($maintainer) ?>"><?php echo htmlspecialchars($maintainer) ?></a></td>
 	<?php else: ?>
 		<td><?php echo htmlspecialchars($maintainer) ?></td>
 	<?php endif; ?>
@@ -114,7 +114,7 @@ if ($row["MaintainerUID"]):
 <?php
 if ($atype == "Developer" || $atype == "Trusted User"):
 ?>
-			<td><a href="voters.php?ID=<?php echo$pkgid ?>"><?php echo $votes ?></a>
+			<td><a href="<?php echo get_uri('/voters/'); ?>?ID=<?php echo$pkgid ?>"><?php echo $votes ?></a>
 <?php else: ?>
 			<td><?php echo $votes ?></td>
 <?php endif; ?>
@@ -139,7 +139,7 @@ if ($atype == "Developer" || $atype == "Trusted User"):
 		# darr: (DepName, DepCondition, PackageID), where ID is NULL if it didn't exist
 		if (!is_null($darr[2])):
 ?>
-				<li><a href="packages.php?ID=<?php echo $darr[2]?>" title="<?php echo __('View packages details for').' '.$darr[0].$darr[1]?>"><?php echo $darr[0].$darr[1]?></a></li>
+				<li><a href="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $darr[2]?>" title="<?php echo __('View packages details for').' '.$darr[0].$darr[1]?>"><?php echo $darr[0].$darr[1]?></a></li>
 		<?php else: ?>
 				<li><a href="http://www.archlinux.org/packages/?q=<?php echo urlencode($darr[0])?>" title="<?php echo __('View packages details for').' '.$darr[0].$darr[1] ?>"><?php echo $darr[0].$darr[1] ?></a></li>
 		<?php endif; ?>
@@ -155,7 +155,7 @@ if ($atype == "Developer" || $atype == "Trusted User"):
 	# darr: (PackageName, PackageID)
 	while (list($k, $darr) = each($requiredby)):
 ?>
-				<li><a href="packages.php?ID=<?php echo $darr[1] ?>" title="<?php echo __('View packages details for').' '.$darr[0]?>"><?php echo $darr[0] ?></a></li>
+				<li><a href="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $darr[1] ?>" title="<?php echo __('View packages details for').' '.$darr[0]?>"><?php echo $darr[0] ?></a></li>
 	<?php endwhile; ?>
 			</ul>
 <?php endif; ?>
diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php
index 7997bb1..3f90088 100644
--- a/web/template/pkg_search_form.php
+++ b/web/template/pkg_search_form.php
@@ -36,7 +36,7 @@ $pages = array(50, 100, 250);
 <div id="pkglist-search" class="box filter-criteria">
 <h2><?php print __("Search Criteria"); ?></h2>
 
-<form action='packages.php' method='get'>
+<form action='<?php echo get_uri('/packages/'); ?>' method='get'>
 	<p><input type='hidden' name='O' value='0' /></p>
 
 	<fieldset>
diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php
index 9076675..440698b 100644
--- a/web/template/pkg_search_results.php
+++ b/web/template/pkg_search_results.php
@@ -20,13 +20,13 @@ if (!$result): ?>
 					<?php elseif ($pagestart + 1 == $first): ?>
 						<span class="page"><?php echo $pagenr ?></span>
 					<?php else: ?>
-						<a class="page" href="packages.php?<?php echo mkurl('O=' . $pagestart) ?>"><?php echo $pagenr ?></a>
+						<a class="page" href="<?php echo get_uri('/packages/'); ?>?<?php echo mkurl('O=' . $pagestart) ?>"><?php echo $pagenr ?></a>
 					<?php endif; ?>
 				<?php endforeach; ?>
 			</p>
 		</div>
 
-		<form id="pkglist-results-form" method="post" action="packages.php?<?php echo htmlentities($_SERVER['QUERY_STRING']) ?>">
+		<form id="pkglist-results-form" method="post" action="<?php echo get_uri('/packages/'); ?>?<?php echo htmlentities($_SERVER['QUERY_STRING']) ?>">
 			<table class="results">
 			<thead>
 				<tr>
@@ -52,7 +52,7 @@ if (!$result): ?>
 		<td><input type="checkbox" name="IDs[<?php echo $row["ID"] ?>]" value="1" /></td>
 		<?php endif; ?>
 		<td><?php echo htmlspecialchars($row["Category"]) ?></td>
-		<td><a href="packages.php?ID=<?php echo $row["ID"] ?>"><?php echo htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]) ?></a></td>
+		<td><a href="<?php echo get_uri('/packages/'); ?>?ID=<?php echo $row["ID"] ?>"><?php echo htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]) ?></a></td>
 		<td><?php echo $row["NumVotes"] ?></td>
 		<?php if ($SID): ?>
 		<td>
@@ -69,7 +69,7 @@ if (!$result): ?>
 		<td><?php echo htmlspecialchars($row['Description'], ENT_QUOTES); ?></td>
 		<td>
 		<?php if (isset($row["Maintainer"])): ?>
-		<a href="packages.php?K=<?php echo htmlspecialchars($row['Maintainer'], ENT_QUOTES) ?>&SeB=m"><?php echo htmlspecialchars($row['Maintainer']) ?></a>
+		<a href="<?php echo get_uri('/packages/'); ?>?K=<?php echo htmlspecialchars($row['Maintainer'], ENT_QUOTES) ?>&SeB=m"><?php echo htmlspecialchars($row['Maintainer']) ?></a>
 		<?php else: ?>
 		<span><?php echo __("orphan") ?></span>
 		<?php endif; ?>
@@ -90,7 +90,7 @@ if (!$result): ?>
 						<?php elseif ($pagestart + 1 == $first): ?>
 							<span class="page"><?php echo $pagenr ?></span>
 						<?php else: ?>
-							<a class="page" href="packages.php?<?php echo mkurl('O=' . $pagestart) ?>"><?php echo $pagenr ?></a>
+							<a class="page" href="<?php echo get_uri('/packages/'); ?>?<?php echo mkurl('O=' . $pagestart) ?>"><?php echo $pagenr ?></a>
 						<?php endif; ?>
 					<?php endforeach; ?>
 				</p>
diff --git a/web/template/search_accounts_form.php b/web/template/search_accounts_form.php
index 9e8c241..3080ecd 100644
--- a/web/template/search_accounts_form.php
+++ b/web/template/search_accounts_form.php
@@ -1,5 +1,5 @@
 <br />
-<form action="account.php" method="post">
+<form action="<?php echo get_uri('/account/'); ?>" method="post">
 	<table>
 
 		<tr>
diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php
index b942dbc..835d956 100644
--- a/web/template/stats/updates_table.php
+++ b/web/template/stats/updates_table.php
@@ -6,7 +6,7 @@
 	<?php foreach ($newest_packages->getIterator() as $row): ?>
 		<tr>
 			<td>
-				<a href="packages.php?ID=<?php print intval($row["ID"]); ?>"><?php print htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]); ?></a>
+				<a href="<?php echo get_uri('/packages/'); ?>?ID=<?php print intval($row["ID"]); ?>"><?php print htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]); ?></a>
 			</td>
 			<td>
 				<span><?php print gmdate("Y-m-d H:i", intval($row["ModifiedTS"])); ?></span>
diff --git a/web/template/stats/user_table.php b/web/template/stats/user_table.php
index 0882119..3620798 100644
--- a/web/template/stats/user_table.php
+++ b/web/template/stats/user_table.php
@@ -7,14 +7,14 @@ $username = username_from_sid($_COOKIE["AURSID"]);
 <table>
 	<tr>
 		<td>
-			<a href="packages.php?SeB=m&L=2&K=<?php echo $username; ?>">
+			<a href="<?php echo get_uri('/packages/'); ?>?SeB=m&L=2&K=<?php echo $username; ?>">
 <?php print __("Packages in unsupported"); ?></a>
 		</td>
 		<td><?php print $maintainer_unsupported_count; ?></td>
 	</tr>
 	<tr>
 		<td>
-			<a href="packages.php?SeB=m&outdated=on&K=<?php echo $username; ?>"><?php print __("Out of Date"); ?></a>
+			<a href="<?php echo get_uri('/packages/'); ?>?SeB=m&outdated=on&K=<?php echo $username; ?>"><?php print __("Out of Date"); ?></a>
 		</td>
 		<td><?php echo $flagged_outdated ?></td>
 	</tr>
diff --git a/web/template/tu_details.php b/web/template/tu_details.php
index 38015e1..3ec05ad 100644
--- a/web/template/tu_details.php
+++ b/web/template/tu_details.php
@@ -11,7 +11,7 @@
 		<?php echo __("User") ?>:
 		<b>
 			<?php if (!empty($row['User'])): ?>
-			<a href="packages.php?K=<?php print $row['User'] ?>&SeB=m"><?php print $row['User'] ?></a>
+			<a href="<?php echo get_uri('/packages/'); ?>?K=<?php print $row['User'] ?>&SeB=m"><?php print $row['User'] ?></a>
 			<?php else: ?>
 			N/A
 			<?php endif; ?>
@@ -61,7 +61,7 @@
 <div class="box">
 
 <?php if ($canvote == 1): ?>
-	<form action="tu.php?id=<?php print $row['ID'] ?>" method="post">
+	<form action="<?php echo get_uri('/tu/'); ?>?id=<?php print $row['ID'] ?>" method="post">
 		<fieldset>
 			<input type="submit" class="button" name="voteYes" value="<?php print __("Yes") ?>" />
 			<input type="submit" class="button" name="voteNo" value="<?php print __("No") ?>" />
diff --git a/web/template/tu_list.php b/web/template/tu_list.php
index ce19da3..eed7f74 100644
--- a/web/template/tu_list.php
+++ b/web/template/tu_list.php
@@ -25,13 +25,13 @@
 			?>
 			<tr class="<?php print $c ?>">
 				<td><?php $row["Agenda"] = htmlspecialchars(substr($row["Agenda"], 0, $prev_Len)); ?>
-					<a href="tu.php?id=<?php print $row['ID'] ?>"><?php print $row["Agenda"] ?></a></span></span>
+					<a href="<?php echo get_uri('/tu/'); ?>?id=<?php print $row['ID'] ?>"><?php print $row["Agenda"] ?></a></span></span>
 				</td>
 				<td><?php print gmdate("Y-m-d", $row["Submitted"]) ?></td>
 				<td><?php print gmdate("Y-m-d", $row["End"]) ?></td>
 				<td>
 				<?php if (!empty($row['User'])): ?>
-					<a href="packages.php?K=<?php echo $row['User'] ?>&SeB=m"><?php echo $row['User'] ?></a>
+					<a href="<?php echo get_uri('/packages/'); ?>?K=<?php echo $row['User'] ?>&SeB=m"><?php echo $row['User'] ?></a>
 				<?php else:
 					print "N/A";
 				endif;
-- 
1.7.11.2



More information about the aur-dev mailing list