Index: /changelog
===================================================================
--- /changelog	(revision 7138)
+++ /changelog	(revision 7140)
@@ -159,2 +159,3 @@
 - Feature: DownloadProdukte: Versandart "Versand per Mail" deaktivierbar
 - Feature: AboProdukte: optionale Informationsmail vor Ablauf des Abos (Zeitspanne variable konfigurierbar)
+- Feature: reCaptcha fÃŒr Kundenregistrierung mÃ¶glich
Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 7138)
+++ /lib/wpsg_basket.class.php	(revision 7140)
@@ -1361,5 +1361,5 @@
 
 				}
-
+				
 			}
 
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 7138)
+++ /model/wpsg_product.class.php	(revision 7140)
@@ -587,4 +587,6 @@
             else {
                 
+                if (!is_array($this->shop->arShippingAll)) $this->shop->arShippingAll = [];
+                
                 $arShipping = array_keys($this->shop->arShippingAll);
 
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 7138)
+++ /mods/wpsg_mod_basic.class.php	(revision 7140)
@@ -95,5 +95,4 @@
 			5000	=> 'wpsg_mod_trustedshops', // Sollte nach den Zahlungsanbietern kommen wegen order_done
 			5100    => 'wpsg_mod_productview', // Produktansicht 
-			5200    => 'wpsg_mod_recaptcha', 
 			5300	=> 'wpsg_mod_converter', // Konverter von wpsg3 auf wpsg4
 			5400 	=> 'wpsg_mod_surfaceproduct', // Druckerei	
Index: /mods/wpsg_mod_kundenverwaltung.class.php
===================================================================
--- /mods/wpsg_mod_kundenverwaltung.class.php	(revision 7138)
+++ /mods/wpsg_mod_kundenverwaltung.class.php	(revision 7140)
@@ -170,4 +170,8 @@
 			$this->shop->update_option('wpsg_mod_kundenverwaltung_aweber_metaAdtracking', $_REQUEST['wpsg_mod_kundenverwaltung_aweber_metaAdtracking']);
 			
+			$this->shop->update_option('wpsg_mod_kundenverwaltung_recaptcha_register', $_REQUEST['wpsg_mod_kundenverwaltung_recaptcha_register']);
+			$this->shop->update_option('wpsg_mod_kundenveraltung_recaptcha_key', $_REQUEST['wpsg_mod_kundenveraltung_recaptcha_key']);
+			$this->shop->update_option('wpsg_mod_kundenveraltung_recaptcha_secretkey', $_REQUEST['wpsg_mod_kundenveraltung_recaptcha_secretkey']);
+			
 			$this->shop->createPage(__('Profil', 'wpsg'), 'wpsg_page_mod_kundenverwaltung_profil', $_REQUEST['wpsg_page_mod_kundenverwaltung_profil']);
 			$this->shop->createPage(__('Registrierung', 'wpsg'), 'wpsg_page_mod_kundenverwaltung_registrierung', $_REQUEST['wpsg_page_mod_kundenverwaltung_registrierung']);
@@ -189,5 +193,39 @@
 
         } // public function wpsg_deinstall_sites()
-		
+
+        public function wpsg_enqueue_scripts() { 
+		    
+		    $register_page = intval($this->shop->get_option('wpsg_page_mod_kundenverwaltung_registrierung'));
+            $wpsg_mod_kundenverwaltung_recaptcha_register = $this->shop->get_option('wpsg_mod_kundenverwaltung_recaptcha_register');
+		    
+		    if (wpsg_isSizedInt($wpsg_mod_kundenverwaltung_recaptcha_register ) && wpsg_isSizedInt($register_page) && \get_the_ID() === $register_page) {
+
+                \wp_enqueue_script('wpsg-recaptcha', 'https://www.google.com/recaptcha/api.js', false);
+                
+            } 
+		    
+        } // public function wpsg_enqueue_scripts()
+        
+        public function systemcheck(&$arData) {
+
+            $wpsg_mod_kundenverwaltung_recaptcha_register = $this->shop->get_option('wpsg_mod_kundenverwaltung_recaptcha_register');
+            $wpsg_mod_kundenveraltung_recaptcha_key = $this->shop->get_option('wpsg_mod_kundenveraltung_recaptcha_key');
+            $wpsg_mod_kundenveraltung_recaptcha_secretkey = $this->shop->get_option('wpsg_mod_kundenveraltung_recaptcha_secretkey');
+		    
+		    if ($wpsg_mod_kundenverwaltung_recaptcha_register === '1' && (!wpsg_isSizedString($wpsg_mod_kundenveraltung_recaptcha_key) || !wpsg_isSizedString($wpsg_mod_kundenveraltung_recaptcha_secretkey))) {
+
+                $arData[] = array(
+                    'wpsg_mod_kundenverwaltung_recaptcha',
+                    wpsg_ShopController::CHECK_ERROR,
+                    wpsg_translate(
+                        __('Die reCaptcha ÃberprÃŒfung ist in den Einstellungen aktiv, aber die Konfiguration ist nicht komplett. Bitte <a href="#1#">hier</a> konfigurieren.', 'wpsg'),
+                        WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_kundenverwaltung'
+                    )
+                );
+		        
+            }
+		    
+        } // public function systemcheck($arData)
+		            
 		public function admin_setcapabilities() { 
 			
@@ -478,4 +516,30 @@
 					
 				}
