summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/html/account.php4
-rw-r--r--web/lib/acctfuncs.inc.php70
-rw-r--r--web/template/account_details.php57
3 files changed, 58 insertions, 73 deletions
diff --git a/web/html/account.php b/web/html/account.php
index 2a96845..ce3f777 100644
--- a/web/html/account.php
+++ b/web/html/account.php
@@ -68,9 +68,7 @@ if (isset($_COOKIE["AURSID"])) {
if (empty($row)) {
print __("Could not retrieve information for the specified user.");
} else {
- display_account_info($row["Username"],
- $row["AccountType"], $row["Email"], $row["RealName"],
- $row["IRCNick"], $row["PGPKey"], $row["LastVoted"]);
+ include("account_details.php");
}
} elseif ($action == "UpdateAccount") {
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 0cb4d72..a46c9df 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -337,76 +337,6 @@ 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="", $K="", $LV="") {
- # 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
- # LV: value to display for last voted
-
- global $SUPPORTED_LANGS;
-
- print "<table>\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 " <tr>\n";
- print " <td align='left'>".__("Email Address").":</td>\n";
- print " <td align='left'><a href='mailto:".htmlspecialchars($E,ENT_QUOTES)."'>".htmlspecialchars($E,ENT_QUOTES)."</a></td>\n";
- print " </tr>\n";
-
- print " <tr>\n";
- print " <td align='left'>".__("Real Name").":</td>\n";
- print " <td align='left'>".htmlspecialchars($R,ENT_QUOTES)."</td>\n";
- print " </tr>\n";
-
- print " <tr>\n";
- print " <td align='left'>".__("IRC Nick").":</td>\n";
- print " <td align='left'>".htmlspecialchars($I,ENT_QUOTES)."</td>\n";
- print " </tr>\n";
-
- print " <tr>\n";
- print " <td align='left'>".__("PGP Key Fingerprint").":</td>\n";
- print " <td align='left'>".html_format_pgp_fingerprint($K)."</td>\n";
- print " </tr>\n";
-
- print " <tr>\n";
- print " <td align='left'>".__("Last Voted").":</td>\n";
- print " <td align='left'>";
- print $LV ? date("Y-m-d", $LV) : __("Never");
- print "</td>\n";
- print " </tr>\n";
-
- print " <tr>\n";
- print " <td colspan='2'><a href='packages.php?K=".$U."&amp;SeB=m'>".__("View this user's packages")."</a></td>\n";
- print " </tr>\n";
-
- print "</table>\n";
- return;
-}
-
/*
* Returns SID (Session ID) and error (error message) in an array
* SID of 0 means login failed.
diff --git a/web/template/account_details.php b/web/template/account_details.php
new file mode 100644
index 0000000..f4c31c6
--- /dev/null
+++ b/web/template/account_details.php
@@ -0,0 +1,57 @@
+<table>
+ <tr>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td align="left"><?php echo __("Username") . ":" ?></td>
+ <td align="left"><?php echo $row["Username"] ?></td>
+ </tr>
+
+ <tr>
+ <td align="left"><?php echo __("Account Type") . ":" ?></td>
+ <td align="left">
+ <?php
+ if ($row["AccountType"] == "User") {
+ print __("User");
+ } elseif ($row["AccountType"] == "Trusted User") {
+ print __("Trusted User");
+ } elseif ($row["AccountType"] == "Developer") {
+ print __("Developer");
+ }
+ ?>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="left"><?php echo __("Email Address") . ":" ?></td>
+ <td align="left"><a href="mailto:<?php echo htmlspecialchars($row["Email"], ENT_QUOTES) ?>"><?php echo htmlspecialchars($row["Email"], ENT_QUOTES) ?></a></td>
+ </tr>
+
+ <tr>
+ <td align="left"><?php echo __("Real Name") . ":" ?></td>
+ <td align="left"><?php echo htmlspecialchars($row["RealName"], ENT_QUOTES) ?></td>
+ </tr>
+
+ <tr>
+ <td align="left"><?php echo __("IRC Nick") . ":" ?></td>
+ <td align="left"><?php echo htmlspecialchars($row["IRCNick"], ENT_QUOTES) ?></td>
+ </tr>
+
+ <tr>
+ <td align="left"><?php echo __("PGP Key Fingerprint") . ":" ?></td>
+ <td align="left"><?php echo html_format_pgp_fingerprint($row["PGPKey"]) ?></td>
+ </tr>
+
+ <tr>
+ <td align="left"><?php echo __("Last Voted") . ":" ?></td>
+ <td align="left">
+ <?php print $row["LastVoted"] ? date("Y-m-d", $row["LastVoted"]) : __("Never"); ?>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2"><a href="packages.php?K=<?php echo $row['Username'] ?>&amp;SeB=m"><?php echo __("View this user's packages") ?></a></td>
+ </tr>
+
+</table>