Index: /changelog
===================================================================
--- /changelog	(revision 7561)
+++ /changelog	(revision 7562)
@@ -254,4 +254,5 @@
 - Bugfix: unrabattierter Preis wird als "OldPrice" dargestellt und ÃŒberschreibt im Produkt-hinterlegten "alten Preis"
 - Bugfix: Gutscheinwert wird nicht mehr addiert, sondern vom Warenkorbwert abgezogen
+- Bugfix: Probleme beim erstmaligen aktivieren in einem Multiblog behoben
 - Feature: KundenID in Kundenverwaltung sortierbar
 - Feature: Wertgutschein als GutscheinProdukt-MÃ¶glichkeit integrierbar
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7561)
+++ /controller/wpsg_ShopController.class.php	(revision 7562)
@@ -312,4 +312,9 @@
 				if ($this->get_option('wpsg_page_request') === false) $this->createPage(__('Anfrageliste', 'wpsg'), 'wpsg_page_request', '-1');
 			}
+			
+			if ($this->get_option('wpsg_multiblog_standalone', true) === false) $this->update_option('wpsg_multiblog_standalone', '1', true);
+			if ($this->get_option('wpsg_customer_start', true) === false) $this->update_option('wpsg_customer_start', '1', true);
+			if ($this->get_option('wpsg_order_start', true) === false) $this->update_option('wpsg_order_start', '1', true);			
+			
 			if ($this->get_option('wpsg_page_basket') === false) $this->createPage(__('Warenkorb', 'wpsg'), 'wpsg_page_basket', '-1');
 			if ($this->get_option('wpsg_currency') === false) $this->update_option('wpsg_currency', 'EUR');
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 7561)
+++ /lib/functions.inc.php	(revision 7562)
@@ -1699,5 +1699,5 @@
 	function wpsg_formNounce($controller, $action = '', $arParam = []) {
 		
-		echo wp_nonce_field(wpsg_getNounce($controller, $action, $arParam));
+		return wp_nonce_field(wpsg_getNounce($controller, $action, $arParam));
 		
 	}
Index: /mods/wpsg_mod_abo.class.php
===================================================================
--- /mods/wpsg_mod_abo.class.php	(revision 7561)
+++ /mods/wpsg_mod_abo.class.php	(revision 7562)
@@ -5,6 +5,5 @@
 	 * @author Daschmi
 	 */
