Subversion Repositories taios

Compare Revisions

Ignore whitespace Rev 27 → Rev 32

/admin/account.php
19,6 → 19,7
<p>Only change the password value if you want to change your password.</p>
<br />
 
<form action="account-do.php" method="POST">
<table>
<tr><td class="bold">ID: </td><td><?php echo $user->ID; ?></td></tr>
<?php
37,6 → 38,7
<tr><td class="bold">Name: </td><td><input type="text" name="name" value="<?php echo $user->name; ?>" /></td></tr>
<tr><td></td><td><input type="submit" value="Update Account" /></td></tr>
</table>
</form>
 
<?php
}
/admin/account-do.php
0,0 → 1,42
<?php
 
require '_taios.php';
 
$page = new Taios_Page('Update Account');
$userID = $page->getPostID();
 
$page->checkLoggedIn();
 
$accessID = $_POST['accessID'];
$password = $_POST['password'];
$email = $_POST['email'];
$name = $_POST['name'];
 
$user = $page->getUserByID($userID);
if (($page->getLoggedInUser()->ID == $userID || $page->isUserAdmin($page->getLoggedInUser())) && $user)
{
if (isset($accessID) && $page->isUserAdmin($page->getLoggedInUser()))
{
$page->query('UPDATE Users SET AccessID=' . $accessID . ' WHERE ID = ' . $userID);
}
if (!empty($password))
{
$page->query('UPDATE Users SET Password=' . sha1($password) . ' WHERE ID = ' . $userID);
}
}
else
{
if (!$user)
{
drawError('No such user, #' . $userID);
}
else
{
drawError('You do not have permission to access this page.');
}
}
 
$page->redirect('account.php?id=' . $id);
 
?>
/blog/post.php
2,6 → 2,23
 
require '../_taios.php';
 
function drawPost($id)
{
$post = $page->getBlogPost($id);
write('<h3>' . $post->title. '</h3>');
write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>');
write('<p>' . $post->content . '</p>');
 
$ids = $page->findIDs('BlogPosts', 'WHERE ParentID = ' . $id);
for ($i = 0; $i < count($ids); $i++)
{
write('<p class="indent">');
drawPost($i);
write('</p>');
}
 
}
 
$page = new Taios_Page('Blog Posts', '../');
 
if (!isset($_GET['id']))
18,11 → 35,9
write('<br />');
}
 
$post = $page->getBlogPost($_GET['id']);
write('<h3>' . $post->title. '</h3>');
write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>');
write('<p>' . $post->content . '</p>');
drawPost($_GET['id']);
 
 
$page->drawFooter();
 
?>
/styles.css
1,111 → 1,115
body {
background-color: #FFFFFF;
color: #000000;
font-family: Droid Sans, Tahoma, sans-serif;
font-size: 11pt;
}
 
h1 {
font-size: 28pt;
margin: 6px;
margin-top: 0px;
color: #000089;
border-bottom: 1px solid #000000;
}
 
h2 {
font-size: 20pt;
margin: 6px;
margin-left: 8px;
color: #00004B;
}
 
h3 {
font-size: 16pt;
margin: 6px;
margin-left: 10px;
color: #000055;
}
 
h4 {
font-size: 12pt;
margin: 6px;
margin-left: 12px;
color: #00005F;
}
 
h5 {
font-size: 10pt;
margin: 6px;
margin-left: 14px;
color: #000069;
}
 
p, table, span {
font-size: 11pt;
margin: 6px;
margin-left: 16px;
}
 
a {
text-decoration: none;
color: #000050;
}
 
a:hover {
text-decoration: underline;
}
 
input {
border: 1px solid #000000;
color: #000000;
background-color: #B5D7FF;
}
 
.sidebar {
left: 0px;
top: 0px;
position: fixed;
padding: 0px;
padding-left: 32px;
border-right: 1px solid #000089;
background-color: #FFFF73;
background-image: url('data/sidebar-gradient.png');
background-repeat: repeat-x;
background-position: center bottom;
}
 
.sidebar-header {
left: 0px;
width: 140px;
padding: 6px;
text-align: right;
}
 
.sidebar-menu {
text-align: right;
padding: 6px;
}
 
.sidebar-menu h3 {
margin: 6px;
}
 
.sidebar-menu p {
font-size: 12pt;
margin: 4px;
}
 
.content {
left: 200px;
top: 0px;
position: absolute;
width: 720px;
margin-right: 32px;
}
 
.bold {
font-weight: bold;
}
body {
background-color: #FFFFFF;
color: #000000;
font-family: Droid Sans, Tahoma, sans-serif;
font-size: 11pt;
}
 
h1 {
font-size: 28pt;
margin: 6px;
margin-top: 0px;
color: #000089;
border-bottom: 1px solid #000000;
}
 
h2 {
font-size: 20pt;
margin: 6px;
margin-left: 8px;
color: #00004B;
}
 
h3 {
font-size: 16pt;
margin: 6px;
margin-left: 10px;
color: #000055;
}
 
h4 {
font-size: 12pt;
margin: 6px;
margin-left: 12px;
color: #00005F;
}
 
h5 {
font-size: 10pt;
margin: 6px;
margin-left: 14px;
color: #000069;
}
 
p, table, span {
font-size: 11pt;
margin: 6px;
margin-left: 16px;
}
 
a {
text-decoration: none;
color: #000050;
}
 
a:hover {
text-decoration: underline;
}
 
input {
border: 1px solid #000000;
color: #000000;
background-color: #B5D7FF;
}
 
.sidebar {
left: 0px;
top: 0px;
position: fixed;
padding: 0px;
padding-left: 32px;
border-right: 1px solid #000089;
background-color: #FFFF73;
background-image: url('data/sidebar-gradient.png');
background-repeat: repeat-x;
background-position: center bottom;
}
 
.sidebar-header {
left: 0px;
width: 140px;
padding: 6px;
text-align: right;
}
 
.sidebar-menu {
text-align: right;
padding: 6px;
}
 
.sidebar-menu h3 {
margin: 6px;
}
 
.sidebar-menu p {
font-size: 12pt;
margin: 4px;
}
 
.content {
left: 200px;
top: 0px;
position: absolute;
width: 720px;
margin-right: 32px;
}
 
.bold {
font-weight: bold;
}
 
p.indent {
margin-left: 5em;
}