Compare commits
15 Commits
b9307c2f5a
...
073c167746
Author | SHA1 | Date | |
---|---|---|---|
073c167746 | |||
bca4f2639b | |||
f7ca614b38 | |||
ca02db7b28 | |||
da63fe3b3c | |||
138b3859aa | |||
f9238eef72 | |||
e7fe409ae5 | |||
a424a4e6e5 | |||
aeddfbd339 | |||
5b6b06e70d | |||
33287c4b40 | |||
923d76c085 | |||
5e107d36ca | |||
19a10e5704 |
@ -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": {
|
||||
|
@ -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": {
|
||||
|
175
assets/mareike.css
Normal file
175
assets/mareike.css
Normal file
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
@ -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() {
|
||||
?>
|
||||
<style>
|
||||
#registerform {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
MailSettingsController::set_smtp_if_required();
|
||||
|
||||
|
||||
|
10
changelog
10
changelog
@ -1,3 +1,13 @@
|
||||
<h4>Version 4.8.2</h4>
|
||||
<ul>
|
||||
<li>Added Control element for manual cronjobs</li>
|
||||
</ul>
|
||||
|
||||
<h4>Version 4.8.1</h4>
|
||||
<ul>
|
||||
<li>Handling of deprecated components</h4>
|
||||
</ul>
|
||||
|
||||
<h4>Version 4.6.2</h4>
|
||||
<ul>
|
||||
<li>Bugfixes</li>
|
||||
|
@ -4,161 +4,67 @@ add_action('admin_enqueue_scripts', 'bdp_update_dashboard_style');
|
||||
add_action('login_enqueue_scripts', 'bdp_update_login_style');
|
||||
|
||||
function bdp_update_login_style() {
|
||||
$css = file_get_contents(BDP_LV_PLUGIN_DIR . 'assets/dashboard.style.css.tpl');
|
||||
echo str_replace('%%BDP_LV_PLUGIN_URL%%', BDP_LV_PLUGIN_URL, $css);
|
||||
if (false === (bool)get_option( 'use_mareike_theme', false )) {
|
||||
$css = file_get_contents( BDP_LV_PLUGIN_DIR . 'assets/dashboard.style.css.tpl' );
|
||||
echo str_replace( '%%BDP_LV_PLUGIN_URL%%', BDP_LV_PLUGIN_URL, $css );
|
||||
}
|
||||
}
|
||||
|
||||
function bdp_update_dashboard_style() {
|
||||
wp_enqueue_style('custom-dashboard-styles', BDP_LV_PLUGIN_URL . '/assets/wordpress-bdp.css');
|
||||
if (true === (bool)get_option( 'use_mareike_theme', false )) {
|
||||
#wp_enqueue_style( 'custom-dashboard-styles', BDP_LV_PLUGIN_URL . '/assets/mareike.css' );
|
||||
wp_enqueue_style( 'custom-dashboard-styles', BDP_LV_PLUGIN_URL . '/assets/wordpress-bdp.css' );
|
||||
} else {
|
||||
wp_enqueue_style( 'custom-dashboard-styles', BDP_LV_PLUGIN_URL . '/assets/wordpress-bdp.css' );
|
||||
}
|
||||
wp_enqueue_style('custom-calendar-styles', BDP_LV_PLUGIN_URL . '/assets/calendar.css');
|
||||
wp_enqueue_style('custom-security-styles', BDP_LV_PLUGIN_URL . '/assets/security.css');
|
||||
}
|
||||
|
||||
function kompass_install_plugin($url, $slug) {
|
||||
// Überprüfen, ob die URL gültig ist
|
||||
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
|
||||
echo 'Ungültige URL';
|
||||
return;
|
||||
}
|
||||
|
||||
function bdp_add_menu_security() {
|
||||
$moduleLoad = get_admin_url() . 'admin.php?page=' . BDP_LV_PLUGIN_SLUG . '/modules/index.php&loadmodule=';
|
||||
}
|
||||
// Dateinamen und Pfad festlegen
|
||||
$tmp_file = download_url($url);
|
||||
|
||||
function bdp_add_menu_contents() {
|
||||
add_menu_page('Seiten',
|
||||
'Inhalte',
|
||||
'edit_posts',
|
||||
'edit.php?post_type=page',
|
||||
'',
|
||||
'dashicons-format-aside',
|
||||
4
|
||||
);
|
||||
// Überprüfen, ob der Download erfolgreich war
|
||||
if (is_wp_error($tmp_file)) {
|
||||
echo 'Download-Fehler: ' . $tmp_file->get_error_message();
|
||||
return;
|
||||
}
|
||||
|
||||
add_submenu_page('edit.php?post_type=page',
|
||||
'media',
|
||||
'Medienverwaltung',
|
||||
'edit_posts',
|
||||
'upload.php'
|
||||
);
|
||||
// Pfad des Plugins
|
||||
$plugin_folder = WP_PLUGIN_DIR;
|
||||
|
||||
add_submenu_page('edit.php?post_type=page',
|
||||
'comments',
|
||||
'Kommentare',
|
||||
'edit_posts',
|
||||
'edit-comments.php'
|
||||
);
|
||||
// Plugin Upgrader Klassen einbinden
|
||||
require_once ABSPATH . 'wp-admin/includes/file.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/misc.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';
|
||||
|
||||
add_submenu_page('edit.php?post_type=page',
|
||||
'Beiträge',
|
||||
'Beiträge',
|
||||
'edit_posts',
|
||||
'edit.php'
|
||||
);
|
||||
// Plugin upgrader initialisieren
|
||||
$upgrader = new Plugin_Upgrader(new WP_Ajax_Upgrader_Skin());
|
||||
|
||||
// Plugin installieren
|
||||
$result = $upgrader->install($tmp_file);
|
||||
|
||||
// Temp Datei löschen
|
||||
unlink($tmp_file);
|
||||
activate_plugin($slug . '/' . $slug . '.php' );
|
||||
|
||||
|
||||
// Überprüfen, ob die Installation erfolgreich war
|
||||
if (is_wp_error($result)) {
|
||||
echo 'Installations-Fehler: ' . $result->get_error_message();
|
||||
} else {
|
||||
echo 'Plugin erfolgreich installiert';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function bdp_add_menu_mein_lv() {
|
||||
$location = BDP_LV_PLUGIN_DIR . '/modules/';
|
||||
$mainSlug = $location . 'index.php';
|
||||
$moduleLoad = get_admin_url() . 'admin.php?page=' . BDP_LV_PLUGIN_SLUG . '/modules/index.php&loadmodule=';
|
||||
|
||||
add_menu_page(
|
||||
'Mein BdP',
|
||||
'BdP',
|
||||
'show_bdp',
|
||||
$mainSlug,
|
||||
'',
|
||||
BDP_LV_PLUGIN_URL . '/icon.png',
|
||||
3
|
||||
);
|
||||
|
||||
add_submenu_page($mainSlug,
|
||||
'Über',
|
||||
'Über',
|
||||
'show_bdp',
|
||||
$moduleLoad . 'about'
|
||||
);
|
||||
}
|
||||
|
||||
function bdp_add_menu_setup() {
|
||||
add_menu_page(
|
||||
'Benutzer',
|
||||
'Benutzer-Verwaltung',
|
||||
'manage_options',
|
||||
'users.php',
|
||||
'',
|
||||
'dashicons-admin-users',
|
||||
6
|
||||
);
|
||||
|
||||
|
||||
add_menu_page(
|
||||
'Allgemeine Einstellungen',
|
||||
'Webseiten-Setup',
|
||||
'manage_options',
|
||||
'options-general.php',
|
||||
'',
|
||||
'dashicons-admin-generic',
|
||||
6
|
||||
);
|
||||
|
||||
add_submenu_page('options-general.php',
|
||||
'Design-Einstellungen',
|
||||
'Template bearbeiten',
|
||||
'manage_options',
|
||||
'customize.php?return=/wp-admin/'
|
||||
);
|
||||
|
||||
add_submenu_page('options-general.php',
|
||||
'plugins',
|
||||
'Erweiterungen',
|
||||
'manage_options',
|
||||
'plugins.php'
|
||||
);
|
||||
|
||||
|
||||
add_submenu_page('options-general.php',
|
||||
'themes',
|
||||
'Designs',
|
||||
'manage_options',
|
||||
'themes.php'
|
||||
);
|
||||
|
||||
|
||||
add_submenu_page('options-general.php',
|
||||
'Sicherheit',
|
||||
'Webseiten-Sicherheit',
|
||||
'manage_options',
|
||||
'site-health.php'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function bdp_cleanup_menu()
|
||||
{
|
||||
global $submenu;
|
||||
|
||||
remove_menu_page('edit-comments.php');
|
||||
remove_menu_page('edit.php');
|
||||
remove_menu_page('edit.php?post_type=page');
|
||||
remove_menu_page('upload.php');
|
||||
remove_menu_page('themes.php');
|
||||
remove_menu_page('plugins.php');
|
||||
remove_menu_page('options-general.php');
|
||||
remove_menu_page('users.php');
|
||||
remove_menu_page('tools.php');
|
||||
|
||||
bdp_add_menu_contents();
|
||||
bdp_add_menu_setup();
|
||||
bdp_add_menu_security();
|
||||
|
||||
|
||||
remove_submenu_page('edit.php?post_type=page','post-new.php?post_type=page');
|
||||
remove_submenu_page('users.php','user-new.php');
|
||||
remove_submenu_page('users.php','profile.php');
|
||||
|
||||
remove_submenu_page('edit.php','post-new.php');
|
||||
remove_submenu_page('edit.php','edit-tags.php?taxonomy=category');
|
||||
remove_submenu_page('edit.php','edit-tags.php?taxonomy=post_tag');
|
||||
}
|
||||
|
||||
function bdp_create_menu_structure()
|
||||
{
|
||||
add_action('admin_menu', 'bdp_cleanup_menu');
|
||||
bdp_add_menu_mein_lv();
|
||||
}
|
||||
|
@ -5,64 +5,38 @@
|
||||
remove_role( 'contributor' ); // Hier 'custom_role_slug' durch den tatsächlichen Slug der zu löschenden Rolle ersetzen
|
||||
remove_role( 'author' ); // Hier 'custom_role_slug' durch den tatsächlichen Slug der zu löschenden Rolle ersetzen
|
||||
remove_role( 'editor' ); // Hier 'custom_role_slug' durch den tatsächlichen Slug der zu löschenden Rolle ersetzen
|
||||
$capabilities = array(
|
||||
'read' => true, // Die Rolle kann Beiträge lesen
|
||||
'edit_posts' => true, // Die Rolle kann Beiträge bearbeiten
|
||||
'delete_posts' => true, // Die Rolle kann Beiträge löschen
|
||||
'publish_posts' => true, // Die Rolle kann Beiträge veröffentlichen
|
||||
// Weitere Berechtigungen können nach Bedarf hinzugefügt werden
|
||||
);
|
||||
|
||||
// Rolle hinzufügen
|
||||
add_role( 'stafue', 'Stammesführung', kompass_get_capa_stafue() );
|
||||
add_role( 'grufue', 'Gruppenführung', kompass_get_capa_grufue() );
|
||||
add_role( 'aktionsleitung', 'Aktionsleitung', kompass_get_capa_aktionsleitung() );
|
||||
$role = get_role( 'director' );
|
||||
if ( null === $role ) {
|
||||
add_role(
|
||||
'director',
|
||||
true === get_option( 'solea_used_for_state', false )
|
||||
? __( 'State director', 'mareike' )
|
||||
: __( 'Club director', 'mareike' ),
|
||||
kompass_get_capa_editor()
|
||||
);
|
||||
} else {
|
||||
$role = get_role( 'director' );
|
||||
foreach ( kompass_get_capa_editor() as $capability => $value ) {
|
||||
$role->add_cap( $capability );
|
||||
}
|
||||
}
|
||||
|
||||
add_role( 'author', 'Redakteur', kompass_get_capa_editor() );
|
||||
|
||||
$role = get_role( 'administrator' );
|
||||
foreach (kompass_get_capa_stafue() as $capability => $value) {
|
||||
$role->add_cap( $capability );
|
||||
$role = get_role( 'user' );
|
||||
if ( null === $role ) {
|
||||
add_role(
|
||||
'user',
|
||||
'Standardnutzer',
|
||||
array('read' => true)
|
||||
);
|
||||
} else {
|
||||
$role->add_cap( 'read' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function kompass_get_capa_stafue() : array
|
||||
{
|
||||
return array_merge(
|
||||
[
|
||||
'create_groups' => true,
|
||||
'delete_groups' => true,
|
||||
'edit_groups' => true,
|
||||
'delete_teilis' => true,
|
||||
'move_teilis' => true,
|
||||
'create_events' => true,
|
||||
], kompass_get_capa_aktionsleitung(), kompass_get_capa_grufue(), kompass_get_capa_editor());
|
||||
}
|
||||
|
||||
|
||||
|
||||
function kompass_get_capa_aktionsleitung() : array
|
||||
{
|
||||
return [
|
||||
'show_bdp' => true,
|
||||
'create_event_teilis' => true,
|
||||
'edit_event_teilis' => true,
|
||||
'delete_event_teilis' => true,
|
||||
'send_event_mails' => true,
|
||||
];
|
||||
}
|
||||
|
||||
function kompass_get_capa_grufue() : array
|
||||
{
|
||||
return [
|
||||
'show_bdp' => true,
|
||||
'show_groups' => true,
|
||||
'create_teilis' => true,
|
||||
'edit_teilis' => true,
|
||||
'send_mails' => true
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
function kompass_get_capa_editor() : array
|
||||
{
|
||||
return [
|
||||
|
@ -44,9 +44,6 @@ function kompass_admin_init()
|
||||
kompass_settings_validators();
|
||||
}
|
||||
|
||||
bdp_create_menu_structure();
|
||||
|
||||
|
||||
function bdp_kompass_load_plugin_textdomain() {
|
||||
load_textdomain( BDP_LV_PLUGIN_SLUG, BDP_LV_PLUGIN_DIR . '/lang/' . BDP_LV_PLUGIN_SLUG . '-' . get_locale() . '.mo' );
|
||||
}
|
||||
@ -55,7 +52,7 @@ function bdp_kompass_load_plugin_textdomain() {
|
||||
function kompass_after_setup_theme()
|
||||
{
|
||||
setup_site_roles();
|
||||
#register_custom_theme_directory();
|
||||
register_custom_theme_directory();
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
class BdpVersionChecker
|
||||
{
|
||||
public $plugin_slug;
|
||||
|
BIN
lib/mareike-theme/assets/logo.png
Normal file
BIN
lib/mareike-theme/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 132 KiB |
7
lib/mareike-theme/footer.php
Normal file
7
lib/mareike-theme/footer.php
Normal file
@ -0,0 +1,7 @@
|
||||
<footer class="footer">
|
||||
<p>© <?php echo date('Y'); ?> mareike powered by BdP Bund der Pfadfinderinnen und Pfadfinderrt - LV Sachsen e.V </p>
|
||||
</footer>
|
||||
</div><!-- .container -->
|
||||
<?php wp_footer(); ?>
|
||||
</body>
|
||||
</html>
|
58
lib/mareike-theme/functions.php
Normal file
58
lib/mareike-theme/functions.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
function custom_theme_setup() {
|
||||
// Unterstützung für Menüs hinzufügen
|
||||
add_theme_support('menus');
|
||||
|
||||
// Menüpositionen registrieren
|
||||
register_nav_menus(array(
|
||||
'primary' => __('Primary Menu')
|
||||
));
|
||||
}
|
||||
add_action('after_setup_theme', 'custom_theme_setup');
|
||||
|
||||
// Theme Customizer anpassen
|
||||
function custom_customize_register($wp_customize) {
|
||||
$wp_customize->add_section('custom_nav_settings', array(
|
||||
'title' => __('Navigation Settings', 'custom-nav-theme'),
|
||||
'priority' => 30,
|
||||
));
|
||||
|
||||
$wp_customize->add_setting('custom_nav_pages', array(
|
||||
'default' => '',
|
||||
'sanitize_callback' => 'absint',
|
||||
));
|
||||
|
||||
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'custom_nav_pages', array(
|
||||
'label' => __('Select Pages for Navigation', 'custom-nav-theme'),
|
||||
'section' => 'custom_nav_settings',
|
||||
'settings' => 'custom_nav_pages',
|
||||
'type' => 'dropdown-pages',
|
||||
'multiple' => true,
|
||||
)));
|
||||
}
|
||||
|
||||
add_action( 'admin_enqueue_scripts', 'mareike_theme_setup' );
|
||||
add_action('customize_register', 'custom_customize_register');
|
||||
add_action('wp_enqueue_scripts', 'mein_child_theme_enqueue_styles');
|
||||
|
||||
function mein_child_theme_enqueue_styles() {
|
||||
wp_enqueue_style('registerform', get_template_directory_uri() . '/style.css');
|
||||
}
|
||||
|
||||
|
||||
|
||||
function mareike_theme_setup() {
|
||||
wp_enqueue_style( 'custom-dashboard-styles', get_template_directory_uri() . '/mareike.css' );
|
||||
}
|
||||
|
||||
|
||||
function custom_registration_form() {
|
||||
wp_enqueue_style('registerform', get_template_directory_uri() . '/style.css');
|
||||
}
|
||||
|
||||
function login_style() {
|
||||
wp_enqueue_style('registerform', get_template_directory_uri() . '/style.css');
|
||||
}
|
||||
|
||||
add_action('register_form', 'custom_registration_form');
|
||||
add_action('login_enqueue_scripts', 'login_style');
|
48
lib/mareike-theme/header.php
Normal file
48
lib/mareike-theme/header.php
Normal file
@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php wp_title(); ?></title>
|
||||
<?php wp_head(); ?>
|
||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>">
|
||||
</head>
|
||||
<body <?php body_class(); ?>>
|
||||
|
||||
<div class="container" <?php if(!is_user_logged_in()) echo 'style="position: relative; top: 30px !important;"'; ?>>
|
||||
<header class="header">
|
||||
<div>
|
||||
<img style="width:250px; height: 150px;" src="<?= get_template_directory_uri(); ?>/assets/logo.png" />
|
||||
</div>
|
||||
<div style="position: relative; top: 10px; width: 305px;">
|
||||
<?php
|
||||
if (is_user_logged_in()) {
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url(admin_url('users.php?page=mareike-profile')); ?>" style="position: relative;" class="theme_mareike_mainpage_button">Profil</a>
|
||||
<a href="<?php echo get_site_url() . '/wp-login.php?action=logout'; ?>" style="position: relative;" class="button theme_mareike_mainpage_button">Abmelden</a>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a href="<?php echo get_site_url() . '/wp-login.php?action=register'; ?>" style="position: relative;" class="button theme_mareike_mainpage_button">Registrieren</a>
|
||||
<a href="<?php echo get_site_url() . '/wp-login.php'; ?>" style="position: relative;" class="button theme_mareike_mainpage_button">Anmelden</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</header>
|
||||
<div class="flex-container">
|
||||
<nav class="navbar">
|
||||
<div class="navcontainer">
|
||||
<?php
|
||||
wp_nav_menu(array(
|
||||
'theme_location' => 'primary',
|
||||
'container' => false,
|
||||
'menu_class' => 'navbar-nav'
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
21
lib/mareike-theme/index.php
Normal file
21
lib/mareike-theme/index.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php get_header(); ?>
|
||||
|
||||
<main>
|
||||
<div class="content">
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<article <?php post_class(); ?>>
|
||||
<h2><?php the_title(); ?></h2>
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
<?php else : ?>
|
||||
<p>Es gibt keine Inhalte.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php get_footer(); ?>
|
BIN
lib/mareike-theme/screenshot.png
Normal file
BIN
lib/mareike-theme/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
255
lib/mareike-theme/style.css
Normal file
255
lib/mareike-theme/style.css
Normal file
@ -0,0 +1,255 @@
|
||||
/*
|
||||
Theme Name: mareike
|
||||
Theme URI: https://repos.contelli.de/mareike-theme/
|
||||
Author: Max Mustermann
|
||||
Author URI: https://contelli.de
|
||||
Description: Ein einfaches WordPress-Theme für den Einstieg.
|
||||
Version: 1.0
|
||||
Text Domain: mareike-theme
|
||||
*/
|
||||
|
||||
/* Hier kannst du deine Styles hinzufügen */
|
||||
body {
|
||||
font-family: Figtree, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
|
||||
background-color: #edf2f7;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
top: -40px;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
background-color: #e5e7eb;
|
||||
--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
|
||||
--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);
|
||||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
display: flex;
|
||||
min-height: 250px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
h2 {
|
||||
position: absolute;
|
||||
top: 140px;
|
||||
background-color: #ffffff;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: #e5e7eb;
|
||||
border-radius: 10px;
|
||||
padding: 0 60px 5px 20px;
|
||||
border-left-width: 40px;
|
||||
font-size: 12pt;
|
||||
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: rgb(255, 203, 4);
|
||||
color: #fff;
|
||||
height: 150px;
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background-color: #e5e7eb !important;
|
||||
width: 25rem;
|
||||
min-height: 100% !important;
|
||||
height: 100% !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.navcontainer {
|
||||
min-height: 100% !important;
|
||||
height: 100% !important;
|
||||
background-color: #ffffff;
|
||||
margin: 0 !important;
|
||||
|
||||
}
|
||||
|
||||
.navcontainer ul {
|
||||
margin: 0px;
|
||||
margin-left: -40px;
|
||||
|
||||
}
|
||||
|
||||
.navcontainer li {
|
||||
border-bottom-color: #e5e7eb;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
padding: 10px 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.navcontainer li:hover {
|
||||
background-color: #29c2f8;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.navcontainer li a {
|
||||
text-decoration: none;
|
||||
color: #374151;
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.navcontainer li:hover a {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
main {
|
||||
background-color: #ffffff !important;
|
||||
width: 100%;
|
||||
padding-bottom: 650px;
|
||||
padding-right: 20px;
|
||||
padding-top: 50px;
|
||||
color: rgb(107, 114, 128);
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
background-color: #e5e7eb;
|
||||
color: #fff;
|
||||
padding: 1px !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#wpadminbar {
|
||||
display: none !important;
|
||||
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
button {
|
||||
background-color: #ffffff;
|
||||
padding: 7px;
|
||||
border-color: #e5e7eb;
|
||||
border-radius: 5px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
button,
|
||||
input[type="submit"]{
|
||||
cursor: pointer;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
background-color: #ffffff;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
button:hover,
|
||||
input[type="submit"]:hover {
|
||||
background-color: #0d66c2;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
select {
|
||||
padding: 7px;
|
||||
border-color: #e5e7eb;
|
||||
border-radius: 5px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.theme_mareike_mainpage_button {
|
||||
background-color:#F3F4F6;
|
||||
padding: 5px 30px;
|
||||
border-radius: 10px;
|
||||
border-style: solid;
|
||||
border-width: 0px;
|
||||
width: 150px;
|
||||
font-size: 12pt;
|
||||
text-decoration: none;
|
||||
color: #000000;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
.navbar {
|
||||
width: 20rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
position: absolute;
|
||||
top: 140px;
|
||||
background-color: #ffffff;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: #e5e7eb;
|
||||
border-radius: 10px;
|
||||
padding: 0 40px 5px 20px;
|
||||
border-left-width: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Styling für das Registrierungsformular */
|
||||
.register {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background: #000000;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.message {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#registerform {
|
||||
position: relative;
|
||||
width: 768px;
|
||||
left: -200px !important;
|
||||
}
|
||||
|
||||
.login h1 {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#login #nav,
|
||||
#backtoblog,
|
||||
.language-switcher
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.register input[type="text"],
|
||||
.register input[type="password"],
|
||||
.register input[type="email"] {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.register input[type="submit"] {
|
||||
background: #0073aa;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.register input[type="submit"]:hover {
|
||||
background: #005177;
|
||||
}
|
@ -3,8 +3,73 @@
|
||||
namespace Bdp\Modules\KompassSettings\Controllers;
|
||||
|
||||
|
||||
use Bdp\Libs\WpConfigEditor;
|
||||
|
||||
class SettingsPage
|
||||
{
|
||||
public static function add_menu() {
|
||||
if (
|
||||
null !== get_option('bdp_calendar_source_url', null ) ||
|
||||
!file_exists(dirname(BDP_LV_STARTUP_FILE ) . '/../kronos/kronos.php')
|
||||
)
|
||||
{
|
||||
add_menu_page(
|
||||
'Kalender Installation',
|
||||
'Kalender Installation',
|
||||
'manage_options',
|
||||
'kompass-calendar',
|
||||
['Bdp\Modules\PluginInstaller\Controllers\InstallSingleplugin', 'install_calendar'],
|
||||
'dashicons-calendar-alt',
|
||||
2
|
||||
);
|
||||
|
||||
if ( file_exists(dirname(BDP_LV_STARTUP_FILE ) . '/../kronos/kronos.php') ) {
|
||||
add_action( 'admin_notices', array( 'Bdp\Modules\PluginInstaller\Controllers\OutdatedModule', 'calender' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
!file_exists(dirname(BDP_LV_STARTUP_FILE ) . '/../solea/solea.php')
|
||||
)
|
||||
{
|
||||
add_menu_page(
|
||||
'Installiere solea (Veranstaltungen)',
|
||||
'Installiere solea (Veranstaltungen)',
|
||||
'manage_options',
|
||||
'kompass-events',
|
||||
['Bdp\Modules\PluginInstaller\Controllers\InstallSingleplugin', 'install_events'],
|
||||
'dashicons-tickets-alt',
|
||||
2
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_submenu_page('options-general.php',
|
||||
'kompass Einstellungen',
|
||||
'kompass Einstellungen',
|
||||
'manage_options',
|
||||
'kompass-settings',
|
||||
['Bdp\Modules\KompassSettings\Controllers\SettingsPage', 'kompass_settings_page_new']
|
||||
);
|
||||
|
||||
|
||||
add_submenu_page('options-general.php',
|
||||
'Mail',
|
||||
'Mail',
|
||||
'manage_options',
|
||||
'kompass-mail-settings',
|
||||
['Bdp\Modules\Mail\Controllers\MailSettingsController', 'settings_form']
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
public function __construct()
|
||||
{
|
||||
add_options_page(
|
||||
@ -16,19 +81,42 @@ class SettingsPage
|
||||
}
|
||||
|
||||
|
||||
public static function kompass_settings_page_new() {
|
||||
if (isset($_POST['save'])) {
|
||||
|
||||
update_option('paged_used_for_state', false);
|
||||
update_option('user_can_register', false);
|
||||
update_option('use_mareike_theme', false);
|
||||
|
||||
if (isset($_POST['used_for_state'])) { update_option('paged_used_for_state', true); }
|
||||
if (isset($_POST['self_register'])) { update_option('user_can_register', true); }
|
||||
if (isset($_POST['use_mareike_theme'])) { update_option('use_mareike_theme', true); }
|
||||
if (isset($_POST['external_cronjobs'])) {
|
||||
WpConfigEditor::updateConfig('DISABLE_WP_CRON', true);
|
||||
} else {
|
||||
WpConfigEditor::deleteConfigKey('DISABLE_WP_CRON');
|
||||
}
|
||||
|
||||
kompass_print_message_box('Die Einstellungen wurden gespeichert.');
|
||||
}
|
||||
|
||||
require BDP_LV_PLUGIN_DIR . '/settings/views/settings.php';
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function option_page() {
|
||||
bdp_kompass_load_plugin_textdomain();
|
||||
$showMessage = null;
|
||||
$tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'tab1';
|
||||
if (isset($_REQUEST['update_options']) && $_REQUEST['update_options'] == true) {
|
||||
switch ($tab) {
|
||||
case 'tab1':
|
||||
update_option('bdp_calendar_categories', json_encode($_POST['category']));
|
||||
update_option('bdp_calendar_source_url', $_POST['bdp_calendar_source_url']);
|
||||
$showMessage = __('The settings were saved.', BDP_LV_PLUGIN_SLUG);
|
||||
break;
|
||||
|
||||
case 'tab2':
|
||||
kompass_print_message_box('Diese Funktion wird nicht mdehr unterstützt.', 'error');
|
||||
break;
|
||||
|
||||
case 'tab3':
|
||||
update_option('kompass_seo_google_verification', $_POST['kompass_seo_google_verification']);
|
||||
update_option('kompass_seo_bing_verification', $_POST['kompass_seo_bing_verification']);
|
||||
$showMessage = __('The settings were saved.', BDP_LV_PLUGIN_SLUG);
|
||||
@ -55,19 +143,19 @@ class SettingsPage
|
||||
<div class="tab-content">
|
||||
<?php
|
||||
switch ($tab) {
|
||||
case 'tab1':
|
||||
echo '<form action="admin.php?page=bdp-kompass-Kompass-settings&tab=tab1" method="post">';
|
||||
case 'tab2':
|
||||
echo '<form action="admin.php?page=bdp-kompass-Kompass-settings&tab=tab2" method="post">';
|
||||
do_settings_sections(BDP_LV_PLUGIN_SLUG . '-calendar-settings');
|
||||
require_once BDP_LV_PLUGIN_DIR . '/modules/calendar/Views/categories-partial.php';
|
||||
echo '<input type="hidden" name="tab" value="tab1" />';
|
||||
echo '<input type="hidden" name="tab" value="tab2" />';
|
||||
submit_button();
|
||||
echo '</form>';
|
||||
break;
|
||||
case 'tab2':
|
||||
case 'tab3':
|
||||
echo '<form action="admin.php?page=bdp-kompass-Kompass-settings" method="post">';
|
||||
do_settings_sections(BDP_LV_PLUGIN_SLUG . '-seo-settings');
|
||||
submit_button();
|
||||
echo '<input type="hidden" name="tab" value="tab2" />';
|
||||
echo '<input type="hidden" name="tab" value="tab3" />';
|
||||
echo '</form>';
|
||||
break;
|
||||
}
|
||||
|
@ -3,10 +3,15 @@
|
||||
{
|
||||
$baseUrl = 'admin.php?page=bdp-kompass-Kompass-settings&tab=';
|
||||
return '<h2 class="nav-tab-wrapper">'.
|
||||
'<a href="' . $baseUrl . 'tab1" class="nav-tab ' . ($activeTab == 'tab1' ? 'nav-tab-active' : '') . '">' .
|
||||
'<a href="' . $baseUrl . 'tab1" class="nav-tab ' . ($activeTab == 'tab1' ? 'nav-tab-active' : '') . '">' .
|
||||
__('Kompass Settings', BDP_LV_PLUGIN_SLUG) .
|
||||
'</a>'.
|
||||
|
||||
|
||||
'<a href="' . $baseUrl . 'tab2" class="nav-tab ' . ($activeTab == 'tab2' ? 'nav-tab-active' : '') . '">' .
|
||||
__('Calendar Settings', BDP_LV_PLUGIN_SLUG) .
|
||||
'</a>'.
|
||||
'<a href="' . $baseUrl . 'tab2" class="nav-tab ' . ($activeTab == 'tab2' ? 'nav-tab-active' : '') .'">' .
|
||||
'<a href="' . $baseUrl . 'tab3" class="nav-tab ' . ($activeTab == 'tab3' ? 'nav-tab-active' : '') .'">' .
|
||||
__('SEO', BDP_LV_PLUGIN_SLUG) .
|
||||
'</a>'.
|
||||
'</h2>';
|
||||
|
@ -18,16 +18,6 @@ class MailController
|
||||
'dashicons-email',
|
||||
4
|
||||
);
|
||||
|
||||
/*$mailCompose = new MailCompose();
|
||||
add_submenu_page(
|
||||
'kompass-mail',
|
||||
__('Templates', BDP_LV_PLUGIN_SLUG),
|
||||
__('Templates', BDP_LV_PLUGIN_SLUG),
|
||||
'send_mails',
|
||||
'kompass-mail-compose',
|
||||
[$mailCompose, '__construct'],
|
||||
1);*/
|
||||
}
|
||||
|
||||
public function router()
|
||||
|
71
modules/Mail/Controllers/class-mailsettingscontroller.php
Normal file
71
modules/Mail/Controllers/class-mailsettingscontroller.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* File: class-mailsettingscontroller.php
|
||||
*
|
||||
*
|
||||
* @since 2024-07-31
|
||||
* @license GPL-3.0-or-later
|
||||
*
|
||||
* @package mareike/
|
||||
*/
|
||||
|
||||
namespace Bdp\Modules\Mail\Controllers;
|
||||
|
||||
class MailSettingsController {
|
||||
public static function set_smtp_if_required() {
|
||||
|
||||
|
||||
$smtp_host = get_option('kompass_smtp_host', null); // SMTP-Host
|
||||
$smtp_port = get_option('kompass_smtp_port', null); // SMTP-Port
|
||||
$smtp_username = get_option('kompass_smtp_user', null); // SMTP-Benutzername
|
||||
$smtp_password = get_option('kompass_smtp_pass', null); // SMTP-Passwort
|
||||
$smtp_secure = 'tls'; // Verschlüsselung (tls oder ssl)
|
||||
|
||||
|
||||
if (false !== (bool)get_option('kompass_use_smtp', false) &&
|
||||
null !== $smtp_host &&
|
||||
null !== $smtp_port &&
|
||||
null !== $smtp_username &&
|
||||
null !== $smtp_password) {
|
||||
|
||||
add_action( 'phpmailer_init', function ( $phpmailer ) use ( $smtp_host, $smtp_port, $smtp_username, $smtp_password, $smtp_secure ) {
|
||||
$phpmailer->isSMTP();
|
||||
$phpmailer->Host = $smtp_host;
|
||||
$phpmailer->Port = $smtp_port;
|
||||
$phpmailer->SMTPAuth = true;
|
||||
$phpmailer->Username = $smtp_username;
|
||||
$phpmailer->Password = $smtp_password;
|
||||
|
||||
$sender = get_option('kompass_smtp_sender', null);
|
||||
$sender_name = get_option('kompass_smtp_sender-name', null);
|
||||
|
||||
if (null !== $sender && null !== $sender_name)
|
||||
$phpmailer->setFrom( $sender, $sender_name );
|
||||
#$phpmailer->SMTPSecure = $smtp_secure;
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function settings_form() {
|
||||
if (isset($_POST['save'])) {
|
||||
update_option('kompass_use_smtp', false);
|
||||
|
||||
if (isset($_POST['use_smtp'])) update_option('kompass_use_smtp', true);
|
||||
update_option('kompass_smtp_host', sanitize_text_field(wp_unslash($_POST['smtp-host'])));
|
||||
update_option('kompass_smtp_port', sanitize_text_field(wp_unslash($_POST['smtp-port'])));
|
||||
update_option('kompass_smtp_user', sanitize_text_field(wp_unslash($_POST['smtp-user'])));
|
||||
update_option('kompass_smtp_pass', sanitize_text_field(wp_unslash($_POST['smtp-pass'])));
|
||||
update_option('kompass_smtp_sender', sanitize_text_field(wp_unslash($_POST['smtp-sender'])));
|
||||
update_option('kompass_smtp_sender-name', sanitize_text_field(wp_unslash($_POST['smtp-sender-name'])));
|
||||
|
||||
kompass_print_message_box('Die Einstellungen wurden gespeichert.');
|
||||
}
|
||||
|
||||
|
||||
require BDP_LV_PLUGIN_DIR . '/settings/views/mail-settings.php';
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* File: class-extendregistrationform.php
|
||||
*
|
||||
*
|
||||
* @since 2024-07-30
|
||||
* @license GPL-3.0-or-later
|
||||
*
|
||||
* @package mareike/
|
||||
*/
|
||||
|
||||
namespace Bdp\Modules\Registration\Controllers;
|
||||
|
||||
class ExtendRegistrationForm {
|
||||
public static function execute() {
|
||||
?>
|
||||
<p>
|
||||
<label for="first_name">Vorname<br />
|
||||
<input required style="width: 768px !important;" type="text" name="first_name" id="first_name" class="input" value="<?php echo esc_attr(wp_unslash($_POST['first_name'] ?? '')); ?>" size="25" /></label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="last_name">Nachname<br />
|
||||
<input required style="width: 768px !important;" type="text" name="last_name" id="last_name" class="input" value="<?php echo esc_attr(wp_unslash($_POST['last_name'] ?? '')); ?>" size="25" /></label>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
public static function error_messages($errors, $sanitized_user_login, $user_email) {
|
||||
if (empty($_POST['first_name']) || !empty($_POST['first_name']) && trim($_POST['first_name']) == '') {
|
||||
$errors->add('first_name_error', '<strong>FEHLER</strong>: Der Vorname ist erforderlich.');
|
||||
}
|
||||
if (empty($_POST['last_name']) || !empty($_POST['last_name']) && trim($_POST['last_name']) == '') {
|
||||
$errors->add('last_name_error', '<strong>FEHLER</strong>: DEr Nachname ist erforderlich.');
|
||||
}
|
||||
return $errors;
|
||||
|
||||
|
||||
}
|
||||
}
|
94
modules/Registration/Controllers/class-saveregistration.php
Normal file
94
modules/Registration/Controllers/class-saveregistration.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* File: class-saveregistration.php
|
||||
*
|
||||
*
|
||||
* @since 2024-07-30
|
||||
* @license GPL-3.0-or-later
|
||||
*
|
||||
* @package mareike/
|
||||
*/
|
||||
|
||||
namespace Bdp\Modules\Registration\Controllers;
|
||||
|
||||
use WP_User;
|
||||
|
||||
class SaveRegistration {
|
||||
public static function execute($user_id) {
|
||||
if (!empty($_POST['first_name'])) {
|
||||
update_user_meta($user_id, 'first_name', sanitize_text_field($_POST['first_name']));
|
||||
}
|
||||
if (!empty($_POST['last_name'])) {
|
||||
update_user_meta($user_id, 'last_name', sanitize_text_field($_POST['last_name']));
|
||||
}
|
||||
|
||||
// Assign the 'Standarduser' role to the new user
|
||||
$user = new WP_User($user_id);
|
||||
$user->set_role('user');
|
||||
|
||||
// Send confirmation email
|
||||
$user = get_userdata($user_id);
|
||||
$code = sha1($user->user_registered);
|
||||
update_user_meta($user_id, 'activation_code', $code);
|
||||
|
||||
$activation_link = add_query_arg(array('key' => $code, 'user' => $user_id), get_site_url() . '/wp-login.php');
|
||||
|
||||
wp_mail($user->user_email, 'Bitte bestätige deine Anmeldung', 'Hallo, bitte bestätige deine Anmeldung über den folgenden Link: ' . $activation_link);
|
||||
|
||||
// Notify admin
|
||||
wp_mail(get_option('admin_email'), 'New User Registration', 'A new user has registered: ' . PHP_EOL .
|
||||
'Username: ' . $user->user_login . PHP_EOL .
|
||||
'First name: ' . $user->first_name . PHP_EOL .
|
||||
'Last name: ' . $user->last_name . PHP_EOL .
|
||||
'E-Mail: ' . $user->user_email);
|
||||
}
|
||||
|
||||
public static function activate_user() {
|
||||
if (isset($_GET['key']) && isset($_GET['user'])) {
|
||||
$user_id = intval($_GET['user']);
|
||||
$activation_code = get_user_meta($user_id, 'activation_code', true);
|
||||
|
||||
if ($activation_code === $_GET['key']) {
|
||||
delete_user_meta($user_id, 'activation_code');
|
||||
wp_redirect(home_url('/wp-login.php?checkemail=registered'));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function check_user_activation($user, $username, $password) {
|
||||
if (!is_a($user, 'WP_User')) {
|
||||
return null;
|
||||
}
|
||||
$user_id = $user->ID;
|
||||
$activation_code = get_user_meta($user_id, 'activation_code', true);
|
||||
|
||||
if ($activation_code) {
|
||||
return new WP_Error('not_activated', __('ERROR: You need to activate your account. Please check your email.', 'kompass'));
|
||||
}
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
public static function display_custom_message() {
|
||||
if (isset($_GET['checkemail']) && $_GET['checkemail'] === 'registered') {
|
||||
echo '<div class="custom-message" style="text-align:center; margin:20px auto; padding:10px; background-color:#e0f7fa; border:1px solid #00796b; border-radius:5px; max-width:600px;">
|
||||
<p style="font-size:16px; color:#00796b;">Vielen Dank für deine Registrierung. Bitte überprüfen deine E-Mails, um deine Registrierung zu bestätigen.</p>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ((isset($_GET['action']) && $_GET['action'] === 'laostpassword') ||
|
||||
isset($_GET['checkemail']) && $_GET['checkemail'] === 'confirm'
|
||||
){
|
||||
echo '<div class="custom-message" style="text-align:center; margin:20px auto; padding:10px; background-color:#e0f7fa; border:1px solid #00796b; border-radius:5px; max-width:600px;">
|
||||
<p style="font-size:16px; color:#00796b;">Insofern der Account existiert, hast du soeben weitere Anweisungen per E-Mail erhalten.</p>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if (isset($_GET['action']) && $_GET['action'] === 'resetpass') {
|
||||
echo '<div class="custom-message" style="text-align:center; margin:20px auto; padding:10px; background-color:#e0f7fa; border:1px solid #00796b; border-radius:5px; max-width:600px;">
|
||||
<p style="font-size:16px; color:#00796b;">Dein Passwort wurde erfolgreich geändert.</p>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
/*******************************Calendar Top Navigation*********************************/
|
||||
div#calendar{
|
||||
margin:0px auto;
|
||||
padding:0px;
|
||||
@ -54,9 +53,6 @@ div#calendar div.header a.next{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************Calendar Content Cells*********************************/
|
||||
div#calendar div.box-content{
|
||||
border-top:none;
|
||||
width: 100%;
|
||||
|
@ -1,6 +1,4 @@
|
||||
<?php
|
||||
add_filter('the_content', ['Calendar', 'printCalendar']);
|
||||
wp_enqueue_style('bdp_calendar_css', BDP_LV_PLUGIN_URL . '/modules/calendar/assets/calendar.css');
|
||||
wp_enqueue_script( 'loadCalendar', BDP_LV_PLUGIN_URL . '/modules/calendar/assets/ajaxscript.js');
|
||||
|
||||
require_once dirname(__FILE__) . '/classes/Calendar.class.php';
|
||||
|
@ -5,29 +5,13 @@ class Calendar
|
||||
public $ical;
|
||||
private $categories = [];
|
||||
|
||||
public static function setup()
|
||||
{
|
||||
$pageName = 'Kalender';
|
||||
$page_exists = get_page_by_path($pageName, OBJECT, 'page');
|
||||
|
||||
// Wenn die Seite nicht existiert, erstelle sie
|
||||
if (!$page_exists) {
|
||||
$page_id = wp_insert_post(array(
|
||||
'post_title' => $pageName,
|
||||
'post_content' => '{{calendar}}',
|
||||
'post_status' => 'publish',
|
||||
'post_type' => 'page',
|
||||
));
|
||||
|
||||
update_option('bdp_calendar_source_url', 'https://wiki.sachsen.pfadfinden.de/rest/calendar-services/1.0/calendar/export/subcalendar/private/ff69f5a689391ac0d7f78a70189cfde7c48cb923.ics');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function printCalendar($content) : string {
|
||||
// Der zu ersetzende String
|
||||
$original_string = '{{calendar}}';
|
||||
if (str_contains($content,$original_string)) {
|
||||
wp_enqueue_style('bdp_calendar_css', BDP_LV_PLUGIN_URL . '/modules/calendar/assets/calendar.css');
|
||||
wp_enqueue_script( 'loadCalendar', BDP_LV_PLUGIN_URL . '/modules/calendar/assets/ajaxscript.js');
|
||||
|
||||
$calendar = new Calendar();
|
||||
|
||||
// Der Ersatzstring
|
||||
@ -64,8 +48,10 @@ class Calendar
|
||||
}
|
||||
|
||||
|
||||
$calendarUrl = get_option('bdp_calendar_source_url', 'https://wiki.sachsen.pfadfinden.de/rest/calendar-services/1.0/calendar/export/subcalendar/private/ff69f5a689391ac0d7f78a70189cfde7c48cb923.ics');
|
||||
|
||||
$calendarUrl = get_option('bdp_calendar_source_url', null);
|
||||
if (null === '') {
|
||||
return;
|
||||
}
|
||||
$this->ical = new \ICal('', array(
|
||||
'defaultSpan' => 2, // Default value
|
||||
'defaultTimeZone' => '',
|
||||
|
@ -40,38 +40,51 @@ class MainController
|
||||
}
|
||||
public function __construct()
|
||||
{
|
||||
global $dbHandler;
|
||||
global $dbHandler, $wpdb;
|
||||
|
||||
add_menu_page(
|
||||
__('Events', BDP_LV_PLUGIN_SLUG),
|
||||
__('Events', BDP_LV_PLUGIN_SLUG),
|
||||
'send_mails',
|
||||
'kompass-events',
|
||||
[$this, 'router'],
|
||||
'dashicons-tickets-alt',
|
||||
3
|
||||
);
|
||||
$no_events = true;
|
||||
|
||||
foreach ($dbHandler->readFromDb( self::KOMPASS_EVENTS_EVENTS, ['archived' => false]) as $currentEvent) {
|
||||
add_submenu_page(
|
||||
'kompass-events',
|
||||
$currentEvent->event_name,
|
||||
$currentEvent->event_name,
|
||||
'show_groups',
|
||||
'kompass-events&action=show-event&event-id=' . $currentEvent->id,
|
||||
[ $this, 'router' ]);
|
||||
}
|
||||
foreach ( [ self::KOMPASS_EVENTS_EVENTS ] as $table ) {
|
||||
$sqlTable = $wpdb->prefix . $table;
|
||||
$sql = "SHOW TABLES LIKE '$sqlTable'";
|
||||
|
||||
add_submenu_page(
|
||||
'kompass-events',
|
||||
__('New Event', BDP_LV_PLUGIN_SLUG),
|
||||
__('New Event', BDP_LV_PLUGIN_SLUG),
|
||||
'show_groups',
|
||||
'kompass-events&action=new-event',
|
||||
[ $this, 'router' ]);
|
||||
$result = $wpdb->get_var( $sql );
|
||||
if ( $result == $sqlTable ) {
|
||||
|
||||
$no_events = 0 === $dbHandler->countSqlRows( self::KOMPASS_EVENTS_EVENTS, [ 'archived' => false ] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !$no_events ) {
|
||||
|
||||
|
||||
|
||||
add_menu_page(
|
||||
__( 'Events (legacy)', BDP_LV_PLUGIN_SLUG ),
|
||||
__( 'Events (legacy)', BDP_LV_PLUGIN_SLUG ),
|
||||
'send_mails',
|
||||
'kompass-events',
|
||||
[ $this, 'router' ],
|
||||
'dashicons-tickets-alt',
|
||||
3
|
||||
);
|
||||
|
||||
foreach ( $dbHandler->readFromDb( self::KOMPASS_EVENTS_EVENTS, [ 'archived' => false ] ) as $currentEvent ) {
|
||||
add_submenu_page(
|
||||
'kompass-events',
|
||||
$currentEvent->event_name,
|
||||
$currentEvent->event_name,
|
||||
'show_groups',
|
||||
'kompass-events&action=show-event&event-id=' . $currentEvent->id,
|
||||
[ $this, 'router' ] );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function router()
|
||||
{
|
||||
if (isset($_REQUEST['action'])) {
|
||||
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* File: class-installsingleplugin.php
|
||||
*
|
||||
*
|
||||
* @since 2024-08-12
|
||||
* @license GPL-3.0-or-later
|
||||
*
|
||||
* @package
|
||||
*/
|
||||
|
||||
namespace Bdp\Modules\PluginInstaller\Controllers;
|
||||
|
||||
use Plugin_Upgrader;
|
||||
use WP_Ajax_Upgrader_Skin;
|
||||
|
||||
class InstallSingleplugin
|
||||
{
|
||||
public static function install_calendar ()
|
||||
{
|
||||
if ( isset( $_REQUEST[ 'install' ] ) ) {
|
||||
if ( !file_exists( dirname( BDP_LV_STARTUP_FILE ) . '/../kronos/kronos.php' ) ) {
|
||||
$pageName = 'Kalender';
|
||||
$page_exists = get_page_by_path( $pageName, OBJECT, 'page' );
|
||||
if ( is_object( $page_exists ) ) {
|
||||
wp_delete_post( $page_exists->ID, false );
|
||||
}
|
||||
$calendar_connection = get_option( 'bdp_calendar_source_url',
|
||||
'https://wiki.sachsen.pfadfinden.de/rest/calendar-services/1.0/calendar/export/subcalendar/private/ff69f5a689391ac0d7f78a70189cfde7c48cb923.ics' );
|
||||
if ( 'https://wiki.sachsen.pfadfinden.de/rest/calendar-services/1.0/calendar/export/subcalendar/private/ff69f5a689391ac0d7f78a70189cfde7c48cb923.ics' !== $calendar_connection ) {
|
||||
update_option( 'kronos_calendar_url', $calendar_connection );
|
||||
}
|
||||
delete_option( 'bdp_calendar_source_url' );
|
||||
|
||||
|
||||
kompass_install_plugin( 'https://repos.contelli.de/plugins/kronos/download', 'kronos' );
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
$install_link = admin_url( 'admin.php?page=kompass-calendar&install=true' );
|
||||
require dirname( __FILE__ ) . '/../views/install-item.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function install_events ()
|
||||
{
|
||||
if ( isset( $_REQUEST[ 'install' ] ) ) {
|
||||
if ( !file_exists( dirname( BDP_LV_STARTUP_FILE ) . '/../solea/solea.php' ) ) {
|
||||
kompass_install_plugin( 'https://repos.contelli.de/plugins/solea/download', 'solea' );
|
||||
}
|
||||
} else {
|
||||
$install_link = admin_url( 'admin.php?page=kompass-events&install=true' );
|
||||
require dirname( __FILE__ ) . '/../views/install-item.php';
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* File: class-outdatedmodule.php
|
||||
*
|
||||
*
|
||||
* @since 2024-08-12
|
||||
* @license GPL-3.0-or-later
|
||||
*
|
||||
* @package
|
||||
*/
|
||||
|
||||
namespace Bdp\Modules\PluginInstaller\Controllers;
|
||||
|
||||
class OutdatedModule
|
||||
{
|
||||
public static function calender() {
|
||||
$module = 'Kalender';
|
||||
$install_url = admin_url('admin.php?page=kompass-calendar');
|
||||
require dirname(__FILE__) . '/../views/outdated-component.php';
|
||||
}
|
||||
}
|
20
modules/plugin-installer/views/install-item.php
Normal file
20
modules/plugin-installer/views/install-item.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* File: install-item.php
|
||||
*
|
||||
*
|
||||
* @since 2024-08-12
|
||||
* @license GPL-3.0-or-later
|
||||
*
|
||||
* @package
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<div style="width: 80%; margin: 50px auto; border-style: solid; border-width: 2px; border-color: #1d4899; padding: 10px;">
|
||||
Um die gewünschte Komponente zu aktivieren, klicke bitte hier auf aktivieren.<br />
|
||||
kompass führt dabei die Installation im Hintergrund durch.
|
||||
<div style="text-align: center">
|
||||
<a href="<?php echo $install_link; ?>" class="button bdp-newplugin-button">Jetzt installieren</a>
|
||||
</div>
|
||||
</div>
|
18
modules/plugin-installer/views/outdated-component.php
Normal file
18
modules/plugin-installer/views/outdated-component.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* File: outdated-component.php
|
||||
*
|
||||
*
|
||||
* @since 2024-08-12
|
||||
* @license GPL-3.0-or-later
|
||||
*
|
||||
* @package
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<div style="padding: 10px 10px; font-size: 15pt; margin-top: 20px; line-height: 30px; background-color: #fafafa; border-left: #f10905 10px solid;">
|
||||
kompass hat festgestellt, dass du die Komponente <?php echo esc_html($module); ?> nutzt, die nicht weiterentwickelt wird.<br />
|
||||
Es steht eine neue Version bereit, bitte klicke <a href="<?php echo esc_url($install_url); ?>">hier</a>, um die Aktualisierung durchzuführen.
|
||||
</div>
|
||||
|
@ -28,8 +28,7 @@ class Security
|
||||
$loginUrl = get_option('whl_page', null) ?? 'bdp-login';
|
||||
}
|
||||
|
||||
enable_option_rewrite_url($loginUrl);
|
||||
enable_option_disable_xmlrpc();
|
||||
enable_option_disable_xmlrpc();
|
||||
enable_option_block_authorscan();
|
||||
enable_option_block_execution_in_uploads();
|
||||
enable_option_prohibit_special_files();
|
||||
@ -83,12 +82,17 @@ class Security
|
||||
public static function SetPageFilters() {
|
||||
global $wp;
|
||||
|
||||
if (str_contains($_SERVER['REQUEST_URI'], 'wp-login.php?action=logout')) {
|
||||
return;
|
||||
add_action('template_redirect', [Security::class, 'protectAuthorScan']);
|
||||
|
||||
if (null !== is_login_rewritten()) {
|
||||
if (str_contains($_SERVER['REQUEST_URI'], 'wp-login.php?action=logout')) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_action('template_redirect', [Security::class, 'protectAuthorScan']);
|
||||
Security::protectLoginSecurity();
|
||||
Security::protectLoginSecurity();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function protectLoginSecurity() {
|
||||
|
@ -86,12 +86,6 @@ function disable_option_disable_wp_debug() {
|
||||
WpConfigEditor::updateConfig('WP_DEBUG', 'true');
|
||||
}
|
||||
|
||||
function enable_option_rewrite_url(?string $url = null) {
|
||||
global $_POST;
|
||||
$saveUrl = $url ?? $_POST['rewrite_login'];
|
||||
update_option('kompass_sec_rewrite_login', $saveUrl);
|
||||
}
|
||||
|
||||
function disable_option_rewrite_url() {
|
||||
update_option('kompass_sec_rewrite_login', null);
|
||||
}
|
||||
@ -110,7 +104,6 @@ function kompass_sec_save_settings($settings) {
|
||||
'option_prohibit_bot_access',
|
||||
'option_block_directory_listing',
|
||||
'option_disable_wp_debug',
|
||||
'option_rewrite_url',
|
||||
];
|
||||
|
||||
$enableSettings = array_intersect($allPossibleSettings, $settings);
|
||||
|
@ -98,20 +98,6 @@
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="bdp_setting_box">
|
||||
<input <?php if (null !== is_login_rewritten()) {echo ' checked';} ?> type="checkbox" id="sec_mod_11" name="security_settings[]" value="option_rewrite_url" />
|
||||
<label for="sec_mod_11">
|
||||
<?= __('Change Login URL', BDP_LV_PLUGIN_SLUG); ?><br />
|
||||
<span>
|
||||
<?= __('Changing the default login URL of WordPress is advisable to enhance the security of your website. By default, WordPress login URLs is /wp-admin or /wp-login.php, which are easily guessed by hackers and facilitate attacks such as brute-force attacks. Changing the login URL to something unique and difficult to guess increases security since potential attackers will struggle to find the correct URL. This can help protect your website from unauthorized access and other malicious activities.', BDP_LV_PLUGIN_SLUG); ?><br />
|
||||
<label style="font-weight: bold;">
|
||||
<?= __('Login-URL', BDP_LV_PLUGIN_SLUG) ?>: <?= get_site_url(); ?>/<input style="width: 100px;" class="long_text" type="text" name="rewrite_login" id="rewrite_login" value="<?= is_login_rewritten(); ?>">
|
||||
</label>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br /><br />
|
||||
<input type="submit" class="button" value="<?= __('Save changes', BDP_LV_PLUGIN_SLUG); ?>" />
|
||||
|
147
settings/views/mail-settings.php
Normal file
147
settings/views/mail-settings.php
Normal file
@ -0,0 +1,147 @@
|
||||
<form action="<?php echo esc_url(admin_url('options-general.php?page=kompass-mail-settings')); ?>" method="post">
|
||||
<input type="hidden" name="save" value="1">
|
||||
<h2>E-Mail Einstellungen</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">SMTP zum senden Verwenden</td>
|
||||
<td>
|
||||
<div class="switch-container">
|
||||
<input name="use_smtp" <?php if (false !== (bool)get_option( 'kompass_use_smtp', false )) echo ' checked ';?> type="checkbox" id="use_smtp" class="switch">
|
||||
<label for="use_smtp" class="switch-label">
|
||||
<span class="switch-inner" data-on="ON" data-off="OFF"></span>
|
||||
<span class="switch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="smtp_settings" <?php if (false === (bool)get_option( 'kompass_use_smtp', false )) echo ' style="display: none;" ';?>>
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">SMTP-Host</td>
|
||||
<td>
|
||||
<input style="width: 500px;" type="text" name="smtp-host" value="<?php echo esc_html(get_option('kompass_smtp_host', '')); ?>" /> :
|
||||
<input style="width: 50px;" type="text" name="smtp-port" value="<?php echo esc_html(get_option('kompass_smtp_port', '25')); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">SMTP-User</td>
|
||||
<td>
|
||||
<input style="width: 562px;" type="text" name="smtp-user" value="<?php echo esc_html(get_option('kompass_smtp_user', '')); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">SMTP-Passwort</td>
|
||||
<td>
|
||||
<input style="width: 562px;" type="text" name="smtp-pass" value="<?php echo esc_html(get_option('kompass_smtp_pass', '')); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">SMTP-Sender email</td>
|
||||
<td>
|
||||
<input style="width: 562px;" type="text" name="smtp-sender" value="<?php echo esc_html(get_option('kompass_smtp_sender', '')); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">SMTP-Sender name</td>
|
||||
<td>
|
||||
<input style="width: 562px;" type="text" name="smtp-sender-name" value="<?php echo esc_html(get_option('kompass_smtp_sender-name', '')); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br /><br />
|
||||
<input type="submit" class="button-primary" value="Speichern">
|
||||
</form>
|
||||
<style>
|
||||
.switch-container {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.switch {
|
||||
visibility: hidden; /* Checkbox unsichtbar machen */
|
||||
}
|
||||
|
||||
.switch-label {
|
||||
display: block;
|
||||
width: 70px;
|
||||
height: 34px;
|
||||
background-color: #ccc;
|
||||
border-radius: 34px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.switch-inner {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 34px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 10px;
|
||||
font-size: 12px;
|
||||
color: white;
|
||||
box-sizing: border-box;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.switch-inner::before,
|
||||
.switch-inner::after {
|
||||
content: attr(data-off);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.switch-inner::after {
|
||||
content: attr(data-on);
|
||||
right: 10px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.switch-switch {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 3px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
transition: transform 0.3s ease, background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label {
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label .switch-inner::before {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label .switch-inner::after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label .switch-switch {
|
||||
transform: translateX(36px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// script.js
|
||||
document.getElementById('use_smtp').addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
document.getElementById('smtp_settings').style.display='block';
|
||||
} else {
|
||||
document.getElementById('smtp_settings').style.display='none';
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
153
settings/views/settings.php
Normal file
153
settings/views/settings.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
use Bdp\Libs\WpConfigEditor;
|
||||
?>
|
||||
<form action="echo esc_url(admin_url('options-general.php?page=kompass-settings')); ?>" method="post">
|
||||
<input type="hidden" name="save" value="1">
|
||||
<h2>Kompass Einstellungen</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">Seite wird für LV genutzt</td>
|
||||
<td>
|
||||
<div class="switch-container">
|
||||
<input name="used_for_state" <?php if (false !== (bool)get_option( 'paged_used_for_state', false )) echo ' checked ';?> type="checkbox" id="switch_lv" class="switch">
|
||||
<label for="switch_lv" class="switch-label">
|
||||
<span class="switch-inner" data-on="ON" data-off="OFF"></span>
|
||||
<span class="switch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">Externe Cron-Ausführung</td>
|
||||
<td>
|
||||
<div class="switch-container">
|
||||
<input name="external_cronjobs"
|
||||
<?php
|
||||
if (WpConfigEditor::getConfigValue('DISABLE_WP_CRON') )
|
||||
echo ' checked ';?> type="checkbox" id="external_cronjobs" class="switch">
|
||||
<label for="external_cronjobs" class="switch-label">
|
||||
<span class="switch-inner" data-on="ON" data-off="OFF"></span>
|
||||
<span class="switch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">Nutzer können sich selbst anmelden</td>
|
||||
<td>
|
||||
<div class="switch-container">
|
||||
<input <?php if (false !== (bool)get_option( 'user_can_register', false )) echo ' checked ';?> name="self_register" type="checkbox" id="switch_register" class="switch">
|
||||
<label for="switch_register" class="switch-label">
|
||||
<span class="switch-inner" data-on="ON" data-off="OFF"></span>
|
||||
<span class="switch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding: 10px;">mareike Theme</td>
|
||||
<td>
|
||||
<div class="switch-container">
|
||||
<input name="use_mareike_theme" <?php if (false !== (bool)get_option( 'use_mareike_theme', false )) echo ' checked ';?>type="checkbox" id="switch_mareike" class="switch">
|
||||
<label for="switch_mareike" class="switch-label">
|
||||
<span class="switch-inner" data-on="ON" data-off="OFF"></span>
|
||||
<span class="switch-switch"></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" class="button-primary" value="Speichern">
|
||||
</form>
|
||||
<style>
|
||||
.switch-container {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.switch {
|
||||
visibility: hidden; /* Checkbox unsichtbar machen */
|
||||
}
|
||||
|
||||
.switch-label {
|
||||
display: block;
|
||||
width: 70px;
|
||||
height: 34px;
|
||||
background-color: #ccc;
|
||||
border-radius: 34px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.switch-inner {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 34px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 10px;
|
||||
font-size: 12px;
|
||||
color: white;
|
||||
box-sizing: border-box;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.switch-inner::before,
|
||||
.switch-inner::after {
|
||||
content: attr(data-off);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.switch-inner::after {
|
||||
content: attr(data-on);
|
||||
right: 10px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.switch-switch {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 3px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
transition: transform 0.3s ease, background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label {
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label .switch-inner::before {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label .switch-inner::after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.switch:checked + .switch-label .switch-switch {
|
||||
transform: translateX(36px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// script.js
|
||||
document.getElementById('switch').addEventListener('change', function() {
|
||||
if (this.checked) {
|
||||
console.log('Switch is ON');
|
||||
} else {
|
||||
console.log('Switch is OFF');
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user