UNTESTED: TLS added to AddCustomer. See #23
UNTESTED: TLS added to AddCustomer. See #23

--- a/Resources/info.php
+++ b/Resources/info.php
@@ -20,7 +20,11 @@
 * See LICENSE
 *
 */
-if(!ob_start("ob_gzhandler")) ob_start();
+
+
+// Using gzhandler broke on a few systems. A lot seem to automatically gzip where possible though, so removed gzhandler call
+ob_start();
+error_reporting(0);
 
 session_start();
 define('_CREDLOCK',1);

--- a/Resources/main.js
+++ b/Resources/main.js
@@ -171,8 +171,13 @@
 function checkNewCust(){
   
   var nme = document.getElementById('FrmName'),
-  grp = document.getElementById('frmGroup');
-      
+  grp = document.getElementById('frmGroup'),
+  email = document.getElementById('FrmEmail');
+      
+      if (email.value.indexOf('@') == -1){
+	email.className += ' frmEntryMissed';
+	return false;
+      }
       
       
       if (grp.options[grp.selectedIndex].value == 'null'){
@@ -185,6 +190,25 @@
 	nme.className += ' frmEntryMissed';
 	return false;
       }
+      
+      
+      if (enabledEncryption()){ 
+ 
+ var fname = document.getElementById('FrmconName'),
+  sname = document.getElementById('FrmSurname');
+ 
+  // Calculate the encrypted value
+ nme.value = Base64.encode(xorestr(nme.value,retKey()));
+ email.value = Base64.encode(xorestr(email.value,retKey()));
+ fname.value = Base64.encode(xorestr(fname.value,retKey()));
+ sname.value = Base64.encode(xorestr(sname.value,retKey()));
+}
+      
+      
+      
+      
+      
+      
   return true;
 }
 

file:a/api.php -> file:b/api.php
--- a/api.php
+++ b/api.php
@@ -8,7 +8,9 @@
 */
 
 session_start();
-ob_start("ob_gzhandler");
+error_reporting(0);
+
+ob_start();
 
 
 define('_CREDLOCK',1);

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -8,6 +8,8 @@
 */
 session_start();
 ob_start();
+error_reporting(0);
+
 define('_CREDLOCK',1);
 
 // Prevent Caching

--- a/views/Customer/add.php
+++ b/views/Customer/add.php
@@ -16,7 +16,25 @@
 
 $db = new CustDB;
 
-if ($db->addCustomer(htmlspecialchars(BTMain::getVar('FrmName')),BTMain::getVar('frmGroup'),htmlspecialchars(BTMain::getVar('FrmconName')),htmlspecialchars(BTMain::getVar('FrmSurname')),htmlspecialchars(BTMain::getVar('FrmEmail')))){
+
+$frmname = BTMain::getVar('FrmName');
+$fname = BTMain::getVar('FrmconName');
+$sname = BTMain::getVar('FrmSurname');
+$email = BTMain::getVar('FrmEmail');
+
+
+
+
+	if (!BTMain::getConnTypeSSL()){
+	    $tlskey = BTMain::getsessVar('tls');
+	    $frmname = base64_decode($crypt->xordstring(base64_decode($frmname),$tlskey));
+	    $fname = base64_decode($crypt->xordstring(base64_decode($fname),$tlskey));
+	    $sname = base64_decode($crypt->xordstring(base64_decode($sname),$tlskey));
+	    $email = base64_decode($crypt->xordstring(base64_decode($email),$tlskey));
+	 }
+
+
+if ($db->addCustomer(htmlspecialchars($frmname),BTMain::getVar('frmGroup'),htmlspecialchars($fname),htmlspecialchars($sname),htmlspecialchars($email))){
 
 
 $notifications->setNotification("addCustSuccess");