// email-verification if ($PHORUM['registration_control']) { //$PHORUM['DATA']['PROFILE']['email_temp']="email_address@bogus.com|bla"; if (!empty($PHORUM['DATA']['PROFILE']['email_temp'])) { list($PHORUM['DATA']['PROFILE']['email_temp_part'], $bogus) = explode("|", $PHORUM['DATA']['PROFILE']['email_temp']); } } $email_temp_part = ""; if (count($_POST)) { if (empty($_POST["email"])) { $error = $PHORUM["DATA"]["LANG"]["ErrRequired"]; } elseif (!phorum_api_mail_check_address($_POST["email"])) { $error = $PHORUM["DATA"]["LANG"]["ErrEmail"]; } elseif ($PHORUM['user']['email'] != $_POST["email"] && phorum_api_user_search("email", $_POST["email"])) { $error = $PHORUM["DATA"]["LANG"]["ErrEmailExists"]; } elseif (($banerr = phorum_api_ban_check($_POST["email"], PHORUM_BAD_EMAILS)) !== NULL) { $error = $banerr; } elseif (isset($PHORUM['DATA']['PROFILE']['email_temp_part']) && !empty($_POST['email_verify_code']) && $PHORUM['DATA']['PROFILE']['email_temp_part'] . "|" . $_POST['email_verify_code'] != $PHORUM['DATA']['PROFILE']['email_temp']) { $error = $PHORUM['DATA']['LANG']['ErrWrongMailcode']; } else { // flip this due to db vs. UI wording. $_POST["hide_email"] = isset($_POST["hide_email"]) ? 0 : 1; $_POST['moderation_email'] = isset($_POST['moderation_email']) && phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_MESSAGES, PHORUM_ACCESS_ANY) ? 1 : 0; // Remember this for the template. if (isset($PHORUM['DATA']['PROFILE']['email_temp_part'])) { $email_temp_part = $PHORUM['DATA']['PROFILE']['email_temp_part']; } // do we need to send a confirmation-mail? if (isset($PHORUM['DATA']['PROFILE']['email_temp_part']) && !empty($_POST['email_verify_code']) && $PHORUM['DATA']['PROFILE']['email_temp_part'] . "|" . $_POST['email_verify_code'] == $PHORUM['DATA']['PROFILE']['email_temp']) { $_POST['email'] = $PHORUM['DATA']['PROFILE']['email_temp_part']; $_POST['email_temp'] = "";
/** * This function can be used to run multiple ban list checks in one go. * * The first check for which a match is found, will make the function * return an error for the match. If all checks are passed, then NULL * will be returned. * * @param array $checks * An array of checks to run. Each element in this array is an * array itself, with two elements in it: * - the value to check * - the banlist type to check against. * * @return bool * An error message in case a value matches a banlist, NULL otherwise. */ function phorum_api_ban_check_multi($checks) { foreach ($checks as $check) { $message = phorum_api_ban_check($check[0], $check[1]); if ($message !== NULL) { return $message; } } return NULL; }