From 19a10e5704fb4b605e291990220c71a26ec67972 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20G=C3=BCnther?=
Date: Tue, 30 Jul 2024 23:06:34 +0200
Subject: [PATCH] Preparation fpr new mareike & solea module
---
bdp-kompass.php | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 46 insertions(+), 1 deletion(-)
diff --git a/bdp-kompass.php b/bdp-kompass.php
index b6f3984..c976809 100644
--- a/bdp-kompass.php
+++ b/bdp-kompass.php
@@ -31,7 +31,6 @@ function bdp_plugin_init() {
bdp_kompass_load_plugin_textdomain();
Security::ProhibitBots();
Security::SetPageFilters();
- EventsMain::setup();
if (null == get_option('kompass_already_installed', null)) {
Seo::setup();
@@ -78,3 +77,49 @@ function enqueue_custom_password_js() {
add_action( 'after_setup_theme', 'kompass_after_setup_theme' );
+
+
+
+
+
+
+
+
+
+
+
+
+// Add registration form fields
+function crp_custom_register_form() {
+
+}
+add_action('register_form', ['Bdp\Modules\Registration\Controllers\ExtendRegistrationForm', 'execute']);
+
+// Validate registration form fields
+add_filter('registration_errors', ['Bdp\Modules\Registration\Controllers\ExtendRegistrationForm', 'error_messages'], 10, 3);
+
+// Save custom user meta data
+add_action('user_register', ['\Bdp\Modules\Registration\Controllers\SaveRegistration', 'execute']);
+
+// Handle account activation
+
+add_action('init', ['Bdp\Modules\Registration\Controllers\SaveRegistration', 'activate_user']);
+
+// Prevent login if account is not activated
+
+add_filter('authenticate', ['Bdp\Modules\Registration\Controllers\SaveRegistration', 'check_user_activation'], 30, 3);
+
+function crp_allow_umlauts_in_usernames($username, $raw_username, $strict) {
+ if (!$strict) {
+ return $username;
+ }
+
+ // Allow letters, numbers, underscores, spaces, periods, hyphens, and umlauts
+ $username = preg_replace('/[^a-zA-Z0-9 _.\-äöüÄÖÜß]/', '', $raw_username);
+
+ return $username;
+}
+add_filter('sanitize_user', 'crp_allow_umlauts_in_usernames', 10, 3);
+
+
+add_action('login_message', ['Bdp\Modules\Registration\Controllers\SaveRegistration','display_custom_message']);
\ No newline at end of file