From b50e6c930ec63b33fbc043672a07c6f03e0901e4 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 20 Dec 2011 17:33:41 +0100 Subject: [PATCH 1/5] fix user_adapter::set_email --- lib/classes/User/Adapter.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/classes/User/Adapter.class.php b/lib/classes/User/Adapter.class.php index 98a374e720..d16b15e780 100644 --- a/lib/classes/User/Adapter.class.php +++ b/lib/classes/User/Adapter.class.php @@ -397,7 +397,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface */ public function set_email($email) { - if (!trim($email)) + if (trim($email) == '') $email = null; $test_user = User_Adapter::get_usr_id_from_email($email); @@ -873,6 +873,9 @@ class User_Adapter implements User_Interface, cache_cacheableInterface public static function get_usr_id_from_email($email) { + if(is_null($email)) + return false; + $conn = connection::getPDOConnection(); $sql = 'SELECT usr_id FROM usr WHERE usr_mail = :email From ad35d019653f4992759c5a86c8a0ad6ed340f973 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 20 Dec 2011 17:34:44 +0100 Subject: [PATCH 2/5] add user_adapter::set_email test --- lib/unitTest/userTest.php | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/unitTest/userTest.php diff --git a/lib/unitTest/userTest.php b/lib/unitTest/userTest.php new file mode 100644 index 0000000000..82e4fc5a3d --- /dev/null +++ b/lib/unitTest/userTest.php @@ -0,0 +1,49 @@ +assertFalse(User_Adapter::get_usr_id_from_email(null)); + try + { + $appbox = appbox::get_instance(); + + self::$user->set_email(null); + + $this->assertFalse(User_Adapter::get_usr_id_from_email(null)); + self::$user->set_email(''); + $this->assertFalse(User_Adapter::get_usr_id_from_email(null)); + self::$user->set_email('noonealt1@example.com'); + $this->assertEquals(self::$user->get_id(), User_Adapter::get_usr_id_from_email('noonealt1@example.com')); + } + catch(Exception $e) + { + $this->fail($e->getMessage()); + } + $this->assertFalse(User_Adapter::get_usr_id_from_email(null)); + } +} \ No newline at end of file From 54c8a7a138cd1f229ea644768da98e28e1cd1ebb Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 20 Dec 2011 18:27:14 +0100 Subject: [PATCH 3/5] Fix #101 : Non graphical tasks does not update their values in database --- lib/classes/task/period/emptyColl.class.php | 2 +- www/admin/task2.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/classes/task/period/emptyColl.class.php b/lib/classes/task/period/emptyColl.class.php index 4fc396231d..c31398f1ba 100644 --- a/lib/classes/task/period/emptyColl.class.php +++ b/lib/classes/task/period/emptyColl.class.php @@ -57,7 +57,7 @@ class task_period_emptyColl extends task_appboxAbstract $collection = collection::get_from_base_id($this->base_id); $this->total_records = $collection->get_record_amount(); $collection->empty_collection(200); - $this->records_done +=200; + $this->records_done += $this->total_records; $this->setProgress($this->records_done, $this->total_records); if ($this->total_records == 0) diff --git a/www/admin/task2.php b/www/admin/task2.php index 1772aac2f1..2ea0358ada 100644 --- a/www/admin/task2.php +++ b/www/admin/task2.php @@ -76,4 +76,10 @@ function stripdoublequotes($value) } $twig = new supertwig(); $twig->addFilter(array('stripdoublequotes'=>'stripdoublequotes')); + +if(!$task->getGraphicForm()) +{ + $parm['view'] = 'XML'; +} + $twig->display('admin/task.html', array('task'=>$task, 'view'=>$parm['view'])); From f3afe79af7deecd026006545723c64d6e767ddc6 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 20 Dec 2011 18:30:19 +0100 Subject: [PATCH 4/5] Detect php location in system --- bin/console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/console b/bin/console index ea8fd64e55..8a5fce126e 100755 --- a/bin/console +++ b/bin/console @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php Date: Wed, 21 Dec 2011 14:00:52 +0100 Subject: [PATCH 5/5] Bump to version 3.5.3 --- lib/version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/version.inc b/lib/version.inc index 890fb380d0..9a6acf9259 100644 --- a/lib/version.inc +++ b/lib/version.inc @@ -15,5 +15,5 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -define('GV_version', '3.5.2.0'); +define('GV_version', '3.5.3.0'); define('GV_version_name', 'Baobab');