query_fetchDB(" SELECT u.user_login, u.user_password, u.user_realname, u.user_email, u.user_url, l.level_key FROM ot_users AS u JOIN ot_users_level AS l ON l.user_id = u.id && (l.level_key = 'administrator' OR l.level_key = 'editor' OR l.level_key = 'author' OR l.level_key = 'user') WHERE u.id = '" . $_GET['user'] . "' LIMIT 1 "); // Fetch user from DB if($User) // User exists? { if(defined("USER_LEVEL_ADMINISTRATOR")) { // We want to edit the user user? if($_SERVER['REQUEST_METHOD'] == "POST") { if( ! empty($_POST['user_realname']) && ! empty($_POST['user_login']) && ! empty($_POST['user_email']) && isset($_POST['user_url']) && ! empty($_POST['user_status'])) { // What's the user's function? if($_POST['user_status'] == "Beheerder") { $_POST['user_status'] = "administrator"; $_POST['user_panel'] = "true"; } elseif($_POST['user_status'] == "Redacteur") { $_POST['user_status'] = "editor"; $_POST['user_panel'] = "true"; } elseif($_POST['user_status'] == "Auteur") { $_POST['user_status'] = "author"; $_POST['user_panel'] = "true"; } elseif($_POST['user_status'] == "Lid") { $_POST['user_status'] = "user"; $_POST['user_panel'] = "false"; } // Edit user in DB $DB->query_execDB(" UPDATE ot_users SET user_login = '" . addslashes($_POST['user_login']) . "', user_realname = '" . addslashes($_POST['user_realname']) . "', user_email = '" . addslashes($_POST['user_email']) . "', user_url = '" . addslashes($_POST['user_url']) . "' WHERE id = '" . $_GET['user'] . "' "); // Edit permissions $DB->query_execDB(" UPDATE ot_users_level t1, ot_users_level t2 SET t1.level_key = '" . $_POST['user_status'] . "', t2.level_value = '" . $_POST['user_panel'] . "' WHERE t1.user_id = '" . $_GET['user'] . "' && t1.level_key = '" . stripslashes($User['0']['level_key']) . "' && t2.user_id = '" . $_GET['user'] . "' && t2.level_key = 'panel' "); header("Location: user-edit.php?user=" . $_GET['user'] . "&update=true"); } else { header("Location: err-403.php"); // Error } } // What's the user's function? if($User['0']['level_key'] == "administrator") { $User['0']['level_key'] = "Beheerder"; } elseif($User['0']['level_key'] == "editor") { $User['0']['level_key'] = "Redacteur"; } elseif($User['0']['level_key'] == "author") { $User['0']['level_key'] = "Auteur"; } elseif($User['0']['level_key'] == "user") { $User['0']['level_key'] = "Lid"; } $Status = array(array('status' => 'Beheerder'), array('status' => 'Redacteur'), array('status' => 'Auteur'), array('status' => 'Lid')); // Create status $PageTitle = " » Gebruikers » Bewerken"; // Set page title include("admin-header.php"); // Load header ?>
Naam: | |
---|---|
Alias: | Het alias zal dienen bij de aanmelding. |
E-mail adres: | Gelieve een bestaand e-mail adres op te geven. Dit zal worden gebruikt ter activatie. |
Website-URL: | |
Gebruikersfunctie: | |