plugin->test_constructor_gatekeeper(); $id = get_input("id"); $first_name = get_input('first_name'); $last_name = get_input('last_name'); $email = get_input('email'); $role = 5; $institution = get_input('institution'); $handler = get_input('handler', 'assessments'); $forward_to = WWW_ROOT."{$handler}/assessment/${id}/proctor"; $input_values = array(); $input_values['first_name'] = $first_name; $input_values['last_name'] = $last_name; $input_values['email'] = $email; $input_values['institution'] = $institution; $_SESSION['input_values'] = $input_values; if (empty($first_name) || empty($last_name) || empty($email)) { $TeKe->add_system_message(_("At least one of the parameters is empty."), 'error'); forward($forward_to); } else if (!$TeKe->user->is_valid_email($email)) { $TeKe->add_system_message(_("Email is not valid."), "error"); forward($forward_to); } else if ($TeKe->user->check_email_exists($email)) { $TeKe->add_system_message(_("User with that email already exists."), "error"); forward($forward_to); } else { if ($user_id = $TeKe->plugin->addUser($first_name, $last_name, $email, $role, $institution)) { $TeKe->add_system_message(_("Success")); } else { $TeKe->add_system_message(_("Registration failed."), 'error'); forward($forward_to); } } unset($_SESSION['input_values']); forward($forward_to); ?>