mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Remove limesurvey!
Make session authentication work without limesurvey itself
This commit is contained in:
@@ -61,7 +61,7 @@ if ($_SESSION['USER_RIGHT_SUPERADMIN'] != 1)
|
||||
include_once(dirname(__FILE__) . "/../functions/functions.xhtml.php");
|
||||
xhtml_head();
|
||||
print "<p>" . T_("You do not have permission to access this area") . "</p>";
|
||||
print "<p><a href='../include/limesurvey/admin/admin.php?action=logout'>" . T_("Logout") . "</a></p>";
|
||||
print "<p><a href='../login.php?action=logout'>" . T_("Logout") . "</a></p>";
|
||||
xhtml_foot();
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ if (isset($_POST['client']) && !empty($_POST['client']))
|
||||
|
||||
if ($db->Execute($sql))
|
||||
{
|
||||
$sql = "UPDATE " . LIME_PREFIX . "users SET `users_name` = $client, `full_name` = $firstname, `email` = $email";
|
||||
$sql = "UPDATE users SET `users_name` = $client, `full_name` = $firstname, `email` = $email";
|
||||
|
||||
/* rewrite 'password' only if not blank in edit mode */
|
||||
if (isset($_GET['edit']) && $_GET['edit'] >0 && isset($_POST['password']) && !empty($_POST['password'])) {
|
||||
@@ -114,8 +114,8 @@ if (isset($_POST['client']) && !empty($_POST['client']))
|
||||
include_once("../include/sha256.php");
|
||||
|
||||
//Insert into lime_users
|
||||
$sql = "INSERT INTO " . LIME_PREFIX . "users (`users_name`,`password`,`full_name`,`parent_id`,`superadmin`,`email`,`lang`)
|
||||
VALUES ($client, '" . SHA256::hashing($_POST['password']) . "', $firstname ,1,0,$email,'auto')";
|
||||
$sql = "INSERT INTO users (`users_name`,`password`,`full_name`,`superadmin`,`email`)
|
||||
VALUES ($client, '" . SHA256::hashing($_POST['password']) . "', $firstname ,0,$email)";
|
||||
|
||||
if ($db->Execute($sql)) $a = T_("Added") . ": " . $client; else $a = T_("Error adding client");
|
||||
}
|
||||
@@ -139,7 +139,7 @@ if (isset($_GET['edit']) && $_GET['edit'] >0 ) {
|
||||
|
||||
$clid = intval($_GET['edit']);
|
||||
|
||||
$sql = "SELECT client.*, u.email, u.uid from client, " . LIME_PREFIX . "users as u WHERE client_id=$clid and u.users_name=username";
|
||||
$sql = "SELECT client.*, u.email, u.uid from client, users as u WHERE client_id=$clid and u.users_name=username";
|
||||
|
||||
$cdata = $db->GetRow($sql);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ include ("../functions/functions.operator.php");
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<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="../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="../login.php?action=logout"><i class="fa fa-sign-out fa-fw "></i> <?php print T_("Logout"); ?> </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -68,7 +68,7 @@ if (isset($_POST['submit']))
|
||||
|
||||
$uname = $db->GetOne($sql);
|
||||
|
||||
$sql = "UPDATE " . LIME_PREFIX . "users
|
||||
$sql = "UPDATE users
|
||||
SET users_name = " . $db->qstr($_POST['username']) . ",
|
||||
email = " . $db->qstr($_POST['email']) . ",
|
||||
full_name = " . $db->qstr($_POST['firstName']) . ",
|
||||
@@ -145,8 +145,8 @@ if (isset($_GET['edit']))
|
||||
|
||||
$operator_id = intval($_GET['edit']);
|
||||
|
||||
$sql = "SELECT o.*,l.superadmin,l.email,l.parent_id
|
||||
FROM operator as o, " . LIME_PREFIX ."users as l
|
||||
$sql = "SELECT o.*,l.superadmin,l.email
|
||||
FROM operator as o, users as l
|
||||
WHERE o.operator_id = $operator_id
|
||||
AND l.users_name = o.username";
|
||||
|
||||
@@ -283,7 +283,7 @@ function generate() {
|
||||
|
||||
<div class="form-group">
|
||||
<label for="admin" class="col-lg-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
|
||||
<div class="col-lg-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 class="col-lg-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>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -118,8 +118,8 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
|
||||
include_once("../include/sha256.php");
|
||||
|
||||
//Insert into lime_users
|
||||
$sql = "INSERT INTO " . LIME_PREFIX . "users (`users_name`,`password`,`full_name`,`parent_id`,`superadmin`,`email`,`lang`)
|
||||
VALUES ($operator, '" . SHA256::hashing($_POST['password']) . "',$firstname,1,$admin,$email,'auto')";
|
||||
$sql = "INSERT INTO users (`users_name`,`password`,`full_name`,`superadmin`,`email`)
|
||||
VALUES ($operator, '" . SHA256::hashing($_POST['password']) . "',$firstname,$admin,$email)";
|
||||
|
||||
$db->Execute($sql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user