-	class wpsg_mod_abo extends wpsg_mod_basic
-	{
+	class wpsg_mod_abo extends wpsg_mod_basic {
 
 		var $lizenz = 1;
@@ -26,6 +25,5 @@
 		 * Costructor
 		 */
-		public function __construct()
-		{
+		public function __construct() {
 
 			parent::__construct();
@@ -37,6 +35,5 @@
 		} // public function __construct()
 
-        public function init()
-        {
+        public function init() {
             
             // Option gab es frÃŒher nicht und wird hier auf den Default Wert korrigiert.
@@ -184,6 +181,7 @@
 		 * Ãbersicht ÃŒber die Kunden im Backend
 		 */
-		private function be_indexAction()
-		{
+		private function be_indexAction() {
+			
+			if (isset($_REQUEST['submit-button'])) wpsg_checkNounce('Abo', 'index', ['search' => '1']);
 		
 			$nPerPage = $this->shop->get_option('wpsg_mod_abo_perpage');
@@ -283,6 +281,5 @@
 		} // private function be_indexAction()
 		
-		public function dispatch()
-		{
+		public function dispatch() {
 			
 			$this->be_indexAction();
Index: /mods/wpsg_mod_kundenverwaltung.class.php
===================================================================
--- /mods/wpsg_mod_kundenverwaltung.class.php	(revision 7561)
+++ /mods/wpsg_mod_kundenverwaltung.class.php	(revision 7562)
@@ -116,7 +116,5 @@
 				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_kundenverwaltung');
 				
-			}
-            else if ($_REQUEST['be_ajax'] === 'su' && is_admin())
-            {
+			} else if ($_REQUEST['be_ajax'] === 'su' && is_admin()) {
 	
 				unset($_SESSION['wpsg']);
@@ -126,10 +124,10 @@
 
                 $this->shop->addBackendMessage(wpsg_translate(__('Sie sind jetzt im Frontend als #1# #2# angemeldet.', 'wpsg'), $kunde_data['vorname'], $kunde_data['name']));
-                $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$_REQUEST['k_id']);
+                $this->shop->redirect(wpsg_admin_url('Customer', 'edit', ['edit_id' => $_REQUEST['k_id']]));
                 
-            }
-            else if ($_REQUEST['be_ajax'] === 'su_index' && is_admin())
-            {
-            	
+            } else if ($_REQUEST['be_ajax'] === 'su_index' && is_admin()) {
+	
+				wpsg_checkNounce('Admin', 'module', ['modul' => 'wpsg_mod_kundenverwaltung', 'be_ajax' => 'su_index', 'k_id' => $_REQUEST['k_id']]);
+				
             	unset($_SESSION['wpsg']);
 
@@ -322,14 +320,43 @@
 		} // public function load()
 		
-		public function dispatch()
-		{
-						
-			if (wpsg_isSizedString($_REQUEST['action'], 'edit')) $this->be_editAction();
-			else if (wpsg_isSizedString($_REQUEST['action'], 'add')) $this->be_addAction();
-			else if (wpsg_isSizedString($_REQUEST['action'], 'export')) $this->be_exportAction();
-			else if (wpsg_isSizedString($_REQUEST['action'], 'import')) $this->be_importAction();
-			else if (wpsg_isSizedString($_REQUEST['action'], 'del')) $this->be_delAction();
-			else if (wpsg_isSizedString($_REQUEST['action'], 'save')) $this->be_saveAction();
-			else {
+		public function dispatch() {
+						
+			if (wpsg_isSizedString($_REQUEST['action'], 'edit')) {
+				
+				wpsg_checkNounce('Customer', 'edit', ['edit_id' => $_REQUEST['edit_id']]);
+				
+				$this->be_editAction();
+				
+			} else if (wpsg_isSizedString($_REQUEST['action'], 'add')) {
+				
+				wpsg_checkNounce('Customer', 'add');
+				
+				$this->be_addAction();
+				
+			} else if (wpsg_isSizedString($_REQUEST['action'], 'export')) {
+				
+				wpsg_checkNounce('Customer', 'export');
+				
+				$this->be_exportAction();
+				
+			} else if (wpsg_isSizedString($_REQUEST['action'], 'import')) {
+				
+				wpsg_checkNounce('Customer', 'import');
+				
+				$this->be_importAction();
+				
+			} else if (wpsg_isSizedString($_REQUEST['action'], 'del')) {
+				
+				wpsg_checkNounce('Customer', 'del', ['edit_id' => $_REQUEST['edit_id']]);
+				
+				$this->be_delAction();
+				
+			} else if (wpsg_isSizedString($_REQUEST['action'], 'save')) {
+				
+				wpsg_checkNounce('Customer', 'save');
+				
+				$this->be_saveAction();
+				
+			} else {
 				
 				if (isset($_REQUEST['submit-button'])) wpsg_checkNounce('Customer', 'search');
@@ -2092,5 +2119,5 @@
 			
 			if (isset($_REQUEST['submit_index'])) $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=index');
-			else $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$_REQUEST['edit_id']);
+			else $this->shop->redirect(wpsg_admin_url('Customer', 'edit', ['edit_id' => $_REQUEST['edit_id']]));
 			
 		} // private function be_saveAction()
Index: /mods/wpsg_mod_versandarten.class.php
===================================================================
--- /mods/wpsg_mod_versandarten.class.php	(revision 7561)
+++ /mods/wpsg_mod_versandarten.class.php	(revision 7562)
@@ -156,5 +156,5 @@
 					} else if ($_REQUEST['field'] == 'vz') {
 	
-						if (wpsg_checkInput($_REQUEST['value'], WPSG_SANITIZE_INT)) {
+						if (wpsg_checkInput($_REQUEST['value'], WPSG_SANITIZE_INT, ['allow' => ['0']])) {
 							
 							$this->db->UpdateQuery(WPSG_TBL_VA, array(
Index: /views/mods/mod_abo/index.phtml
===================================================================
--- /views/mods/mod_abo/index.phtml	(revision 7561)
+++ /views/mods/mod_abo/index.phtml	(revision 7562)
@@ -28,5 +28,7 @@
 				<div class="col-lg-4">
 					<form method="post" id="filter_form" >
-
+						
+						<?php echo wpsg_formNounce('Abo', 'index', ['search' => '1']); ?>
+						
 						<input id="wpsg_seite" type="hidden" name="seite" value="<?php echo @$this->view['arFilter']['page']; ?>" class="current-page" />
 						<input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
Index: /views/mods/mod_kundenverwaltung/edit.phtml
===================================================================
--- /views/mods/mod_kundenverwaltung/edit.phtml	(revision 7561)
+++ /views/mods/mod_kundenverwaltung/edit.phtml	(revision 7562)
@@ -37,4 +37,6 @@
 		<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=save&noheader=1" enctype="multipart/form-data">
 
+			<?php echo wpsg_formNounce('Customer', 'save'); ?>
+			
 			<div class="row">
 				<div class="col-md-8 col-lg-8">
@@ -116,5 +118,5 @@
 						<?php echo wpsg_drawForm_Input('password1', __('Passwort', 'wpsg'), '', array('type' => 'password')); ?>
 						<?php echo wpsg_drawForm_Input('password2', __('Wiederholung', 'wpsg'), '', array('type' => 'password')); ?>
-                        <div id="wpsg_pwd_info">
+                        <div id="wpsg_pwd_info" style="display:none;">
                             <h4><?php echo __('Passwort sollte folgende Regeln befolgen:','wpsg') ?></h4>
                             <ul>
@@ -214,5 +216,5 @@
 </div>
 
-<script type="text/javascript">/* <![CDATA[ */
+<script>
 	
 	jQuery(document).ready(function() {
@@ -288,15 +290,15 @@
 			}
 
+		} ).on('focus', function() {
+			
 			jQuery('#wpsg_pwd_info').show();
-
-			jQuery(this).blur(function() {
-
-				jQuery('#wpsg_pwd_info').hide();
-
-			} );
-
-		} );
-
+			
+		}).on('blur', function() {
+
+			jQuery('#wpsg_pwd_info').hide();
+			
+		});
+		
 	} );
 
-/* ]]> */</script>
+</script>
Index: /views/mods/mod_kundenverwaltung/index.phtml
===================================================================
--- /views/mods/mod_kundenverwaltung/index.phtml	(revision 7561)
+++ /views/mods/mod_kundenverwaltung/index.phtml	(revision 7562)
@@ -18,5 +18,11 @@
 					<li role="presentation" class="<?php echo ((!isset($_REQUEST['action']))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer" onclick="return false;"><?php echo wpsg_translate(__("Kundenverwaltung (#1# Kunden)", "wpsg"), $this->view['countAll']); ?></a></li>
 					<li role="presentation" class="wpsg-customer-tab-a wpsg_showhide_filter <?php echo ((wpsg_isTrue($this->view['hasFilter']))?'active':''); ?>" id="wpsg-customer-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
-                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("HinzufÃŒgen", "wpsg"); ?></a></li>
+                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php 
+						
+						echo wpsg_admin_url('Customer', 'add'); 
+						
+					?>"><span class="glyphicon glyphicon-plus"></span><?php echo __("HinzufÃŒgen", "wpsg"); 
+							
+					?></a></li>
                     
                     <?php /* Integration Exportprofile */ ?>
@@ -29,7 +35,15 @@
 				</ul>
 				<ul class="nav navbar-nav navbar-right">
-                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'import'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=import"><span class="glyphicon glyphicon-import"></span><?php echo __("Daten-Import", "wpsg"); ?></a></li>
+                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'import'))?'active':''); ?>"><a href="<?php
+		
+						echo wpsg_admin_url('Customer', 'import', [], ['noheader' => '1']);
+							
+					?>"><span class="glyphicon glyphicon-import"></span><?php echo __("Daten-Import", "wpsg"); ?></a></li>
 					<?php if (wpsg_isSizedArray($this->view['arData'])) { ?>
-					<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'export'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=export&noheader=1"><span class="glyphicon glyphicon-export"></span><?php echo __("Daten-Export", "wpsg"); ?></a></li>
+					<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'export'))?'active':''); ?>"><a href="<?php
+							
+						echo wpsg_admin_url('Customer', 'export', [], ['noheader' => '1']);
+
+					?>"><span class="glyphicon glyphicon-export"></span><?php echo __("Daten-Export", "wpsg"); ?></a></li>
 					<?php } ?>
 				</ul>
@@ -160,13 +174,24 @@
                                 <?php } ?>
                                 <div class="row-actions">
