diff options
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/acctfuncs.inc.php | 2 | ||||
-rw-r--r-- | web/lib/pkgfuncs.inc.php | 2 | ||||
-rw-r--r-- | web/lib/routing.inc.php | 17 |
3 files changed, 19 insertions, 2 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index e7dcb10..7471d06 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -827,7 +827,7 @@ function voter_list($voteid, $dbh=NULL) { $result = $dbh->query($q); if ($result) { while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $whovoted.= '<a href="' . get_uri('/accounts/') . '?Action=AccountInfo&ID='.$row['UserID'].'">'.$row['Username'].'</a> '; + $whovoted.= '<a href="' . get_user_uri($row['Username']) . '">'.$row['Username'].'</a> '; } } return $whovoted; diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 6cdab0f..b2daf0e 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -764,7 +764,7 @@ function pkg_flag ($atype, $ids, $action=true, $dbh=NULL) { if ($result) { while ($row = $result->fetch(PDO::FETCH_ASSOC)) { # 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 . "/" . get_pkg_uri($row['Name']) . "\n\n[1] - " . $AUR_LOCATION . "/" . get_uri('/accounts/') . "?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_pkg_uri($row['Name']) . "\n\n[1] - " . $AUR_LOCATION . "/" . get_user_uri($f_name); $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); diff --git a/web/lib/routing.inc.php b/web/lib/routing.inc.php index 4ca1150..dfd6942 100644 --- a/web/lib/routing.inc.php +++ b/web/lib/routing.inc.php @@ -18,6 +18,7 @@ $ROUTES = array( ); $PKG_PATH = '/packages'; +$USER_PATH = '/account'; function get_route($path) { global $ROUTES; @@ -56,3 +57,19 @@ function get_pkg_uri($pkgname) { return get_route($PKG_PATH) . '?N=' . urlencode($pkgname); } } + +function get_user_route() { + global $USER_PATH; + return $USER_PATH; +} + +function get_user_uri($username) { + global $USE_VIRTUAL_URLS; + global $USER_PATH; + + if ($USE_VIRTUAL_URLS) { + return $USER_PATH . '/' . urlencode($username) . '/'; + } else { + return get_route($USER_PATH) . '?U=' . urlencode($username); + } +} |