Files
Testing/mailservices/admin/usermgr/myaccount.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

192 lines
8.6 KiB
PHP

<?php
require_once("base.php");
require_once("security.php");
$cur_menu="user";
require_once("menu.php");
//connect to db if required
$dconn=dbconnect();
$em="";
if(isset($_POST["update"]))
{
include("edit_user_act.php");
}
//set defaults for form fields
$_SESSION["euuid"]=$_SESSION["admin_uid"];
$emsg="";
$sql="SELECT
`tobin_users`.`uid`,
`tobin_users`.`firstname`,
`tobin_users`.`mi`,
AES_DECRYPT(`tobin_users`.`lastname`,'".$_SESSION["tobin_akey"]."') AS lname,
`tobin_users`.`title`,
`tobin_users`.`department`,
AES_DECRYPT(`tobin_users`.`email`,'".$_SESSION["tobin_akey"]."') AS uemail,
AES_DECRYPT(`tobin_users`.`phone`,'".$_SESSION["tobin_akey"]."') AS uphone,
AES_DECRYPT(`tobin_users`.`cellphone`,'".$_SESSION["tobin_akey"]."') AS ucellphone,
AES_DECRYPT(`tobin_users`.`fax`,'".$_SESSION["tobin_akey"]."') AS ufax,
AES_DECRYPT(`tobin_users`.`user`,'".$_SESSION["tobin_akey"]."') AS uuser,
AES_DECRYPT(`tobin_users`.`pass`,'".$_SESSION["tobin_akey"]."') as upass,
`tobin_users`.`admin`,
`tobin_users`.`default_admin`,
`tobin_users`.`lastupdate`,
`tobin_users`.`cdate`
FROM
`tobin_users`
WHERE `tobin_users`.`uid`=".$_SESSION["tobin_uid"];
$result=mysql_query($sql) or $em=mysql_error();
$a=mysql_fetch_assoc($result);
if(!isset($_POST["fname"])){$fname=$a["firstname"];}
if(!isset($_POST["mi"])){$mi=$a["mi"];}
if(!isset($_POST["lname"])){$lname=$a["lname"];}
if(!isset($_POST["dept"])){$dept=$a["department"];}
if(!isset($_POST["title"])){$title=$a["title"];}
if(!isset($_POST["telephone"])){$telephone=$a["uphone"];}
if(!isset($_POST["cellphone"])){$cellphone=$a["ucellphone"];}
if(!isset($_POST["fax"])){$fax=$a["ufax"];}
if(!isset($_POST["email"])){$email=$a["uemail"];}
if(!isset($_POST["username"])){$username=$a["uuser"];}
if(!isset($_POST["pass"])){$pass=$a["upass"];}
if(!isset($_POST["admin"])){$admin=$a["admin"];}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Edit My Account</title>
<meta name="description" content="Edit My Account" />
<meta name="keywords" content="" />
<meta name="abstract" content="Edit My Account" />
<meta name="rating" content="General" />
<meta name="revisit-after" content="6 Days" />
<meta name="doc-class" content="Draft" />
<meta name="copyright" content="2008 The Curry" />
<meta name="robots" content="noindex, nofollow" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="/rss_feed.xml" />
<link rev="pdp" href="poremba.net" title="Produced by pdp design: design, content, consulting" />
<link rev="poremba" href="http://www.poremba.net/" title="Directed by Philip Poremba: structural design and content" />
<meta http-equiv="Content-Type" content="charset=iso-8859-1" />
<link rel="stylesheet" href="/admin/css/btks_2.css" type="text/css" media="all" />
<script language="JavaScript" src="/admin/js/base.js" type="text/javascript"></script>
<script language="JavaScript" src="/admin/js/formcheck.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
var onesubmit=0;
function checkform(val){
if(onesubmit==0)
{
onesubmit=1;
if(isEmpty(val.fname.value))
{
alert("Please enter first name.");val.fname.focus();onesubmit=0;return false;
}
if(isEmpty(val.lname.value))
{
alert("Please enter last name.");val.lname.focus();onesubmit=0;return false;
}
if(!isEmail(val.email.value))
{
alert("Please enter a valid email address.");val.email.focus();onesubmit=0;return false;
}
if(isEmpty(val.username.value) || val.username.value.length < 8)
{
alert("Please enter a username at least 4 characters in length.");val.username.focus();onesubmit=0;return false;
}
if(isEmpty(val.pass.value) || val.pass.value.length < 8 || val.pass.value.length > 32)
{
alert("Please enter a password between 8 and 32 characters in length.");val.pass.focus();onesubmit=0;return false;
}
return true;
}
return false;
}
function init(){dosize();}
onload=init;
onresize=dosize;
</script>
</head>
<body>
<div id="header" style="height:77px;">
<span id="spanimg"></span>
</div>
<div id="menu">
<div id="innermenu">
<span class="fl"><?php echo $menu_left; ?></span>
<span class="fr"><?php echo $menu_right; ?></span>
</div>
</div>
<div id="tsc">
<div id="container">
<div id="content">
<div id="icontent">
<h2>Edit Administrative My Account</h2>
<?php
if(isset($postsuccess))
{
echo "<div id=\"postsuccess\">".$postsuccess."</div>";
}
if(isset($posterror))
{
echo "<div id=\"posterror\">".$posterror."</div>";
}
?>
<div id="notabfrm">
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onsubmit="return checkform(this);">
<fieldset>
<label for="fname">First Name:</label><input name="fname" id="fname" type="text" size="24" tabindex="1" value="<?php echo $fname; ?>" maxlength="100" /><span class="frmrequired">(*required)</span><br clear="all" />
<label for="mi">M.I.:</label><input name="mi" id="mi" type="text" size="3" tabindex="2" value="<?php echo $mi; ?>" maxlength="5" /><span class="frmrequired">(add period)</span><br clear="all" />
<label for="lname">Last Name:</label><input name="lname" id="lname" type="text" size="24" tabindex="3" value="<?php echo $lname; ?>" maxlength="100" /><span class="frmrequired">(*required)</span><br clear="all" />
<label for="dept">Department:</label><input name="dept" id="dept" type="text" size="24" tabindex="4" value="<?php echo $dept; ?>" maxlength="100" /><br clear="all" />
<label for="title">Title:</label><input name="title" id="title" type="text" size="30" tabindex="5" value="<?php echo $title; ?>" maxlength="100" /><br clear="all" />
<label for="telephone">Telephone:</label><input name="telephone" id="telephone" type="text" size="20" tabindex="6" value="<?php echo $telephone; ?>" maxlength="20" /><br clear="all" />
<label for="cellphone">Cellphone:</label><input name="cellphone" id="cellphone" type="text" size="20" tabindex="7" value="<?php echo $cellphone; ?>" maxlength="20" /><br clear="all" />
<label for="fax">Fax:</label><input name="fax" id="fax" type="text" size="20" tabindex="8" title="fax" value="<?php echo $fax; ?>" maxlength="20" /><br clear="all" />
<label for="email">Email:</label><input name="email" id="email" type="text" size="30" tabindex="9" value="<?php echo $email; ?>" maxlength="255" /><span class="frmrequired">(*required)</span><br clear="all" />
<label for="username">Username:</label><input name="username" id="username" type="text" size="20" tabindex="10" value="<?php echo $username; ?>" maxlength="255" /><span class="frmrequired">(*required, min 8 char)</span><br clear="all" />
<label for="pass">Password:</label><input name="pass" id="pass" type="text" size="20" tabindex="11" value="<?php echo $pass; ?>" maxlength="32" /><span class="frmrequired">(*required, 8 to 32 char.)</span><br clear="all" />
<?php
if($a["default_admin"]=="Y")
{
echo "<span class=\"fixedspan\">Administrator:</span>Default Administrative Account";
echo "<input type=\"hidden\" name=\"admin\" id=\"admin\" value=\"Y\" />";
}
else {
echo "<label for=\"admin\">Administrator:</label><input type=\"checkbox\" name=\"admin\" id=\"admin\" tabindex=\"12\" value=\"Y\" title=\"Enable Administrator Account\"";
if($admin=="Y") {echo "checked=\"checked\"";}
echo " />";
}
?>
<input type="hidden" name="orig_admin" id="orig_admin" value="<?php echo $a["admin"]; ?>" /><br clear="all" />
<div>
<span class="fixedspan">Date Created:</span><?php echo $a["cdate"];?></span><br clear="all" />
<span class="fixedspan">Last Update:</span><?php echo $a["lastupdate"];?></span><br clear="all" />
<label for="update">&nbsp;</label><input type="submit" name="update" id="update" tabindex="13" value="Update" style="margin-top:5px;"/><br clear="all" />
<input type="hidden" name="orig_username" value="<?php echo $a["uuser"]; ?>" />
</div>
</fieldset>
</form>
</div>
</div>
</div>
<div id="rail">
<div id="irail">
<ul>
<li><a href="/admin/usermgr/accounts.php" title="List of Accounts">LIST OF ACCOUNTS</a></li>
<li><a href="/admin/usermgr/add_user.php" title="Add user account">ADD NEW ACCOUNT</a></li>
<li>MY ACCOUNT</li>
<li><a href="/admin/usermgr/groups.php" title="Groups">GROUPS</a></li>
<li><a href="/admin/usermgr/group_add.php" title="Add Group">ADD GROUP</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="footer">&copy; 2008 The Curry</div>
</body>
</html>