mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #476 from romainneutron/fix_07-10
[3.8] Multiple fixes
This commit is contained in:
@@ -80,11 +80,10 @@ border-manager:
|
|||||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
trials-before-failure: 9
|
trials-before-display: 9
|
||||||
providers:
|
providers:
|
||||||
facebook:
|
facebook:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@@ -37,7 +37,7 @@ class Install extends Command
|
|||||||
->addOption('db-port', null, InputOption::VALUE_OPTIONAL, 'MySQL server port', 3306)
|
->addOption('db-port', null, InputOption::VALUE_OPTIONAL, 'MySQL server port', 3306)
|
||||||
->addOption('db-user', null, InputOption::VALUE_OPTIONAL, 'MySQL server user', 'phrasea')
|
->addOption('db-user', null, InputOption::VALUE_OPTIONAL, 'MySQL server user', 'phrasea')
|
||||||
->addOption('db-password', null, InputOption::VALUE_OPTIONAL, 'MySQL server password', null)
|
->addOption('db-password', null, InputOption::VALUE_OPTIONAL, 'MySQL server password', null)
|
||||||
->addOption('db-template', null, InputOption::VALUE_OPTIONAL, 'Metadata structure language template', null)
|
->addOption('db-template', null, InputOption::VALUE_OPTIONAL, 'Metadata structure language template (available are fr (french) and en (english))', null)
|
||||||
->addOption('databox', null, InputOption::VALUE_OPTIONAL, 'Database name for the DataBox', null)
|
->addOption('databox', null, InputOption::VALUE_OPTIONAL, 'Database name for the DataBox', null)
|
||||||
->addOption('appbox', null, InputOption::VALUE_OPTIONAL, 'Database name for the ApplicationBox', null)
|
->addOption('appbox', null, InputOption::VALUE_OPTIONAL, 'Database name for the ApplicationBox', null)
|
||||||
->addOption('indexer', null, InputOption::VALUE_OPTIONAL, 'Path to Phraseanet Indexer', 'auto')
|
->addOption('indexer', null, InputOption::VALUE_OPTIONAL, 'Path to Phraseanet Indexer', 'auto')
|
||||||
@@ -126,7 +126,7 @@ class Install extends Command
|
|||||||
$hostname = $dialog->ask($output, "DB hostname (localhost) : ", 'localhost');
|
$hostname = $dialog->ask($output, "DB hostname (localhost) : ", 'localhost');
|
||||||
$port = $dialog->ask($output, "DB port (3306) : ", 3306);
|
$port = $dialog->ask($output, "DB port (3306) : ", 3306);
|
||||||
$dbUser = $dialog->ask($output, "DB user : ");
|
$dbUser = $dialog->ask($output, "DB user : ");
|
||||||
$dbPassword = $dialog->ask($output, "DB password : ");
|
$dbPassword = $dialog->askHiddenResponse($output, "DB password (hidden) : ");
|
||||||
$abName = $dialog->ask($output, "DB name (phraseanet) : ", 'phraseanet');
|
$abName = $dialog->ask($output, "DB name (phraseanet) : ", 'phraseanet');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -148,7 +148,7 @@ class Install extends Command
|
|||||||
{
|
{
|
||||||
$credentials = $abConn->get_credentials();
|
$credentials = $abConn->get_credentials();
|
||||||
|
|
||||||
$dbConn = null;
|
$dbConn = $template = null;
|
||||||
if (!$input->getOption('databox')) {
|
if (!$input->getOption('databox')) {
|
||||||
do {
|
do {
|
||||||
$retry = false;
|
$retry = false;
|
||||||
@@ -160,7 +160,7 @@ class Install extends Command
|
|||||||
$output->writeln("\n\t<info>Data-Box : Connection successful !</info>\n");
|
$output->writeln("\n\t<info>Data-Box : Connection successful !</info>\n");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$template = $dialog->ask($output, 'Choose a language template for metadata structure (en) : ', 'en');
|
$template = $dialog->ask($output, 'Choose a language template for metadata structure, available are fr (french) and en (english) (en) : ', 'en');
|
||||||
} while (!in_array($template, array('en', 'fr')));
|
} while (!in_array($template, array('en', 'fr')));
|
||||||
|
|
||||||
$output->writeln("\n\tLanguage selected is <info>'$template'</info>\n");
|
$output->writeln("\n\tLanguage selected is <info>'$template'</info>\n");
|
||||||
@@ -192,7 +192,7 @@ class Install extends Command
|
|||||||
} while (!\Swift_Validate::email($email));
|
} while (!\Swift_Validate::email($email));
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$password = $dialog->ask($output, 'Please provide a password (6 character min) : ');
|
$password = $dialog->askHiddenResponse($output, 'Please provide a password (hidden, 6 character min) : ');
|
||||||
} while (strlen($password) < 6);
|
} while (strlen($password) < 6);
|
||||||
|
|
||||||
$output->writeln("\n\t<info>Email / Password successfully set</info>\n");
|
$output->writeln("\n\t<info>Email / Password successfully set</info>\n");
|
||||||
|
@@ -854,9 +854,7 @@ class Databox implements ControllerProviderInterface
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $app->redirectPath('admin_database', array(
|
return $app->redirectPath('admin_databases', array(
|
||||||
'databox_id' => $databox_id,
|
|
||||||
'error' => 'file-too-big',
|
|
||||||
'reload-tree' => 1,
|
'reload-tree' => 1,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@@ -186,6 +186,7 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
'error_msg' => $errorMsg,
|
'error_msg' => $errorMsg,
|
||||||
'recommendations' => $upgrader->getRecommendations(),
|
'recommendations' => $upgrader->getRecommendations(),
|
||||||
'advices' => $request->query->get('advices', array()),
|
'advices' => $request->query->get('advices', array()),
|
||||||
|
'reloadTree' => (Boolean) $request->query->get('reload-tree'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -603,6 +603,7 @@ class Login implements ControllerProviderInterface
|
|||||||
$url = $app->url('login_renew_password', array('token' => $token), true);
|
$url = $app->url('login_renew_password', array('token' => $token), true);
|
||||||
|
|
||||||
$mail = MailRequestPasswordUpdate::create($app, $receiver);
|
$mail = MailRequestPasswordUpdate::create($app, $receiver);
|
||||||
|
$mail->setLogin($user->get_login());
|
||||||
$mail->setButtonUrl($url);
|
$mail->setButtonUrl($url);
|
||||||
|
|
||||||
$app['notification.deliverer']->deliver($mail);
|
$app['notification.deliverer']->deliver($mail);
|
||||||
|
@@ -67,8 +67,10 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
}, $authConf['auto-create']['templates']));
|
}, $authConf['auto-create']['templates']));
|
||||||
|
|
||||||
|
$enabled = $app['phraseanet.registry']->get('GV_autoregister') && $app['registration.enabled'];
|
||||||
|
|
||||||
return new AccountCreator($app['tokens'], $app['phraseanet.appbox'], $authConf['auto-create']['enabled'], $templates);
|
return new AccountCreator($app['tokens'], $app['phraseanet.appbox'], $enabled, $templates);
|
||||||
});
|
});
|
||||||
|
|
||||||
$app['authentication.providers'] = $app->share(function (Application $app) {
|
$app['authentication.providers'] = $app->share(function (Application $app) {
|
||||||
@@ -101,7 +103,7 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
|||||||
$app['auth.native.failure-manager'] = $app->share(function (Application $app) {
|
$app['auth.native.failure-manager'] = $app->share(function (Application $app) {
|
||||||
$authConf = $app['phraseanet.configuration']['authentication']['captcha'];
|
$authConf = $app['phraseanet.configuration']['authentication']['captcha'];
|
||||||
|
|
||||||
return new FailureManager($app['EM'], $app['recaptcha'], isset($authConf['trials-before-failure']) ? $authConf['trials-before-failure'] : 9);
|
return new FailureManager($app['EM'], $app['recaptcha'], isset($authConf['trials-before-display']) ? $authConf['trials-before-display'] : 9);
|
||||||
});
|
});
|
||||||
|
|
||||||
$app['auth.password-checker'] = $app->share(function (Application $app) {
|
$app['auth.password-checker'] = $app->share(function (Application $app) {
|
||||||
|
@@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core;
|
|||||||
*/
|
*/
|
||||||
class Version
|
class Version
|
||||||
{
|
{
|
||||||
protected static $number = '3.8.0.a16';
|
protected static $number = '3.8.0.a17';
|
||||||
protected static $name = 'Carnosaurus';
|
protected static $name = 'Carnosaurus';
|
||||||
|
|
||||||
public static function getNumber()
|
public static function getNumber()
|
||||||
|
@@ -11,8 +11,23 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Notification\Mail;
|
namespace Alchemy\Phrasea\Notification\Mail;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Exception\LogicException;
|
||||||
|
|
||||||
class MailRequestPasswordUpdate extends AbstractMailWithLink
|
class MailRequestPasswordUpdate extends AbstractMailWithLink
|
||||||
{
|
{
|
||||||
|
/** @var string */
|
||||||
|
private $login;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the login related to the password renewal
|
||||||
|
*
|
||||||
|
* @param string $login
|
||||||
|
*/
|
||||||
|
public function setLogin($login)
|
||||||
|
{
|
||||||
|
$this->login = $login;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@@ -26,7 +41,11 @@ class MailRequestPasswordUpdate extends AbstractMailWithLink
|
|||||||
*/
|
*/
|
||||||
public function getMessage()
|
public function getMessage()
|
||||||
{
|
{
|
||||||
return _('login:: Quelqu\'un a demande a reinitialiser le mode passe correspondant au login suivant : ')
|
if (!$this->login) {
|
||||||
|
throw new LogicException('You must set a login before calling getMessage');
|
||||||
|
}
|
||||||
|
|
||||||
|
return sprintf(_('Password renewal for login "%s" has been requested'), $this->login)
|
||||||
. "\n"
|
. "\n"
|
||||||
. _('login:: Visitez le lien suivant et suivez les instructions pour continuer, sinon ignorez cet email et il ne se passera rien');
|
. _('login:: Visitez le lien suivant et suivez les instructions pour continuer, sinon ignorez cet email et il ne se passera rien');
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,7 @@ class PhraseaEngine implements SearchEngineInterface
|
|||||||
public function getAvailableDateFields()
|
public function getAvailableDateFields()
|
||||||
{
|
{
|
||||||
if (!$this->dateFields) {
|
if (!$this->dateFields) {
|
||||||
|
$this->dateFields = array();
|
||||||
foreach ($this->app['phraseanet.appbox']->get_databoxes() as $databox) {
|
foreach ($this->app['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_meta_structure() as $databox_field) {
|
foreach ($databox->get_meta_structure() as $databox_field) {
|
||||||
if ($databox_field->get_type() != \databox_field::TYPE_DATE) {
|
if ($databox_field->get_type() != \databox_field::TYPE_DATE) {
|
||||||
|
@@ -35,6 +35,7 @@ class module_console_systemBackupDB extends Command
|
|||||||
$this
|
$this
|
||||||
->setDescription('Backup Phraseanet Databases')
|
->setDescription('Backup Phraseanet Databases')
|
||||||
->addArgument('directory', null, 'The directory where to backup', $dir)
|
->addArgument('directory', null, 'The directory where to backup', $dir)
|
||||||
|
->addOption('timeout', 't', null, 'The timeout for this command (default is 3600s / 1h). Set 0 to disable timeout.', 3600)
|
||||||
->addOption('gzip', 'g', null, 'Gzip the output (requires gzip utility)')
|
->addOption('gzip', 'g', null, 'Gzip the output (requires gzip utility)')
|
||||||
->addOption('bzip', 'b', null, 'Bzip the output (requires bzip2 utility)');
|
->addOption('bzip', 'b', null, 'Bzip the output (requires bzip2 utility)');
|
||||||
|
|
||||||
@@ -89,6 +90,7 @@ class module_console_systemBackupDB extends Command
|
|||||||
$command .= ' > ' . escapeshellarg($filename);
|
$command .= ' > ' . escapeshellarg($filename);
|
||||||
|
|
||||||
$process = new Process($command);
|
$process = new Process($command);
|
||||||
|
$process->setTimeout((int) $input->getOption('timeout'));
|
||||||
$process->run();
|
$process->run();
|
||||||
|
|
||||||
if (!$process->isSuccessful()) {
|
if (!$process->isSuccessful()) {
|
||||||
|
66
lib/classes/patch/3817.php
Normal file
66
lib/classes/patch/3817.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2012 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
|
class patch_3817 implements patchInterface
|
||||||
|
{
|
||||||
|
/** @var string */
|
||||||
|
private $release = '3.8.0.a17';
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function get_release()
|
||||||
|
{
|
||||||
|
return $this->release;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function require_all_upgrades()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function concern()
|
||||||
|
{
|
||||||
|
return $this->concern;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function apply(base $appbox, Application $app)
|
||||||
|
{
|
||||||
|
$auth = $app['phraseanet.configuration']['authentication'];
|
||||||
|
|
||||||
|
if (isset($auth['captcha']) && isset($auth['captcha']['trials-before-failure'])) {
|
||||||
|
$auth['captcha']['trials-before-display'] = $auth['captcha']['trials-before-failure'];
|
||||||
|
unset($auth['captcha']['trials-before-failure']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($auth['auto-create']) && isset($auth['auto-create']['enabled'])) {
|
||||||
|
unset($auth['auto-create']['enabled']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$app['phraseanet.configuration']['authentication'] = $auth;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@@ -83,11 +83,10 @@ border-manager:
|
|||||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
trials-before-failure: 9
|
trials-before-display: 9
|
||||||
providers:
|
providers:
|
||||||
facebook:
|
facebook:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
{% if reloadTree %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
reloadTree('bases:bases');
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if app['request'].query.get('success') == '1' %}
|
{% if app['request'].query.get('success') == '1' %}
|
||||||
<div class="alert alert-success">
|
<div class="alert alert-success">
|
||||||
<a class="close" data-dismiss="alert" href="#">×</a>
|
<a class="close" data-dismiss="alert" href="#">×</a>
|
||||||
|
@@ -68,11 +68,10 @@ border-manager:
|
|||||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
trials-before-failure: 9
|
trials-before-display: 9
|
||||||
providers:
|
providers:
|
||||||
facebook:
|
facebook:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -116,8 +115,6 @@ registration-fields:
|
|||||||
required: true
|
required: true
|
||||||
xsendfile:
|
xsendfile:
|
||||||
enabled: false
|
enabled: false
|
||||||
type: ''
|
type: nginx
|
||||||
mapping:
|
mapping: []
|
||||||
-
|
plugins: []
|
||||||
directory: ''
|
|
||||||
mount-point: ''
|
|
||||||
|
@@ -68,11 +68,10 @@ border-manager:
|
|||||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
trials-before-failure: 9
|
trials-before-display: 9
|
||||||
providers:
|
providers:
|
||||||
facebook:
|
facebook:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -116,8 +115,6 @@ registration-fields:
|
|||||||
required: true
|
required: true
|
||||||
xsendfile:
|
xsendfile:
|
||||||
enabled: false
|
enabled: false
|
||||||
type: ''
|
type: nginx
|
||||||
mapping:
|
mapping: []
|
||||||
-
|
plugins: []
|
||||||
directory: ''
|
|
||||||
mount-point: ''
|
|
||||||
|
@@ -93,11 +93,10 @@ border-manager:
|
|||||||
- Video
|
- Video
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
trials-before-failure: 9
|
trials-before-display: 9
|
||||||
providers:
|
providers:
|
||||||
facebook:
|
facebook:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@@ -93,11 +93,10 @@ border-manager:
|
|||||||
- Video
|
- Video
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
trials-before-failure: 9
|
trials-before-display: 9
|
||||||
providers:
|
providers:
|
||||||
facebook:
|
facebook:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
@@ -88,7 +88,7 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
$app->register(new ConfigurationServiceProvider());
|
$app->register(new ConfigurationServiceProvider());
|
||||||
|
|
||||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
||||||
$conf['authentication']['captcha']['trials-before-failure'] = 42;
|
$conf['authentication']['captcha']['trials-before-display'] = 42;
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration'] = $conf;
|
||||||
|
|
||||||
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
||||||
@@ -107,12 +107,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
$app = new PhraseaApplication();
|
$app = new PhraseaApplication();
|
||||||
$app->register(new ConfigurationServiceProvider());
|
$app->register(new ConfigurationServiceProvider());
|
||||||
|
|
||||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
$conf = $app['phraseanet.configuration']->getConfig();
|
||||||
$conf['authentication']['auto-create'] = array(
|
$conf['authentication']['auto-create'] = array(
|
||||||
'enabled' => true,
|
|
||||||
'templates' => array(),
|
'templates' => array(),
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$app['authentication.providers.account-creator'];
|
$app['authentication.providers.account-creator'];
|
||||||
}
|
}
|
||||||
@@ -139,11 +138,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
}));
|
}));
|
||||||
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
$conf = $app['phraseanet.configuration']->getConfig();
|
||||||
$conf['authentication']['captcha'] = array(
|
$conf['authentication']['captcha'] = array(
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
@@ -177,11 +176,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
}));
|
}));
|
||||||
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
||||||
|
|
||||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
$conf = $app['phraseanet.configuration']->getConfig();
|
||||||
$conf['authentication']['captcha'] = array(
|
$conf['authentication']['captcha'] = array(
|
||||||
'enabled' => false,
|
'enabled' => false,
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
@@ -203,15 +202,14 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
$template2 = \User_Adapter::create(self::$DI['app'], 'template' . $random->generatePassword(), $random->generatePassword(), null, false);
|
$template2 = \User_Adapter::create(self::$DI['app'], 'template' . $random->generatePassword(), $random->generatePassword(), null, false);
|
||||||
$template2->set_template(self::$DI['user']);
|
$template2->set_template(self::$DI['user']);
|
||||||
|
|
||||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
$conf = $app['phraseanet.configuration']->getConfig();
|
||||||
$conf['authentication']['auto-create'] = array(
|
$conf['authentication']['auto-create'] = array(
|
||||||
'enabled' => true,
|
|
||||||
'templates' => array(
|
'templates' => array(
|
||||||
$template1->get_id(),
|
$template1->get_id(),
|
||||||
$template2->get_login()
|
$template2->get_login()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$this->assertEquals(array($template1, $template2), $app['authentication.providers.account-creator']->getTemplates());
|
$this->assertEquals(array($template1, $template2), $app['authentication.providers.account-creator']->getTemplates());
|
||||||
|
|
||||||
|
@@ -3,15 +3,22 @@
|
|||||||
namespace Alchemy\Tests\Phrasea\Notification\Mail;
|
namespace Alchemy\Tests\Phrasea\Notification\Mail;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Notification\Mail\MailRequestPasswordUpdate;
|
use Alchemy\Phrasea\Notification\Mail\MailRequestPasswordUpdate;
|
||||||
|
use Alchemy\Phrasea\Exception\LogicException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Alchemy\Phrasea\Notification\Mail\MailRequestPasswordUpdate
|
* @covers Alchemy\Phrasea\Notification\Mail\MailRequestPasswordUpdate
|
||||||
*/
|
*/
|
||||||
class MailRequestPasswordUpdateTest extends MailWithLinkTestCase
|
class MailRequestPasswordUpdateTest extends MailWithLinkTestCase
|
||||||
{
|
{
|
||||||
|
public function testSetLogin()
|
||||||
|
{
|
||||||
|
$mail = $this->getMail();
|
||||||
|
$this->assertTrue(false !== strpos($mail->getMessage(), 'RomainNeutron'));
|
||||||
|
}
|
||||||
|
|
||||||
public function getMail()
|
public function getMail()
|
||||||
{
|
{
|
||||||
return MailRequestPasswordUpdate::create(
|
$mail = MailRequestPasswordUpdate::create(
|
||||||
$this->getApp(),
|
$this->getApp(),
|
||||||
$this->getReceiverMock(),
|
$this->getReceiverMock(),
|
||||||
$this->getEmitterMock(),
|
$this->getEmitterMock(),
|
||||||
@@ -19,5 +26,28 @@ class MailRequestPasswordUpdateTest extends MailWithLinkTestCase
|
|||||||
$this->getUrl(),
|
$this->getUrl(),
|
||||||
$this->getExpiration()
|
$this->getExpiration()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$mail->setLogin('RomainNeutron');
|
||||||
|
|
||||||
|
return $mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testThatALogicExceptionIsThrownIfNoLoginProvided()
|
||||||
|
{
|
||||||
|
$mail = MailRequestPasswordUpdate::create(
|
||||||
|
$this->getApp(),
|
||||||
|
$this->getReceiverMock(),
|
||||||
|
$this->getEmitterMock(),
|
||||||
|
$this->getMessage(),
|
||||||
|
$this->getUrl(),
|
||||||
|
$this->getExpiration()
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$mail->getMessage();
|
||||||
|
$this->fail('Should have raised an exception');
|
||||||
|
} catch (LogicException $e) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -202,13 +202,12 @@ class Migration38Test extends AbstractSetupTester
|
|||||||
),
|
),
|
||||||
'authentication' => array(
|
'authentication' => array(
|
||||||
'auto-create' => array(
|
'auto-create' => array(
|
||||||
'enabled' => false,
|
|
||||||
'templates' => array(
|
'templates' => array(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'captcha' => array(
|
'captcha' => array(
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
'trials-before-failure' => 9,
|
'trials-before-display' => 9,
|
||||||
),
|
),
|
||||||
'providers' => array(
|
'providers' => array(
|
||||||
'facebook' => array(
|
'facebook' => array(
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Phraseanet
|
|
||||||
*
|
|
||||||
* (c) 2005-2013 Alchemy
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
|
||||||
|
|
||||||
require __DIR__ . "/../../vendor/autoload.php";
|
|
||||||
|
|
||||||
$app = new Application;
|
|
||||||
$output = '';
|
|
||||||
|
|
||||||
$request = http_request::getInstance();
|
|
||||||
$parm = $request->get_parms('action', 'city');
|
|
||||||
|
|
||||||
$action = $parm['action'];
|
|
||||||
|
|
||||||
switch ($action) {
|
|
||||||
case 'FIND':
|
|
||||||
$output = $app['twig']->render('geonames/city_list.html.twig', array('geonames' => $app['geonames']->find_city($parm['city'])));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo $output;
|
|
||||||
|
|
Reference in New Issue
Block a user