From 91e1bacc034def374dfbf9a6241835f3546f07a0 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 18 Jan 2012 10:54:54 -0500
Subject: [PATCH] - Fixed a timezone warning in updater. - Fixed a database password encryption error in remote API. - Fixed database add example script. - Added examply for new query syntax for forwards.
---
interface/lib/classes/remoting_lib.inc.php | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php
index 1310737..9073941 100644
--- a/interface/lib/classes/remoting_lib.inc.php
+++ b/interface/lib/classes/remoting_lib.inc.php
@@ -536,11 +536,16 @@
if($field['formtype'] == 'PASSWORD') {
$sql_insert_key .= "`$key`, ";
if($field['encryption'] == 'CRYPT') {
- $record[$key] = $app->auth->crypt_password(stripslashes($record[$key]));
+ $record[$key] = $app->auth->crypt_password(stripslashes($record[$key]));
+ $sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
+ } elseif ($field['encryption'] == 'MYSQL') {
+ $sql_insert_val .= "PASSWORD('".$app->db->quote($record[$key])."'), ";
+ } elseif ($field['encryption'] == 'CLEARTEXT') {
+ $sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
} else {
- $record[$key] = md5($record[$key]);
+ $record[$key] = md5(stripslashes($record[$key]));
+ $sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
}
- $sql_insert_val .= "'".$record[$key]."', ";
} elseif ($field['formtype'] == 'CHECKBOX') {
$sql_insert_key .= "`$key`, ";
if($record[$key] == '') {
@@ -645,7 +650,7 @@
foreach($primary_id as $key => $val) {
$key = $app->db->quote($key);
$val = $app->db->quote($val);
- if(strpos($val,'%')) {
+ if(stristr($val,'%')) {
$sql_where .= "$key like '$val' AND ";
} else {
$sql_where .= "$key = '$val' AND ";
--
Gitblit v1.9.1