Update user_edit.php
This commit is contained in:
parent
e32f82939d
commit
48b2b05f20
|
|
@ -23,17 +23,20 @@
|
|||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
if (permission_exists("user_account_setting_view")) {
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists("user_account_setting_view")) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
|
|
@ -74,7 +77,8 @@ else {
|
|||
}
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && $_POST["persistform"] != "1") {
|
||||
//process http post data
|
||||
if (count($_POST) > 0 && $_POST["persistform"] != "1") {
|
||||
|
||||
//get the HTTP values and set as variables
|
||||
$password = check_str($_POST["password"]);
|
||||
|
|
@ -244,8 +248,8 @@ if (count($_POST)>0 && $_POST["persistform"] != "1") {
|
|||
$_SESSION["message"] = $text['confirm-update'];
|
||||
header("Location: ".PROJECT_PATH."/core/user_settings/user_edit.php");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
$sql = "select * from v_users ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and user_uuid = '$user_uuid' ";
|
||||
|
|
@ -262,7 +266,7 @@ else {
|
|||
//get the groups the user is a member of
|
||||
//group_members function defined in config.php
|
||||
$group_members = group_members($db, $user_uuid);
|
||||
}
|
||||
}
|
||||
|
||||
//include the header
|
||||
require_once "resources/header.php";
|
||||
|
|
@ -392,62 +396,6 @@ else {
|
|||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "<br>";
|
||||
echo "<br>";
|
||||
|
||||
echo "<table $table_width cellpadding='0' cellspacing='0'>";
|
||||
echo " <tr>\n";
|
||||
echo " <th class='th' colspan='2' align='left'>".$text['table2-title']."</th>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
if ($_SESSION['user_status_display'] == "false") {
|
||||
//hide the user_status when it is set to false
|
||||
}
|
||||
else {
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' class=\"vncell\" valign='top'>\n";
|
||||
echo " ".$text['label-status']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td width='70%' class=\"vtable\" align='left'>\n";
|
||||
echo " <select id='user_status' name='user_status' class='formfld' style=''>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($user_status == "Available") {
|
||||
echo " <option value='Available' selected='selected'>".$text['check-available-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Available'>".$text['check-available-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "Available (On Demand)") {
|
||||
echo " <option value='Available (On Demand)' selected='selected'>".$text['check-available-ondemand-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Available (On Demand)'>".$text['check-available-ondemand-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "Logged Out") {
|
||||
echo " <option value='Logged Out' selected='selected'>".$text['check-loggedout-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Logged Out'>".$text['check-loggedout-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "On Break") {
|
||||
echo " <option value='On Break' selected='selected'>".$text['check-onbreak-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='On Break'>".$text['check-onbreak-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "Do Not Disturb") {
|
||||
echo " <option value='Do Not Disturb' selected='selected'>".$text['check-do-not-disturb-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Do Not Disturb'>".$text['check-do-not-disturb-status']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " <br />\n";
|
||||
echo " ".$text['description-status']."<br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" valign='top'>\n";
|
||||
|
|
@ -509,20 +457,68 @@ else {
|
|||
echo " ".$text['description-timezone']."<br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
if ($_SESSION['user_status_display'] == "false") {
|
||||
//hide the user_status when it is set to false
|
||||
}
|
||||
else {
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' class=\"vncell\" valign='top'>\n";
|
||||
echo " ".$text['label-status']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td width='70%' class=\"vtable\" align='left'>\n";
|
||||
echo " <select id='user_status' name='user_status' class='formfld' style=''>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($user_status == "Available") {
|
||||
echo " <option value='Available' selected='selected'>".$text['check-available-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Available'>".$text['check-available-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "Available (On Demand)") {
|
||||
echo " <option value='Available (On Demand)' selected='selected'>".$text['check-available-ondemand-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Available (On Demand)'>".$text['check-available-ondemand-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "Logged Out") {
|
||||
echo " <option value='Logged Out' selected='selected'>".$text['check-loggedout-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Logged Out'>".$text['check-loggedout-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "On Break") {
|
||||
echo " <option value='On Break' selected='selected'>".$text['check-onbreak-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='On Break'>".$text['check-onbreak-status']."</option>\n";
|
||||
}
|
||||
if ($user_status == "Do Not Disturb") {
|
||||
echo " <option value='Do Not Disturb' selected='selected'>".$text['check-do-not-disturb-status']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='Do Not Disturb'>".$text['check-do-not-disturb-status']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " <br />\n";
|
||||
echo " ".$text['description-status']."<br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
echo "<br />";
|
||||
|
||||
echo "<div align='right'><input type='button' class='btn' value='".$text['button-save']."' onclick=\"if (check_password_strength(document.getElementById('password').value)) { submit_form(); }\"></div>";
|
||||
echo "<br />";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
//capture enter key to submit form
|
||||
echo "<script>\n";
|
||||
//capture enter key to submit form
|
||||
echo " $(window).keypress(function(event){\n";
|
||||
echo " if (event.which == 13) { submit_form(); }\n";
|
||||
echo " });\n";
|
||||
// convert password fields to text
|
||||
|
||||
// convert password fields to text
|
||||
echo " function submit_form() {\n";
|
||||
echo " $('input:password').css('visibility','hidden');\n";
|
||||
echo " $('input:password').attr({type:'text'});\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue