/** * Clean the posted form values to be used on the user actions, * and again on the form if validation failed. */ $add_user_data_name = encode_html($_POST['add_user_form_name']); $add_user_data_email = encode_html($_POST['add_user_form_email']); $add_user_data_level = encode_html($_POST['add_user_form_level']); $add_user_data_user = encode_html($_POST['add_user_form_user']); $add_user_data_active = isset($_POST["add_user_form_active"]) ? 1 : 0; /** Arguments used on validation and user creation. */ $new_arguments = array('id' => '', 'username' => $add_user_data_user, 'password' => $_POST['add_user_form_pass'], 'name' => $add_user_data_name, 'email' => $add_user_data_email, 'role' => $add_user_data_level, 'active' => $add_user_data_active, 'type' => 'new_user'); /** Validate the information from the posted form. */ $new_validate = $new_user->validate_user($new_arguments); /** Create the user if validation is correct. */ if ($new_validate == 1) { $new_response = $new_user->create_user($new_arguments); } } ?> <div id="main"> <h2><?php echo $page_title; ?> </h2> <div class="whiteform whitebox"> <?php /** * If the form was submited with errors, show them here.