-                                    <span class="edit"><a title="<?php echo __("Diesen Kunden bearbeiten", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id=<?php echo $c->id; ?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>
+                                    <span class="edit"><a title="<?php echo __("Diesen Kunden bearbeiten", "wpsg"); ?>" href="<?php 
+											
+										echo wpsg_admin_url('Customer', 'edit', ['edit_id' => $c->getId()]);
+											
+									?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>
                                     |
-                                    <span class="del"><a onclick="if (!confirm('<?php echo __("Sind Sie sicher, dass Sie den Kunden lÃ¶schen wollen?", "wpsg"); ?>')) return false;" title="<?php echo __("Diesen Kunden lÃ¶schen", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=del&edit_id=<?php echo $c->id; ?>&noheader=1"><?php echo __("LÃ¶schen", "wpsg"); ?></a></span>
+                                    <span class="del"><a onclick="if (!confirm('<?php echo __("Sind Sie sicher, dass Sie den Kunden lÃ¶schen wollen?", "wpsg"); ?>')) return false;" title="<?php echo __("Diesen Kunden lÃ¶schen", "wpsg"); ?>" href="<?php 
+									
+										echo wpsg_admin_url('Customer', 'del', ['edit_id' => $c->id]);		
+											
+									?>&noheader=1"><?php echo __("LÃ¶schen", "wpsg"); ?></a></span>
                                     |
