return true;
}
+ /**
+ * Confirm the new user as registered. This should normally not be used,
+ * but it may be necessary if the user auth_method is changed to manual
+ * before the user is confirmed.
+ */
+ function user_confirm($username, $confirmsecret = null) {
+ $user = get_complete_user_data('username', $username);
+
+ if (!empty($user)) {
+ if ($user->confirmed) {
+ return AUTH_CONFIRM_ALREADY;
+ } else {
+ if (!set_field("user", "confirmed", 1, "id", $user->id)) {
+ return AUTH_CONFIRM_FAIL;
+ }
+ if (!set_field("user", "firstaccess", time(), "id", $user->id)) {
+ return AUTH_CONFIRM_FAIL;
+ }
+ return AUTH_CONFIRM_OK;
+ }
+ } else {
+ return AUTH_CONFIRM_ERROR;
+ }
+ }
+
}
?>