mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Link settings option to operator editing
Initial user always to have superadmin rights (otherwise may lose access to system)
This commit is contained in:
@@ -43,7 +43,16 @@ include ("../config.inc.php");
|
|||||||
*/
|
*/
|
||||||
include ("auth-admin.php");
|
include ("auth-admin.php");
|
||||||
|
|
||||||
include ("../functions/functions.xhtml.php");
|
/*
|
||||||
|
* XHTML file
|
||||||
|
*/
|
||||||
|
include ("../functions/functions.xhtml.php");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Operator functions
|
||||||
|
*/
|
||||||
|
include ("../functions/functions.operator.php");
|
||||||
|
|
||||||
$username = $_SESSION['user'];
|
$username = $_SESSION['user'];
|
||||||
$g = 0;
|
$g = 0;
|
||||||
if (isset($_GET['g']))
|
if (isset($_GET['g']))
|
||||||
@@ -81,7 +90,7 @@ include ("auth-admin.php");
|
|||||||
</a>
|
</a>
|
||||||
<!--- User menu // not connected to pages so not working yet // could be hidden -->
|
<!--- User menu // not connected to pages so not working yet // could be hidden -->
|
||||||
<ul class="dropdown-menu" role="menu">
|
<ul class="dropdown-menu" role="menu">
|
||||||
<li><a href="../include/limesurvey/admin/admin.php?action=editusers"><i class="fa fa-cogs fa-fw "></i> <?php print T_("Settings"); ?></a></li>
|
<li><a href="?g=5&page=operatorlist.php?edit=<?php print get_operator_id(); ?>"><i class="fa fa-cogs fa-fw "></i> <?php print T_("Settings"); ?></a></li>
|
||||||
<!--- <li><a href="../screenloc.php"><i class="fa fa-lock fa-fw "></i> <?php print T_("Lock Screen"); ?></a></li> -->
|
<!--- <li><a href="../screenloc.php"><i class="fa fa-lock fa-fw "></i> <?php print T_("Lock Screen"); ?></a></li> -->
|
||||||
<li><a href="../include/limesurvey/admin/admin.php?action=logout"><i class="fa fa-sign-out fa-fw "></i> <?php print T_("Logout"); ?> </a></li>
|
<li><a href="../include/limesurvey/admin/admin.php?action=logout"><i class="fa fa-sign-out fa-fw "></i> <?php print T_("Logout"); ?> </a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -55,10 +55,11 @@ $msg = "";
|
|||||||
if (isset($_POST['submit']))
|
if (isset($_POST['submit']))
|
||||||
{
|
{
|
||||||
$operator_id = intval($_POST['operator_id']);
|
$operator_id = intval($_POST['operator_id']);
|
||||||
$chat_enable = $voip = $enabled = 0;
|
$superadmin = $chat_enable = $voip = $enabled = 0;
|
||||||
if (isset($_POST['voip'])) $voip = 1;
|
if (isset($_POST['voip'])) $voip = 1;
|
||||||
if (isset($_POST['chat_enable'])) $chat_enable = 1;
|
if (isset($_POST['chat_enable'])) $chat_enable = 1;
|
||||||
if (isset($_POST['enabled'])) $enabled = 1;
|
if (isset($_POST['enabled'])) $enabled = 1;
|
||||||
|
if (isset($_POST['admin'])) $superadmin = 1;
|
||||||
|
|
||||||
//get username
|
//get username
|
||||||
$sql = "SELECT username
|
$sql = "SELECT username
|
||||||
@@ -70,7 +71,8 @@ if (isset($_POST['submit']))
|
|||||||
$sql = "UPDATE " . LIME_PREFIX . "users
|
$sql = "UPDATE " . LIME_PREFIX . "users
|
||||||
SET users_name = " . $db->qstr($_POST['username']) . ",
|
SET users_name = " . $db->qstr($_POST['username']) . ",
|
||||||
email = " . $db->qstr($_POST['email']) . ",
|
email = " . $db->qstr($_POST['email']) . ",
|
||||||
full_name = " . $db->qstr($_POST['firstName']);
|
full_name = " . $db->qstr($_POST['firstName']) . ",
|
||||||
|
superadmin = $superadmin";
|
||||||
|
|
||||||
if (!empty($_POST['password']))
|
if (!empty($_POST['password']))
|
||||||
{
|
{
|
||||||
@@ -143,7 +145,7 @@ if (isset($_GET['edit']))
|
|||||||
|
|
||||||
$operator_id = intval($_GET['edit']);
|
$operator_id = intval($_GET['edit']);
|
||||||
|
|
||||||
$sql = "SELECT o.*,l.superadmin,l.email
|
$sql = "SELECT o.*,l.superadmin,l.email,l.parent_id
|
||||||
FROM operator as o, " . LIME_PREFIX ."users as l
|
FROM operator as o, " . LIME_PREFIX ."users as l
|
||||||
WHERE o.operator_id = $operator_id
|
WHERE o.operator_id = $operator_id
|
||||||
AND l.users_name = o.username";
|
AND l.users_name = o.username";
|
||||||
@@ -264,7 +266,7 @@ function generate() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="admin" class="col-sm-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
|
<label for="admin" class="col-sm-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
|
||||||
<div class="col-sm-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger" <?php if ($rs['superadmin']) echo "checked=\"checked\""; ?> value="1"/></div>
|
<div class="col-sm-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger" <?php if ($rs['superadmin'] || ($rs['parent_id'] == 0)) echo " checked=\"checked\" "; if ($rs['parent_id'] == 0) echo " disabled=\"disabled\" "; ?> value="1"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="chat_enable" class="col-sm-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
|
<label for="chat_enable" class="col-sm-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
|
||||||
|
|||||||
Reference in New Issue
Block a user