summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/html/account.php23
-rw-r--r--web/lang/account_po.inc4
-rw-r--r--web/lib/acctfuncs.inc55
-rw-r--r--web/lib/pkgfuncs.inc9
4 files changed, 84 insertions, 7 deletions
diff --git a/web/html/account.php b/web/html/account.php
index d911f933..841ed66a 100644
--- a/web/html/account.php
+++ b/web/html/account.php
@@ -59,7 +59,24 @@ if (isset($_COOKIE["AURSID"])) {
}
}
- } elseif ($_REQUEST["Action"] == "UpdateAccount") {
+ } elseif ($_REQUEST["Action"] == "AccountInfo") {
+ # no editing, just looking up user info
+ #
+ $q = "SELECT Users.*, AccountTypes.AccountType ";
+ $q.= "FROM Users, AccountTypes ";
+ $q.= "WHERE AccountTypes.ID = Users.AccountTypeID ";
+ $q.= "AND Users.ID = ".intval($_REQUEST["ID"]);
+ $result = db_query($q, $dbh);
+ if (!mysql_num_rows($result)) {
+ print __("Could not retrieve information for the specified user.");
+ } else {
+ $row = mysql_fetch_assoc($result);
+ display_account_info($row["Username"],
+ $row["AccountType"], $row["Email"], $row["RealName"],
+ $row["IRCNick"]);
+ }
+
+ } elseif ($_REQUEST["Action"] == "UpdateAccount") {
# user is submitting their modifications to an existing account
#
process_account_form($atype, "edit", "UpdateAccount",
@@ -109,7 +126,9 @@ if (isset($_COOKIE["AURSID"])) {
} else {
# visitor is not logged in
#
- if ($_REQUEST["Action"] == "NewAccount") {
+ if ($_REQUEST["Action"] == "AccountInfo") {
+ print __("You must log in to view user information.");
+ } elseif ($_REQUEST["Action"] == "NewAccount") {
# process the form input for creating a new account
#
process_account_form("","new", "NewAccount",
diff --git a/web/lang/account_po.inc b/web/lang/account_po.inc
index c246dcad..8c675421 100644
--- a/web/lang/account_po.inc
+++ b/web/lang/account_po.inc
@@ -327,4 +327,6 @@ $_t["en"]["You do not have permission to edit this account."] = "You do not have
$_t["de"]["You do not have permission to edit this account."] = "Zugriff für das Bearbeiten dieses Benutzerkontos verweigert.";
$_t["pl"]["You do not have permission to edit this account."] = "Nie masz uprawnień do edycji tego konta.";
-?> \ No newline at end of file
+$_t["en"]["You must log in to view user information."] = "You must log in to view user information.";
+
+?>
diff --git a/web/lib/acctfuncs.inc b/web/lib/acctfuncs.inc
index 996a70c6..8021cc67 100644
--- a/web/lib/acctfuncs.inc
+++ b/web/lib/acctfuncs.inc
@@ -586,5 +586,60 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
return;
}
+# Display non-editable account info
+#
+function display_account_info($U="",$T="",
+ $E="",$R="",$I="") {
+ # U: value to display for username
+ # T: value to display for account type
+ # E: value to display for email address
+ # R: value to display for RealName
+ # I: value to display for IRC nick
+
+ global $SUPPORTED_LANGS;
+
+ print "<center>\n";
+ print "<table border='0' cellpadding='0' cellspacing='0' width='33%'>\n";
+ print " <tr>\n";
+ print " <td colspan='2'>&nbsp;</td>\n";
+ print " </tr>\n";
+
+ print " <tr>\n";
+ print " <td align='left'>".__("Username").":</td>\n";
+ print " <td align='left'>".$U."</td>\n";
+ print " </tr>\n";
+
+ print " <tr>\n";
+ print " <td align='left'>".__("Account Type").":</td>\n";
+ print " <td align='left'>";
+ if ($T == "User") {
+ print __("User");
+ } elseif ($T == "Trusted User") {
+ print __("Trusted User");
+ } elseif ($T == "Developer") {
+ print __("Developer");
+ }
+ print "</td>\n";
+
+ print " <tr>\n";
+ print " <td align='left'>".__("Email Address").":</td>\n";
+ print " <td align='left'><a href='mailto:".$E."'>".$E."</a></td>\n";
+ print " </tr>\n";
+
+ print " <tr>\n";
+ print " <td align='left'>".__("Real Name").":</td>\n";
+ print " <td align='left'>".$R."</td>\n";
+ print " </tr>\n";
+
+ print " <tr>\n";
+ print " <td align='left'>".__("IRC Nick").":</td>\n";
+ print " <td align='left'>".$I."</td>\n";
+ print " </tr>\n";
+
+ print "</table>\n";
+ print "</center>\n";
+ return;
+}
+
# vim: ts=2 sw=2 noet ft=php
?>
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 451467f9..b0743cc5 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -309,14 +309,15 @@ function package_details($id=0, $SID="") {
print "</tr>\n";
print "<tr>\n";
print " <td colspan='2'><span class='f3'>".__("Maintainer").": ";
- if ($row["AURMaintainerUID"]) {
- $maintainer = username_from_id($row["AURMaintainerUID"]);
- } elseif ($row["MaintainerUID"]) {
+ if ($row["MaintainerUID"]) {
$maintainer = username_from_id($row["MaintainerUID"]);
+ print "<a href='/account.php?Action=AccountInfo&ID=";
+ print $row["MaintainerUID"] . "'>";
+ print $maintainer . "</a></span></td>";
} else {
$maintainer = "None";
+ print $maintainer . "</span></td>";
}
- print $maintainer . "</span></td>";
print "</tr>\n";
print "<tr>\n";
print " <td colspan='2'><img src='/images/pad.gif' height='15'></td>";