mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Merge
This commit is contained in:
@@ -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
|
||||
|
@@ -36,9 +36,44 @@ class module_console_systemUpgrade extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if(!setup::is_installed())
|
||||
if (!setup::is_installed())
|
||||
{
|
||||
throw new RuntimeException('Phraseanet is not set up');
|
||||
|
||||
if (file_exists(dirname(__FILE__) . "/../../../../config/connexion.inc")
|
||||
&& !file_exists(dirname(__FILE__) . "/../../../../config/config.inc")
|
||||
&& file_exists(dirname(__FILE__) . "/../../../../config/_GV.php"))
|
||||
{
|
||||
|
||||
$output->writeln('This version of Phraseanet requires a config/config.inc');
|
||||
$output->writeln('Would you like it to be created based on your settings ?');
|
||||
|
||||
$dialog = $this->getHelperSet()->get('dialog');
|
||||
do
|
||||
{
|
||||
$continue = mb_strtolower($dialog->ask($output, '<question>' . _('Create automatically') . ' (Y/n)</question>', 'y'));
|
||||
}
|
||||
while (!in_array($continue, array('y', 'n')));
|
||||
|
||||
if ($continue == 'y')
|
||||
{
|
||||
require __DIR__ . "/../../../../config/_GV.php";
|
||||
|
||||
$datas = '<?php'."\n"
|
||||
.'$servername = "'.GV_ServerName.'";'."\n"
|
||||
.'$maintenance=false;'."\n"
|
||||
.'$debug=false;'."\n"
|
||||
.'$debug=true;'."\n"
|
||||
.'';
|
||||
|
||||
file_put_contents(__DIR__ . "/../../../../config/config.inc", $datas);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RuntimeException('Phraseanet is not set up');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../../../lib/bootstrap.php';
|
||||
@@ -60,7 +95,7 @@ class module_console_systemUpgrade extends Command
|
||||
$output->write('<info>Upgrading...</info>', true);
|
||||
$appbox = appbox::get_instance();
|
||||
|
||||
if(count(User_Adapter::get_wrong_email_users($appbox)) > 0)
|
||||
if (count(User_Adapter::get_wrong_email_users($appbox)) > 0)
|
||||
{
|
||||
return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>'));
|
||||
}
|
||||
|
@@ -1541,6 +1541,7 @@ class task_period_archive extends task_abstract
|
||||
$record->set_metadatas($meta['metadatas']);
|
||||
$record->set_binary_status(databox_status::operation_or($stat0, $stat1));
|
||||
$record->rebuild_subdefs();
|
||||
$record->reindex();
|
||||
$rid = $record->get_record_id();
|
||||
$this->log(sprintf((' (recordId %s)'), $rid));
|
||||
$this->archivedFiles++;
|
||||
@@ -1881,6 +1882,7 @@ class task_period_archive extends task_abstract
|
||||
$record->set_metadatas($meta['metadatas']);
|
||||
$record->set_binary_status(databox_status::operation_or(databox_status::operation_or($stat0, $stat1), databox_status::hex2bin($hexstat)));
|
||||
$record->rebuild_subdefs();
|
||||
$record->reindex();
|
||||
|
||||
$rid = $record->get_record_id();
|
||||
if ($grp_rid !== NULL)
|
||||
|
@@ -38,6 +38,7 @@ Entities\Basket:
|
||||
validation:
|
||||
targetEntity: ValidationSession
|
||||
mappedBy: basket
|
||||
cascade: ["remove"]
|
||||
oneToMany:
|
||||
elements:
|
||||
targetEntity: BasketElement
|
||||
|
@@ -36,7 +36,7 @@ Entities\ValidationSession:
|
||||
participants:
|
||||
targetEntity: ValidationParticipant
|
||||
mappedBy: session
|
||||
|
||||
cascade: ["remove"]
|
||||
|
||||
|
||||
|
||||
|
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));
|
||||
}
|
||||
}
|
@@ -86,6 +86,8 @@ $parm = $request->get_parms('section');
|
||||
$twig = new supertwig();
|
||||
$twig->display('admin/index.html.twig', array(
|
||||
'module' => 'admin'
|
||||
,'events'=> eventsmanager_broker::getInstance($appbox)
|
||||
,'module_name' => 'Admin'
|
||||
, 'feature' => $feature
|
||||
, 'featured' => $featured
|
||||
, 'databoxes' => $databoxes
|
||||
|
@@ -82,4 +82,10 @@ if(!$task->getGraphicForm())
|
||||
|
||||
$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']));
|
||||
|
@@ -1,12 +1,7 @@
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
var date = new Date();
|
||||
date.setMonth(date.getMonth() + 2);
|
||||
<<<<<<< HEAD
|
||||
$.cookie('screen', screen.width+"x"+screen.height, { path: '/', expires: date });
|
||||
=======
|
||||
jQuery.cookie('screen', screen.width+"x"+screen.height, { path: '/', expires: date });
|
||||
>>>>>>> FixHome
|
||||
|
||||
var test_cookie = date.getTime();
|
||||
jQuery.cookie('test_cookie'+test_cookie, 'accepted', { path: '/', expires: date });
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Reference in New Issue
Block a user