+
+                if (isset($_REQUEST['wpsg_mod_kundenverwaltung_register']) && $this->shop->get_option('wpsg_mod_kundenverwaltung_recaptcha_register') === '1') {
+
+                    $url = 'https://www.google.com/recaptcha/api/siteverify';
+                    $data = array(
+                        'secret' => $this->shop->get_option('wpsg_mod_kundenveraltung_recaptcha_secretkey'),
+                        'response' => $_REQUEST["g-recaptcha-response"]
+                    );
+                    $options = array(
+                        'http' => array (
+                            'method' => 'POST',
+                            'content' => http_build_query($data)
+                        )
+                    );
+                    $context = stream_context_create($options);
+                    $verify = file_get_contents($url, false, $context);
+                    $captcha_success = json_decode($verify);
+
+                    if ($captcha_success->success === false) {
+
+                        $this->shop->addFrontendError(__('Bitte bestÃ€tigen Sie, dass Sie kein Bot sind.', 'wpsg'));
+                        $_SESSION['wpsg']['errorFields'][] = 'mod_kundenverwaltung_recaptcha';
+
+                    }
+                    
+                }
 				
 			}
Index: /views/css/frontend.css
===================================================================
--- /views/css/frontend.css	(revision 7138)
+++ /views/css/frontend.css	(revision 7140)
@@ -86,4 +86,5 @@
 .wpsg_checkout .wpsg_checkoutblock input[type="checkbox"] { width:auto; margin-right:5px; }
 .wpsg_checkout .wpsg_checkoutblock select { box-sizing:border-box; width:100%; margin-bottom:5px; }
+.wpsg_checkout .wpsg_checkoutblock .g-recaptcha { float:right; margin-top:15px; }
 .wpsg_checkout .wpsg_mandatoryfield_hint { margin-top:1rem; }
 .wpsg_checkout .wpsg_required { font-weight:bold; color:#FF0000; }
Index: /views/mods/mod_kundenverwaltung/register.phtml
===================================================================
--- /views/mods/mod_kundenverwaltung/register.phtml	(revision 7138)
+++ /views/mods/mod_kundenverwaltung/register.phtml	(revision 7140)
@@ -323,5 +323,15 @@
 		<?php /* Automatische Einbindung der benutzerdefinierten Kundenfelder ENDE */ ?>
 		<div class="wpsg_clear"></div>
-		
+
+        <?php if ($this->get_option('wpsg_mod_kundenverwaltung_recaptcha_register') === '1') { ?>
+            <div class="wpsg_checkoutblock">
+                <label>
+                    <?php echo __('SPAM Schutz Abfrage'); ?> <span class="wpsg_required">*</span>:
+                    <div class="g-recaptcha" data-sitekey="<?php echo $this->get_option('wpsg_mod_kundenveraltung_recaptcha_key'); ?>"></div>
+                </label>
+            </div>
+            <div class="wpsg_clear"></div>
+        <?php } ?>
+        
 		<div class="wpsg_mandatoryfield_hint">
 			<?php echo wpsg_translate(__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>'); ?>
@@ -334,5 +344,5 @@
 			</span> 
 		<?php /* versteckte Sicherheitsabfrage als Bot-Schutz ENDE*/ ?>
-		
+		        
 		<br />		
 		
Index: /views/mods/mod_kundenverwaltung/settings_edit.phtml
===================================================================
--- /views/mods/mod_kundenverwaltung/settings_edit.phtml	(revision 7138)
+++ /views/mods/mod_kundenverwaltung/settings_edit.phtml	(revision 7140)
@@ -67,8 +67,7 @@
 	
 	<?php echo wpsg_drawForm_Select('wpsg_mod_kundenverwaltung_wpuser_role', __('Benutzerrolle', 'wpsg'), $this->view['arRoles'], $this->get_option('wpsg_mod_kundenverwaltung_wpuser_role')); ?>
-	 
+    <br />
+    
 </div>
-
-<br />
 
 <?php echo wpsg_drawForm_Checkbox('wpsg_mod_kundenverwaltung_aweber', __('AWeber Integration', 'wpsg'), $this->get_option('wpsg_mod_kundenverwaltung_aweber'), array('help' => 'wpsg_mod_kundenverwaltung_aweber')); ?>
@@ -78,6 +77,23 @@
 	<?php echo wpsg_drawForm_Input('wpsg_mod_kundenverwaltung_aweber_listname', __('AWeber listname', 'wpsg'), $this->get_option('wpsg_mod_kundenverwaltung_aweber_listname')); ?>
 	<?php echo wpsg_drawForm_Input('wpsg_mod_kundenverwaltung_aweber_metaAdtracking', __('AWeber meta_adtracking', 'wpsg'), $this->get_option('wpsg_mod_kundenverwaltung_aweber_metaAdtracking')); ?>
-	
+    <br />    
+    
 </div>
+
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_kundenverwaltung_recaptcha_register', __('reCaptcha V2 fÃŒr Registrierung', 'wpsg'), $this->get_option('wpsg_mod_kundenverwaltung_recaptcha_register')); ?>
+<div id="wpsg_mod_kundenverwaltung_register_recaptcha_layer" style="display:none;">
+    
+    <?php echo wpsg_drawForm_Input('wpsg_mod_kundenveraltung_recaptcha_key', __('WebsiteschlÃŒssel', 'wpsg'), $this->get_option('wpsg_mod_kundenveraltung_recaptcha_key')); ?>
+    <?php echo wpsg_drawForm_Input('wpsg_mod_kundenveraltung_recaptcha_secretkey', __('Geheimer SchlÃŒssel', 'wpsg'), $this->get_option('wpsg_mod_kundenveraltung_recaptcha_secretkey')); ?>
+    
+</div>
+<script> 
+    
+    jQuery('#wpsg_mod_kundenverwaltung_recaptcha_register').on('change', function() { 
+       
+        if (jQuery(this).prop('checked')) jQuery('#wpsg_mod_kundenverwaltung_register_recaptcha_layer').show();
+        else jQuery('#wpsg_mod_kundenverwaltung_register_recaptcha_layer').hide();
+    
+    } ).change(); </script>
 
 <br />
