A few minor changes.

This commit is contained in:
Mark Crane 2015-03-05 12:38:35 +00:00
parent 8170e5188c
commit 2a4f9f6a10
2 changed files with 8 additions and 4 deletions

View File

@ -45,6 +45,7 @@ require_once "resources/require.php";
$sql = "select group_name from v_groups ";
$sql .= "where group_uuid = '".$group_uuid."' ";
$sql .= "and (domain_uuid = '".$_SESSION['domain_uuid']."' or domain_uuid is null); ";
//echo $sql . "\n";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
@ -56,7 +57,8 @@ require_once "resources/require.php";
//delete the group users
$sql = "delete from v_group_users ";
$sql .= "where group_uuid = '".$group_uuid."' ";
$sql .= "and (domain_uuid = '".$_SESSION['domain_uuid']."' or domain_uuid is null) ";
$sql .= "and (domain_uuid = '".$_SESSION['domain_uuid']."' or domain_uuid is null); ";
//echo $sql . "\n";
if (!$db->exec($sql)) {
$error = $db->errorInfo();
print_r($error);
@ -66,7 +68,8 @@ require_once "resources/require.php";
if (strlen($group_name) > 0) {
$sql = "delete from v_group_permissions ";
$sql .= "where group_name = '".$group_name."' ";
$sql .= "and (domain_uuid = '".$_SESSION['domain_uuid']."' or domain_uuid is null) ";
$sql .= "and (domain_uuid = '".$_SESSION['domain_uuid']."' or domain_uuid is null); ";
//echo $sql . "\n";
if (!$db->exec($sql)) {
$error = $db->errorInfo();
print_r($error);
@ -76,7 +79,8 @@ require_once "resources/require.php";
//delete the group
$sql = "delete from v_groups ";
$sql .= "where group_uuid = '".$group_uuid."' ";
$sql .= "and (domain_uuid = '".$_SESSION['domain_uuid']."' or domain_uuid is null) ";
$sql .= "and (domain_uuid = '".$_SESSION['domain_uuid']."' or domain_uuid is null); ";
//echo $sql . "\n";
if (!$db->exec($sql)) {
$error = $db->errorInfo();
print_r($error);

View File

@ -46,7 +46,7 @@ else {
$user_uuid = check_str($_POST["user_uuid"]);
//add the user to the group
if (is_uuid($user_uuid) && is_uuid($group_uuid) && strlen($group_name) > 0) {
if (is_uuid($user_uuid) && is_uuid($group_uuid) && strlen($group_name) > 0) {
$sql = "insert into v_group_users ";
$sql .= "(";
$sql .= "group_user_uuid, ";