* @copyright Australian Consortium for Social and Political Research Incorporated (ACSPRI) 2007,2008,2009,2010,2011 * @package queXS * @subpackage admin * @link http://www.acspri.org.au/software queXS was writen for ACSPRI * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * */ /** * Configuration file */ include_once(dirname(__FILE__).'/../config.inc.php'); /** * Database */ include_once(dirname(__FILE__).'/../db.inc.php'); /** * XHTML functions */ include_once(dirname(__FILE__).'/../functions/functions.xhtml.php'); $display = true; $msg = ""; if (isset($_POST['submit'])) { $operator_id = intval($_POST['operator_id']); $voip = $enabled = 0; if (isset($_POST['voip'])) $voip = 1; if (isset($_POST['enabled'])) $enabled = 1; if (HTPASSWD_PATH !== false && $_POST['existing_username'] != $_POST['username'] && empty($_POST['password'])) { $msg = T_("If changing usernames, you must specify a new password"); } else { $sql = "UPDATE operator SET username = " . $db->qstr($_POST['username']) . ", lastName = " . $db->qstr($_POST['lastName']) . ", firstName = " . $db->qstr($_POST['firstName']) . ", extension = " . $db->qstr($_POST['extension']) . ", extension_password = " . $db->qstr($_POST['extension_password']) . ", Time_zone_name = " . $db->qstr($_POST['timezone']) . ", voip = $voip, enabled = $enabled WHERE operator_id = $operator_id"; $rs = $db->Execute($sql); if (!empty($rs)) { if (HTPASSWD_PATH !== false && !empty($_POST['password'])) { //update password in htaccess include_once(dirname(__FILE__).'/../functions/functions.htpasswd.php'); $htp = New Htpasswd(HTPASSWD_PATH); $htp->deleteUser($_POST["existing_username"]); $htp->deleteUser($_POST["username"]); $htp->addUser($_POST["username"],$_POST["password"]); } $msg = T_("Successfully updated user"); } else { $msg = T_("Failed to update user. Please make sure the username and extension are unique"); } } $_GET['edit'] = $operator_id; } if (isset($_GET['edit'])) { xhtml_head(T_("Operator edit"),true,array("../css/table.css")); $operator_id = intval($_GET['edit']); $sql = "SELECT * FROM operator WHERE operator_id = $operator_id"; $rs = $db->GetRow($sql); $sql = "SELECT Time_zone_name as value, Time_zone_name as description FROM timezone_template"; $tz = $db->GetAll($sql); print "
" . T_("Download the file for each user and save in the same folder as the voip.exe executable. When the file is executed, it will run the voip.exe program with the correct connection details to connect the operator to the VoIP server") . "
"; print ""; print ""; $columns[] = "voipenabledisable"; $columns[] = "winbat"; $columns[] = "sh"; $titles[] = T_("Enable/Disable VoIP"); $titles[] = T_("Windows VoIP"); $titles[] = T_("*nix VoIP"); } xhtml_table($rs,$columns,$titles); xhtml_foot(); } ?>