From 6f4add6f715cfefa283f0087c98ccc8ae9edc62f Mon Sep 17 00:00:00 2001 From: wyrie <wyrie@ispconfig3> Date: Thu, 08 Apr 2010 13:59:59 -0400 Subject: [PATCH] Added support for datetime form encoding --- interface/lib/classes/remoting_lib.inc.php | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php index 565cad1..df13dff 100644 --- a/interface/lib/classes/remoting_lib.inc.php +++ b/interface/lib/classes/remoting_lib.inc.php @@ -325,6 +325,18 @@ case 'CURRENCY': $new_record[$key] = str_replace(",",".",$record[$key]); break; + + case 'DATETIME': + if (is_array($record[$key])) + { + $filtered_values = array_map(create_function('$item','return (int)$item;'), $record[$key]); + extract($filtered_values, EXTR_PREFIX_ALL, '_dt'); + + if ($_dt_day != 0 && $_dt_month != 0 && $_dt_year != 0) { + $new_record[$key] = date( 'Y-m-d H:i:s', mktime($_dt_hour, $_dt_minute, $_dt_second, $_dt_month, $_dt_day, $_dt_year) ); + } + } + break; } // The use of the field value is deprecated, use validators instead @@ -492,8 +504,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); @@ -519,8 +533,10 @@ if($field['formtype'] == 'PASSWORD') { 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); -- Gitblit v1.9.1