Merge branch 'master' of github.com:alchemy-fr/Phraseanet

This commit is contained in:
Romain Neutron
2011-12-26 17:26:37 +01:00
6 changed files with 62 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/php
#!/usr/bin/env php
<?php
/*
* This file is part of Phraseanet

View File

@@ -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);
@@ -878,6 +878,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

View File

@@ -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)

49
lib/unitTest/userTest.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once dirname(__FILE__) . '/PhraseanetPHPUnitAbstract.class.inc';
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class userTest extends PhraseanetPHPUnitAbstract
{
public function testMail()
{
$this->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));
}
}

View File

@@ -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');

View File

@@ -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']));