User Password
\n”.n “
User Credential Management
\n”.n “
\n”;n//This script will create a salted hash of the username and password providedn$user_staff_info = get_user_staff_information($_POST[”userid”]);nnif (isset($_POST[”salt”]) && $_POST[”userid”] > 0) {n // retrieve user info n $user_data_array = array(”password”=>$_POST[”pass_to_salt”]);n // Update apollo passwordn if($_SESSION[”user_level”] < 301){n if($_POST[''pass_to_salt''] != $_POST[''password_confirm'']){ echo "Passwords do not match. Please go back and try again."; die();}n if($_POST[''userid''] != $_SESSION[''user_id''] && ($_POST[''dealer_apollo_id''] <= 0 ) ){n echo "You Do not have permission to change another user''s password, unless they are a dealer.";n die();n }n }n echo "Updating Apollo Password…“;n set_user_password($_POST[”userid”],$_POST[”pass_to_salt”]);n // update kayako support suite passwordn if($user_staff_info[”support_suite_userid”] > 0){n echo “Updating Support Suite Password…“;n update_support_suite_user_data($user_staff_info[”support_suite_userid”],$user_data_array);n }n // update knowledge tree passwordn if($user_staff_info[”knowledge_tree_userid”] > 0){n echo “Updating Knowledge Tree Password…“;n update_knowledge_tree_user_data($user_staff_info[”knowledge_tree_userid”],$user_data_array);n }nn echo “
All Passwords Updated
“;nn $user_info = user_info($_POST[”userid”]);n if($user_info[”new_password”]==1){n mysql_query(“update employee_data set new_password = 0 where user_id = ”$_POST[userid]” “);n $emptycookie[”user_name”] = “”;n $emptycookie[”pass_hash”] = “”;n $emptycookie[”session_id”] = “0”;n $now = time();n mysql_query(“INSERT INTO user_session_history (userid, sessionid, time, note) VALUES(”$_SESSION[user_id]”’$_SESSION[session_id]”’$now”’Logged Out”);”);n if (isset($_COOKIE[”siliconlogin”])) { n setcookie(“siliconlogin”, $emptycookie, “-1”, “/”, “.siliconsolar.com”, false, true);nn }n echo “You are now logged out. Return to login?“;n session_destroy();n die();n }n}nif($_GET[”ap_user_id”] > 0){n $user_info = user_info($_GET[”ap_user_id”]);n if($user_info[”level”]!=”2”){n die(“This user is not a dealer. This should not happen. Scheming, miserly critters!”);n }n echon “
Update Your Passwords:
n
This form permits you to update the password for all of the software systems in use at SiliconSolar. Updating this form will change the passwords forn Apollo, Support Suite, and Knowledge Tree. Please be sure to remove the saved (old) password from your browser and anywhere else it is stored, and to testn your new login/password combination at your earliest convenience. If necessary, you can email the support teamn to request a new password.n
n
n
“;n}nelseif($_SESSION[”user_level”]>300){n echo “
Reset a user”s password(s):
“;n echo “
“;n echo “
“;n}nelse{n $user_info = user_info($_SESSION[user_id]);n $_GET[”ap_user_id”] = 0;n if($user_info[”new_password”]==1){n echo “
Weclome to apollo. Please update your password.
“;n }n echo “n
Update Your Passwords:
n
This form permits you to update the password for all of the software systems in use at SiliconSolar. Updating this form will change the passwords forn Apollo, Support Suite, and Knowledge Tree. Please be sure to remove the saved (old) password from your browser and anywhere else it is stored, and to testn your new login/password combination at your earliest convenience. If necessary, you can email the support teamn to request a new password.n
n
n “;n}n////////////////////////////////////////////////////////////////////ninclude $SITE[”path_to_webroot”].”/admin/template/bottom.php”;n?>\n”.n “
User Credential Management
\n”.n “