mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Merge branch 'master' of github.com:alchemy-fr/Phraseanet
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* This file is part of Phraseanet
|
* This file is part of Phraseanet
|
||||||
|
@@ -397,7 +397,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
*/
|
*/
|
||||||
public function set_email($email)
|
public function set_email($email)
|
||||||
{
|
{
|
||||||
if (!trim($email))
|
if (trim($email) == '')
|
||||||
$email = null;
|
$email = null;
|
||||||
|
|
||||||
$test_user = User_Adapter::get_usr_id_from_email($email);
|
$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)
|
public static function get_usr_id_from_email($email)
|
||||||
{
|
{
|
||||||
|
if(is_null($email))
|
||||||
|
return false;
|
||||||
|
|
||||||
$conn = connection::getPDOConnection();
|
$conn = connection::getPDOConnection();
|
||||||
$sql = 'SELECT usr_id FROM usr
|
$sql = 'SELECT usr_id FROM usr
|
||||||
WHERE usr_mail = :email
|
WHERE usr_mail = :email
|
||||||
|
@@ -57,7 +57,7 @@ class task_period_emptyColl extends task_appboxAbstract
|
|||||||
$collection = collection::get_from_base_id($this->base_id);
|
$collection = collection::get_from_base_id($this->base_id);
|
||||||
$this->total_records = $collection->get_record_amount();
|
$this->total_records = $collection->get_record_amount();
|
||||||
$collection->empty_collection(200);
|
$collection->empty_collection(200);
|
||||||
$this->records_done +=200;
|
$this->records_done += $this->total_records;
|
||||||
$this->setProgress($this->records_done, $this->total_records);
|
$this->setProgress($this->records_done, $this->total_records);
|
||||||
|
|
||||||
if ($this->total_records == 0)
|
if ($this->total_records == 0)
|
||||||
|
49
lib/unitTest/userTest.php
Normal file
49
lib/unitTest/userTest.php
Normal 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));
|
||||||
|
}
|
||||||
|
}
|
@@ -15,5 +15,5 @@
|
|||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||||
* @link www.phraseanet.com
|
* @link www.phraseanet.com
|
||||||
*/
|
*/
|
||||||
define('GV_version', '3.5.2.0');
|
define('GV_version', '3.5.3.0');
|
||||||
define('GV_version_name', 'Baobab');
|
define('GV_version_name', 'Baobab');
|
||||||
|
@@ -76,4 +76,10 @@ function stripdoublequotes($value)
|
|||||||
}
|
}
|
||||||
$twig = new supertwig();
|
$twig = new supertwig();
|
||||||
$twig->addFilter(array('stripdoublequotes'=>'stripdoublequotes'));
|
$twig->addFilter(array('stripdoublequotes'=>'stripdoublequotes'));
|
||||||
|
|
||||||
|
if(!$task->getGraphicForm())
|
||||||
|
{
|
||||||
|
$parm['view'] = 'XML';
|
||||||
|
}
|
||||||
|
|
||||||
$twig->display('admin/task.html', array('task'=>$task, 'view'=>$parm['view']));
|
$twig->display('admin/task.html', array('task'=>$task, 'view'=>$parm['view']));
|
||||||
|
Reference in New Issue
Block a user