MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if (mysql_num_rows($sql_result)=="0") { echo"

Error Accessing Record

\n"; echo"You do not appear to have permission to edit this record.
\n"; echo"«« Go Back\n"; include"$page_footer"; echo"\n\n"; exit; } else { $row = mysql_fetch_array($sql_result); $userid = $row["UserID"]; } } else { $userid = $_GET["userid"]; } } ?>

Updating User List...

\n"; if ($admin=="TRUE") { $mode="A"; } else if ($editor=="TRUE") { $mode="E"; } else if ($disabled=="TRUE") {$mode="D"; } else { $mode="U"; } if ($trusted !=="TRUE") {$trusted="FALSE"; } if (checkFormKey()) { $sql = "UPDATE `t_userprofiles` SET `UserMode`= '$mode', `UserTrusted`= '$trusted' WHERE `UserID`='$i'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); } //Do Special Disable, Delete, Enable Account Operations if ($_POST["selected$i"] AND $_POST["submit"] !=="Update") { $selecteduser = $_POST["selected$i"]; if ($_POST["submit"]=="Disable Selected") { if (checkFormKey()) { $sql = "UPDATE `t_userprofiles` SET `UserMode`= 'D' WHERE `UserID`='$selecteduser'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result) { echo"User Account for User Number $selecteduser Disabled
\n"; } //Disabling an author, check their extension list and disable any item they're the solo author of. $sql = "SELECT TM.ID, TM.Name from `t_main` TM INNER JOIN `t_authorxref` TAX ON TM.ID=TAX.ID WHERE TAX.UserID = '$selecteduser'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); while ($row = mysql_fetch_array($sql_result)) { $id = $row["ID"]; $name = $row["Name"]; $sql2 = "SELECT `ID` from `t_authorxref` WHERE `ID` = '$id'"; $sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if (mysql_num_rows($sql_result2)<="1") { $sql3 = "UPDATE `t_version` SET `approved`='DISABLED' WHERE `ID`='$id' and `approved` !='NO' "; $sql_result3 = mysql_query($sql3, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result3) { echo"$name disabled from public viewing...
\n"; } } } } } else if ($_POST["submit"]=="Delete Selected") { if (checkFormKey()) { $sql = "DELETE FROM `t_userprofiles` WHERE `UserID`='$selecteduser' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result) { echo"User Account for User Number $selecteduser Deleted
\n"; } } } else if ($_POST["submit"]=="Enable Selected") { if (checkFormKey()) { $sql = "UPDATE `t_userprofiles` SET `UserMode`= 'U' WHERE `UserID`='$selecteduser'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result) { echo"User Account for User Number $selecteduser Enabled, User Mode set to User
\n"; } //Disabling an author, check their extension list and disable any item they're the solo author of. $sql = "SELECT TM.ID, TM.Name from `t_main` TM INNER JOIN `t_authorxref` TAX ON TM.ID=TAX.ID WHERE TAX.UserID = '$selecteduser'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); while ($row = mysql_fetch_array($sql_result)) { $id = $row["ID"]; $name = $row["Name"]; $sql2 = "SELECT `ID` from `t_authorxref` WHERE `ID` = '$id'"; $sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if (mysql_num_rows($sql_result2)<="1") { $sql3 = "UPDATE `t_version` SET `approved`='?' WHERE `ID`='$id' and `approved` !='NO'"; $sql_result3 = mysql_query($sql3, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result3) { echo"$name restored to public view pending approval...
\n"; } } } } } } } unset($i); echo"Your changes to the User List have been succesfully completed
\n"; } ?>

Manage User list

$maxuserid) {$maxuserid =$userid;} if ($usermode=="A") {$a="TRUE"; $e="TRUE"; } else if ($usermode=="E") {$e="TRUE"; $a="FALSE"; } else if ($usermode=="U") {$e="FALSE"; $a="FALSE"; } else if ($usermode=="D") {$d="TRUE";} $i++; echo""; echo"\n"; echo"\n"; echo"\n"; echo""; echo""; echo""; echo""; if ($d=="TRUE") {echo"\n"; } echo"\n"; unset($a,$e,$t); } echo""; ?>
Name E-Mail Address S E A T
$i  $username  $useremail

Add New User

E-Mail:
MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result) { echo"

Updating User Profile...

\n"; echo"The User Profile for $username, has been successfully updated...
\n"; } } } else if ($_POST["submit"] == "Delete User") { if ($_SESSION["level"] !=="admin" && $_SESSION["uid"] !== $_POST["userid"]) {$_POST["userid"]=$_SESSION["uid"];} $userid = $_POST["userid"]; $username = $_POST["username"]; if (checkFormKey()) { $sql = "DELETE FROM `t_userprofiles` WHERE `UserID`='$userid'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result) { echo"

Deleting User... Please wait...

\n"; echo"You've successfully deleted the user profile for $username...
\n"; include"$page_footer"; echo"\n\n"; exit; } } } if (!$userid) {$userid=$_POST["userid"];} //Show Edit Form $sql = "SELECT * FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $row = mysql_fetch_array($sql_result); $userid = $row["UserID"]; $username = $row["UserName"]; $useremail = $row["UserEmail"]; $userwebsite = $row["UserWebsite"]; $userpass = $row["UserPass"]; $usermode = $row["UserMode"]; $trusted = $row["UserTrusted"]; $useremailhide = $row["UserEmailHide"]; $userlastlogin = date("l, F, d, Y, g:i:sa", strtotime($row["UserLastLogin"])); ?>

Edit User Profile for

\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; ?>
Last login:
Name:
E-Mail:
Website:
Password:Change Password
Permissions:"; if ($_SESSION["level"]=="user" or $_SESSION[level]=="editor") { if ($usermode=="U") {echo"User \n"; //To prevent being reset to null on submit. } else if ($usermode=="E") { echo"Editor \n"; } else { echo"Unknown \n"; } if ($trusted=="TRUE") { echo"Trusted \n"; } } else if ($_SESSION["level"]=="admin") { if ($usermode=="A") {$a="TRUE"; $e="TRUE"; } else if ($usermode=="E") {$e="TRUE"; $a="FALSE"; } else if ($usermode=="U") {$e="FALSE"; $a="FALSE"; } echo"Editor: \n "; echo"Admin: \n "; echo"Trusted: \n"; } echo"
E-Mail Public:"; if ($useremailhide==="1") { echo"Hidden: Visible: "; } else if ($useremailhide==="0") { echo"Hidden: Visible: "; } else { echo"Hidden: Visible: "; } echo"
    ?');">
«« Return to User Manager
Adding User...\n"; //Verify Users Password and md5 encode it for storage... if ($_POST[userpass]==$_POST[userpassconfirm]) { $_POST[userpass]=md5($_POST[userpass]); } else { $errors="true"; echo"Your two passwords did not match, go back and try again...
\n"; } //Add User to MySQL Table if ($errors !="true") { $_POST["username"] = htmlspecialchars($_POST["username"]); $admin = $_POST["admin"]; $editor = $_POST["editor"]; $trusted = $_POST["trusted"]; $disabled = $_POST["disabled"]; //echo"$i - $admin - $editor - $trusted
\n"; if ($admin=="TRUE") { $mode="A"; } else if ($editor=="TRUE") { $mode="E"; } else if ($disabled=="TRUE") {$mode="D"; } else { $mode="U"; } if ($trusted !=="TRUE") {$trusted="FALSE"; } $username = $_POST[username]; $useremail = $_POST[useremail]; $userwebsite = $_POST[userwebsite]; $userpass = $_POST[userpass]; $useremailhide = $_POST[useremailhide]; if (checkFormKey()) { $sql = "INSERT INTO `t_userprofiles` (`UserName`, `UserEmail`, `UserWebsite`, `UserPass`, `UserMode`, `UserTrusted`, `UserEmailHide`) VALUES ('$username', '$useremail', '$userwebsite', '$userpass', '$mode', '$trusted', '$useremailhide');"; $sql_result = mysql_query($sql) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result) { include"mail_newaccount.php"; echo"The user $username has been added successfully...
\n"; echo"An E-Mail has been sent to the e-mail address specified with the login info they need to log in to their new account.
\n"; } } } } ?>

Add New User

E-Mail:" SIZE=30 MAXLENGTH=100>
Show E-Mail:Hidden: Visible:
Name:
Website:
Password:
Confirm:  
Permissions:Editor: Admin: Trusted:
  
«« Return to User Manager
Changing Password, please wait...\n"; $userid = $_POST["userid"]; $sql = "SELECT `UserPass`, `UserEmail` FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $row = mysql_fetch_array($sql_result); $userpass = $row["UserPass"]; $email = $row["UserEmail"]; $oldpass = md5($_POST[oldpass]); if ($userpass==$oldpass) { if ($_POST[newpass]==$_POST[newpass2]) { $newpassword = $_POST["newpass"]; $password_plain = $newpassword; $userpass = md5($newpassword); $sql_result = false; if (checkFormKey()) { $sql = "UPDATE `t_userprofiles` SET `UserPass`='$userpass' WHERE `UserID`='$userid'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); } if ($sql_result) { include"mail_newpassword.php"; echo"The password has been successfully changed, an e-mail has been sent confirming this action.
\n"; } } else { echo"The two passwords did not match, please go back and try again.
\n"; } } else { echo"Your Old password did not match the password on file, please try again.
\n"; } } else if ($_POST["submit"]=="Generate New Password") { echo"

Generating New Password, please wait...

\n"; $newpassword = substr(md5(mt_rand()),0,14); $password_plain = $newpassword; $userpass = md5($newpassword); $userid = $_POST["userid"]; $sql = "SELECT `UserEmail` FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $row = mysql_fetch_array($sql_result); $email = $row["UserEmail"]; if (checkFormKey()) { $sql = "UPDATE `t_userprofiles` SET `UserPass`='$userpass' WHERE `UserID`='$userid'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); if ($sql_result) { include"mail_newpassword.php"; echo"The password has been successfully reset. The user has been sent an e-mail notifying them of their new password.
\n"; } } } if (!$userid) { $userid = $_POST["userid"]; } //Get Name of User for Form $sql = "SELECT `UserName` FROM `t_userprofiles` WHERE `UserID` = '$userid' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $row = mysql_fetch_array($sql_result); $username = $row["UserName"]; ?>

Change password for

"> ">
Old Password:
New Password:
Retype New Password:   
  
«« Return to User Manager