diff --git a/.deployment/info.json b/.deployment/info.json index 505c245..ade19f3 100644 --- a/.deployment/info.json +++ b/.deployment/info.json @@ -6,7 +6,7 @@ "version": "4.3.2", "download_url": "http://lv-sachsen-main.bdp.mein-verein.online/wordpress/bdp-kompass-4.3.2.zip", "requires": "6.0", - "tested": "6.5", + "tested": "6.7", "requires_php": "8.2", "last_updated": "02.03.2024 16:24:00", "sections": { diff --git a/.deployment/info.json.tpl b/.deployment/info.json.tpl index e611cd6..4860bd7 100644 --- a/.deployment/info.json.tpl +++ b/.deployment/info.json.tpl @@ -6,7 +6,7 @@ "version": "%version%", "download_url": "http://lv-sachsen-main.bdp.mein-verein.online/wordpress/bdp-kompass-%version%.zip", "requires": "6.0", - "tested": "6.5", + "tested": "6.7", "requires_php": "8.2", "last_updated": "%date%", "sections": { diff --git a/assets/mareike.css b/assets/mareike.css new file mode 100644 index 0000000..9d09b97 --- /dev/null +++ b/assets/mareike.css @@ -0,0 +1,175 @@ +/* Allgemeine Anpassungen */ +body { + --ame-ms-menu-width: 250px; +} + +#wpwrap { + background-color: #f3f3f1; /* Hintergrundfarbe angepasst */ +} + +/* Admin Menü */ +#adminmenuback, #adminmenuwrap, #adminmenu { + width: 250px; + background-color: #ffffff; /* Hintergrundfarbe angepasst */ +} + +#adminmenu .wp-has-current-submenu > .wp-submenu { + width: 250px; +} + +#wpcontent, #wpfooter { + margin-left: 250px; + background-color: #ffffff; + padding-left: 20px; /* Padding reduziert */ +} + +#adminmenu .wp-not-current-submenu .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu .ame-has-deep-submenu:not(.ame-has-highlighted-item) > .wp-submenu { + width: 250px; +} + +/* Menüelemente */ +#adminmenu > li { + padding: 10px 10px; /* Padding angepasst */ + font-weight: bold; /* Schriftstärke angepasst */ +} + +#adminmenu > li a { + color: #333; /* Textfarbe angepasst */ +} + +#adminmenu > li div.wp-menu-image:before { + color: #333; /* Iconfarbe angepasst */ +} + +#adminmenu > li a:hover, #adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus { + color: #0056b3; /* Textfarbe bei Hover angepasst */ +} + +#adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus { + background-color: #e9ecef; /* Hintergrundfarbe bei Hover angepasst */ +} + +#adminmenu .wp-submenu, #adminmenu .wp-submenu a { + background-color: #f8f9fa; /* Untermenü-Hintergrundfarbe angepasst */ + color: #333; /* Untermenü-Textfarbe angepasst */ +} + +#adminmenu .wp-submenu a:hover { + background-color: #e9ecef; /* Untermenü-Hintergrundfarbe bei Hover angepasst */ + color: #0056b3; /* Untermenü-Textfarbe bei Hover angepasst */ +} + +/* Admin Bar */ +#wpadminbar { + background-color: #ffffff; /* Admin Bar Hintergrundfarbe angepasst */ + color: #0056b3; /* Admin Bar Textfarbe angepasst */ +} + +#wpadminbar .ab-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon { + color: #0056b3; /* Admin Bar Textfarbe angepasst */ +} + +#wpadminbar .ab-icon, #wpadminbar .ab-icon:before, #wpadminbar .ab-item:before, #wpadminbar .ab-item:after { + color: #0056b3; /* Admin Bar Icon-Farbe angepasst */ +} + +#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item, #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item { + background-color: #e9ecef; /* Admin Bar Hintergrundfarbe bei Hover angepasst */ + color: #0056b3; /* Admin Bar Textfarbe bei Hover angepasst */ +} + +#wpadminbar .quicklinks .menupop ul li a:hover, #wpadminbar .quicklinks .menupop ul li a:focus { + background-color: #e9ecef; /* Untermenü Hintergrundfarbe bei Hover angepasst */ + color: #0056b3; /* Untermenü Textfarbe bei Hover angepasst */ +} + +/* Buttons */ +.button-primary { + border-style: none; + background-color: #0056b3 !important; /* Button Hintergrundfarbe angepasst */ + color: #ffffff !important; /* Button Textfarbe angepasst */ + box-shadow: none; /* Box-Shadow entfernt */ +} + +.button-primary:hover { + background-color: #004085 !important; /* Button Hintergrundfarbe bei Hover angepasst */ +} + +/* Anpassungen für Bildschirme mit unterschiedlichen Breiten */ +@media screen and (min-width: 783px) { + #adminmenu .wp-not-current-submenu .wp-submenu { + display: none !important; + } +} + +@media screen and (max-width: 960px) and (min-width: 783px) { + body.auto-fold #widgets-editor .interface-interface-skeleton { + left: var(--ame-ms-collapsed-menu-width, 36px); + } +} + +/* Weitere Anpassungen */ +.nav-tab { + border-color: #0056b3; + background-color: #e9ecef; + border-radius: 5px 5px 0 0; +} + +.about-wrap .nav-tab-active, .nav-tab-active, .nav-tab-active:hover { + border-style: none; + background-color: #ffffff; + border-bottom-color: #ffffff; + box-shadow: none; +} + +/* Weitere spezifische Anpassungen */ +#collapse-button { + display: none; +} + +/* Spezielle Einstellungen Box */ +.bdp_setting_box { + margin-right: 10px; + background-color: #ffffff; + padding: 15px; + border: 1px solid #1d94cf; +} + +.bdp_setting_box label { + cursor: pointer; +} + +.bdp_setting_box label span { + cursor: pointer; + width: 10pt; + color: #a0a0a0; +} + +@media screen and (min-width: 783px) { + .wp-has-current-submenu li a { + width: 210px !important; + } +} + +.wp-submenu li a:hover { + background-color: #e9ecef !important; + color: #0056b3 !important; +} + +.current .menu-top .wp-menu-name, .wp-has-current-submenu .wp-menu-name { + background-color: #0056b3 !important; + border-style: none !important; + width: 202px; +} + +@media screen and (min-width: 783px) { + .wp-submenu, .wp-submenu-wrap { + background-color: #f8f9fa !important; + width: 220px !important; + } + + #adminmenu .current .menu-top .wp-menu-name { + padding: 10px; + width: 225px !important; + } +} diff --git a/assets/wordpress-bdp.css b/assets/wordpress-bdp.css index d70f95a..d10e3e7 100644 --- a/assets/wordpress-bdp.css +++ b/assets/wordpress-bdp.css @@ -393,4 +393,14 @@ li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after, background-color: #FFFFFF !important; } +.bdp-newplugin-button:hover { + color: #ffffff !important; + background-color: #1d4899 !important; +} +.bdp-newplugin-button { + background-color: #ffffff !important; + padding: 5px 20px !important; + cursor: pointer !important; + color: #1d4899 !important; +} diff --git a/bdp-kompass.php b/bdp-kompass.php index b6f3984..168a497 100644 --- a/bdp-kompass.php +++ b/bdp-kompass.php @@ -2,7 +2,7 @@ /** * Plugin Name: BdP Kompass * Description: Wordpress-Plugin zur Unterstützung von Stämmen im Bund der Pfadfinderinnen und Pfadfinder e.V. zur optimalen Verwaltung eurer Webseite - * Version: 4.6.2 + * Version: 4.8.1 * Tags: bdp, utility, helper * Requires at least: 6.0 * Requires PHP: 8.2 @@ -12,11 +12,12 @@ * Text Domain: bdp-kompass */ +use Bdp\Libs\WpConfigEditor; use Bdp\Modules\EventParticipants\Controllers\MainController as EventsMain; -use Bdp\Modules\Gruppen\Controllers\MainController as GruppenMain; use Bdp\Modules\KompassSettings\Controllers\SettingsPage as KomnpassSettings; use Bdp\Modules\LimitLoginAttempts\Controllers\OptionsPage as OptionsPageAlias; use Bdp\Modules\Mail\Controllers\MailController; +use Bdp\Modules\Mail\Controllers\MailSettingsController; use Bdp\Modules\Security\Security; use Bdp\Modules\Seo\Seo; @@ -31,11 +32,11 @@ function bdp_plugin_init() { bdp_kompass_load_plugin_textdomain(); Security::ProhibitBots(); Security::SetPageFilters(); - EventsMain::setup(); - if (null == get_option('kompass_already_installed', null)) { +# WpConfigEditor::updateConfig('DISABLE_WP_CRON', true); + + if (null == get_option('kompass_already_installed', null)) { Seo::setup(); - Calendar::setup(); Security::setup(); update_option('kompass_already_installed', true); wp_redirect( 'site-health.php?tab=bdp_enhanced_security'); @@ -58,12 +59,14 @@ add_action('wp_ajax_kompass_show_ajax', 'kompass_load_ajax_content'); add_action('wp_ajax_nopriv_kompass_show_ajax', 'kompass_load_ajax_content'); function register_custom_theme_directory() { - $file = ABSPATH . '/wp-content/plugins/bdp-kompass/buena/' ; + if (is_dir(ABSPATH . '/wp-content/themes/mareike-theme/')) { + return; + } + $file = ABSPATH . '/wp-content/plugins/bdp-kompass/lib/mareike-theme/' ; - system('mkdir ' . ABSPATH . 'wp-content/themes/buena/'); - system('cp -r ' . $file . '* ' . ABSPATH . 'wp-content/themes/buena/'); + system('mkdir ' . ABSPATH . '/wp-content/themes/mareike-theme/'); + system('cp -r ' . $file . '* ' . ABSPATH . '/wp-content/themes/mareike-theme/'); - switch_theme('buena'); } function enqueue_custom_password_js() { @@ -78,3 +81,67 @@ function enqueue_custom_password_js() { add_action( 'after_setup_theme', 'kompass_after_setup_theme' ); + +add_action( 'admin_menu', ['Bdp\Modules\KompassSettings\Controllers\SettingsPage', 'add_menu'] ); + + + +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']); + +if (false === (bool)get_option('user_can_register', false)) { + + add_filter('registration_errors', 'kompass_disable_user_registration', 10, 3); + + function kompass_disable_user_registration($errors, $sanitized_user_login, $user_email) { + $errors->add('registration_disabled', __('Die Registrierung ist derzeit deaktiviert.')); + return $errors; + } + + add_action('login_enqueue_scripts', 'kompass_remove_register_link'); + + function kompass_remove_register_link() { + ?> + + Version 4.8.2 + + +

Version 4.8.1

+ +

Version 4.6.2