From 2425f963f8ad45292c217914b5fee1ed18104c26 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 14 Jul 2012 01:24:59 +0200 Subject: Use virtual path feature for links 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 --- 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(-) (limited to 'web') diff --git a/web/html/addvote.php b/web/html/addvote.php index d3bd7d4b..d1cd809a 100644 --- a/web/html/addvote.php +++ b/web/html/addvote.php @@ -68,7 +68,7 @@ if ($atype == "Trusted User" || $atype == "Developer") {

-
+

diff --git a/web/html/home.php b/web/html/home.php index 48f5e00a..df112b82 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -91,7 +91,7 @@ $dbh = db_connect();

- +
diff --git a/web/html/login.php b/web/html/login.php index 7f4f3420..9c6a5469 100644 --- a/web/html/login.php +++ b/web/html/login.php @@ -17,7 +17,7 @@ html_header('AUR ' . __("Login"));

' . username_from_sid($_COOKIE["AURSID"]) . ''); ?> - [] + []

@@ -40,7 +40,7 @@ html_header('AUR ' . __("Login"));

" /> - [] + []

diff --git a/web/html/logout.php b/web/html/logout.php index fe8ffb01..835f1c90 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 cb88e5ab..9fca5050 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@archlinux.org\nFrom:aur-notify@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 65e2f6db..8c93b0cc 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(); ?> -
+
diff --git a/web/html/tu.php b/web/html/tu.php index 86199039..084a2232 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -116,17 +116,17 @@ if ($atype == "Trusted User" || $atype == "Developer") { $nextresult = proposal_count(); ?>
-

+

- + ?off=&by='> - +
@@ -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 231e3230..378e605d 100644 --- a/web/html/voters.php +++ b/web/html/voters.php @@ -15,12 +15,12 @@ if ($atype == 'Trusted User' || $atype== 'Developer'): ?>
-

Votes for

+

Votes for

-
+
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index a41a4e7d..fcc6a603 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.= ''.$row['Username'].' '; + $whovoted.= ''.$row['Username'].' '; } } return $whovoted; diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 0009b93b..bdf89764 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@archlinux.org\nFrom:aur-notify@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 f4c31c66..85515330 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -51,7 +51,7 @@ - + diff --git a/web/template/account_edit_form.php b/web/template/account_edit_form.php index c32eb94d..fd58f840 100644 --- a/web/template/account_edit_form.php +++ b/web/template/account_edit_form.php @@ -1,4 +1,4 @@ - +
diff --git a/web/template/account_search_results.php b/web/template/account_search_results.php index f2ed62e1..cc2a1c2b 100644 --- a/web/template/account_search_results.php +++ b/web/template/account_search_results.php @@ -28,7 +28,7 @@ else: ?> - "> + "> - "> + "> @@ -63,7 +63,7 @@ else: @@ -88,7 +88,7 @@ if ($SID && ($uid == $row["MaintainerUID"] || if ($row["SubmitterUID"]): if ($SID): ?> - + @@ -101,7 +101,7 @@ if ($row["SubmitterUID"]): if ($row["MaintainerUID"]): if ($SID): ?> - + @@ -114,7 +114,7 @@ if ($row["MaintainerUID"]): - @@ -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])): ?> -
  • +
  • @@ -155,7 +155,7 @@ if ($atype == "Developer" || $atype == "Trusted User"): # darr: (PackageName, PackageID) while (list($k, $darr) = each($requiredby)): ?> -
  • +
  • diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php index 7997bb1d..3f900882 100644 --- a/web/template/pkg_search_form.php +++ b/web/template/pkg_search_form.php @@ -36,7 +36,7 @@ $pages = array(50, 100, 250); - +
    - +
    @@ -78,7 +78,7 @@ else:
    -
    +
    diff --git a/web/template/actions_form.php b/web/template/actions_form.php index ff0fd4e5..9cd50244 100644 --- a/web/template/actions_form.php +++ b/web/template/actions_form.php @@ -1,5 +1,5 @@
    - +
    diff --git a/web/template/header.php b/web/template/header.php index 246b3047..52c0ab88 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -8,7 +8,7 @@ - + ' /> @@ -50,17 +50,17 @@
    diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index b2d9ca58..5b5f6104 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -10,11 +10,11 @@ $count = package_comments_count($_GET['ID']); {$row['UserName']}"; + $row['UserName'] = "?Action=AccountInfo&ID={$row['UsersID']}\">{$row['UserName']}"; endif; ?>

    - +
    diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index b41fdede..4cb86021 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"))): ?>

    - +
    @@ -75,7 +75,7 @@ if ($SID && ($uid == $row["MaintainerUID"] ||
    - +
    +
    @@ -52,7 +52,7 @@ if (!$result): ?> - +
    ]" value="1" /> ">"> @@ -69,7 +69,7 @@ if (!$result): ?> - + @@ -90,7 +90,7 @@ if (!$result): ?> - +

    diff --git a/web/template/search_accounts_form.php b/web/template/search_accounts_form.php index 9e8c241f..3080ecd1 100644 --- a/web/template/search_accounts_form.php +++ b/web/template/search_accounts_form.php @@ -1,5 +1,5 @@
    - + diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php index b942dbcb..835d956f 100644 --- a/web/template/stats/updates_table.php +++ b/web/template/stats/updates_table.php @@ -6,7 +6,7 @@ getIterator() as $row): ?>
    - "> + "> diff --git a/web/template/stats/user_table.php b/web/template/stats/user_table.php index 0882119e..36207989 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"]); diff --git a/web/template/tu_details.php b/web/template/tu_details.php index 38015e1e..3ec05ad7 100644 --- a/web/template/tu_details.php +++ b/web/template/tu_details.php @@ -11,7 +11,7 @@ : - + N/A @@ -61,7 +61,7 @@
    - +
    " /> " /> diff --git a/web/template/tu_list.php b/web/template/tu_list.php index ce19da3c..eed7f74e 100644 --- a/web/template/tu_list.php +++ b/web/template/tu_list.php @@ -25,13 +25,13 @@ ?>
    - +
    - +
    - + - +