-                                    <span class="order"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&filter%5Bk_id%5D=<?php echo $c->id; ?>"><?php echo __('Bestellungen einsehen', 'wpsg'); ?></a></span>
-                                    
+									
                                     <?php if ($c->status !== '-1') { ?>
                                     |
-                                    <span class="order"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_kundenverwaltung&noheader=1&be_ajax=su_index&k_id=<?php echo $c->id; ?>"><?php echo __('Kundenlogin simulieren', 'wpsg'); ?></a></span>
+                                    <span class="order"><a href="<?php 
+											
+										echo wpsg_admin_url('Admin', 'module', ['modul' => 'wpsg_mod_kundenverwaltung', 'be_ajax' => 'su_index', 'k_id' => $c->getId()], ['noheader' => '1']);											
+											
+									?>"><?php echo __('Kundenlogin simulieren', 'wpsg'); ?></a></span>
                                     <?php } ?>
                                     
Index: /views/mods/mod_versandarten/list.phtml
===================================================================
--- /views/mods/mod_versandarten/list.phtml	(revision 7561)
+++ /views/mods/mod_versandarten/list.phtml	(revision 7562)
@@ -4,5 +4,7 @@
 	 * Template fÃŒr die Liste der Versandarten 
 	 */
-
+	
+	$arVzNamen = [];
+	
 ?>
 <?php if (!is_array($this->view['data']) || sizeof($this->view['data']) <= 0) { ?>
@@ -88,11 +90,17 @@
 
         <?php echo wpsg_drawForm_TextStart(); ?>
-        <span id="va_vz_<?php echo $va['id']; ?>">
-        <?php if ($va['vz'] > 0) { ?>
-        	<?php echo wpsg_hspc($this->view['arVZ'][$va['vz']]['name']); ?>
-        	<?php } else { ?>
-        	<?php echo __('Alle Versandzonen', 'wpsg'); ?>
-        	<?php } ?>
-        </span>
+        <span id="va_vz_<?php echo $va['id']; ?>"><?php
+				
+				if ($va['vz'] > 0) { 
+					
+					echo wpsg_hspc($this->view['arVZ'][$va['vz']]['name']); 
+        		
+				} else { 
+        	
+					echo __('Alle Versandzonen', 'wpsg'); 
+        	
+				} 
+				
+        ?></span>
 		<a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign" data-wpsg-tip="wpsg_shippay_versandzone" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_shippay_versandzone" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_shippay_versandzone"></a>
         <?php echo wpsg_drawForm_TextEnd(__('Versandzone', 'wpsg')); ?>
Index: /views/produkttemplates/standard.phtml
===================================================================
--- /views/produkttemplates/standard.phtml	(revision 7561)
+++ /views/produkttemplates/standard.phtml	(revision 7562)
@@ -323,23 +323,24 @@
 								jQuery.ajax( {
 									url: '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>',
-									data:
-									{
+									data: {
 										'wpsg_form_data': jQuery('#wpsg_produktform_<?php echo $this->getTemplateIndex(); ?>').serialize(),
 										'wpsg[ajax]': '1',
 										'wpsg[submit]': '1'
 									},
-									success: function(data)
-									{
+									success: function(data) {
 
                                         wpsg_refreshBasketWidget();
-
+										
 										<?php if ($this->get_option('wpsg_afterinsert') == '2') { ?>
-										tb_show('<?php echo __('Ihr Warenkorb', 'wpsg'); ?>', '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET_AJAX); ?>&height=500');
+										
+											tb_show('<?php echo __('Ihr Warenkorb', 'wpsg'); ?>', '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET_AJAX); ?>&height=500');
+											
 										<?php } else { ?>
 
+											jQuery('body').append(data);
+
+										<?php } ?>
+
 										wpsg_unblockProductTemplate(<?php echo $this->getTemplateIndex(); ?>);
-										jQuery('body').append(data);
-
-										<?php } ?>
 
 									}
