From b5a23a1be34827ba18ca537740edb121e616cd7a Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Sun, 06 Jan 2008 12:58:26 -0500
Subject: [PATCH] Added reseller capabilities to all modules. Added a server module for clients and a mail plugin.

---
 interface/lib/classes/tform.inc.php |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index 92ef324..e5644c3 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -135,10 +135,16 @@
                 $this->formDef = $form;
 
                 $this->module = $module;
+				$wb = array();
+				
                 if($module == '') {
+					if(is_file("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
                         include_once("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
+					}
                 } else {
+					if(is_file("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
                         include_once("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
+					}
                 }
                 $this->wordbook = $wb;
 
@@ -712,7 +718,7 @@
                                                 }
                                         } else {
                                                 if($field['formtype'] == 'PASSWORD') {
-														if($field['encryption'] == 'CRYPT') {
+														if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') {
                                                                 $salt="$1$";
 																for ($n=0;$n<8;$n++) {
 																	$salt.=chr(mt_rand(64,126));
@@ -883,9 +889,9 @@
 				
                 if(is_array($record_new) && count($record_new) > 0) {
                         foreach($record_new as $key => $val) {
-                                if($record_old[$key] != $val) {
+                                if(@$record_old[$key] != $val) {
 										// Record has changed
-                                        $diffrec[$key] = array('old' => $record_old[$key],
+                                        $diffrec[$key] = array('old' => @$record_old[$key],
                                                                'new' => $val);
                                 }
                         }
@@ -993,8 +999,8 @@
                         }
                 } else {
                         $result = false;
-                        if($this->formDef["auth_preset"]["userid"] == $_SESSION["s"]["user"]["userid"] && stristr($perm,$this->formDef["auth_preset"]["perm_user"])) $result = true;
-                        if($this->formDef["auth_preset"]["groupid"] == $_SESSION["s"]["user"]["groupid"] && stristr($perm,$this->formDef["auth_preset"]["perm_group"])) $result = true;
+                        if(@$this->formDef["auth_preset"]["userid"] == $_SESSION["s"]["user"]["userid"] && stristr($perm,$this->formDef["auth_preset"]["perm_user"])) $result = true;
+                        if(@$this->formDef["auth_preset"]["groupid"] == $_SESSION["s"]["user"]["groupid"] && stristr($perm,$this->formDef["auth_preset"]["perm_group"])) $result = true;
                         if(@stristr($this->formDef["auth_preset"]["perm_other"],$perm)) $result = true;
 
                         // if preset == 0, everyone can insert a record of this type

--
Gitblit v1.9.1