Added:
/trunk/drydock/tpl/profiles/logout.tpl
/trunk/drydock/tpl/profiles/memberlist.tpl
/trunk/drydock/tpl/profiles/nopermission.tpl
Modified:
/trunk/drydock/profiles.php
=======================================
--- /dev/null
+++ /trunk/drydock/tpl/profiles/logout.tpl Sat Jul 23 21:12:54 2011
@@ -0,0 +1,14 @@
+{*{include file=head.tpl} Commented out until everything in profiles gets
switched over *}
+<title>{$THname} — Logout</title>
+</head>
+<body>
+ <div id="main">
+ <div class="box">
+ <div class="pgtitle">Logged out</div>
+ {if $notloggedin}
+ <div>You are not logged in!</div>
+ {else}
+ <div>You are now logged out!</div>
+ {/if}
+ [<a href="drydock.php">Board index</a>]
+ {include file=bottombar.tpl}
=======================================
--- /dev/null
+++ /trunk/drydock/tpl/profiles/memberlist.tpl Sat Jul 23 21:12:54 2011
@@ -0,0 +1,14 @@
+{*{include file=head.tpl} Commented out until everything in profiles gets
switched over *}
+<title>{$THname} — Members</title>
+</head>
+<body>
+ <div id="main">
+ <div class="box">
+ <div class="pgtitle">Members</div><div>
+{foreach from=$users item=user}
+{if $user.username != "initialadmin"}
+<a
href="profiles.php?action=viewprofile&user={$user.username}">{$user.username}</a><br
/>
+{/if}
+{/foreach}
+
+{include file=bottombar.tpl}
=======================================
--- /dev/null
+++ /trunk/drydock/tpl/profiles/nopermission.tpl Sat Jul 23 21:12:54 2011
@@ -0,0 +1,10 @@
+{*{include file=head.tpl} Commented out until everything in profiles gets
switched over *}
+<title>{$THname} — Profiles</title>
+</head>
+<body>
+ <div id="main">
+ <div class="box">
+ <div class="pgtitle">Permissions error</div><div>
+ <strong>Error:</strong> You are not authorized to view
this page!</div>
+ [<a href="drydock.php">Board index</a>]
+ {include file=bottombar.tpl}
=======================================
--- /trunk/drydock/profiles.php Sat Jul 23 20:54:24 2011
+++ /trunk/drydock/profiles.php Sat Jul 23 21:12:54 2011
@@ -27,9 +27,15 @@
<link rel="stylesheet" type="text/css" href="<?php echo
THurl . 'tpl/' . THtplset; ?>/futaba.css" title="Stylesheet" />
<?php
+
+function renderPermissionDenied()
+{
+ $sm = sminit("nopermission.tpl", null, "profiles", false, false);
+ $sm->display("nopermission.tpl", null);
+}
+
$db = new ThornProfileDBI();
-
if (isset($_GET['action'])) {
if ($_GET['action'] == "login") {
@@ -74,9 +80,8 @@
$sm->display("login.tpl", null);
} else
if ($_GET['action'] == "logout") {
- echo "<title>" . THname . "— Logout</title>\n";
- echo "</head><body>\n";
- echo '<div id="main"><div class="box">';
+
+ $sm = sminit("logout.tpl", null, "profiles", false, false);
if (isset($_SESSION['username'])) {
if (isset($_COOKIE[THcookieid . '-uname']) &&
isset($_COOKIE[THcookieid . '-id'])) {
@@ -91,18 +96,15 @@
unset($_SESSION['admin']);
unset($_SESSION['moderator']);
unset($_SESSION['mod_array']);
- echo '<div class="pgtitle">Logged out</div><br />';
- echo "You are now logged out!<br /><br />\n";
} else {
- echo '<div class="pgtitle">Logged out</div><br />';
- echo "You are not logged in!<br /><br />\n";
- }
- echo "[<a href=\"drydock.php\">Board index</a>]\n";
+ // Not logged in, weird.
+ $sm->assign("notloggedout", 1);
+ }
+
+ $sm->display("logout.tpl", null);
+
} else
if ($_GET['action'] == "memberlist") {
- echo "<title>" . THname . "— Members</title>\n";
- echo "</head><body>\n";
- echo '<div id="main"><div class="box">';
$can_access = 0;
if (THprofile_viewuserpolicy == 2) {
@@ -114,20 +116,13 @@
}
if ($can_access) {
- echo "<div class=\"pgtitle\">Members</div><br />\n";
-
- $users = $db->getuserlist();
-
- foreach ($users as $user_entry) {
- if ($user_entry['username'] != "initialadmin") {
- echo "<a
href=\"profiles.php?action=viewprofile&user=" .
$user_entry['username'] . "\">" .
- $user_entry['username'] . "</a><br />\n";
- }
- }
+
+ $sm = sminit("memberlist.tpl", null, "profiles",
false, false);
+ $sm->assign("users",$db->getuserlist());
+ $sm->display("memberlist.tpl", null);
+
} else {
- echo "<div class=\"pgtitle\">Permissions
error</div><br />\n";
- echo "<b>Error:</b> You are not authorized to view
this page!<br /><br />\n";
- echo "[<a href=\"drydock.php\">Board index</a>]\n";
+ renderPermissionDenied();
}
} else
if ($_GET['action'] == "viewprofile") {
@@ -169,10 +164,7 @@
}
$sm->display("viewprofile.tpl", null);
} else {
- echo "<div class=\"pgtitle\">Permissions
error</div><br />\n";
- echo "<b>Error:</b> You are not authorized to view
this page!<br /><br />\n";
- echo "[<a href=\"drydock.php\">Board index</a>]\n";
- echo "</td></tr></table>\n";
+ renderPermissionDenied();
}
} else
if ($_GET['action'] == "edit") {