$create_new_folder = false; } } if ($create_new_folder == true) { $new_id = $db->query_insert("nested_tree", array('parent_id' => $_POST['parent_id'], 'title' => mysql_real_escape_string(stripslashes($_POST['title'])), 'personal_folder' => 0, 'renewal_period' => mysql_real_escape_string(stripslashes($_POST['renewal_period'])), 'bloquer_creation' => '0', 'bloquer_modification' => '0')); //Add complexity $db->query_insert("misc", array('type' => 'complex', 'intitule' => $new_id, 'valeur' => $_POST['complex'])); //Add this folder to the role the creator has foreach (array_filter(explode(';', $_SESSION['fonction_id'])) as $role_id) { $db->query_insert("roles_values", array('folder_id' => $new_id, 'role_id' => $role_id)); } require_once 'NestedTree.class.php'; $tree = new NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title'); $tree->rebuild(); //Get user's rights IdentificationDesDroits($_SESSION['groupes_visibles'] . ';' . $new_id, $_SESSION['groupes_interdits'], $_SESSION['is_admin'], $_SESSION['fonction_id'], true); //Reload page echo 'RefreshPage("form_groupes");'; } break; //CASE where to update the associated Function //CASE where to update the associated Function case "fonction": $val = explode(';', $_POST['valeur']); $valeur = $_POST['valeur']; //Check if ID already exists $data = $db->fetch_row("SELECT authorized FROM " . $pre . "rights WHERE tree_id = '" . $val[0] . "' AND fonction_id= '" . $val[1] . "'"); if (empty($data[0])) { //Insert into DB $db->query_insert('rights', array('tree_id' => $val[0], 'fonction_id' => $val[1], 'authorized' => 1)); } else {
} else { $_SESSION['groupes_interdits'] = array(); } $_SESSION['fonction_id'] = $data['fonction_id']; //build array of roles $_SESSION['arr_roles'] = array(); foreach (array_filter(explode(';', $_SESSION['fonction_id'])) as $role) { $res_roles = $db->query_first("SELECT title FROM " . $pre . "roles_title WHERE id = " . $role); $_SESSION['arr_roles'][$role] = array('id' => $role, 'title' => $res_roles['title']); } $_SESSION['user']['find_cookie'] = false; $_SESSION['settings']['update_needed'] = ""; // Update table $db->query_update("users", array('key_tempo' => $_SESSION['cle_session'], 'last_connexion' => mktime(date("h"), date("i"), date("s"), date("m"), date("d"), date("Y")), 'disabled' => 0, 'no_bad_attempts' => 0), "id=" . $data['id']); //récupérer les droits de l'utilisateur IdentificationDesDroits($data['groupes_visibles'], $_SESSION['groupes_interdits'], $data['admin'], $data['fonction_id'], false); //Get some more elements $_SESSION['hauteur_ecran'] = $_POST['hauteur_ecran']; //Get last seen items $_SESSION['latest_items_tab'][] = ""; foreach ($_SESSION['latest_items'] as $item) { if (!empty($item)) { $data = $db->query_first("SELECT label,id_tree FROM " . $pre . "items WHERE id = " . $item); $_SESSION['latest_items_tab'][$item] = array('label' => $data['label'], 'url' => 'index.php?page=items&group=' . $data['id_tree'] . '&id=' . $item); } } //send back the random key $return = $_POST['randomstring']; } else { if ($data['disabled'] == 1) { //User and password is okay but account is locked