From 8216c5ee690f97b9f8f8ac967dac5c5f3745a00f Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Tue, 12 Apr 2016 06:18:24 -0400
Subject: [PATCH] Fixed: Issue #3820 v3.1 Shell user wrong default Base Dir in GUI results to corrupt shell user home directory creation.

---
 server/lib/classes/cron.d/400-openvz.inc.php |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/server/lib/classes/cron.d/400-openvz.inc.php b/server/lib/classes/cron.d/400-openvz.inc.php
index 18f4598..c88e0e6 100644
--- a/server/lib/classes/cron.d/400-openvz.inc.php
+++ b/server/lib/classes/cron.d/400-openvz.inc.php
@@ -55,14 +55,12 @@
 		//######################################################################################################
 
 		if ($app->dbmaster == $app->db) {
-			$current_date = date('Y-m-d');
-
 			//* Check which virtual machines have to be deactivated
-			$sql = "SELECT * FROM openvz_vm WHERE active = 'y' AND active_until_date != '0000-00-00' AND active_until_date < '$current_date'";
+			$sql = "SELECT * FROM openvz_vm WHERE active = 'y' AND active_until_date IS NOT NULL AND active_until_date < CURDATE()";
 			$records = $app->db->queryAllRecords($sql);
 			if(is_array($records)) {
 				foreach($records as $rec) {
-					$app->dbmaster->datalogUpdate('openvz_vm', "active = 'n'", 'vm_id', $rec['vm_id']);
+					$app->dbmaster->datalogUpdate('openvz_vm', array("active" => 'n'), 'vm_id', $rec['vm_id']);
 					$app->log('Virtual machine active date expired. Disabling VM '.$rec['veid'], LOGLEVEL_DEBUG);
 				}
 			}

--
Gitblit v1.9.1