public function handleForm(Context $context, $action) { if ($action == "createUser") { if (isset($_POST['username']) && $_POST['username'] != "" && (isset($_POST['userlevel']) && $_POST['userlevel'] != "") && (isset($_POST['name']) && $_POST['name'] != "") && (isset($_POST['email']) && $_POST['email'] != "")) { $password = ""; if (Config::login_type == LOGIN_TYPE_DB) { $password = CryptoUtil::generatePassword(9, 4); } UserDao::createUser($_POST['username'], $_POST['name'], $_POST['email'], $_POST['userlevel'], $password); $message = "Created User -- Username: "******" Password: "******"Required Field Left Blank."); } } else { $context->addError("Incorrect Action."); } }