You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
mxml/www/account.php

150 lines
3.8 KiB

<?php
//
// "$Id: account.php,v 1.2 2004/05/18 01:39:00 mike Exp $"
//
// Account management page...
//
//
// Include necessary headers...
//
include_once "phplib/html.php";
include_once "phplib/common.php";
include_once "phplib/str.php";
if ($argc == 1 && $argv[0] == "X")
auth_logout();
if ($LOGIN_USER == "")
{
header("Location: login.php");
exit(0);
}
if ($argc == 1)
$op = "$argv[0]";
else
$op = "L";
switch ($op)
{
case 'L' :
// List
html_header("New/Pending");
html_start_links(1);
html_link("New/Pending", "$PHP_SELF?L");
html_link("Change Password", "$PHP_SELF?P");
html_link("Logout", "$PHP_SELF?X");
html_end_links();
print("<h1>New/Pending</h1>\n");
$email = db_escape($_COOKIE["FROM"]);
print("<h2>New/Pending Articles:</h2>\n");
print("<p>No new/pending articles found.</p>\n");
print("<h2>New/Pending STRs:</h2>\n");
$result = db_query("SELECT * FROM str WHERE status >= $STR_STATUS_PENDING "
."AND (manager_email == '' OR manager_email = '$email') "
."ORDER BY status DESC, priority DESC, scope DESC, "
."modify_date");
$count = db_count($result);
if ($count == 0)
print("<p>No new/pending STRs found.</p>\n");
else
{
html_start_table(array("Id", "Priority", "Status", "Scope",
"Summary", "Version", "Last Updated",
"Assigned To"));
while ($row = db_next($result))
{
$date = date("M d, Y", $row['modify_date']);
$summary = htmlspecialchars($row['summary'], ENT_QUOTES);
$summabbr = htmlspecialchars(abbreviate($row['summary'], 80), ENT_QUOTES);
$prtext = $priority_text[$row['priority']];
$sttext = $status_text[$row['status']];
$sctext = $scope_text[$row['scope']];
html_start_row();
print("<td nowrap>"
."<a href='str.php?L$row[id]$options' alt='STR #$row[id]: $summary'>"
."$row[id]</a></td>"
."<td align='center'>$prtext</td>"
."<td align='center'>$sttext</td>"
."<td align='center'>$sctext</td>"
."<td align='center'><a href='str.php?L$row[id]$options' "
."alt='STR #$row[id]: $summary'>$summabbr</a></td>"
."<td align='center'>$row[str_version]</td>"
."<td align='center'>$date</td>");
if ($row['manager_email'] != "")
$email = sanitize_email($row['manager_email']);
else
$email = "<i>Unassigned</i>";
print("<td align='center'>$email</td>");
html_end_row();
}
html_end_table();
}
db_free($result);
html_footer();
break;
case 'P' :
// Change password
html_header("Change Password");
html_start_links(1);
html_link("New/Pending", "$PHP_SELF?L");
html_link("Change Password", "$PHP_SELF?P");
html_link("Logout", "$PHP_SELF?X");
html_end_links();
print("<h1>Change Password</h1>\n");
if ($REQUEST_METHOD == "POST" &&
array_key_exists("PASSWORD", $_POST) &&
array_key_exists("PASSWORD2", $_POST) &&
$_POST["PASSWORD"] == $_POST["PASSWORD2"])
{
// Store new password and re-login...
print("<p>Password changed successfully!</p>\n");
}
else
{
print("<form method='POST' action='$PHP_SELF?P'>"
."<p><table width='100%'>\n"
."<tr><th align='right'>Password:</th>"
."<td><input type='password' name='PASSWORD' size='16' "
."maxsize='255'/></td></tr>\n"
."<tr><th align='right'>Password Again:</th>"
."<td><input type='password' name='PASSWORD2' size='16' "
."maxsize='255'/></td></tr>\n"
."<tr><th></th><td><input type='submit' value='Change Password'/>"
."</td></tr>\n"
."</table></p></form>\n");
}
html_footer();
break;
}
//
// End of "$Id: account.php,v 1.2 2004/05/18 01:39:00 mike Exp $".
//
?>