From 6e2a8dbc1a25d0f9366b8a0ab7958ae7a666b8a3 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Mon, 25 Jan 2010 15:14:13 -0500 Subject: [PATCH] Fixed: FS#1038 - Alias 1 character long --- interface/lib/classes/tform.inc.php | 37 +++++++++++++------------------------ 1 files changed, 13 insertions(+), 24 deletions(-) diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php index 3d29591..4d7c148 100644 --- a/interface/lib/classes/tform.inc.php +++ b/interface/lib/classes/tform.inc.php @@ -700,7 +700,7 @@ } break; case 'ISEMAIL': - if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) { + if(!preg_match("/^\w+[\w.-]*\w{0,}@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) { $errmsg = $validator['errmsg']; if(isset($this->wordbook[$errmsg])) { $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; @@ -816,8 +816,10 @@ $sql_insert_key .= "`$key`, "; if($field['encryption'] == 'CRYPT') { $salt="$1$"; + $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; for ($n=0;$n<8;$n++) { - $salt.=chr(mt_rand(64,126)); + //$salt.=chr(mt_rand(64,126)); + $salt.=$base64_alphabet[mt_rand(0,63)]; } $salt.="$"; // $salt = substr(md5(time()),0,2); @@ -849,8 +851,10 @@ if($field['formtype'] == 'PASSWORD') { if(isset($field['encryption']) && $field['encryption'] == 'CRYPT') { $salt="$1$"; + $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; for ($n=0;$n<8;$n++) { - $salt.=chr(mt_rand(64,126)); + //$salt.=chr(mt_rand(64,126)); + $salt.=$base64_alphabet[mt_rand(0,63)]; } $salt.="$"; // $salt = substr(md5(time()),0,2); @@ -1017,7 +1021,11 @@ function datalogSave($action,$primary_id, $record_old, $record_new) { global $app,$conf; - + + $app->db->datalogSave($this->formDef['db_table'], $action, $this->formDef['db_table_idx'], $primary_id, $record_old, $record_new); + return true; + + /* // Add backticks for incomplete table names. if(stristr($this->formDef['db_table'],'.')) { $escape = ''; @@ -1026,26 +1034,6 @@ } $this->diffrec = array(); - /* - if(is_array($record_new) && count($record_new) > 0) { - foreach($record_new as $key => $val) { - if(@$record_old[$key] != $val) { - // Record has changed - $diffrec[$key] = array('old' => @$record_old[$key], - 'new' => $val); - } - } - } elseif(is_array($record_old)) { - foreach($record_old as $key => $val) { - if($record_new[$key] != $val) { - // Record has changed - $diffrec[$key] = array('new' => $record_new[$key], - 'old' => $val); - } - } - } - $this->diffrec = $diffrec; - */ // Full diff records for ISPConfig, they have a different format then the simple diffrec $diffrec_full = array(); @@ -1098,6 +1086,7 @@ } return true; + */ } -- Gitblit v1.9.1