Add AuthenticationServiceProvider

This commit is contained in:
Romain Neutron
2013-02-15 11:08:05 +01:00
parent f5c5aebe22
commit d2bc4f4a23
117 changed files with 610 additions and 535 deletions

View File

@@ -29,13 +29,13 @@ class Lightbox implements ControllerProviderInterface
return; return;
} }
if ($app->isAuthenticated()) { if ($app['authentication']->isAuthenticated()) {
$app->closeAccount(); $app['authentication']->closeAccount();
} }
try { try {
$auth = new \Session_Authentication_Token($app, $request->query->get('LOG')); $auth = new \Session_Authentication_Token($app, $request->query->get('LOG'));
$app->openAccount($auth); $app['authentication']->openAccount($auth);
} catch (Exception $e) { } catch (Exception $e) {
return $app->redirect("/login/?error=" . urlencode($e->getMessage())); return $app->redirect("/login/?error=" . urlencode($e->getMessage()));
} }
@@ -72,8 +72,8 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$basket_collection = array_merge( $basket_collection = array_merge(
$repository->findActiveByUser($app['phraseanet.user']) $repository->findActiveByUser($app['authentication']->getUser())
, $repository->findActiveValidationByUser($app['phraseanet.user']) , $repository->findActiveValidationByUser($app['authentication']->getUser())
); );
$template = 'lightbox/index.html.twig'; $template = 'lightbox/index.html.twig';
@@ -97,7 +97,7 @@ class Lightbox implements ControllerProviderInterface
$basketElement = $app['EM'] $basketElement = $app['EM']
->getRepository('\Entities\BasketElement') ->getRepository('\Entities\BasketElement')
->findUserElement($sselcont_id, $app['phraseanet.user']); ->findUserElement($sselcont_id, $app['authentication']->getUser());
$parameters = array( $parameters = array(
'basket_element' => $basketElement, 'basket_element' => $basketElement,
@@ -111,7 +111,7 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketElementRepository */ /* @var $repository \Repositories\BasketElementRepository */
$repository = $app['EM']->getRepository('\Entities\BasketElement'); $repository = $app['EM']->getRepository('\Entities\BasketElement');
$BasketElement = $repository->findUserElement($sselcont_id, $app['phraseanet.user']); $BasketElement = $repository->findUserElement($sselcont_id, $app['authentication']->getUser());
if ($app['browser']->isMobile()) { if ($app['browser']->isMobile()) {
$output = $app['twig']->render('lightbox/basket_element.html.twig', array( $output = $app['twig']->render('lightbox/basket_element.html.twig', array(
@@ -199,12 +199,12 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$basket_collection = $repository->findActiveValidationAndBasketByUser( $basket_collection = $repository->findActiveValidationAndBasketByUser(
$app['phraseanet.user'] $app['authentication']->getUser()
); );
$basket = $repository->findUserBasket( $basket = $repository->findUserBasket(
$app, $ssel_id $app, $ssel_id
, $app['phraseanet.user'] , $app['authentication']->getUser()
, false , false
); );
@@ -214,9 +214,9 @@ class Lightbox implements ControllerProviderInterface
$app['EM']->flush(); $app['EM']->flush();
} }
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['phraseanet.user'], $app)->getIsAware() === false) { if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->getIsAware() === false) {
$basket = $app['EM']->merge($basket); $basket = $app['EM']->merge($basket);
$basket->getValidation()->getParticipant($app['phraseanet.user'], $app)->setIsAware(true); $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true);
$app['EM']->flush(); $app['EM']->flush();
} }
@@ -251,12 +251,12 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$basket_collection = $repository->findActiveValidationAndBasketByUser( $basket_collection = $repository->findActiveValidationAndBasketByUser(
$app['phraseanet.user'] $app['authentication']->getUser()
); );
$basket = $repository->findUserBasket( $basket = $repository->findUserBasket(
$app, $ssel_id $app, $ssel_id
, $app['phraseanet.user'] , $app['authentication']->getUser()
, false , false
); );
@@ -266,9 +266,9 @@ class Lightbox implements ControllerProviderInterface
$app['EM']->flush(); $app['EM']->flush();
} }
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['phraseanet.user'])->getIsAware() === false) { if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) {
$basket = $app['EM']->merge($basket); $basket = $app['EM']->merge($basket);
$basket->getValidation()->getParticipant($app['phraseanet.user'], $app)->setIsAware(true); $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true);
$app['EM']->flush(); $app['EM']->flush();
} }
@@ -334,7 +334,7 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$basket = $repository->findUserBasket( $basket = $repository->findUserBasket(
$app, $ssel_id $app, $ssel_id
, $app['phraseanet.user'] , $app['authentication']->getUser()
, false , false
); );
@@ -357,9 +357,9 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketElementRepository */ /* @var $repository \Repositories\BasketElementRepository */
$repository = $app['EM']->getRepository('\Entities\BasketElement'); $repository = $app['EM']->getRepository('\Entities\BasketElement');
$basket_element = $repository->findUserElement($sselcont_id, $app['phraseanet.user']); $basket_element = $repository->findUserElement($sselcont_id, $app['authentication']->getUser());
$validationDatas = $basket_element->getUserValidationDatas($app['phraseanet.user'], $app); $validationDatas = $basket_element->getUserValidationDatas($app['authentication']->getUser(), $app);
$validationDatas->setNote($note); $validationDatas->setNote($note);
@@ -405,14 +405,14 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketElementRepository */ /* @var $repository \Repositories\BasketElementRepository */
$basket_element = $repository->findUserElement( $basket_element = $repository->findUserElement(
$sselcont_id $sselcont_id
, $app['phraseanet.user'] , $app['authentication']->getUser()
); );
/* @var $basket_element \Entities\BasketElement */ /* @var $basket_element \Entities\BasketElement */
$validationDatas = $basket_element->getUserValidationDatas($app['phraseanet.user'], $app); $validationDatas = $basket_element->getUserValidationDatas($app['authentication']->getUser(), $app);
if (!$basket_element->getBasket() if (!$basket_element->getBasket()
->getValidation() ->getValidation()
->getParticipant($app['phraseanet.user'], $app)->getCanAgree()) { ->getParticipant($app['authentication']->getUser(), $app)->getCanAgree()) {
throw new ControllerException('You can not agree on this'); throw new ControllerException('You can not agree on this');
} }
@@ -420,7 +420,7 @@ class Lightbox implements ControllerProviderInterface
$participant = $basket_element->getBasket() $participant = $basket_element->getBasket()
->getValidation() ->getValidation()
->getParticipant($app['phraseanet.user'], $app); ->getParticipant($app['authentication']->getUser(), $app);
$app['EM']->merge($basket_element); $app['EM']->merge($basket_element);
@@ -453,7 +453,7 @@ class Lightbox implements ControllerProviderInterface
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$basket = $repository->findUserBasket( $basket = $repository->findUserBasket(
$app, $ssel_id $app, $ssel_id
, $app['phraseanet.user'] , $app['authentication']->getUser()
, false , false
); );
@@ -461,7 +461,7 @@ class Lightbox implements ControllerProviderInterface
throw new ControllerException('There is no validation session attached to this basket'); throw new ControllerException('There is no validation session attached to this basket');
} }
if (!$basket->getValidation()->getParticipant($app['phraseanet.user'], $app)->getCanAgree()) { if (!$basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->getCanAgree()) {
throw new ControllerException('You have not right to agree'); throw new ControllerException('You have not right to agree');
} }
@@ -478,7 +478,7 @@ class Lightbox implements ControllerProviderInterface
} }
/* @var $basket \Entities\Basket */ /* @var $basket \Entities\Basket */
$participant = $basket->getValidation()->getParticipant($app['phraseanet.user'], $app); $participant = $basket->getValidation()->getParticipant($app['authentication']->getUser(), $app);
$expires = new \DateTime('+10 days'); $expires = new \DateTime('+10 days');
$url = $app['phraseanet.registry']->get('GV_ServerName') $url = $app['phraseanet.registry']->get('GV_ServerName')
@@ -492,7 +492,7 @@ class Lightbox implements ControllerProviderInterface
$to = $basket->getValidation()->getInitiator($app)->get_id(); $to = $basket->getValidation()->getInitiator($app)->get_id();
$params = array( $params = array(
'ssel_id' => $basket->getId(), 'ssel_id' => $basket->getId(),
'from' => $app['phraseanet.user']->get_id(), 'from' => $app['authentication']->getUser()->get_id(),
'url' => $url, 'url' => $url,
'to' => $to 'to' => $to
); );

View File

@@ -32,10 +32,10 @@ return call_user_func(function($environment = null) {
}); });
$app->before(function(Request $request) use ($app) { $app->before(function(Request $request) use ($app) {
if ($request->cookies->has('persistent') && !$app->isAuthenticated()) { if ($request->cookies->has('persistent') && !$app['authentication']->isAuthenticated()) {
try { try {
$auth = new \Session_Authentication_PersistentCookie($app, $request->cookies->get('persistent')); $auth = new \Session_Authentication_PersistentCookie($app, $request->cookies->get('persistent'));
$app->openAccount($auth, $auth->getSessionId()); $app['authentication']->openAccount($auth, $auth->getSessionId());
} catch (\Exception $e) { } catch (\Exception $e) {
} }

View File

@@ -11,6 +11,12 @@
namespace Alchemy\Phrasea\Controller\Api; namespace Alchemy\Phrasea\Controller\Api;
use Alchemy\Phrasea\Authentication\Context;
use Alchemy\Phrasea\Application as PhraseaApplication;
use Alchemy\Phrasea\Authentication\Exception\AccountLockedException;
use Alchemy\Phrasea\Authentication\Exception\RequireCaptchaException;
use Alchemy\Phrasea\Core\Event\PreAuthenticate;
use Alchemy\Phrasea\Core\PhraseaEvents;
use Silex\Application; use Silex\Application;
use Silex\ControllerProviderInterface; use Silex\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@@ -37,6 +43,9 @@ class Oauth2 implements ControllerProviderInterface
$request = $app['request']; $request = $app['request'];
$oauth2_adapter = $app['oauth']; $oauth2_adapter = $app['oauth'];
$context = new Context(Context::CONTEXT_OAUTH2_NATIVE);
$app['dispatcher']->dispatch(PhraseaEvents::PRE_AUTHENTICATE, new PreAuthenticate($request, $context));
//Check for auth params, send error or redirect if not valid //Check for auth params, send error or redirect if not valid
$params = $oauth2_adapter->getAuthorizationRequestParameters($request); $params = $oauth2_adapter->getAuthorizationRequestParameters($request);
@@ -65,17 +74,23 @@ class Oauth2 implements ControllerProviderInterface
); );
} }
if (!$app->isAuthenticated()) { if (!$app['authentication']->isAuthenticated()) {
if ($action_login !== null) { if ($action_login !== null) {
try { try {
$auth = new \Session_Authentication_Native( $usr_id = $app['auth.native']->isValid($request->get("login"), $request->get("password"), $request);
$app, $request->get("login"), $request->get("password")
);
$app->openAccount($auth); if (!$usr_id) {
} catch (\Exception $e) { $app['session']->getFlashBag()->set('error', _('login::erreur: Erreur d\'authentification'));
return new Response($app['twig']->render($template, array("auth" => $oauth2_adapter)));
return $app->redirect($app->path('oauth2_authorize'));
}
} catch (RequireCaptchaException $e) {
return $app->redirect($app->path('oauth2_authorize'), array('error' => 'captcha'));
} catch (AccountLockedException $e) {
return $app->redirect($app->path('oauth2_authorize'), array('error' => 'account-locked'));
} }
$app['authentication']->openAccount(\User_Adapter::getInstance($usr_id, $app));
} else { } else {
return new Response($app['twig']->render($template, array("auth" => $oauth2_adapter))); return new Response($app['twig']->render($template, array("auth" => $oauth2_adapter)));
} }
@@ -84,7 +99,7 @@ class Oauth2 implements ControllerProviderInterface
//check if current client is already authorized by current user //check if current client is already authorized by current user
$user_auth_clients = \API_OAuth2_Application::load_authorized_app_by_user( $user_auth_clients = \API_OAuth2_Application::load_authorized_app_by_user(
$app $app
, $app['phraseanet.user'] , $app['authentication']->getUser()
); );
foreach ($user_auth_clients as $auth_client) { foreach ($user_auth_clients as $auth_client) {
@@ -93,7 +108,7 @@ class Oauth2 implements ControllerProviderInterface
} }
} }
$account = $oauth2_adapter->updateAccount($app['phraseanet.user']->get_id()); $account = $oauth2_adapter->updateAccount($app['authentication']->getUser()->get_id());
$params['account_id'] = $account->get_id(); $params['account_id'] = $account->get_id();
@@ -119,7 +134,9 @@ class Oauth2 implements ControllerProviderInterface
} }
}; };
$controllers->match('/authorize', $authorize_func)->method('GET|POST'); $controllers->match('/authorize', $authorize_func)
->method('GET|POST')
->bind('oauth2_authorize');
/** /**
* TOKEN ENDPOINT * TOKEN ENDPOINT
@@ -130,7 +147,7 @@ class Oauth2 implements ControllerProviderInterface
throw new HttpException(400, 'This route requires the use of the https scheme', null, array('content-type' => 'application/json')); throw new HttpException(400, 'This route requires the use of the https scheme', null, array('content-type' => 'application/json'));
} }
$app['oauth']->grantAccessToken(); $app['oauth']->grantAccessToken($request);
ob_flush(); ob_flush();
flush(); flush();

View File

@@ -13,6 +13,8 @@ namespace Alchemy\Phrasea\Controller\Api;
use Silex\ControllerProviderInterface; use Silex\ControllerProviderInterface;
use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Authentication\Context;
use Alchemy\Phrasea\Core\Event\PreAuthenticate;
use Alchemy\Phrasea\Core\Event\ApiOAuth2StartEvent; use Alchemy\Phrasea\Core\Event\ApiOAuth2StartEvent;
use Alchemy\Phrasea\Core\Event\ApiOAuth2EndEvent; use Alchemy\Phrasea\Core\Event\ApiOAuth2EndEvent;
use Silex\Application as SilexApplication; use Silex\Application as SilexApplication;
@@ -49,6 +51,9 @@ class V1 implements ControllerProviderInterface
* @ throws \API_V1_exception_forbidden * @ throws \API_V1_exception_forbidden
*/ */
$controllers->before(function($request) use ($app) { $controllers->before(function($request) use ($app) {
$context = new Context(Context::CONTEXT_OAUTH2_TOKEN);
$app['dispatcher']->dispatch(PhraseaEvents::PRE_AUTHENTICATE, new PreAuthenticate($request, $context));
$app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_START, new ApiOAuth2StartEvent()); $app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_START, new ApiOAuth2StartEvent());
$oauth2_adapter = new \API_OAuth2_Adapter($app); $oauth2_adapter = new \API_OAuth2_Adapter($app);
$oauth2_adapter->verifyAccessToken(); $oauth2_adapter->verifyAccessToken();
@@ -63,16 +68,15 @@ class V1 implements ControllerProviderInterface
throw new \API_V1_exception_forbidden(_('The use of phraseanet Navigator is not allowed')); throw new \API_V1_exception_forbidden(_('The use of phraseanet Navigator is not allowed'));
} }
if ($app->isAuthenticated()) { if ($app['authentication']->isAuthenticated()) {
$app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_END, new ApiOAuth2EndEvent()); $app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_END, new ApiOAuth2EndEvent());
return; return;
} }
$user = \User_Adapter::getInstance($oauth2_adapter->get_usr_id(), $app); $user = \User_Adapter::getInstance($oauth2_adapter->get_usr_id(), $app);
$auth = new \Session_Authentication_None($user);
$app->openAccount($auth, $oauth2_adapter->get_ses_id()); $app['authentication']->openAccount($user);
$oauth2_adapter->remember_this_ses_id($app['session']->get('session_id')); $oauth2_adapter->remember_this_ses_id($app['session']->get('session_id'));
$app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_END, new ApiOAuth2EndEvent()); $app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_END, new ApiOAuth2EndEvent());
@@ -646,19 +650,19 @@ class V1 implements ControllerProviderInterface
*/ */
$controllers->get('/feeds/list/', function(SilexApplication $app) { $controllers->get('/feeds/list/', function(SilexApplication $app) {
return $app['api'] return $app['api']
->search_publications($app['request'], $app['phraseanet.user']) ->search_publications($app['request'], $app['authentication']->getUser())
->get_response(); ->get_response();
}); });
$controllers->get('/feeds/content/', function(SilexApplication $app) { $controllers->get('/feeds/content/', function(SilexApplication $app) {
return $app['api'] return $app['api']
->get_publications($app['request'], $app['phraseanet.user']) ->get_publications($app['request'], $app['authentication']->getUser())
->get_response(); ->get_response();
}); });
$controllers->get('/feeds/entry/{entry_id}/', function(SilexApplication $app, $entry_id) { $controllers->get('/feeds/entry/{entry_id}/', function(SilexApplication $app, $entry_id) {
return $app['api'] return $app['api']
->get_feed_entry($app['request'], $entry_id, $app['phraseanet.user']) ->get_feed_entry($app['request'], $entry_id, $app['authentication']->getUser())
->get_response(); ->get_response();
})->assert('entry_id', '\d+'); })->assert('entry_id', '\d+');
@@ -675,7 +679,7 @@ class V1 implements ControllerProviderInterface
*/ */
$controllers->get('/feeds/{feed_id}/content/', function(SilexApplication $app, $feed_id) { $controllers->get('/feeds/{feed_id}/content/', function(SilexApplication $app, $feed_id) {
return $app['api'] return $app['api']
->get_publication($app['request'], $feed_id, $app['phraseanet.user']) ->get_publication($app['request'], $feed_id, $app['authentication']->getUser())
->get_response(); ->get_response();
})->assert('feed_id', '\d+'); })->assert('feed_id', '\d+');

View File

@@ -14,6 +14,10 @@ namespace Alchemy\Phrasea\Core;
final class PhraseaEvents final class PhraseaEvents
{ {
const LOGOUT = 'phrasea.logout'; const LOGOUT = 'phrasea.logout';
const PRE_AUTHENTICATE = 'phrasea.pre-authenticate';
const POST_AUTHENTICATE = 'phrasea.post-authenticate';
const API_OAUTH2_START = 'api.oauth2.start'; const API_OAUTH2_START = 'api.oauth2.start';
const API_OAUTH2_END = 'api.oauth2.end'; const API_OAUTH2_END = 'api.oauth2.end';
const API_LOAD_START = 'api.load.start'; const API_LOAD_START = 'api.load.start';

View File

@@ -29,13 +29,13 @@ class Prod extends Helper
$bases = $fields = $dates = array(); $bases = $fields = $dates = array();
if (! $this->app['phraseanet.user'] instanceof \User_Adapter) { if (! $this->app['authentication']->getUser() instanceof \User_Adapter) {
return $search_datas; return $search_datas;
} }
$searchSet = json_decode($this->app['phraseanet.user']->getPrefs('search'), true); $searchSet = json_decode($this->app['authentication']->getUser()->getPrefs('search'), true);
foreach ($this->app['phraseanet.user']->ACL()->get_granted_sbas() as $databox) { foreach ($this->app['authentication']->getUser()->ACL()->get_granted_sbas() as $databox) {
$sbas_id = $databox->get_sbas_id(); $sbas_id = $databox->get_sbas_id();
$bases[$sbas_id] = array( $bases[$sbas_id] = array(
@@ -45,7 +45,7 @@ class Prod extends Helper
'sbas_id' => $sbas_id 'sbas_id' => $sbas_id
); );
foreach ($this->app['phraseanet.user']->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll) { foreach ($this->app['authentication']->getUser()->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll) {
$selected = (isset($searchSet['bases']) && $selected = (isset($searchSet['bases']) &&
isset($searchSet['bases'][$sbas_id])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbas_id])) : true; isset($searchSet['bases'][$sbas_id])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbas_id])) : true;
$bases[$sbas_id]['collections'][] = $bases[$sbas_id]['collections'][] =
@@ -83,7 +83,7 @@ class Prod extends Helper
if (! $bases[$sbas_id]['thesaurus']) { if (! $bases[$sbas_id]['thesaurus']) {
continue; continue;
} }
if ( ! $this->app['phraseanet.user']->ACL()->has_right_on_sbas($sbas_id, 'bas_modif_th')) { if ( ! $this->app['authentication']->getUser()->ACL()->has_right_on_sbas($sbas_id, 'bas_modif_th')) {
continue; continue;
} }

View File

@@ -116,7 +116,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
$repository = $app['EM']->getRepository('\Entities\Basket'); $repository = $app['EM']->getRepository('\Entities\Basket');
/* @var $$repository \Repositories\BasketRepository */ /* @var $$repository \Repositories\BasketRepository */
$Basket = $repository->findUserBasket($this->app, $Request->get('ssel'), $app['phraseanet.user'], false); $Basket = $repository->findUserBasket($this->app, $Request->get('ssel'), $app['authentication']->getUser(), false);
$this->selection->load_basket($Basket); $this->selection->load_basket($Basket);
@@ -125,7 +125,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
} elseif (trim($Request->get('story')) !== '') { } elseif (trim($Request->get('story')) !== '') {
$repository = $app['EM']->getRepository('\Entities\StoryWZ'); $repository = $app['EM']->getRepository('\Entities\StoryWZ');
$storyWZ = $repository->findByUserAndId($app, $app['phraseanet.user'], $Request->get('story')); $storyWZ = $repository->findByUserAndId($app, $app['authentication']->getUser(), $Request->get('story'));
$this->selection->load_list(array($storyWZ->getRecord($this->app)->get_serialize_key()), $this->flatten_groupings); $this->selection->load_list(array($storyWZ->getRecord($this->app)->get_serialize_key()), $this->flatten_groupings);
} else { } else {

View File

@@ -73,7 +73,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
protected function delete_user(\User_Adapter $user) protected function delete_user(\User_Adapter $user)
{ {
$list = array_keys($this->app['phraseanet.user']->ACL()->get_granted_base(array('canadmin'))); $list = array_keys($this->app['authentication']->getUser()->ACL()->get_granted_base(array('canadmin')));
$user->ACL()->revoke_access_from_bases($list); $user->ACL()->revoke_access_from_bases($list);
@@ -86,7 +86,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
public function get_users_rights() public function get_users_rights()
{ {
$list = array_keys($this->app['phraseanet.user']->ACL()->get_granted_base(array('canadmin'))); $list = array_keys($this->app['authentication']->getUser()->ACL()->get_granted_base(array('canadmin')));
$sql = "SELECT $sql = "SELECT
b.sbas_id, b.sbas_id,
@@ -366,7 +366,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
public function apply_rights() public function apply_rights()
{ {
$request = \http_request::getInstance(); $request = \http_request::getInstance();
$ACL = $this->app['phraseanet.user']->ACL(); $ACL = $this->app['authentication']->getUser()->ACL();
$base_ids = array_keys($ACL->get_granted_base(array('canadmin'))); $base_ids = array_keys($ACL->get_granted_base(array('canadmin')));
$update = $create = $delete = $create_sbas = $update_sbas = array(); $update = $create = $delete = $create_sbas = $update_sbas = array();
@@ -570,11 +570,11 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
{ {
$template = \User_adapter::getInstance($this->request->get('template'), $this->app); $template = \User_adapter::getInstance($this->request->get('template'), $this->app);
if ($template->get_template_owner()->get_id() != $this->app['phraseanet.user']->get_id()) { if ($template->get_template_owner()->get_id() != $this->app['authentication']->getUser()->get_id()) {
throw new \Exception_Forbidden('You are not the owner of the template'); throw new \Exception_Forbidden('You are not the owner of the template');
} }
$base_ids = array_keys($this->app['phraseanet.user']->ACL()->get_granted_base(array('canadmin'))); $base_ids = array_keys($this->app['authentication']->getUser()->ACL()->get_granted_base(array('canadmin')));
foreach ($this->users as $usr_id) { foreach ($this->users as $usr_id) {
$user = \User_adapter::getInstance($usr_id, $this->app); $user = \User_adapter::getInstance($usr_id, $this->app);
@@ -642,7 +642,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
public function resetRights() public function resetRights()
{ {
$base_ids = array_keys($this->app['phraseanet.user']->ACL()->get_granted_base(array('canadmin'))); $base_ids = array_keys($this->app['authentication']->getUser()->ACL()->get_granted_base(array('canadmin')));
foreach ($this->users as $usr_id) { foreach ($this->users as $usr_id) {
$user = \User_Adapter::getInstance($usr_id, $this->app); $user = \User_Adapter::getInstance($usr_id, $this->app);
@@ -651,7 +651,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
if ($user->is_template()) { if ($user->is_template()) {
$template = $user; $template = $user;
if ($template->get_template_owner()->get_id() !== $this->app['phraseanet.user']->get_id()) { if ($template->get_template_owner()->get_id() !== $this->app['authentication']->getUser()->get_id()) {
continue; continue;
} }
} }

View File

@@ -71,7 +71,7 @@ class Manage extends Helper
->like($this->query_parms['like_field'], $this->query_parms['like_value']) ->like($this->query_parms['like_field'], $this->query_parms['like_value'])
->get_inactives($this->query_parms['inactives']) ->get_inactives($this->query_parms['inactives'])
->include_templates(false) ->include_templates(false)
->on_bases_where_i_am($this->app['phraseanet.user']->ACL(), array('canadmin')) ->on_bases_where_i_am($this->app['authentication']->getUser()->ACL(), array('canadmin'))
->execute(); ->execute();
return $this->results->get_results(); return $this->results->get_results();
@@ -109,7 +109,7 @@ class Manage extends Helper
->like($this->query_parms['like_field'], $this->query_parms['like_value']) ->like($this->query_parms['like_field'], $this->query_parms['like_value'])
->get_inactives($this->query_parms['inactives']) ->get_inactives($this->query_parms['inactives'])
->include_templates(true) ->include_templates(true)
->on_bases_where_i_am($this->app['phraseanet.user']->ACL(), array('canadmin')) ->on_bases_where_i_am($this->app['authentication']->getUser()->ACL(), array('canadmin'))
->limit($offset_start, $results_quantity) ->limit($offset_start, $results_quantity)
->execute(); ->execute();
@@ -218,8 +218,8 @@ class Manage extends Helper
} }
$created_user = \User_Adapter::create($this->app, $name, \random::generatePassword(16), null, false, false); $created_user = \User_Adapter::create($this->app, $name, \random::generatePassword(16), null, false, false);
$created_user->set_template($this->app['phraseanet.user']); $created_user->set_template($this->app['authentication']->getUser());
$this->usr_id = $this->app['phraseanet.user']->get_id(); $this->usr_id = $this->app['authentication']->getUser()->get_id();
return $created_user; return $created_user;
} }

View File

@@ -45,13 +45,13 @@ class WorkZone extends Helper
$ret = new \Doctrine\Common\Collections\ArrayCollection(); $ret = new \Doctrine\Common\Collections\ArrayCollection();
$baskets = $repo_baskets->findActiveByUser($this->app['phraseanet.user'], $sort); $baskets = $repo_baskets->findActiveByUser($this->app['authentication']->getUser(), $sort);
$validations = $repo_baskets->findActiveValidationByUser($this->app['phraseanet.user'], $sort); $validations = $repo_baskets->findActiveValidationByUser($this->app['authentication']->getUser(), $sort);
/* @var $repo_stories \Doctrine\Repositories\StoryWZRepository */ /* @var $repo_stories \Doctrine\Repositories\StoryWZRepository */
$repo_stories = $this->app['EM']->getRepository('Entities\StoryWZ'); $repo_stories = $this->app['EM']->getRepository('Entities\StoryWZ');
$stories = $repo_stories->findByUser($this->app, $this->app['phraseanet.user'], $sort); $stories = $repo_stories->findByUser($this->app, $this->app['authentication']->getUser(), $sort);
$ret->set(self::BASKETS, $baskets); $ret->set(self::BASKETS, $baskets);
$ret->set(self::VALIDATIONS, $validations); $ret->set(self::VALIDATIONS, $validations);

View File

@@ -166,7 +166,7 @@ class PDF
$fimg = $subdef->get_pathfile(); $fimg = $subdef->get_pathfile();
if (!$this->app['phraseanet.user']->ACL()->has_right_on_base($rec->get_base_id(), "nowatermark") if (!$this->app['authentication']->getUser()->ACL()->has_right_on_base($rec->get_base_id(), "nowatermark")
&& $subdef->get_type() == \media_subdef::TYPE_IMAGE) { && $subdef->get_type() == \media_subdef::TYPE_IMAGE) {
$fimg = \recordutils_image::watermark($this->app, $subdef); $fimg = \recordutils_image::watermark($this->app, $subdef);
} }
@@ -430,7 +430,7 @@ class PDF
$f = $subdef->get_pathfile(); $f = $subdef->get_pathfile();
if (!$this->app['phraseanet.user']->ACL()->has_right_on_base($rec->get_base_id(), "nowatermark") if (!$this->app['authentication']->getUser()->ACL()->has_right_on_base($rec->get_base_id(), "nowatermark")
&& $subdef->get_type() == \media_subdef::TYPE_IMAGE) && $subdef->get_type() == \media_subdef::TYPE_IMAGE)
$f = \recordutils_image::watermark($this->app, $subdef); $f = \recordutils_image::watermark($this->app, $subdef);

View File

@@ -184,12 +184,12 @@ class PhraseaEngine implements SearchEngineInterface
*/ */
private function checkSession() private function checkSession()
{ {
if (!$this->app['phraseanet.user']) { if (!$this->app['authentication']->getUser()) {
throw new \RuntimeException('Phrasea currently support only authenticated queries'); throw new \RuntimeException('Phrasea currently support only authenticated queries');
} }
if (!phrasea_open_session($this->app['session']->get('phrasea_session_id'), $this->app['phraseanet.user']->get_id())) { if (!phrasea_open_session($this->app['session']->get('phrasea_session_id'), $this->app['authentication']->getUser()->get_id())) {
if (!$ses_id = phrasea_create_session((string) $this->app['phraseanet.user']->get_id())) { if (!$ses_id = phrasea_create_session((string) $this->app['authentication']->getUser()->get_id())) {
throw new \Exception_InternalServerError('Unable to create phrasea session'); throw new \Exception_InternalServerError('Unable to create phrasea session');
} }
$this->app['session']->set('phrasea_session_id', $ses_id); $this->app['session']->set('phrasea_session_id', $ses_id);
@@ -557,7 +557,7 @@ class PhraseaEngine implements SearchEngineInterface
$stmt->execute($params); $stmt->execute($params);
$stmt->closeCursor(); $stmt->closeCursor();
if ($this->app['phraseanet.user']) { if ($this->app['authentication']->getUser()) {
\User_Adapter::saveQuery($this->app, $query); \User_Adapter::saveQuery($this->app, $query);
} }

View File

@@ -623,15 +623,15 @@ class SearchEngineOptions
$bas = array_map(function($base_id) use ($app) { $bas = array_map(function($base_id) use ($app) {
return \collection::get_from_base_id($app, $base_id); return \collection::get_from_base_id($app, $base_id);
}, $request->get('bases')); }, $request->get('bases'));
} elseif (!$app->isAuthenticated()) { } elseif (!$app['authentication']->isAuthenticated()) {
$bas = $app->getOpenCollections(); $bas = $app->getOpenCollections();
} else { } else {
$bas = $app['phraseanet.user']->ACL()->get_granted_base(); $bas = $app['authentication']->getUser()->ACL()->get_granted_base();
} }
$bas = array_filter($bas, function($collection) use ($app) { $bas = array_filter($bas, function($collection) use ($app) {
if ($app->isAuthenticated()) { if ($app['authentication']->isAuthenticated()) {
return $app['phraseanet.user']->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord'); return $app['authentication']->getUser()->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord');
} else { } else {
return in_array($collection, $app->getOpenCollections()); return in_array($collection, $app->getOpenCollections());
} }
@@ -645,9 +645,9 @@ class SearchEngineOptions
} }
} }
if ($app->isAuthenticated() && $app['phraseanet.user']->ACL()->has_right('modifyrecord')) { if ($app['authentication']->isAuthenticated() && $app['authentication']->getUser()->ACL()->has_right('modifyrecord')) {
$BF = array_filter($bas, function($collection) use ($app) { $BF = array_filter($bas, function($collection) use ($app) {
return $app['phraseanet.user']->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord'); return $app['authentication']->getUser()->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord');
}); });
$options->allowBusinessFieldsOn($BF); $options->allowBusinessFieldsOn($BF);

View File

@@ -26,7 +26,7 @@ class Firewall
{ {
$this->requireNotGuest(); $this->requireNotGuest();
if (!$this->app['phraseanet.user']->ACL()->is_admin()) { if (!$this->app['authentication']->getUser()->ACL()->is_admin()) {
$this->app->abort(403, 'Admin role is required'); $this->app->abort(403, 'Admin role is required');
} }
@@ -37,7 +37,7 @@ class Firewall
{ {
$this->requireAuthentication(); $this->requireAuthentication();
if (!$this->app['phraseanet.user']->ACL()->has_access_to_module($module)) { if (!$this->app['authentication']->getUser()->ACL()->has_access_to_module($module)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -48,7 +48,7 @@ class Firewall
{ {
$this->requireAuthentication(); $this->requireAuthentication();
if (!$this->app['phraseanet.user']->ACL()->has_access_to_sbas($sbas_id)) { if (!$this->app['authentication']->getUser()->ACL()->has_access_to_sbas($sbas_id)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -59,7 +59,7 @@ class Firewall
{ {
$this->requireAuthentication(); $this->requireAuthentication();
if (!$this->app['phraseanet.user']->ACL()->has_access_to_base($base_id)) { if (!$this->app['authentication']->getUser()->ACL()->has_access_to_base($base_id)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -70,7 +70,7 @@ class Firewall
{ {
$this->requireAuthentication(); $this->requireAuthentication();
if (!$this->app['phraseanet.user']->ACL()->has_right($right)) { if (!$this->app['authentication']->getUser()->ACL()->has_right($right)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -81,7 +81,7 @@ class Firewall
{ {
$this->requireAuthentication(); $this->requireAuthentication();
if (!$this->app['phraseanet.user']->ACL()->has_right_on_base($base_id, $right)) { if (!$this->app['authentication']->getUser()->ACL()->has_right_on_base($base_id, $right)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -92,7 +92,7 @@ class Firewall
{ {
$this->requireAuthentication(); $this->requireAuthentication();
if (!$this->app['phraseanet.user']->ACL()->has_right_on_sbas($sbas_id, $right)) { if (!$this->app['authentication']->getUser()->ACL()->has_right_on_sbas($sbas_id, $right)) {
$this->app->abort(403, 'You do not have required rights'); $this->app->abort(403, 'You do not have required rights');
} }
@@ -103,7 +103,7 @@ class Firewall
{ {
$this->requireAuthentication(); $this->requireAuthentication();
if ($this->app['phraseanet.user']->is_guest()) { if ($this->app['authentication']->getUser()->is_guest()) {
$this->app->abort(403, 'Guests do not have admin role'); $this->app->abort(403, 'Guests do not have admin role');
} }
@@ -112,7 +112,7 @@ class Firewall
public function requireAuthentication() public function requireAuthentication()
{ {
if (!$this->app->isAuthenticated()) { if (!$this->app['authentication']->isAuthenticated()) {
$this->app->abort(302, 'You are not authenticated', array('X-Phraseanet-Redirect' => '/login/')); $this->app->abort(302, 'You are not authenticated', array('X-Phraseanet-Redirect' => '/login/'));
} }
@@ -121,7 +121,7 @@ class Firewall
public function requireNotAuthenticated() public function requireNotAuthenticated()
{ {
if ($this->app->isAuthenticated()) { if ($this->app['authentication']->isAuthenticated()) {
$this->app->abort(302, 'You are authenticated', array('X-Phraseanet-Redirect' => '/prod/')); $this->app->abort(302, 'You are authenticated', array('X-Phraseanet-Redirect' => '/prod/'));
} }
@@ -130,7 +130,7 @@ class Firewall
public function requireOrdersAdmin() public function requireOrdersAdmin()
{ {
if (false === !!count($this->app['phraseanet.user']->ACL()->get_granted_base(array('order_master')))) { if (false === !!count($this->app['authentication']->getUser()->ACL()->get_granted_base(array('order_master')))) {
$this->app->abort(403, 'You are not an order admin'); $this->app->abort(403, 'You are not an order admin');
} }

View File

@@ -76,7 +76,7 @@ class Installer
{ {
$template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml'); $template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml');
$databox = \databox::create($this->app, $dbConn, $template, $this->app['phraseanet.registry']); $databox = \databox::create($this->app, $dbConn, $template, $this->app['phraseanet.registry']);
$this->app['phraseanet.user']->ACL() $this->app['authentication']->getUser()->ACL()
->give_access_to_sbas(array($databox->get_sbas_id())) ->give_access_to_sbas(array($databox->get_sbas_id()))
->update_rights_to_sbas( ->update_rights_to_sbas(
$databox->get_sbas_id(), array( $databox->get_sbas_id(), array(
@@ -85,10 +85,10 @@ class Installer
) )
); );
$collection = \collection::create($this->app, $databox, $this->app['phraseanet.appbox'], 'test', $this->app['phraseanet.user']); $collection = \collection::create($this->app, $databox, $this->app['phraseanet.appbox'], 'test', $this->app['authentication']->getUser());
$this->app['phraseanet.user']->ACL()->give_access_to_base(array($collection->get_base_id())); $this->app['authentication']->getUser()->ACL()->give_access_to_base(array($collection->get_base_id()));
$this->app['phraseanet.user']->ACL()->update_rights_to_base($collection->get_base_id(), array( $this->app['authentication']->getUser()->ACL()->update_rights_to_base($collection->get_base_id(), array(
'canpush' => 1, 'cancmd' => 1 'canpush' => 1, 'cancmd' => 1
, 'canputinalbum' => 1, 'candwnldhd' => 1, 'candwnldpreview' => 1, 'canadmin' => 1 , 'canputinalbum' => 1, 'candwnldhd' => 1, 'candwnldpreview' => 1, 'canadmin' => 1
, 'actif' => 1, 'canreport' => 1, 'canaddrecord' => 1, 'canmodifrecord' => 1 , 'actif' => 1, 'canreport' => 1, 'canaddrecord' => 1, 'canmodifrecord' => 1

View File

@@ -33,7 +33,7 @@
<h1 id="namePhr">{{home_title}}</h1> <h1 id="namePhr">{{home_title}}</h1>
</div> </div>
{% if not app.isAuthenticated() %} {% if not app['authentication'].isAuthenticated() %}
<div id="content-box" class="span6 offset3"> <div id="content-box" class="span6 offset3">
<form id="login-form" class="form-vertical" method="post"> <form id="login-form" class="form-vertical" method="post">
{% for key,value in auth.getParams %} {% for key,value in auth.getParams %}
@@ -56,8 +56,8 @@
</p> </p>
</div> </div>
{% else %} {% else %}
{% if app['phraseanet.user'] is not none %} {% if app['authentication'].getUser() is not none %}
{% set username = '<b>' ~ app['phraseanet.user'].get_display_name() ~ '</b>' %} {% set username = '<b>' ~ app['authentication'].getUser().get_display_name() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans %} {% trans %}

View File

@@ -37,8 +37,8 @@
<h1 id="namePhr">{{ app['phraseanet.registry'].get('GV_homeTitle') }}</h1> <h1 id="namePhr">{{ app['phraseanet.registry'].get('GV_homeTitle') }}</h1>
</div> </div>
{% if app['phraseanet.user'] is not none %} {% if app['authentication'].getUser() is not none %}
{% set username = '<b>' ~ app['phraseanet.user'].get_display_name() ~ '</b>' %} {% set username = '<b>' ~ app['authentication'].getUser().get_display_name() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans %} {% trans %}

View File

@@ -21,12 +21,12 @@
<div data-role="content"> <div data-role="content">
{{ thumbnail.format100percent(record.get_preview(),'', record.get_thumbnail()) }} {{ thumbnail.format100percent(record.get_preview(),'', record.get_thumbnail()) }}
{% if basket_element.getBasket().getValidation() %} {% if basket_element.getBasket().getValidation() %}
{% if basket_element.getBasket().getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %} {% if basket_element.getBasket().getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
<fieldset data-role="controlgroup" data-type="horizontal" style="text-align:center;"> <fieldset data-role="controlgroup" data-type="horizontal" style="text-align:center;">
<input {% if basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == true%}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-yes_{{basket_element.getId()}}" value="yes" /> <input {% if basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == true%}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-yes_{{basket_element.getId()}}" value="yes" />
<label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-yes_{{basket_element.getId()}}">{% trans 'validation:: OUI' %}</label> <label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-yes_{{basket_element.getId()}}">{% trans 'validation:: OUI' %}</label>
<input {% if basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == false and basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is not null %}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-no_{{basket_element.getId()}}" value="no" /> <input {% if basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == false and basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() is not null %}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-no_{{basket_element.getId()}}" value="no" />
<label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-no_{{basket_element.getId()}}">{% trans 'validation:: NON' %}</label> <label class="agreement_radio" style="width:130px;text-align:center;" for="radio-view-no_{{basket_element.getId()}}">{% trans 'validation:: NON' %}</label>
</fieldset> </fieldset>
{% endif %} {% endif %}

View File

@@ -19,7 +19,7 @@
<form action=""> <form action="">
<textarea class="note_area" <textarea class="note_area"
id="note_area_{{basket_element.getId()}}" id="note_area_{{basket_element.getId()}}"
{% if basket_element.getUserValidationDatas(app['phraseanet.user'], app).getNote() == '' %}placeholder="Note"{% endif %}>{{basket_element.getUserValidationDatas(app['phraseanet.user'], app).getNote()}}</textarea> {% if basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getNote() == '' %}placeholder="Note"{% endif %}>{{basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getNote()}}</textarea>
<button type="submit" class="note_area_validate">{% trans 'boutton::valider' %}</button> <button type="submit" class="note_area_validate">{% trans 'boutton::valider' %}</button>
<input name="sselcont_id" value="{{basket_element.getId()}}" type="hidden"/> <input name="sselcont_id" value="{{basket_element.getId()}}" type="hidden"/>
</form> </form>

View File

@@ -1,5 +1,5 @@
{% for validationDatas in basket_element.getValidationDatas() %} {% for validationDatas in basket_element.getValidationDatas() %}
{% set is_mine = validationDatas.getParticipant().getUser(app).get_id() == app['phraseanet.user'].get_id() %} {% set is_mine = validationDatas.getParticipant().getUser(app).get_id() == app['authentication'].getUser().get_id() %}
{% if validationDatas.getNote() != '' or (validationDatas.getAgreement() is not null and is_mine) %} {% if validationDatas.getNote() != '' or (validationDatas.getAgreement() is not null and is_mine) %}
<li> <li>
<h3 style="text-align:left;"> <h3 style="text-align:left;">

View File

@@ -24,8 +24,8 @@
<ul class="image_set"> <ul class="image_set">
{% for basket_element in basket.getElements() %} {% for basket_element in basket.getElements() %}
<li class="image_box" id="sselcontid_{{basket_element.getId()}}"> <li class="image_box" id="sselcontid_{{basket_element.getId()}}">
{% if basket_element.getBasket().getValidation() and basket_element.getBasket().getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %} {% if basket_element.getBasket().getValidation() and basket_element.getBasket().getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
<div class="valid_choice valid_choice_{{basket_element.getId()}} {% if basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == true %}agree{% elseif basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == false and basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is not null %}disagree{% endif %}"> <div class="valid_choice valid_choice_{{basket_element.getId()}} {% if basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == true %}agree{% elseif basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == false and basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() is not null %}disagree{% endif %}">
</div> </div>
{% endif %} {% endif %}
<a href="/lightbox/ajax/LOAD_BASKET_ELEMENT/{{basket_element.getId()}}/"> <a href="/lightbox/ajax/LOAD_BASKET_ELEMENT/{{basket_element.getId()}}/">

View File

@@ -31,7 +31,7 @@
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label> <label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<div class="controls"> <div class="controls">
<p>{{ app['phraseanet.user'].get_login() }}</p> <p>{{ app['authentication'].getUser().get_login() }}</p>
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
@@ -39,13 +39,13 @@
<label class="form_label control-label" for="form_gender">{% trans 'admin::compte-utilisateur sexe' %}</label> <label class="form_label control-label" for="form_gender">{% trans 'admin::compte-utilisateur sexe' %}</label>
<div class="controls"> <div class="controls">
<select> <select>
<option {% if app['phraseanet.user'].get_gender() == "0" %}selected{% endif %} value="0" > <option {% if app['authentication'].getUser().get_gender() == "0" %}selected{% endif %} value="0" >
{% trans 'admin::compte-utilisateur:sexe: mademoiselle' %} {% trans 'admin::compte-utilisateur:sexe: mademoiselle' %}
</option> </option>
<option {% if app['phraseanet.user'].get_gender() == "1" %}selected{% endif %} value="1" > <option {% if app['authentication'].getUser().get_gender() == "1" %}selected{% endif %} value="1" >
{% trans 'admin::compte-utilisateur:sexe: madame' %} {% trans 'admin::compte-utilisateur:sexe: madame' %}
</option> </option>
<option {% if app['phraseanet.user'].get_gender() == "2" %}selected{% endif %} value="2" > <option {% if app['authentication'].getUser().get_gender() == "2" %}selected{% endif %} value="2" >
{% trans 'admin::compte-utilisateur:sexe: monsieur' %} {% trans 'admin::compte-utilisateur:sexe: monsieur' %}
</option> </option>
</select> </select>
@@ -55,42 +55,42 @@
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_lastname">{% trans 'admin::compte-utilisateur nom' %}</label> <label class="form_label control-label" for="form_lastname">{% trans 'admin::compte-utilisateur nom' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_lastname" id="form_lastname" value="{{ app['phraseanet.user'].get_lastname() }}" /> <input class="input_element" type="text" name="form_lastname" id="form_lastname" value="{{ app['authentication'].getUser().get_lastname() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label> <label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_firstname" id="form_firstname" value="{{ app['phraseanet.user'].get_firstname() }}" /> <input class="input_element" type="text" name="form_firstname" id="form_firstname" value="{{ app['authentication'].getUser().get_firstname() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur email' %}</label> <label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur email' %}</label>
<div class="controls"> <div class="controls">
<p>{{ app['phraseanet.user'].get_email() }} <a href="/account/reset-email/" target="_self">{% trans 'login:: Changer mon adresse email' %}</a></p> <p>{{ app['authentication'].getUser().get_email() }} <a href="/account/reset-email/" target="_self">{% trans 'login:: Changer mon adresse email' %}</a></p>
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_address">{% trans 'admin::compte-utilisateur adresse' %}</label> <label class="form_label control-label" for="form_address">{% trans 'admin::compte-utilisateur adresse' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_address" id="form_address" value="{{ app['phraseanet.user'].get_address() }}" /> <input class="input_element" type="text" name="form_address" id="form_address" value="{{ app['authentication'].getUser().get_address() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_zip">{% trans 'admin::compte-utilisateur code postal' %}</label> <label class="form_label control-label" for="form_zip">{% trans 'admin::compte-utilisateur code postal' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_zip" id="form_zip" value="{{ app['phraseanet.user'].get_zipcode() }}" /> <input class="input_element" type="text" name="form_zip" id="form_zip" value="{{ app['authentication'].getUser().get_zipcode() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_city">{% trans 'admin::compte-utilisateur ville' %}</label> <label class="form_label control-label" for="form_city">{% trans 'admin::compte-utilisateur ville' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element geoname_field" type="text" name="form_geonameid" id="form_geonameid" geonameid="{{ app['phraseanet.user'].get_geonameid() }}" value="{{ app['geonames'].name_from_id(app['phraseanet.user'].get_geonameid()) }}" /> <input class="input_element geoname_field" type="text" name="form_geonameid" id="form_geonameid" geonameid="{{ app['authentication'].getUser().get_geonameid() }}" value="{{ app['geonames'].name_from_id(app['authentication'].getUser().get_geonameid()) }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
@@ -104,35 +104,35 @@
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_function">{% trans 'admin::compte-utilisateur poste' %}</label> <label class="form_label control-label" for="form_function">{% trans 'admin::compte-utilisateur poste' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_function" id="form_function" value="{{ app['phraseanet.user'].get_position() }}" /> <input class="input_element" type="text" name="form_function" id="form_function" value="{{ app['authentication'].getUser().get_position() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_company">{% trans 'admin::compte-utilisateur societe' %}</label> <label class="form_label control-label" for="form_company">{% trans 'admin::compte-utilisateur societe' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_company" id="form_company" value="{{ app['phraseanet.user'].get_company() }}" /> <input class="input_element" type="text" name="form_company" id="form_company" value="{{ app['authentication'].getUser().get_company() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_activity">{% trans 'admin::compte-utilisateur activite' %}</label> <label class="form_label control-label" for="form_activity">{% trans 'admin::compte-utilisateur activite' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_activity" id="form_activity" value="{{ app['phraseanet.user'].get_job() }}" /> <input class="input_element" type="text" name="form_activity" id="form_activity" value="{{ app['authentication'].getUser().get_job() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_phone">{% trans 'admin::compte-utilisateur telephone' %}</label> <label class="form_label control-label" for="form_phone">{% trans 'admin::compte-utilisateur telephone' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_phone" id="form_phone" value="{{ app['phraseanet.user'].get_tel() }}" /> <input class="input_element" type="text" name="form_phone" id="form_phone" value="{{ app['authentication'].getUser().get_tel() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_fax">{% trans 'admin::compte-utilisateur fax' %}</label> <label class="form_label control-label" for="form_fax">{% trans 'admin::compte-utilisateur fax' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_fax" id="form_fax" value="{{ app['phraseanet.user'].get_fax() }}" /> <input class="input_element" type="text" name="form_fax" id="form_fax" value="{{ app['authentication'].getUser().get_fax() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
@@ -145,7 +145,7 @@
<label class="form_label control-label"></label> <label class="form_label control-label"></label>
<div class="controls"> <div class="controls">
<label class="checkbox" for="notif_{{ notification['id'] }}"> <label class="checkbox" for="notif_{{ notification['id'] }}">
<input type="checkbox" id="notif_{{ notification['id'] }}" name="notifications[{{ notification['id'] }}]" {% if not app['phraseanet.user'].getPrefs('notification_' ~ notification['id']) == '0' %}checked{% endif %} value="1"/> <input type="checkbox" id="notif_{{ notification['id'] }}" name="notifications[{{ notification['id'] }}]" {% if not app['authentication'].getUser().getPrefs('notification_' ~ notification['id']) == '0' %}checked{% endif %} value="1"/>
{{ notification['description'] }} {{ notification['description'] }}
</label> </label>
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
@@ -158,50 +158,50 @@
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_activeFTP">{% trans 'admin::compte-utilisateur:ftp: Activer le compte FTP' %}</label> <label class="form_label control-label" for="form_activeFTP">{% trans 'admin::compte-utilisateur:ftp: Activer le compte FTP' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="checkbox" name="form_activeFTP" id="form_activeFTP" {% if app['phraseanet.user'].get_activeftp() %}checked{% endif %} onchange="if(this.checked){$('#ftpinfos').slideDown();}else{$('#ftpinfos').slideUp();}" /> <input class="input_element" type="checkbox" name="form_activeFTP" id="form_activeFTP" {% if app['authentication'].getUser().get_activeftp() %}checked{% endif %} onchange="if(this.checked){$('#ftpinfos').slideDown();}else{$('#ftpinfos').slideUp();}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div id="ftpinfos" style="display: {% if app['phraseanet.user'].get_activeftp() %}block{% else %}none{% endif %}"> <div id="ftpinfos" style="display: {% if app['authentication'].getUser().get_activeftp() %}block{% else %}none{% endif %}">
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_addrFTP">{% trans 'phraseanet:: adresse' %}</label> <label class="form_label control-label" for="form_addrFTP">{% trans 'phraseanet:: adresse' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_addrFTP" id="form_addrFTP" value="{{ app['phraseanet.user'].get_ftp_address() }}" /> <input class="input_element" type="text" name="form_addrFTP" id="form_addrFTP" value="{{ app['authentication'].getUser().get_ftp_address() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_loginFTP">{% trans 'admin::compte-utilisateur identifiant' %}</label> <label class="form_label control-label" for="form_loginFTP">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_loginFTP" id="form_loginFTP" value="{{ app['phraseanet.user'].get_ftp_login() }}" /> <input class="input_element" type="text" name="form_loginFTP" id="form_loginFTP" value="{{ app['authentication'].getUser().get_ftp_login() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_pwdFTP">{% trans 'admin::compte-utilisateur mot de passe' %}</label> <label class="form_label control-label" for="form_pwdFTP">{% trans 'admin::compte-utilisateur mot de passe' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_pwdFTP" id="form_pwdFTP" value="{{ app['phraseanet.user'].get_ftp_password() }}" /> <input class="input_element" type="text" name="form_pwdFTP" id="form_pwdFTP" value="{{ app['authentication'].getUser().get_ftp_password() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_destFTP">{% trans 'admin::compte-utilisateur:ftp: repertoire de destination ftp' %}</label> <label class="form_label control-label" for="form_destFTP">{% trans 'admin::compte-utilisateur:ftp: repertoire de destination ftp' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_destFTP" id="form_destFTP" value="{{ app['phraseanet.user'].get_ftp_dir() }}" /> <input class="input_element" type="text" name="form_destFTP" id="form_destFTP" value="{{ app['authentication'].getUser().get_ftp_dir() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_prefixFTPfolder">{% trans 'admin::compte-utilisateur:ftp: prefixe des noms de dossier ftp' %}</label> <label class="form_label control-label" for="form_prefixFTPfolder">{% trans 'admin::compte-utilisateur:ftp: prefixe des noms de dossier ftp' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="text" name="form_prefixFTPfolder" id="form_prefixFTPfolder" value="{{ app['phraseanet.user'].get_ftp_dir_prefix() }}" /> <input class="input_element" type="text" name="form_prefixFTPfolder" id="form_prefixFTPfolder" value="{{ app['authentication'].getUser().get_ftp_dir_prefix() }}" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_passifFTP">{% trans 'admin::compte-utilisateur:ftp: Utiliser le mode passif' %}</label> <label class="form_label control-label" for="form_passifFTP">{% trans 'admin::compte-utilisateur:ftp: Utiliser le mode passif' %}</label>
<div class="controls"> <div class="controls">
<input class="input_element" type="checkbox" name="form_passifFTP" id="form_passifFTP" {% if app['phraseanet.user'].get_ftp_passif() == "1" %}checked{% endif %} /> <input class="input_element" type="checkbox" name="form_passifFTP" id="form_passifFTP" {% if app['authentication'].getUser().get_ftp_passif() == "1" %}checked{% endif %} />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>

View File

@@ -58,7 +58,7 @@ $(document).ready(function(){
{% for application in applications %} {% for application in applications %}
<li id='app_{{application.get_id}}'> <li id='app_{{application.get_id}}'>
<div> <div>
{% set account = application.get_user_account(app['phraseanet.user']) %} {% set account = application.get_user_account(app['authentication'].getUser()) %}
{% if account.is_revoked() is empty %} {% if account.is_revoked() is empty %}
<button type='button' class='revoke app-btn' value='{{application.get_id()}}'>{% trans 'Revoquer l\'access' %}</button> <button type='button' class='revoke app-btn' value='{{application.get_id()}}'>{% trans 'Revoquer l\'access' %}</button>
{% else %} {% else %}

View File

@@ -68,7 +68,7 @@ $(document).ready(function() {
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label> <label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<div class="controls"> <div class="controls">
<p>{{ app['phraseanet.user'].get_login() }}</p> <p>{{ app['authentication'].getUser().get_login() }}</p>
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
</div> </div>
</div> </div>

View File

@@ -64,7 +64,7 @@
<div class="control-group"> <div class="control-group">
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label> <label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
<div class="controls"> <div class="controls">
<p>{{ app['phraseanet.user'].get_login() }}</p> <p>{{ app['authentication'].getUser().get_login() }}</p>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
@@ -80,7 +80,7 @@
<span style="font-size: 10px;">{% trans '8 caracteres minimum' %}</span> <span style="font-size: 10px;">{% trans '8 caracteres minimum' %}</span>
</label> </label>
<div class="controls"> <div class="controls">
<input type="hidden" id="form_login" value="{{ app['phraseanet.user'].get_login() }}" autocomplete="off" /> <input type="hidden" id="form_login" value="{{ app['authentication'].getUser().get_login() }}" autocomplete="off" />
<input type="password" id="form_password" name="form_password" /> <input type="password" id="form_password" name="form_password" />
<p class="form_alert help-block"></p> <p class="form_alert help-block"></p>
<div class="password-meter"> <div class="password-meter">

View File

@@ -34,7 +34,7 @@
<li>{{ collection.get_record_amount() }} records <a target="_self" href="/admin/collection/{{ collection.get_base_id() }}/informations/details/">{% trans 'phraseanet:: details' %}</a></li> <li>{{ collection.get_record_amount() }} records <a target="_self" href="/admin/collection/{{ collection.get_base_id() }}/informations/details/">{% trans 'phraseanet:: details' %}</a></li>
</ul> </ul>
{% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<div class="well well-small"> <div class="well well-small">
<h5>{% trans 'admin::collection:: Gestionnaires des commandes' %}</h5> <h5>{% trans 'admin::collection:: Gestionnaires des commandes' %}</h5>
<form id="admin_adder" action="/admin/collection/{{ bas_id }}/order/admins/" method="post" style="margin:0;"> <form id="admin_adder" action="/admin/collection/{{ bas_id }}/order/admins/" method="post" style="margin:0;">
@@ -120,7 +120,7 @@
<h5>{% trans 'admin::base:collection: minilogo actuel' %}</h5> <h5>{% trans 'admin::base:collection: minilogo actuel' %}</h5>
{% if collection.getLogo(bas_id, app) is not empty %} {% if collection.getLogo(bas_id, app) is not empty %}
<div class="thumbnail" style="width:120px;height:24px;margin-top:5px;margin-bottom:5px">{{ collection.getLogo(bas_id, app) | raw }}</div> <div class="thumbnail" style="width:120px;height:24px;margin-top:5px;margin-bottom:5px">{{ collection.getLogo(bas_id, app) | raw }}</div>
{% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<form method="post" action="/admin/collection/{{ bas_id }}/picture/mini-logo/delete/" style="margin:0;"> <form method="post" action="/admin/collection/{{ bas_id }}/picture/mini-logo/delete/" style="margin:0;">
<button class="btn btn-danger btn-mini" > <button class="btn btn-danger btn-mini" >
<i class="icon-trash icon-white"></i> <i class="icon-trash icon-white"></i>
@@ -128,7 +128,7 @@
</button> </button>
</form> </form>
{% endif%} {% endif%}
{% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span> <span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/mini-logo/" style="margin:0;"> <form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/mini-logo/" style="margin:0;">
<input name="newLogo" type="file" accept="image/*" /> <input name="newLogo" type="file" accept="image/*" />
@@ -141,7 +141,7 @@
<h5>{% trans "Watermark" %}</h5> <h5>{% trans "Watermark" %}</h5>
{% if collection.getWatermark(bas_id) is not empty %} {% if collection.getWatermark(bas_id) is not empty %}
<div class="thumbnail">{{ collection.getWatermark(bas_id)| raw }}</div> <div class="thumbnail">{{ collection.getWatermark(bas_id)| raw }}</div>
{% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<form method="post" action="/admin/collection/{{ bas_id }}/picture/watermark/delete/" style="margin:0;"> <form method="post" action="/admin/collection/{{ bas_id }}/picture/watermark/delete/" style="margin:0;">
<button class="btn btn-danger btn-mini"> <button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i> <i class="icon-trash icon-white"></i>
@@ -149,7 +149,7 @@
</button> </button>
</form> </form>
{% endif%} {% endif%}
{% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span> <span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/watermark/" style="margin:0;"> <form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/watermark/" style="margin:0;">
<input name="newWm" type="file" accept="image/*" /> <input name="newWm" type="file" accept="image/*" />
@@ -162,7 +162,7 @@
<h5>{% trans "Stamp logo" %}</h5> <h5>{% trans "Stamp logo" %}</h5>
{% if collection.getStamp(bas_id) is not empty %} {% if collection.getStamp(bas_id) is not empty %}
<div class="thumbnail" style="max-height:120px;max-width:260px">{{ collection.getStamp(bas_id)| raw }}</div> <div class="thumbnail" style="max-height:120px;max-width:260px">{{ collection.getStamp(bas_id)| raw }}</div>
{% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<form method="post" action="/admin/collection/{{ bas_id }}/picture/stamp-logo/delete/" style="margin:0;"> <form method="post" action="/admin/collection/{{ bas_id }}/picture/stamp-logo/delete/" style="margin:0;">
<button class="btn btn-danger btn-mini"> <button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i> <i class="icon-trash icon-white"></i>
@@ -170,7 +170,7 @@
</button> </button>
</form> </form>
{% endif%} {% endif%}
{% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span> <span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/stamp-logo/" style="margin:0;"> <form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/stamp-logo/" style="margin:0;">
<input name="newStamp" type="file" accept="image/*" /> <input name="newStamp" type="file" accept="image/*" />
@@ -183,7 +183,7 @@
<h5>{% trans 'admin::base:collection: image de presentation : ' %}</h5> <h5>{% trans 'admin::base:collection: image de presentation : ' %}</h5>
{% if collection.getPresentation(bas_id) is not empty %} {% if collection.getPresentation(bas_id) is not empty %}
<div class="thumbnail" style="width:650px;height:200px">{{ collection.getPresentation(bas_id)| raw }}</div> <div class="thumbnail" style="width:650px;height:200px">{{ collection.getPresentation(bas_id)| raw }}</div>
{% if app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<form method="post" action="/admin/collection/{{ bas_id }}/picture/banner/delete/" style="margin:0;"> <form method="post" action="/admin/collection/{{ bas_id }}/picture/banner/delete/" style="margin:0;">
<button class="btn btn-danger btn-mini"> <button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i> <i class="icon-trash icon-white"></i>
@@ -191,7 +191,7 @@
</button> </button>
</form> </form>
{% endif%} {% endif%}
{% elseif app['phraseanet.user'].ACL.has_right_on_base(bas_id, 'manage') %} {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span> <span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/banner/" style="margin:0;"> <form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="/admin/collection/{{ bas_id }}/picture/banner/" style="margin:0;">
<input name="newBanner" type="file" accept="image/*" /> <input name="newBanner" type="file" accept="image/*" />

View File

@@ -32,10 +32,10 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
{% if app['phraseanet.user'].ACL().get_granted_base(["canadmin"]) | length > 0 %} {% if app['authentication'].getUser().ACL().get_granted_base(["canadmin"]) | length > 0 %}
<select id="othcollsel" name="othcollsel" disabled> <select id="othcollsel" name="othcollsel" disabled>
<option>{% trans "choisir" %}</option> <option>{% trans "choisir" %}</option>
{% for baseId, collection in app['phraseanet.user'].ACL().get_granted_base(["canadmin"]) %} {% for baseId, collection in app['authentication'].getUser().ACL().get_granted_base(["canadmin"]) %}
<option value="{{ baseId }}">{{ collection.get_name() }}</option> <option value="{{ baseId }}">{{ collection.get_name() }}</option>
{% endfor %} {% endfor %}
</select> </select>

View File

@@ -37,7 +37,7 @@
</ul> </ul>
</div> </div>
{% if app['phraseanet.user'].ACL().is_admin() %} {% if app['authentication'].getUser().ACL().is_admin() %}
<div class="db_infos"> <div class="db_infos">
<h2>{% trans 'admin::base: Version' %}</h2> <h2>{% trans 'admin::base: Version' %}</h2>

View File

@@ -30,7 +30,7 @@
<li> <li>
{% trans 'admin::base: Alias' %} : <span id="viewname">{{ databox.get_viewname() }}</span> {% trans 'admin::base: Alias' %} : <span id="viewname">{{ databox.get_viewname() }}</span>
{% if app['phraseanet.user'].ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app['authentication'].getUser().ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<img src="/skins/icons/edit_0.gif" id="show-view-name" /> <img src="/skins/icons/edit_0.gif" id="show-view-name" />
<div class="well well-small" id="change-view-name" style="display:none;"> <div class="well well-small" id="change-view-name" style="display:none;">
<form method="post" action="{{ path('admin_database_rename', {'databox_id': databox.get_sbas_id()}) }}"> <form method="post" action="{{ path('admin_database_rename', {'databox_id': databox.get_sbas_id()}) }}">
@@ -87,7 +87,7 @@
</div> </div>
</div> </div>
{% if app['phraseanet.user'].ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app['authentication'].getUser().ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<div class="well well-small"> <div class="well well-small">
<form method="post" action="{{ path('admin_database_set_indexable', {'databox_id': databox.get_sbas_id()}) }}" style="margin:0;"> <form method="post" action="{{ path('admin_database_set_indexable', {'databox_id': databox.get_sbas_id()}) }}" style="margin:0;">
<label class="checkbox" for="is_indexable"> <label class="checkbox" for="is_indexable">
@@ -152,7 +152,7 @@
<li> <li>
<form class="form-inline" method="post" action="{{ path('admin_database_mount_collection', {'databox_id': databox.get_sbas_id(), 'collection_id' : collId }) }}"> <form class="form-inline" method="post" action="{{ path('admin_database_mount_collection', {'databox_id': databox.get_sbas_id(), 'collection_id' : collId }) }}">
{% trans "Monter" %} {{ name }} {% trans "Monter" %} {{ name }}
{% if app['phraseanet.user'].ACL().get_granted_base(["canadmin"]) | length > 0 %} {% if app['authentication'].getUser().ACL().get_granted_base(["canadmin"]) | length > 0 %}
<label for="othcollsel">{% trans "admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces " %}</label> <label for="othcollsel">{% trans "admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces " %}</label>
<select id="othcollsel" name="othcollsel" > <select id="othcollsel" name="othcollsel" >
<option>{% trans "choisir" %}</option> <option>{% trans "choisir" %}</option>
@@ -201,7 +201,7 @@
<h4>{% trans "admin::base: logo impression PDF" %}</h4> <h4>{% trans "admin::base: logo impression PDF" %}</h4>
<div id="printLogoDIV_OK"> <div id="printLogoDIV_OK">
<img class="thumbnail" id="printLogo" src="/custom/minilogos/logopdf_{{ databox.get_sbas_id() }}.jpg" /> <img class="thumbnail" id="printLogo" src="/custom/minilogos/logopdf_{{ databox.get_sbas_id() }}.jpg" />
{% if app['phraseanet.user'].ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app['authentication'].getUser().ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<form method="post" target="right" action="{{ path('admin_database_delete_logo', {'databox_id': databox.get_sbas_id()}) }}" > <form method="post" target="right" action="{{ path('admin_database_delete_logo', {'databox_id': databox.get_sbas_id()}) }}" >
<button class="btn btn-mini btn-danger">{% trans "admin::base:collection: supprimer le logo" %}</button> <button class="btn btn-mini btn-danger">{% trans "admin::base:collection: supprimer le logo" %}</button>
</form> </form>
@@ -209,7 +209,7 @@
</div> </div>
<div id="printLogoDIV_NONE"> <div id="printLogoDIV_NONE">
{% trans "admin::base:collection: aucun fichier (minilogo, watermark ...)" %} {% trans "admin::base:collection: aucun fichier (minilogo, watermark ...)" %}
{% if app['phraseanet.user'].ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %} {% if app['authentication'].getUser().ACL().has_right_on_sbas(databox.get_sbas_id(), "bas_manage") %}
<input id="fileupload" class="no-ajax" type="file" name="newLogoPdf" data-url="{{ path('admin_database_submit_logo', {'databox_id': databox.get_sbas_id()}) }}" accept="image/jpg, image/jpeg"> <input id="fileupload" class="no-ajax" type="file" name="newLogoPdf" data-url="{{ path('admin_database_submit_logo', {'databox_id': databox.get_sbas_id()}) }}" accept="image/jpg, image/jpeg">
<i>{% trans "admin::base: envoyer un logo (jpeg 35px de hauteur max)" %}</i> <i>{% trans "admin::base: envoyer un logo (jpeg 35px de hauteur max)" %}</i>
{% endif %} {% endif %}

View File

@@ -337,16 +337,16 @@
</div> </div>
</td> </td>
<td style="text-align:center;width:19px;" title="{% trans 'Allowed to publish' %}"> <td style="text-align:center;width:19px;" title="{% trans 'Allowed to publish' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_chupub', users, 'sbas')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_chupub', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:19px;" title="{% trans 'Manage Thesaurus' %}"> <td style="text-align:center;width:19px;" title="{% trans 'Manage Thesaurus' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_modif_th', users, 'sbas')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_modif_th', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:19px;" title="{% trans 'Manage Database' %}"> <td style="text-align:center;width:19px;" title="{% trans 'Manage Database' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_manage', users, 'sbas')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_manage', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:19px;" title="{% trans 'Manage DB fields' %}"> <td style="text-align:center;width:19px;" title="{% trans 'Manage DB fields' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'bas_modify_struct', users, 'sbas')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'bas_modify_struct', users, 'sbas')}}
</td> </td>
<td style="text-align:center;width:48px;"></td> <td style="text-align:center;width:48px;"></td>
</tr> </tr>
@@ -356,25 +356,25 @@
{{rights['base_id']|bas_names(app)}} {{rights['base_id']|bas_names(app)}}
</td> </td>
<td class="users_col case_right_access" title="{% trans 'Access' %}"> <td class="users_col case_right_access" title="{% trans 'Access' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'access', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'access', users, 'base')}}
</td> </td>
<td class="users_col case_right_actif" title="{% trans 'Active' %}"> <td class="users_col case_right_actif" title="{% trans 'Active' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'actif', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'actif', users, 'base')}}
</td> </td>
<td class="users_col case_right_canputinalbum" title="{% trans 'Allowed to add in basket' %}"> <td class="users_col case_right_canputinalbum" title="{% trans 'Allowed to add in basket' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'canputinalbum', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'canputinalbum', users, 'base')}}
</td> </td>
<td class="users_col case_right_candwnldpreview" title="{% trans 'Access to preview' %}"> <td class="users_col case_right_candwnldpreview" title="{% trans 'Access to preview' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'candwnldpreview', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'candwnldpreview', users, 'base')}}
</td> </td>
<td class="users_col case_right_nowatermark" title="{% trans 'Remove watermark' %}"> <td class="users_col case_right_nowatermark" title="{% trans 'Remove watermark' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'nowatermark', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'nowatermark', users, 'base')}}
</td> </td>
<td class="users_col case_right_candwnldhd" title="{% trans 'Access to HD' %}"> <td class="users_col case_right_candwnldhd" title="{% trans 'Access to HD' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'candwnldhd', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'candwnldhd', users, 'base')}}
</td> </td>
<td class="users_col case_right_cancmd" title="{% trans 'Allowed to order' %}"> <td class="users_col case_right_cancmd" title="{% trans 'Allowed to order' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'cancmd', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'cancmd', users, 'base')}}
</td> </td>
<td class="users_col case_right_quota" title="{% trans 'Set download quotas' %}"> <td class="users_col case_right_quota" title="{% trans 'Set download quotas' %}">
<div class="quota_trigger quota_{{rights['base_id']}}"> <div class="quota_trigger quota_{{rights['base_id']}}">
@@ -410,34 +410,34 @@
<td style="text-align:center;width:100px;"></td> <td style="text-align:center;width:100px;"></td>
<td class="users_col case_right_canaddrecord" title="{% trans 'Allowed to add' %}"> <td class="users_col case_right_canaddrecord" title="{% trans 'Allowed to add' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'canaddrecord', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'canaddrecord', users, 'base')}}
</td> </td>
<td class="users_col case_right_canmodifrecord" title="{% trans 'Allowed to edit' %}"> <td class="users_col case_right_canmodifrecord" title="{% trans 'Allowed to edit' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'canmodifrecord', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'canmodifrecord', users, 'base')}}
</td> </td>
<td class="users_col case_right_chgstatus" title="{% trans 'Allowed to change statuses' %}"> <td class="users_col case_right_chgstatus" title="{% trans 'Allowed to change statuses' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'chgstatus', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'chgstatus', users, 'base')}}
</td> </td>
<td class="users_col case_right_candeleterecord" title="{% trans 'Allowed to delete' %}"> <td class="users_col case_right_candeleterecord" title="{% trans 'Allowed to delete' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'candeleterecord', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'candeleterecord', users, 'base')}}
</td> </td>
<td class="users_col case_right_imgtools" title="{% trans 'Access to image tools' %}"> <td class="users_col case_right_imgtools" title="{% trans 'Access to image tools' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'imgtools', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'imgtools', users, 'base')}}
</td> </td>
<td class="users_col case_right_canadmin" title="{% trans 'Manage users' %}"> <td class="users_col case_right_canadmin" title="{% trans 'Manage users' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'canadmin', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'canadmin', users, 'base')}}
</td> </td>
<td class="users_col case_right_canreport" title="{% trans 'Allowed to access report' %}"> <td class="users_col case_right_canreport" title="{% trans 'Allowed to access report' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'canreport', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'canreport', users, 'base')}}
</td> </td>
<td class="users_col case_right_canpush" title="{% trans 'Allowed to push' %}"> <td class="users_col case_right_canpush" title="{% trans 'Allowed to push' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'canpush', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'canpush', users, 'base')}}
</td> </td>
<td class="users_col case_right_manage" title="{% trans 'Manage collection' %}"> <td class="users_col case_right_manage" title="{% trans 'Manage collection' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'manage', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'manage', users, 'base')}}
</td> </td>
<td class="users_col case_right_modify" title="{% trans 'Manage values lists' %}"> <td class="users_col case_right_modify" title="{% trans 'Manage values lists' %}">
{{_self.format_checkbox(app['phraseanet.user'], rights, 'modify_struct', users, 'base')}} {{_self.format_checkbox(app['authentication'].getUser(), rights, 'modify_struct', users, 'base')}}
</td> </td>
<td colspan="5"> <td colspan="5">

View File

@@ -54,7 +54,7 @@
dataType: 'json', dataType: 'json',
data: { data: {
module : 3, module : 3,
usr : {{ app['phraseanet.user'].get_id() }} usr : {{ app['authentication'].getUser().get_id() }}
}, },
error: function(){ error: function(){
window.setTimeout("sessionactive();", 10000); window.setTimeout("sessionactive();", 10000);

View File

@@ -6,7 +6,7 @@
{% if error %} {% if error %}
<div class="error alert alert-error">{{ error }}</div> <div class="error alert alert-error">{{ error }}</div>
{% endif %} {% endif %}
{% if feed.is_owner(app['phraseanet.user']) %} {% if feed.is_owner(app['authentication'].getUser()) %}
<h2>{% trans 'Edition' %}</h2> <h2>{% trans 'Edition' %}</h2>
<div class="control-group"> <div class="control-group">
<div id="pub_icon"> <div id="pub_icon">
@@ -97,7 +97,7 @@
<div class="controls"> <div class="controls">
<select id="edit_pub_base_id" class="input-large" name="base_id" {% if feed.is_public() %}disabled="disabled"{% endif %}> <select id="edit_pub_base_id" class="input-large" name="base_id" {% if feed.is_public() %}disabled="disabled"{% endif %}>
<option value="">{% trans 'Non-Restreinte (publique)' %}</option> <option value="">{% trans 'Non-Restreinte (publique)' %}</option>
{% for databox in app['phraseanet.user'].ACL().get_granted_sbas('bas_chupub') %} {% for databox in app['authentication'].getUser().ACL().get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_viewname() }}"> <optgroup label="{{ databox.get_viewname() }}">
{% for collection in databox.get_collections() %} {% for collection in databox.get_collections() %}
<option {% if feed.get_collection() and feed.get_collection().get_base_id() == collection.get_base_id() %}selected="selected"{% endif %} value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option> <option {% if feed.get_collection() and feed.get_collection().get_base_id() == collection.get_base_id() %}selected="selected"{% endif %} value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>

View File

@@ -21,7 +21,7 @@
<div class="controls"> <div class="controls">
<select id="add_pub_base_id" class="input-large" name="base_id"> <select id="add_pub_base_id" class="input-large" name="base_id">
<option value="">{% trans 'Non-Restreinte (publique)' %}</option> <option value="">{% trans 'Non-Restreinte (publique)' %}</option>
{% for databox in app['phraseanet.user'].ACL().get_granted_sbas('bas_chupub') %} {% for databox in app['authentication'].getUser().ACL().get_granted_sbas('bas_chupub') %}
<optgroup label="{{ databox.get_viewname() }}"> <optgroup label="{{ databox.get_viewname() }}">
{% for collection in databox.get_collections() %} {% for collection in databox.get_collections() %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option> <option value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>
@@ -81,7 +81,7 @@
{% endif %} {% endif %}
</td> </td>
<td valign="center" align="center"> <td valign="center" align="center">
{% if feed.is_owner(app['phraseanet.user']) %} {% if feed.is_owner(app['authentication'].getUser()) %}
<form class="no-ajax form_publication" action="/admin/publications/feed/{{feed.get_id()}}/delete/" method="post" style="margin:0;"> <form class="no-ajax form_publication" action="/admin/publications/feed/{{feed.get_id()}}/delete/" method="post" style="margin:0;">
<button class="feed_remover btn btn-mini">{% trans 'boutton::supprimer' %}</button> <button class="feed_remover btn btn-mini">{% trans 'boutton::supprimer' %}</button>
</form> </form>

View File

@@ -2,7 +2,7 @@
<ul id="tree" class="filetree"> <ul id="tree" class="filetree">
{% if app['phraseanet.user'].ACL().is_admin() %} {% if app['authentication'].getUser().ACL().is_admin() %}
<li> <li>
<a target="right" href="/admin/dashboard/" class="ajax"> <a target="right" href="/admin/dashboard/" class="ajax">
<img src="/skins/admin/Dashboard.png" /> <img src="/skins/admin/Dashboard.png" />
@@ -15,7 +15,7 @@
</li> </li>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().is_admin() %} {% if app['authentication'].getUser().ACL().is_admin() %}
<li> <li>
<a target="right" href="/admin/setup/" class="ajax"> <a target="right" href="/admin/setup/" class="ajax">
<img src="/skins/admin/Setup.png" /> <img src="/skins/admin/Setup.png" />
@@ -36,7 +36,7 @@
</a> </a>
</li> </li>
{% if app['phraseanet.user'].ACL().has_right('manageusers') %} {% if app['authentication'].getUser().ACL().has_right('manageusers') %}
<li class="{% if feature == 'users' %}selected{% endif %}"> <li class="{% if feature == 'users' %}selected{% endif %}">
<a target="right" href="/admin/users/search/" class="ajax zone_editusers"> <a target="right" href="/admin/users/search/" class="ajax zone_editusers">
<img src="/skins/admin/Users.png" /> <img src="/skins/admin/Users.png" />
@@ -51,7 +51,7 @@
</li> </li>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('bas_chupub') %} {% if app['authentication'].getUser().ACL().has_right('bas_chupub') %}
<li class=""> <li class="">
<a target="right" href="/admin/publications/list/" class="ajax"> <a target="right" href="/admin/publications/list/" class="ajax">
<img src="/skins/icons/rss16.png" /> <img src="/skins/icons/rss16.png" />
@@ -60,7 +60,7 @@
</li> </li>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('taskmanager') %} {% if app['authentication'].getUser().ACL().has_right('taskmanager') %}
<li class="{% if feature == 'taskmanager' %}selected{% endif %}"> <li class="{% if feature == 'taskmanager' %}selected{% endif %}">
<a target="right" href="/admin/task-manager/tasks/" class="ajax"> <a target="right" href="/admin/task-manager/tasks/" class="ajax">
<img src="/skins/admin/TaskManager.png" /> <img src="/skins/admin/TaskManager.png" />
@@ -103,7 +103,7 @@
</div> </div>
<ul> <ul>
{% if app['phraseanet.user'].ACL().has_right_on_sbas( sbas_id , 'bas_modify_struct') %} {% if app['authentication'].getUser().ACL().has_right_on_sbas( sbas_id , 'bas_modify_struct') %}
<li> <li>
<a target="right" class="ajax" href="/admin/structure/{{ sbas_id }}/"> <a target="right" class="ajax" href="/admin/structure/{{ sbas_id }}/">
<img src="/skins/icons/miniadjust01.gif"/> <img src="/skins/icons/miniadjust01.gif"/>
@@ -144,7 +144,7 @@
{% set seeUsrGene = false %} {% set seeUsrGene = false %}
{% for coll in databox.get_collections() %} {% for coll in databox.get_collections() %}
{% if app['phraseanet.user'].ACL.has_right_on_base( coll.get_base_id() , 'canadmin') %} {% if app['authentication'].getUser().ACL.has_right_on_base( coll.get_base_id() , 'canadmin') %}
{% set seeUsrGene = true %} {% set seeUsrGene = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@@ -159,9 +159,9 @@
{% endif %} {% endif %}
{% for collection in databox.get_collections() %} {% for collection in databox.get_collections() %}
{% if (collection.get_base_id() in app['phraseanet.user'].ACL.get_granted_base(['canadmin'])|keys {% if (collection.get_base_id() in app['authentication'].getUser().ACL.get_granted_base(['canadmin'])|keys
or collection.get_base_id() in app['phraseanet.user'].ACL.get_granted_base(['manage'])|keys or collection.get_base_id() in app['authentication'].getUser().ACL.get_granted_base(['manage'])|keys
or collection.get_base_id() in app['phraseanet.user'].ACL.get_granted_base(['modify_struct'])|keys) %} or collection.get_base_id() in app['authentication'].getUser().ACL.get_granted_base(['modify_struct'])|keys) %}
<li> <li>
<div style="padding:0 0 2px 0;"> <div style="padding:0 0 2px 0;">
@@ -171,7 +171,7 @@
</div> </div>
<ul> <ul>
{% if (app['phraseanet.user'].ACL.has_right_on_base(collection.get_base_id(), 'modify_struct')) %} {% if (app['authentication'].getUser().ACL.has_right_on_base(collection.get_base_id(), 'modify_struct')) %}
<li> <li>
<a target="right" href="/admin/collection/{{ collection.get_base_id() }}/suggested-values/" class="ajax"> <a target="right" href="/admin/collection/{{ collection.get_base_id() }}/suggested-values/" class="ajax">
<img src="/skins/icons/foldph20open_0.gif"/> <img src="/skins/icons/foldph20open_0.gif"/>
@@ -180,10 +180,10 @@
</li> </li>
{% endif %} {% endif %}
{% if (app['phraseanet.user'].ACL.has_right_on_base( collection.get_base_id(), 'canadmin')) %} {% if (app['authentication'].getUser().ACL.has_right_on_base( collection.get_base_id(), 'canadmin')) %}
{% if (app['phraseanet.user'].ACL.has_right_on_base( collection.get_base_id(), 'canmodifrecord') {% if (app['authentication'].getUser().ACL.has_right_on_base( collection.get_base_id(), 'canmodifrecord')
and app['phraseanet.user'].ACL.has_right_on_base( collection.get_base_id(), 'manage') and app['authentication'].getUser().ACL.has_right_on_base( collection.get_base_id(), 'manage')
and app['phraseanet.user'].ACL.has_right_on_sbas( sbas_id, 'bas_manage') ) %} and app['authentication'].getUser().ACL.has_right_on_sbas( sbas_id, 'bas_manage') ) %}
<li> <li>
<a target="right" href="/admin/users/search/?base_id[]={{ collection.get_base_id() }}" class="ajax"> <a target="right" href="/admin/users/search/?base_id[]={{ collection.get_base_id() }}" class="ajax">
<img src="/skins/admin/Users.png"/> <img src="/skins/admin/Users.png"/>

View File

@@ -33,7 +33,7 @@
<h1 id="namePhr">{{home_title}}</h1> <h1 id="namePhr">{{home_title}}</h1>
</div> </div>
{% if not app.isAuthenticated() %} {% if not app['authentication'].isAuthenticated() %}
<div id="content-box" class="span6 offset3"> <div id="content-box" class="span6 offset3">
<form id="login-form" class="form-vertical" method="post"> <form id="login-form" class="form-vertical" method="post">
{% for key,value in auth.getParams %} {% for key,value in auth.getParams %}
@@ -57,7 +57,7 @@
</div> </div>
{% else %} {% else %}
{% if user is not none %} {% if user is not none %}
{% set username = '<b>' ~ app['phraseanet.user'].get_display_name() ~ '</b>' %} {% set username = '<b>' ~ app['authentication'].getUser().get_display_name() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans %} {% trans %}

View File

@@ -38,7 +38,7 @@
</div> </div>
{% if user is not none %} {% if user is not none %}
{% set username = '<b>' ~ app['phraseanet.user'].get_display_name() ~ '</b>' %} {% set username = '<b>' ~ app['authentication'].getUser().get_display_name() ~ '</b>' %}
<div id="hello-box" class="span6 offset3"> <div id="hello-box" class="span6 offset3">
<p class="login_hello"> <p class="login_hello">
{% trans %} {% trans %}

View File

@@ -45,7 +45,7 @@
<div class="baskCreate" title="{% trans 'action:: nouveau panier' %}" onclick="newBasket();"></div> <div class="baskCreate" title="{% trans 'action:: nouveau panier' %}" onclick="newBasket();"></div>
<div style="float:right;position:relative;width:3px;height:16px;"></div> <div style="float:right;position:relative;width:3px;height:16px;"></div>
{% if total_baskets > 0 and (app['phraseanet.user'].ACL().has_right("candwnldhd") or app['phraseanet.user'].ACL().has_right("candwnldpreview") or app['phraseanet.user'].ACL().has_right("cancmd") > 0) %} {% if total_baskets > 0 and (app['authentication'].getUser().ACL().has_right("candwnldhd") or app['authentication'].getUser().ACL().has_right("candwnldpreview") or app['authentication'].getUser().ACL().has_right("cancmd") > 0) %}
<div class="baskDownload" title="{% trans 'action : exporter' %}" onclick="evt_dwnl();"></div> <div class="baskDownload" title="{% trans 'action : exporter' %}" onclick="evt_dwnl();"></div>
{% endif %} {% endif %}
@@ -117,10 +117,10 @@
onclick="evt_del_in_chutier({{ element.getId() }});" onclick="evt_del_in_chutier({{ element.getId() }});"
title="{% trans 'action : supprimer' %}"> title="{% trans 'action : supprimer' %}">
</div> </div>
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'candwnldhd') {% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'candwnldhd')
or app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'candwnldpreview') or app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'candwnldpreview')
or app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'cancmd') or app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'cancmd')
or app['phraseanet.user'].ACL().has_preview_grant(record) %} or app['authentication'].getUser().ACL().has_preview_grant(record) %}
<div class="baskOneDownload" onclick="evt_dwnl('{{ record.get_serialize_key() }}');" title="{% trans 'action : exporter' %}"></div> <div class="baskOneDownload" onclick="evt_dwnl('{{ record.get_serialize_key() }}');" title="{% trans 'action : exporter' %}"></div>
{% endif %} {% endif %}
</div> </div>

View File

@@ -446,7 +446,7 @@
dataType: 'json', dataType: 'json',
data: { data: {
app : 2, app : 2,
usr : {{ app['phraseanet.user'].get_id() }} usr : {{ app['authentication'].getUser().get_id() }}
}, },
error: function(){ error: function(){
window.setTimeout("sessionactive();", 10000); window.setTimeout("sessionactive();", 10000);

View File

@@ -20,7 +20,7 @@
{% set s_width = subdef.get_width() %} {% set s_width = subdef.get_width() %}
{% set s_height = subdef.get_height() %} {% set s_height = subdef.get_height() %}
{% endif %} {% endif %}
{% if app.isAuthenticated() == true %} {% if app['authentication'].isAuthenticated() == true %}
{% set url = subdef.get_url() %} {% set url = subdef.get_url() %}
{% else %} {% else %}
{% set url = subdef.get_permalink().get_url() %} {% set url = subdef.get_permalink().get_url() %}

View File

@@ -5,8 +5,8 @@
{% import 'common/caption_templates/overview.html.twig' as cap_ovr %} {% import 'common/caption_templates/overview.html.twig' as cap_ovr %}
{% import 'common/caption_templates/preview.html.twig' as cap_prev %} {% import 'common/caption_templates/preview.html.twig' as cap_prev %}
{% if app['phraseanet.user'] %} {% if app['authentication'].getUser() %}
{% set business = app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %} {% set business = app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
{% else %} {% else %}
{% set business = false %} {% set business = false %}
{% endif %} {% endif %}

View File

@@ -76,7 +76,7 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% if app['phraseanet.registry'].get('GV_needAuth2DL') and app['phraseanet.user'].is_guest() %} {% if app['phraseanet.registry'].get('GV_needAuth2DL') and app['authentication'].getUser().is_guest() %}
<script type="text/javascript"> <script type="text/javascript">
p4.Dialog.get(1).Close(); p4.Dialog.get(1).Close();
parent.login({act:"dwnl",lst:"{{ lst }}",SSTTID:"{{ ssttid }}"}); parent.login({act:"dwnl",lst:"{{ lst }}",SSTTID:"{{ ssttid }}"});
@@ -173,7 +173,7 @@
<div> <div>
{% trans 'export::mail: destinataire' %} {% trans 'export::mail: destinataire' %}
<input type="text" value="" name="destmail" class="required span4"> <input type="text" value="" name="destmail" class="required span4">
{% set my_email = app['phraseanet.user'].get_email() %} {% set my_email = app['authentication'].getUser().get_email() %}
{% if my_email != '' %} {% if my_email != '' %}
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" name="reading_confirm" value="1" /> <input type="checkbox" name="reading_confirm" value="1" />
@@ -299,9 +299,9 @@
<label class="control-label" for="sexe">{% trans 'Civility' %}</label> <label class="control-label" for="sexe">{% trans 'Civility' %}</label>
<div class="controls"> <div class="controls">
<select name="sexe" id="sexe"> <select name="sexe" id="sexe">
<option {% if app['phraseanet.user'].get_gender == 0 %}selected="selected"{% endif %} value="0">{% trans 'admin::compte-utilisateur:sexe: mademoiselle' %}</option> <option {% if app['authentication'].getUser().get_gender == 0 %}selected="selected"{% endif %} value="0">{% trans 'admin::compte-utilisateur:sexe: mademoiselle' %}</option>
<option {% if app['phraseanet.user'].get_gender == 1 %}selected="selected"{% endif %} value="1">{% trans 'admin::compte-utilisateur:sexe: madame' %}</option> <option {% if app['authentication'].getUser().get_gender == 1 %}selected="selected"{% endif %} value="1">{% trans 'admin::compte-utilisateur:sexe: madame' %}</option>
<option {% if app['phraseanet.user'].get_gender == 2 %}selected="selected"{% endif %} value="2">{% trans 'admin::compte-utilisateur:sexe: monsieur' %}</option> <option {% if app['authentication'].getUser().get_gender == 2 %}selected="selected"{% endif %} value="2">{% trans 'admin::compte-utilisateur:sexe: monsieur' %}</option>
</select> </select>
</div> </div>
</div> </div>
@@ -309,70 +309,70 @@
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_lastname">{% trans 'admin::compte-utilisateur nom' %}</label> <label class="control-label" for="usr_lastname">{% trans 'admin::compte-utilisateur nom' %}</label>
<div class="controls"> <div class="controls">
<input id='usr_lastname' type="text" name="usr_nom" class="required" value="{{ app['phraseanet.user'].get_lastname() }}"/> <input id='usr_lastname' type="text" name="usr_nom" class="required" value="{{ app['authentication'].getUser().get_lastname() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label> <label class="control-label" for="usr_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label>
<div class="controls"> <div class="controls">
<input type="text" name="usr_prenom" class="required" id="usr_firstname" value="{{ app['phraseanet.user'].get_firstname() }}"/> <input type="text" name="usr_prenom" class="required" id="usr_firstname" value="{{ app['authentication'].getUser().get_firstname() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_mail"> {% trans 'admin::compte-utilisateur email' %}</label> <label class="control-label" for="usr_mail"> {% trans 'admin::compte-utilisateur email' %}</label>
<div class="controls"> <div class="controls">
<input class="required" type="text" name="usr_mail" id="usr_mail" value="{{ app['phraseanet.user'].get_email() }}"/> <input class="required" type="text" name="usr_mail" id="usr_mail" value="{{ app['authentication'].getUser().get_email() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_tel">{% trans 'admin::compte-utilisateur telephone' %}</label> <label class="control-label" for="usr_tel">{% trans 'admin::compte-utilisateur telephone' %}</label>
<div class="controls"> <div class="controls">
<input type="text" name="tel" id="usr_tel" value="{{ app['phraseanet.user'].get_tel() }}"/> <input type="text" name="tel" id="usr_tel" value="{{ app['authentication'].getUser().get_tel() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_societe">{% trans 'admin::compte-utilisateur societe' %}</label> <label class="control-label" for="usr_societe">{% trans 'admin::compte-utilisateur societe' %}</label>
<div class="controls"> <div class="controls">
<input type="text" name="societe" id="usr_societe" value="{{ app['phraseanet.user'].get_company() }}"/> <input type="text" name="societe" id="usr_societe" value="{{ app['authentication'].getUser().get_company() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_function">{% trans 'admin::compte-utilisateur poste' %}</label> <label class="control-label" for="usr_function">{% trans 'admin::compte-utilisateur poste' %}</label>
<div class="controls"> <div class="controls">
<input type="text" name="fonction" id="usr_fonction" value="{{ app['phraseanet.user'].get_job() }}"/> <input type="text" name="fonction" id="usr_fonction" value="{{ app['authentication'].getUser().get_job() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_address">{% trans 'admin::compte-utilisateur adresse' %}</label> <label class="control-label" for="usr_address">{% trans 'admin::compte-utilisateur adresse' %}</label>
<div class="controls"> <div class="controls">
<input class="required" type="text" name="adresse" id="usr_adresse" value="{{ app['phraseanet.user'].get_address() }}"/> <input class="required" type="text" name="adresse" id="usr_adresse" value="{{ app['authentication'].getUser().get_address() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_zip_code">{% trans 'admin::compte-utilisateur code postal' %}</label> <label class="control-label" for="usr_zip_code">{% trans 'admin::compte-utilisateur code postal' %}</label>
<div class="controls"> <div class="controls">
<input id="usr_zip_code" type="text" name="cpostal" name="cpostal" class="required" value="{{ app['phraseanet.user'].get_zipcode() }}"/> <input id="usr_zip_code" type="text" name="cpostal" name="cpostal" class="required" value="{{ app['authentication'].getUser().get_zipcode() }}"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="command_geoname_field">{% trans 'admin::compte-utilisateur ville' %}</label> <label class="control-label" for="command_geoname_field">{% trans 'admin::compte-utilisateur ville' %}</label>
<div class="controls"> <div class="controls">
<input class="required geoname_field" type="text" name="geonameid" id="command_geoname_field" geonameid="{{ app['phraseanet.user'].get_geonameid() }}" value="{{ app['geonames'].name_from_id(app['phraseanet.user'].get_geonameid()) }}" /> <input class="required geoname_field" type="text" name="geonameid" id="command_geoname_field" geonameid="{{ app['authentication'].getUser().get_geonameid() }}" value="{{ app['geonames'].name_from_id(app['authentication'].getUser().get_geonameid()) }}" />
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label" for="usr_fax">{% trans 'admin::compte-utilisateur fax' %}</label> <label class="control-label" for="usr_fax">{% trans 'admin::compte-utilisateur fax' %}</label>
<div class="controls"> <div class="controls">
<input type="text" id="usr_fax" name="fax" value="{{ app['phraseanet.user'].get_fax() }}"/> <input type="text" id="usr_fax" name="fax" value="{{ app['authentication'].getUser().get_fax() }}"/>
</div> </div>
</div> </div>
@@ -650,7 +650,7 @@
$('input[name="obj[]"]:checked', $('#download')).each(function(i,n){ $('input[name="obj[]"]:checked', $('#download')).each(function(i,n){
$('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true); $('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true);
}); });
$('input[name="destmail"]', $('#sendmail')).val("{{app['phraseanet.user'].get_email()}}"); $('input[name="destmail"]', $('#sendmail')).val("{{app['authentication'].getUser().get_email()}}");
$('.tabs', dialog.getDomElement()).tabs('select',1); $('.tabs', dialog.getDomElement()).tabs('select',1);
} }

View File

@@ -8,7 +8,7 @@
<tr> <tr>
<td> <td>
<div class="context-menu context-menu-theme-vista"> <div class="context-menu context-menu-theme-vista">
{% if app['phraseanet.user'].ACL.has_right_on_base(record.get_base_id, 'canputinalbum') and not record.is_grouping() %} {% if app['authentication'].getUser().ACL.has_right_on_base(record.get_base_id, 'canputinalbum') and not record.is_grouping() %}
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner"
onclick="evt_add_in_chutier('{{record.get_sbas_id}}','{{record.get_record_id}}',false,this);return(false);"> onclick="evt_add_in_chutier('{{record.get_sbas_id}}','{{record.get_record_id}}',false,this);return(false);">
@@ -16,7 +16,7 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL.has_right_on_base(record.get_base_id, 'candwnldpreview') or app['phraseanet.user'].ACL.has_right_on_base(record.get_base_id, 'candwnldhd') %} {% if app['authentication'].getUser().ACL.has_right_on_base(record.get_base_id, 'candwnldpreview') or app['authentication'].getUser().ACL.has_right_on_base(record.get_base_id, 'candwnldhd') %}
<div title="" class="context-menu-item"> <div title="" class="context-menu-item">
<div class="context-menu-item-inner" <div class="context-menu-item-inner"
onclick="evt_dwnl('{{record.get_sbas_id}}_{{record.get_record_id}}',false,this);return(false);"> onclick="evt_dwnl('{{record.get_sbas_id}}_{{record.get_record_id}}',false,this);return(false);">

View File

@@ -6,7 +6,7 @@
Phraseanet Phraseanet
</span> </span>
</li> </li>
{% if module != "lightbox" and app.isAuthenticated() %} {% if module != "lightbox" and app['authentication'].isAuthenticated() %}
<li> <li>
{% if module == "prod" %} {% if module == "prod" %}
<a target="_self" href="/client/"> <a target="_self" href="/client/">
@@ -33,7 +33,7 @@
{% endif %} {% endif %}
</li> </li>
{% if app['browser'].isNewGeneration and app['phraseanet.registry'].get('GV_thesaurus') == true and app['phraseanet.user'].ACL.has_access_to_module('thesaurus') %} {% if app['browser'].isNewGeneration and app['phraseanet.registry'].get('GV_thesaurus') == true and app['authentication'].getUser().ACL.has_access_to_module('thesaurus') %}
<li> <li>
<a target="_blank" href="/thesaurus/"> <a target="_blank" href="/thesaurus/">
<span class="{% if module == "thesaurus" %}selected{% endif %}"> <span class="{% if module == "thesaurus" %}selected{% endif %}">
@@ -45,7 +45,7 @@
{# MODULE #} {# MODULE #}
{% if app['phraseanet.user'].ACL.has_access_to_module('admin') %} {% if app['authentication'].getUser().ACL.has_access_to_module('admin') %}
<li> <li>
<a target="_blank" href="/admin/"> <a target="_blank" href="/admin/">
<span class="{% if module == "admin" %}selected{% endif %}"> <span class="{% if module == "admin" %}selected{% endif %}">
@@ -56,7 +56,7 @@
{% endif %} {% endif %}
{# MODULE #} {# MODULE #}
{% if app['phraseanet.user'].ACL.has_access_to_module('report') %} {% if app['authentication'].getUser().ACL.has_access_to_module('report') %}
<li> <li>
<a target="_blank" href="{{ app.path('report_dashboard') }}"> <a target="_blank" href="{{ app.path('report_dashboard') }}">
<span class="{% if module == "report" %}selected{% endif %}"> <span class="{% if module == "report" %}selected{% endif %}">
@@ -77,7 +77,7 @@
{# MODULE #} {# MODULE #}
{% if module == "prod" %} {% if module == "prod" %}
{% if app['phraseanet.user'].ACL.has_access_to_module('upload') %} {% if app['authentication'].getUser().ACL.has_access_to_module('upload') %}
<li> <li>
{% set link = '/prod/upload/' %} {% set link = '/prod/upload/' %}
@@ -105,7 +105,7 @@
</li> </li>
{% endif %} {% endif %}
{% if module == "prod" and app['phraseanet.user'].ACL.has_right('order_master') %} {% if module == "prod" and app['authentication'].getUser().ACL.has_right('order_master') %}
<li> <li>
<a href="{{ path('prod_orders') }}" class="dialog full-dialog" title="{% trans 'Orders manager' %}"> <a href="{{ path('prod_orders') }}" class="dialog full-dialog" title="{% trans 'Orders manager' %}">
<span> <span>
@@ -122,7 +122,7 @@
<div class="PNB" style="left:auto;overflow:hidden;"> <div class="PNB" style="left:auto;overflow:hidden;">
<ol> <ol>
{% if app.isAuthenticated() and (module == "client" or module == "prod") %} {% if app['authentication'].isAuthenticated() and (module == "client" or module == "prod") %}
<li id="notification_trigger"> <li id="notification_trigger">
<a href="#" style="font-weight:bold;text-decoration:none;"> <a href="#" style="font-weight:bold;text-decoration:none;">
<span> <span>
@@ -142,15 +142,15 @@
</div> </div>
{% endif %} {% endif %}
<li> <li>
{% if app.isAuthenticated() %} {% if app['authentication'].isAuthenticated() %}
{% if app['phraseanet.user'].is_guest %} {% if app['authentication'].getUser().is_guest %}
<span> <span>
{% trans 'Guest' %} {% trans 'Guest' %}
</span> </span>
{% else %} {% else %}
<a target="_blank" href="/account/" title="{% trans 'login:: Mon compte' %}"> <a target="_blank" href="/account/" title="{% trans 'login:: Mon compte' %}">
<span> <span>
{{app['phraseanet.user'].get_login()}} {{app['authentication'].getUser().get_login()}}
</span> </span>
</a> </a>
{% endif %} {% endif %}
@@ -185,7 +185,7 @@
</table> </table>
</li> </li>
<li> <li>
{% if app.isAuthenticated() %} {% if app['authentication'].isAuthenticated() %}
<a href="/login/logout/?app={{module}}" target="_self"> <a href="/login/logout/?app={{module}}" target="_self">
<span> <span>
{% trans 'phraseanet:: deconnection' %} {% trans 'phraseanet:: deconnection' %}

View File

@@ -9,7 +9,7 @@
{% set previewHtml5 = null %} {% set previewHtml5 = null %}
{% if app['phraseanet.user'].ACL().has_access_to_subdef(record, 'preview') %} {% if app['authentication'].getUser().ACL().has_access_to_subdef(record, 'preview') %}
{% set preview_obj = record.get_preview() %} {% set preview_obj = record.get_preview() %}
{% else %} {% else %}
{% set preview_obj = record.get_thumbnail() %} {% set preview_obj = record.get_thumbnail() %}

View File

@@ -42,7 +42,7 @@
{% if app.isAuthenticated() == true %} {% if app['authentication'].isAuthenticated() == true %}
{% set url = thumbnail.get_url() %} {% set url = thumbnail.get_url() %}
{% else %} {% else %}
{% set url = thumbnail.get_permalink().get_url() %} {% set url = thumbnail.get_permalink().get_url() %}
@@ -145,7 +145,7 @@
{% if app.isAuthenticated() == true %} {% if app['authentication'].isAuthenticated() == true %}
{% set url = thumbnail.get_url() %} {% set url = thumbnail.get_url() %}
{% else %} {% else %}
{% set url = thumbnail.get_permalink().get_url() %} {% set url = thumbnail.get_permalink().get_url() %}

View File

@@ -14,11 +14,11 @@
</table> </table>
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div style="margin-left:10px;width:220px;"> <div style="margin-left:10px;width:220px;">
{{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }} {{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}
</div> </div>
<ul style="margin:10px 0 0 20px;width:200px;"> <ul style="margin:10px 0 0 20px;width:200px;">
{% for validation_data in basket_element.getValidationDatas() %} {% for validation_data in basket_element.getValidationDatas() %}
{% if basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanSeeOthers() or validation_data.getParticipant().getUser(app) == app['phraseanet.user'] %} {% if basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanSeeOthers() or validation_data.getParticipant().getUser(app) == app['authentication'].getUser() %}
{% if validation_data.getAgreement() == true %} {% if validation_data.getAgreement() == true %}
{% set classuser = 'agree' %} {% set classuser = 'agree' %}
{% elseif validation_data.getAgreement() is null %} {% elseif validation_data.getAgreement() is null %}
@@ -27,19 +27,19 @@
{% set classuser = 'disagree' %} {% set classuser = 'disagree' %}
{% endif %} {% endif %}
{% set participant = validation_data.getParticipant().getUser(app) %} {% set participant = validation_data.getParticipant().getUser(app) %}
<li class="{% if participant.get_id() == app['phraseanet.user'].get_id() %}me{% endif %} {{classuser}} userchoice">{{participant.get_display_name()}}</li> <li class="{% if participant.get_id() == app['authentication'].getUser().get_id() %}me{% endif %} {{classuser}} userchoice">{{participant.get_display_name()}}</li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %} {% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
<div class="left choices"> <div class="left choices">
<div style="height:60px;margin-top:15px;"> <div style="height:60px;margin-top:15px;">
<table cellspacing="0" cellpadding="0" style="width:230px;"> <table cellspacing="0" cellpadding="0" style="width:230px;">
<tr> <tr>
<td> <td>
{% set agreement = basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() %} {% set agreement = basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() %}
<div style="width:70px;margin:0px auto 0;" class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}"> <div style="width:70px;margin:0px auto 0;" class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}">
<img src="/skins/lightbox/agree-bigie6.gif" style="vertical-align:middle;"/><span>{% trans 'validation:: OUI' %}</span> <img src="/skins/lightbox/agree-bigie6.gif" style="vertical-align:middle;"/><span>{% trans 'validation:: OUI' %}</span>
</div> </div>

View File

@@ -1,4 +1,4 @@
{% if basket.getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %} {% if basket.getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
<button class="confirm_report" title="{% trans 'validation::envoyer mon rapport'%}"> <button class="confirm_report" title="{% trans 'validation::envoyer mon rapport'%}">
<img src="/skins/lightbox/envoyerie6.gif"/> <img src="/skins/lightbox/envoyerie6.gif"/>
{% trans 'validation::envoyer mon rapport'%} {% trans 'validation::envoyer mon rapport'%}

View File

@@ -40,7 +40,7 @@
</div> </div>
<div class="container left"> <div class="container left">
{% if first_item %} {% if first_item %}
{% if app['phraseanet.user'].ACL().has_access_to_subdef(first_item.get_record(), 'preview') %} {% if app['authentication'].getUser().ACL().has_access_to_subdef(first_item.get_record(), 'preview') %}
{% set preview = first_item.get_record().get_preview() %} {% set preview = first_item.get_record().get_preview() %}
{% else %} {% else %}
{% set preview = first_item.get_record().get_thumbnail() %} {% set preview = first_item.get_record().get_thumbnail() %}
@@ -87,7 +87,7 @@
<div class="right_column_wrapper right_column_wrapper_caption left unselectable" style="width:230px;height:auto;"> <div class="right_column_wrapper right_column_wrapper_caption left unselectable" style="width:230px;height:auto;">
<div id="record_infos"> <div id="record_infos">
<div class="container"> <div class="container">
{% set business = app['phraseanet.user'].ACL().has_right_on_base(first_item.get_record().get_base_id(), 'canmodifrecord') %} {% set business = app['authentication'].getUser().ACL().has_right_on_base(first_item.get_record().get_base_id(), 'canmodifrecord') %}
{% if first_item %} {% if first_item %}
{{caption.format_caption(first_item.get_record(), '', null, business)}} {{caption.format_caption(first_item.get_record(), '', null, business)}}
{% endif %} {% endif %}

View File

@@ -56,7 +56,7 @@
</h2> </h2>
{% if basket.getValidation().isFinished() %} {% if basket.getValidation().isFinished() %}
{% trans '(validation) session terminee' %} {% trans '(validation) session terminee' %}
{% elseif basket.getValidation().getParticipant(app['phraseanet.user'], app).getIsConfirmed() %} {% elseif basket.getValidation().getParticipant(app['authentication'].getUser(), app).getIsConfirmed() %}
{% trans '(validation) envoyee' %} {% trans '(validation) envoyee' %}
{% else %} {% else %}
{% trans '(validation) a envoyer' %} {% trans '(validation) a envoyer' %}
@@ -72,7 +72,7 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div>{{ basket.getDescription() }}</div> <div>{{ basket.getDescription() }}</div>
<div>{{ basket.getValidation.getValidationString(app, app['phraseanet.user']) }}</div> <div>{{ basket.getValidation.getValidationString(app, app['authentication'].getUser()) }}</div>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -9,9 +9,9 @@
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div class="agreement"> <div class="agreement">
<img src="/skins/lightbox/agree.png" <img src="/skins/lightbox/agree.png"
class="agree_button {%if element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == false or element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" /> class="agree_button {%if element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == false or element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" />
<img src="/skins/lightbox/disagree.png" <img src="/skins/lightbox/disagree.png"
class="disagree_button {%if element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == true or element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" /> class="disagree_button {%if element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == true or element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" />
</div> </div>
{% endif %} {% endif %}
{{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}} {{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}}

View File

@@ -101,7 +101,7 @@
<div id="record_infos"> <div id="record_infos">
<div class="container"> <div class="container">
{% if basket_element %} {% if basket_element %}
{% set business = app['phraseanet.user'].ACL().has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %} {% set business = app['authentication'].getUser().ACL().has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %}
{{caption.format_caption(basket_element.getRecord(app), '', null, business)}} {{caption.format_caption(basket_element.getRecord(app), '', null, business)}}
{% endif %} {% endif %}
</div> </div>

View File

@@ -13,10 +13,10 @@
</tbody> </tbody>
</table> </table>
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div>{{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }}</div> <div>{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}</div>
<ul> <ul>
{% for choice in basket_element.getValidationDatas() %} {% for choice in basket_element.getValidationDatas() %}
{% if basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanSeeOthers() or choice.getParticipant().getUser(app) == app['phraseanet.user'] %} {% if basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanSeeOthers() or choice.getParticipant().getUser(app) == app['authentication'].getUser() %}
{% if choice.getAgreement() == true %} {% if choice.getAgreement() == true %}
{% set classuser = 'agree' %} {% set classuser = 'agree' %}
{% elseif choice.getAgreement() is null %} {% elseif choice.getAgreement() is null %}
@@ -25,17 +25,17 @@
{% set classuser = 'disagree' %} {% set classuser = 'disagree' %}
{% endif %} {% endif %}
{% set participant = choice.getParticipant().getUser(app) %} {% set participant = choice.getParticipant().getUser(app) %}
<li class="{% if participant.get_id() == app['phraseanet.user'].get_id() %}me{% endif %} {{classuser}} userchoice">{{participant.get_display_name()}}</li> <li class="{% if participant.get_id() == app['authentication'].getUser().get_id() %}me{% endif %} {{classuser}} userchoice">{{participant.get_display_name()}}</li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
</div> </div>
<div class="PNB user_infos"> <div class="PNB user_infos">
{% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %} {% if basket_element and basket_element.getBasket().getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
<div class="PNB choices"> <div class="PNB choices">
<div style="height:60px;"> <div style="height:60px;">
{% set agreement = basket_element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() %} {% set agreement = basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() %}
<div class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}"> <div class="ui-corner-all big_box agree_{{basket_element.getId()}} agree {% if agreement is null or agreement == false %}not_decided{% endif %}">
<img src="/skins/lightbox/agree-big.png"/><span class="title15">{% trans 'validation:: OUI' %}</span> <img src="/skins/lightbox/agree-big.png"/><span class="title15">{% trans 'validation:: OUI' %}</span>
</div> </div>

View File

@@ -1,4 +1,4 @@
{% if basket.getValidation() and basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanAgree() %} {% if basket.getValidation() and basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanAgree() %}
<button class="confirm_report" style="width:100%;" title="{% trans 'validation::envoyer mon rapport'%}"> <button class="confirm_report" style="width:100%;" title="{% trans 'validation::envoyer mon rapport'%}">
<img src="/skins/lightbox/envoyer.png"/> <img src="/skins/lightbox/envoyer.png"/>
{% trans 'validation::envoyer mon rapport'%} {% trans 'validation::envoyer mon rapport'%}

View File

@@ -44,7 +44,7 @@
</div> </div>
<div class="container PNB"> <div class="container PNB">
{% if first_item %} {% if first_item %}
{% if app['phraseanet.user'].ACL().has_access_to_subdef(first_item.get_record(), 'preview') %} {% if app['authentication'].getUser().ACL().has_access_to_subdef(first_item.get_record(), 'preview') %}
{% set bask_prev = first_item.get_record().get_preview() %} {% set bask_prev = first_item.get_record().get_preview() %}
{% else %} {% else %}
{% set bask_prev = first_item.get_record().get_thumbnail() %} {% set bask_prev = first_item.get_record().get_thumbnail() %}
@@ -83,7 +83,7 @@
<div class="right_column_wrapper caption right_column_wrapper_caption PNB"> <div class="right_column_wrapper caption right_column_wrapper_caption PNB">
<div id="record_infos" class="PNB"> <div id="record_infos" class="PNB">
<div class="container PNB"> <div class="container PNB">
{% set business = app['phraseanet.user'].ACL().has_right_on_base(first_item.get_record().get_base_id(), 'canmodifrecord') %} {% set business = app['authentication'].getUser().ACL().has_right_on_base(first_item.get_record().get_base_id(), 'canmodifrecord') %}
{% if first_item %} {% if first_item %}
{{caption.format_caption(first_item.get_record(), '', null, business)}} {{caption.format_caption(first_item.get_record(), '', null, business)}}
{% endif %} {% endif %}

View File

@@ -57,7 +57,7 @@
</h2> </h2>
{% if basket.getValidation().isFinished() %} {% if basket.getValidation().isFinished() %}
{% trans '(validation) session terminee' %} {% trans '(validation) session terminee' %}
{% elseif basket.getValidation().getParticipant(app['phraseanet.user'], app).getIsConfirmed() %} {% elseif basket.getValidation().getParticipant(app['authentication'].getUser(), app).getIsConfirmed() %}
{% trans '(validation) envoyee' %} {% trans '(validation) envoyee' %}
{% else %} {% else %}
{% trans '(validation) a envoyer' %} {% trans '(validation) a envoyer' %}
@@ -73,7 +73,7 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div>{{ basket.getDescription() }}</div> <div>{{ basket.getDescription() }}</div>
<div>{{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }}</div> <div>{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}</div>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -10,9 +10,9 @@
{% if basket.getValidation() %} {% if basket.getValidation() %}
<div class="agreement"> <div class="agreement">
<img src="/skins/lightbox/agree.png" <img src="/skins/lightbox/agree.png"
class="agree_button {%if element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == false or element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" /> class="agree_button {%if element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == false or element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() is null %}not_decided{%endif%} agree_{{element.getId()}}" />
<img src="/skins/lightbox/disagree.png" <img src="/skins/lightbox/disagree.png"
class="disagree_button {%if element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() == true or element.getUserValidationDatas(app['phraseanet.user'], app).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" /> class="disagree_button {%if element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() == true or element.getUserValidationDatas(app['authentication'].getUser(), app).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" />
</div> </div>
{% endif %} {% endif %}
{{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}} {{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}}

View File

@@ -8,7 +8,7 @@
<hr/> <hr/>
{% for validationDatas in basket_element.getValidationDatas() %} {% for validationDatas in basket_element.getValidationDatas() %}
{% if validationDatas.getNote() != '' %} {% if validationDatas.getNote() != '' %}
<div class="note_wrapper ui-corner-all {% if validationDatas.getParticipant().getUser(app).get_id() == app['phraseanet.user'].get_id() %}my_note{% endif %} "> <div class="note_wrapper ui-corner-all {% if validationDatas.getParticipant().getUser(app).get_id() == app['authentication'].getUser().get_id() %}my_note{% endif %} ">
<span class="note_author title15"> <span class="note_author title15">
{{validationDatas.getParticipant().getUser(app).get_display_name()}} {{validationDatas.getParticipant().getUser(app).get_display_name()}}
</span> : {{ validationDatas.getNote()|nl2br }} </span> : {{ validationDatas.getNote()|nl2br }}
@@ -17,7 +17,7 @@
{% endfor %} {% endfor %}
<form> <form>
<textarea>{{basket_element.getUserValidationDatas(app['phraseanet.user'], app).getNote()}}</textarea> <textarea>{{basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getNote()}}</textarea>
<div class="buttons"> <div class="buttons">
<button class="note_closer ui-corner-all"> <button class="note_closer ui-corner-all">
{% trans 'boutton::fermer' %} {% trans 'boutton::fermer' %}

View File

@@ -1,8 +1,8 @@
{% if basket_element and basket_element.getBasket().getValidation() %} {% if basket_element and basket_element.getBasket().getValidation() %}
<div class="agreement_selector" style="display:none;"> <div class="agreement_selector" style="display:none;">
<img src="/skins/lightbox/agree-big.png" <img src="/skins/lightbox/agree-big.png"
class="{% if basket_element.getUserValidationDatas (app['phraseanet.user'], app) != true %}not_decided{% endif %} agree_{{basket_element.getId()}}"/> class="{% if basket_element.getUserValidationDatas (app['authentication'].getUser(), app) != true %}not_decided{% endif %} agree_{{basket_element.getId()}}"/>
<img src="/skins/lightbox/disagree-big.png" <img src="/skins/lightbox/disagree-big.png"
class="{% if basket_element.getUserValidationDatas (app['phraseanet.user'], app) != false %}not_decided{% endif %} disagree_{{basket_element.getId()}}" /> class="{% if basket_element.getUserValidationDatas (app['authentication'].getUser(), app) != false %}not_decided{% endif %} disagree_{{basket_element.getId()}}" />
</div> </div>
{% endif %} {% endif %}

View File

@@ -99,7 +99,7 @@
<div id="record_infos" class="PNB"> <div id="record_infos" class="PNB">
<div class="container PNB"> <div class="container PNB">
{% if basket_element %} {% if basket_element %}
{% set business = app['phraseanet.user'].ACL().has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %} {% set business = app['authentication'].getUser().ACL().has_right_on_base(basket_element.getRecord(app).get_base_id(), 'canmodifrecord') %}
{{caption.format_caption(basket_element.getRecord(app), '', null, business)}} {{caption.format_caption(basket_element.getRecord(app), '', null, business)}}
{% endif %} {% endif %}
</div> </div>
@@ -183,7 +183,7 @@
<div id="dialog_dwnl" title="{% trans 'action : exporter' %}" style="display:none;"></div> <div id="dialog_dwnl" title="{% trans 'action : exporter' %}" style="display:none;"></div>
<script type="text/javascript"> <script type="text/javascript">
{% if basket.getValidation() %} {% if basket.getValidation() %}
p4.releasable = {% if basket.getValidation().getParticipant(app['phraseanet.user'], app).isReleasable() %}"{% trans 'Do you want to send your report ?' %}"{% else %}false{% endif %} p4.releasable = {% if basket.getValidation().getParticipant(app['authentication'].getUser(), app).isReleasable() %}"{% trans 'Do you want to send your report ?' %}"{% else %}false{% endif %}
{% endif %} {% endif %}
</script> </script>
{% endblock %} {% endblock %}

View File

@@ -132,6 +132,9 @@
<div style="height:530px;" class="tab-pane"> <div style="height:530px;" class="tab-pane">
<div id="id-main" class="tab-content" style="display:block;"> <div id="id-main" class="tab-content" style="display:block;">
<form name="send" action="/login/authenticate/" method="post" > <form name="send" action="/login/authenticate/" method="post" >
{% for provider in app['authentication.providers'] %}
<a href="{{ path('login_authentication_provider_authenticate', {'providerId' : provider.getId()}) }}">{{ provider.getId() }}</a>
{% endfor %}
{% if display_layout == 'DISPLAYx1' %} {% if display_layout == 'DISPLAYx1' %}
{% include 'login/index_layout_displayx1.html.twig' %} {% include 'login/index_layout_displayx1.html.twig' %}
{% elseif display_layout == 'DISPLAYx4' %} {% elseif display_layout == 'DISPLAYx4' %}

View File

@@ -2,7 +2,7 @@
<label>{% trans 'Collection' %}</label> <label>{% trans 'Collection' %}</label>
<select name="base_id"> <select name="base_id">
{% for collection in app['phraseanet.user'].ACL().get_granted_base(['canaddrecord']) %} {% for collection in app['authentication'].getUser().ACL().get_granted_base(['canaddrecord']) %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_databox().get_viewname() }} / {{ collection.get_name() }}</option> <option value="{{ collection.get_base_id() }}">{{ collection.get_databox().get_viewname() }} / {{ collection.get_name() }}</option>
{% endfor %} {% endfor %}
</select> </select>

View File

@@ -1,7 +1,7 @@
{% extends 'prod/Tooltip/Tooltip.html.twig'%} {% extends 'prod/Tooltip/Tooltip.html.twig'%}
{% set title %} {% set title %}
app['phraseanet.user'].get_display_name() app['authentication'].getUser().get_display_name()
{% endset %} {% endset %}
{% set width = 300 %} {% set width = 300 %}
{% set maxwidth = null %} {% set maxwidth = null %}
@@ -12,12 +12,12 @@
<img style="margin:14px 8px;" src="/skins/icons/user.png"/> <img style="margin:14px 8px;" src="/skins/icons/user.png"/>
</div> </div>
<div class="PNB" style="left:100px;"> <div class="PNB" style="left:100px;">
<h1> {{ app['phraseanet.user'].get_display_name() }}</h1> <h1> {{ app['authentication'].getUser().get_display_name() }}</h1>
<ul> <ul>
<li>{{ app['phraseanet.user'].get_email() }}</li> <li>{{ app['authentication'].getUser().get_email() }}</li>
<li>{{ app['phraseanet.user'].get_company() }}</li> <li>{{ app['authentication'].getUser().get_company() }}</li>
<li>{{ app['phraseanet.user'].get_job() }}</li> <li>{{ app['authentication'].getUser().get_job() }}</li>
<li>{{ app['phraseanet.user'].get_position() }}</li> <li>{{ app['authentication'].getUser().get_position() }}</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@@ -10,36 +10,36 @@
<img src="/skins/prod/000000/images/print_history.gif"/> <img src="/skins/prod/000000/images/print_history.gif"/>
</button> </button>
{% if app['phraseanet.user'].ACL().has_right('modifyrecord') %} {% if app['authentication'].getUser().ACL().has_right('modifyrecord') %}
<button class="ui-corner-all TOOL_ppen_btn basket_window" title="{% trans 'action : editer' %}"> <button class="ui-corner-all TOOL_ppen_btn basket_window" title="{% trans 'action : editer' %}">
<img src="/skins/prod/000000/images/ppen_history.gif"/> <img src="/skins/prod/000000/images/ppen_history.gif"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('changestatus') %} {% if app['authentication'].getUser().ACL().has_right('changestatus') %}
<button class="ui-corner-all TOOL_chgstatus_btn basket_window" title="{% trans 'action : status' %}"> <button class="ui-corner-all TOOL_chgstatus_btn basket_window" title="{% trans 'action : status' %}">
<img src="/skins/prod/000000/images/chgstatus_history.gif"/> <img src="/skins/prod/000000/images/chgstatus_history.gif"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('deleterecord') and app['phraseanet.user'].ACL().has_right('addrecord') %} {% if app['authentication'].getUser().ACL().has_right('deleterecord') and app['authentication'].getUser().ACL().has_right('addrecord') %}
<button class="ui-corner-all TOOL_chgcoll_btn basket_window" title="{% trans 'action : collection' %}"> <button class="ui-corner-all TOOL_chgcoll_btn basket_window" title="{% trans 'action : collection' %}">
<img src="/skins/prod/000000/images/chgcoll_history.gif"/> <img src="/skins/prod/000000/images/chgcoll_history.gif"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('push') %} {% if app['authentication'].getUser().ACL().has_right('push') %}
<button class="ui-corner-all TOOL_pushdoc_btn basket_window" title="{% trans 'action : push' %}"> <button class="ui-corner-all TOOL_pushdoc_btn basket_window" title="{% trans 'action : push' %}">
<img src="/skins/icons/push16.png"/> <img src="/skins/icons/push16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('push') %} {% if app['authentication'].getUser().ACL().has_right('push') %}
<button class="ui-corner-all TOOL_feedback_btn basket_window" title="{% trans 'Feedback' %}"> <button class="ui-corner-all TOOL_feedback_btn basket_window" title="{% trans 'Feedback' %}">
<img src="/skins/icons/feedback16.png"/> <img src="/skins/icons/feedback16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('bas_chupub') %} {% if app['authentication'].getUser().ACL().has_right('bas_chupub') %}
<button class="ui-corner-all TOOL_bridge_btn basket_window" title="{% trans 'action : bridge' %}"> <button class="ui-corner-all TOOL_bridge_btn basket_window" title="{% trans 'action : bridge' %}">
<img src="/skins/icons/door.png"/> <img src="/skins/icons/door.png"/>
</button> </button>
@@ -48,7 +48,7 @@
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('doctools') %} {% if app['authentication'].getUser().ACL().has_right('doctools') %}
<button class="ui-corner-all TOOL_imgtools_btn basket_window" title="{% trans 'action : outils' %}"> <button class="ui-corner-all TOOL_imgtools_btn basket_window" title="{% trans 'action : outils' %}">
<img src="/skins/prod/000000/images/imgtools_history.gif"/> <img src="/skins/prod/000000/images/imgtools_history.gif"/>
</button> </button>

View File

@@ -11,7 +11,7 @@
<td> <td>
<h1 class="title"> <h1 class="title">
<img class="loader" src="/skins/prod/Basket/Browser/loader.gif" /> <img class="loader" src="/skins/prod/Basket/Browser/loader.gif" />
{% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app['phraseanet.user']) %} {% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app['authentication'].getUser()) %}
<a href="/prod/baskets/{{ Basket.getId() }}/archive/?archive=1" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};"> <a href="/prod/baskets/{{ Basket.getId() }}/archive/?archive=1" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};">
<span> <span>
<img src="/skins/prod/Basket/Browser/archive.png"/> <img src="/skins/prod/Basket/Browser/archive.png"/>

View File

@@ -49,7 +49,7 @@
<td class="content"> <td class="content">
<h1 class="title"> <h1 class="title">
<img class="loader" src="/skins/prod/Basket/Browser/loader.gif" /> <img class="loader" src="/skins/prod/Basket/Browser/loader.gif" />
{% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app['phraseanet.user']) %} {% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app['authentication'].getUser()) %}
<a href="/prod/baskets/{{ Basket.getId() }}/archive/?archive=1" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};"> <a href="/prod/baskets/{{ Basket.getId() }}/archive/?archive=1" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};">
<span> <span>
<img src="/skins/prod/Basket/Browser/archive.png"/> <img src="/skins/prod/Basket/Browser/archive.png"/>

View File

@@ -276,10 +276,10 @@
{% macro element(wz_scope, container, contained, record, ord) %} {% macro element(wz_scope, container, contained, record, ord) %}
{% set box_height = 110 %} {% set box_height = 110 %}
{% if app['phraseanet.user'].getPrefs('basket_title_display') == '1' %} {% if app['authentication'].getUser().getPrefs('basket_title_display') == '1' %}
{% set box_height = (box_height + 20) %} {% set box_height = (box_height + 20) %}
{% endif %} {% endif %}
{% if app['phraseanet.user'].getPrefs('basket_status_display') == '1' %} {% if app['authentication'].getUser().getPrefs('basket_status_display') == '1' %}
{% set box_height = (box_height + 20) %} {% set box_height = (box_height + 20) %}
{% endif %} {% endif %}
@@ -289,12 +289,12 @@
class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;" class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;"
id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}"> id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}">
<input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/> <input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/>
{% if app['phraseanet.user'].getPrefs('basket_title_display') == '1' %} {% if app['authentication'].getUser().getPrefs('basket_title_display') == '1' %}
<div class="title"> <div class="title">
{{record.get_title()}} {{record.get_title()}}
</div> </div>
{% endif %} {% endif %}
{% if app['phraseanet.user'].getPrefs('basket_status_display') == '1' %} {% if app['authentication'].getUser().getPrefs('basket_status_display') == '1' %}
<div class="status" style="position:relative;height:20px;overflow-y:visible;z-index:15;"> <div class="status" style="position:relative;height:20px;overflow-y:visible;z-index:15;">
{{record.get_status_icons|raw}} {{record.get_status_icons|raw}}
</div> </div>
@@ -317,7 +317,7 @@
class="WorkZoneElementRemover {{ wz_scope }}" title="{% trans 'delete'%}" > class="WorkZoneElementRemover {{ wz_scope }}" title="{% trans 'delete'%}" >
X X
</a> </a>
{% if app['phraseanet.user'].getPrefs('basket_caption_display') == '1' %} {% if app['authentication'].getUser().getPrefs('basket_caption_display') == '1' %}
<div class="captionRolloverTips" tooltipsrc="/prod/tooltip/caption/{{record.get_sbas_id()}}/{{record.get_record_id()}}/basket/?number={{record.get_number()}}"></div> <div class="captionRolloverTips" tooltipsrc="/prod/tooltip/caption/{{record.get_sbas_id()}}/{{record.get_record_id()}}/basket/?number={{record.get_number()}}"></div>
{% endif %} {% endif %}
</div> </div>
@@ -353,7 +353,7 @@
<td style="width:100%;"> <td style="width:100%;">
<table style=width:100%> <table style=width:100%>
{% for choice in basket_element.getValidationDatas() %} {% for choice in basket_element.getValidationDatas() %}
{% if basket.getValidation().getParticipant(app['phraseanet.user'], app).getCanSeeOthers() or choice.getParticipant().getUser(app) == app['phraseanet.user'] %} {% if basket.getValidation().getParticipant(app['authentication'].getUser(), app).getCanSeeOthers() or choice.getParticipant().getUser(app) == app['authentication'].getUser() %}
<tr> <tr>
<td> {{ choice.getParticipant().getUser(app).get_display_name() }} </td> <td> {{ choice.getParticipant().getUser(app).get_display_name() }} </td>
<td> <td>

View File

@@ -9,36 +9,36 @@
<img src="/skins/prod/000000/images/print_history.gif"/> <img src="/skins/prod/000000/images/print_history.gif"/>
</button> </button>
{% if app['phraseanet.user'].ACL().has_right('modifyrecord') %} {% if app['authentication'].getUser().ACL().has_right('modifyrecord') %}
<button class="ui-corner-all TOOL_ppen_btn story_window" title="{% trans 'action : editer' %}"> <button class="ui-corner-all TOOL_ppen_btn story_window" title="{% trans 'action : editer' %}">
<img src="/skins/prod/000000/images/ppen_history.gif"/> <img src="/skins/prod/000000/images/ppen_history.gif"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('changestatus') %} {% if app['authentication'].getUser().ACL().has_right('changestatus') %}
<button class="ui-corner-all TOOL_chgstatus_btn story_window" title="{% trans 'action : status' %}"> <button class="ui-corner-all TOOL_chgstatus_btn story_window" title="{% trans 'action : status' %}">
<img src="/skins/prod/000000/images/chgstatus_history.gif"/> <img src="/skins/prod/000000/images/chgstatus_history.gif"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('deleterecord') and app['phraseanet.user'].ACL().has_right('addrecord') %} {% if app['authentication'].getUser().ACL().has_right('deleterecord') and app['authentication'].getUser().ACL().has_right('addrecord') %}
<button class="ui-corner-all TOOL_chgcoll_btn story_window" title="{% trans 'action : collection' %}"> <button class="ui-corner-all TOOL_chgcoll_btn story_window" title="{% trans 'action : collection' %}">
<img src="/skins/prod/000000/images/chgcoll_history.gif"/> <img src="/skins/prod/000000/images/chgcoll_history.gif"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('push') %} {% if app['authentication'].getUser().ACL().has_right('push') %}
<button class="ui-corner-all TOOL_pushdoc_btn story_window" title="{% trans 'action : push' %}"> <button class="ui-corner-all TOOL_pushdoc_btn story_window" title="{% trans 'action : push' %}">
<img src="/skins/icons/push16.png"/> <img src="/skins/icons/push16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('push') %} {% if app['authentication'].getUser().ACL().has_right('push') %}
<button class="ui-corner-all TOOL_feedback_btn story_window" title="{% trans 'Feedback' %}"> <button class="ui-corner-all TOOL_feedback_btn story_window" title="{% trans 'Feedback' %}">
<img src="/skins/icons/feedback16.png"/> <img src="/skins/icons/feedback16.png"/>
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('bas_chupub') %} {% if app['authentication'].getUser().ACL().has_right('bas_chupub') %}
<button class="ui-corner-all TOOL_bridge_btn story_window" title="{% trans 'action : bridge' %}"> <button class="ui-corner-all TOOL_bridge_btn story_window" title="{% trans 'action : bridge' %}">
<img src="/skins/icons/door.png"/> <img src="/skins/icons/door.png"/>
</button> </button>
@@ -47,7 +47,7 @@
</button> </button>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('doctools') %} {% if app['authentication'].getUser().ACL().has_right('doctools') %}
<button class="ui-corner-all TOOL_imgtools_btn story_window" title="{% trans 'action : outils' %}"> <button class="ui-corner-all TOOL_imgtools_btn story_window" title="{% trans 'action : outils' %}">
<img src="/skins/prod/000000/images/imgtools_history.gif"/> <img src="/skins/prod/000000/images/imgtools_history.gif"/>
</button> </button>

View File

@@ -33,7 +33,7 @@
<input type="hidden" name="usr_id" value="{{ owner.getUser().get_id() }}" /> <input type="hidden" name="usr_id" value="{{ owner.getUser().get_id() }}" />
</td> </td>
<td style="padding-right:10px;min-width:100px;"> <td style="padding-right:10px;min-width:100px;">
{% if app['phraseanet.user'].get_id() == owner.getUser(app).get_id() %} {% if app['authentication'].getUser().get_id() == owner.getUser(app).get_id() %}
{% if owner.getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if owner.getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
{% trans 'You are Admin' %} {% trans 'You are Admin' %}
{% endif %} {% endif %}
@@ -53,7 +53,7 @@
{% endif %} {% endif %}
</td> </td>
<td style="width:15px"> <td style="width:15px">
{% if app['phraseanet.user'].get_id() != owner.getUser(app).get_id() %} {% if app['authentication'].getUser().get_id() != owner.getUser(app).get_id() %}
<a href="#" class="deleter"> <a href="#" class="deleter">
<img src="/skins/prod/Push/close_badge.png" title="{% trans 'Remove' %}"/> <img src="/skins/prod/Push/close_badge.png" title="{% trans 'Remove' %}"/>
</a> </a>

View File

@@ -5,7 +5,7 @@
<table style="height: 40px;"> <table style="height: 40px;">
<tr> <tr>
<td style="white-space:nowrap;"> <td style="white-space:nowrap;">
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<form class="form-inline" method="POST" name="SaveName" action="/prod/lists/list/{{ list.getId() }}/update/"> <form class="form-inline" method="POST" name="SaveName" action="/prod/lists/list/{{ list.getId() }}/update/">
<label>{% trans 'List Name' %}</label> <label>{% trans 'List Name' %}</label>
<input type="text" name="name" style="margin: 0 5px;" value="{{ list.getName() }}"/> <input type="text" name="name" style="margin: 0 5px;" value="{{ list.getName() }}"/>
@@ -16,14 +16,14 @@
{% endif %} {% endif %}
</td> </td>
<td style="text-align:right;white-space:nowrap;"> <td style="text-align:right;white-space:nowrap;">
{% if list.getOwner(app['phraseanet.user'], app).getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if list.getOwner(app['authentication'].getUser(), app).getRole() == constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<a href="/prod/lists/list/{{ list.getId() }}/share/" title="{% trans 'Share the list' %}" class="list_sharer"> <a href="/prod/lists/list/{{ list.getId() }}/share/" title="{% trans 'Share the list' %}" class="list_sharer">
<img src="/skins/prod/Push/list-icon.png" /> <img src="/skins/prod/Push/list-icon.png" />
{% trans "Set sharing permission" %} {% trans "Set sharing permission" %}
</a> </a>
{% endif %} {% endif %}
</td> </td>
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %} {% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_ADMIN') %}
<td style="text-align:right;white-space:nowrap;width:150px;"> <td style="text-align:right;white-space:nowrap;width:150px;">
<button class="deleter btn btn-inverse"> <button class="deleter btn btn-inverse">
{% trans 'Delete' %} {% trans 'Delete' %}
@@ -40,20 +40,20 @@
<p> <p>
{% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %} {% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %}
{% trans %}{{ length }} peoples{% endtrans %} {% trans %}{{ length }} peoples{% endtrans %}
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<button class="EditToggle btn btn-inverse">{% trans 'Edit' %}</button> <button class="EditToggle btn btn-inverse">{% trans 'Edit' %}</button>
{% endif %} {% endif %}
</p> </p>
</div> </div>
<div class="PNB" style="top:35px;overflow:auto;"> <div class="PNB" style="top:35px;overflow:auto;">
{% set role = list.getOwner(app['phraseanet.user'], app).getRole() %} {% set role = list.getOwner(app['authentication'].getUser(), app).getRole() %}
{% for entry in list.getEntries() %} {% for entry in list.getEntries() %}
{{ ListsMacros.badgeReadonly(entry, role) }} {{ ListsMacros.badgeReadonly(entry, role) }}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div> </div>
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<div class="PNB content readwrite grey-bg" style="display:none;top:40px;"> <div class="PNB content readwrite grey-bg" style="display:none;top:40px;">
<form name="list-editor-search" method="POST" action="/prod/push/edit-list/{{ list.getId() }}/"> <form name="list-editor-search" method="POST" action="/prod/push/edit-list/{{ list.getId() }}/">
<div class="PNB10" style="height:160px;"> <div class="PNB10" style="height:160px;">

View File

@@ -14,7 +14,7 @@
{% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %} {% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %}
<li class="list" style="padding:2px;"> <li class="list" style="padding:2px;">
<a href="/prod/push/edit-list/{{ list.getId() }}/" class="list_link"> <a href="/prod/push/edit-list/{{ list.getId() }}/" class="list_link">
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<img src="/skins/prod/Push/list-icon.png" /> <img src="/skins/prod/Push/list-icon.png" />
{% else %} {% else %}
<img src="/skins/icons/SHARE16.png" /> <img src="/skins/icons/SHARE16.png" />

View File

@@ -48,7 +48,7 @@
{% for list in lists %} {% for list in lists %}
<li class="list" style="padding:2px;"> <li class="list" style="padding:2px;">
<a class="list_loader" href="/prod/push/list/{{ list.getId() }}/"> <a class="list_loader" href="/prod/push/list/{{ list.getId() }}/">
{% if list.getOwner(app['phraseanet.user'], app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %} {% if list.getOwner(app['authentication'].getUser(), app).getRole() >= constant('\\Entities\\UsrListOwner::ROLE_EDITOR') %}
<img src="/skins/prod/Push/list-icon.png" /> <img src="/skins/prod/Push/list-icon.png" />
{% else %} {% else %}
<img src="/skins/icons/SHARE16.png" /> <img src="/skins/icons/SHARE16.png" />
@@ -73,7 +73,7 @@
<input class="search" name="users-search" placeholder="{% trans 'Users' %}" type="text" style="width:210px;"/> <input class="search" name="users-search" placeholder="{% trans 'Users' %}" type="text" style="width:210px;"/>
<br/> <br/>
{% trans 'Select a user in the list'%} <br/> {% trans 'Select a user in the list'%} <br/>
{% if app['phraseanet.user'].ACL().has_right('manageusers') %} {% if app['authentication'].getUser().ACL().has_right('manageusers') %}
{% trans 'or' %} {% trans 'or' %}
<a href="/prod/push/add-user/" class="user_adder link">{% trans 'Add user' %}</a> <a href="/prod/push/add-user/" class="user_adder link">{% trans 'Add user' %}</a>
{% endif %} {% endif %}

View File

@@ -4,8 +4,8 @@
{% set cont_width = 130 %} {% set cont_width = 130 %}
{% set cont_height = 140 %} {% set cont_height = 140 %}
{% else %} {% else %}
{% set cont_width = app['phraseanet.user'].getPrefs('editing_images_size') %} {% set cont_width = app['authentication'].getUser().getPrefs('editing_images_size') %}
{% set cont_height = app['phraseanet.user'].getPrefs('editing_images_size') %} {% set cont_height = app['authentication'].getUser().getPrefs('editing_images_size') %}
{% endif %} {% endif %}
{% set i = record.get_number() %} {% set i = record.get_number() %}
@@ -27,7 +27,7 @@
{% endif %} {% endif %}
{% set class_status = 'nostatus' %} {% set class_status = 'nostatus' %}
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'chgstatus') %} {% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'chgstatus') %}
{% set class_status = '' %} {% set class_status = '' %}
{% endif %} {% endif %}
@@ -71,8 +71,8 @@
{%trans 'prod::editing::fields: status ' %} {%trans 'prod::editing::fields: status ' %}
</div> </div>
{% set cssfile = '000000' %} {% set cssfile = '000000' %}
{% if app['phraseanet.user'].getPrefs('css') %} {% if app['authentication'].getUser().getPrefs('css') %}
{% set cssfile = app['phraseanet.user'].getPrefs('css') %} {% set cssfile = app['authentication'].getUser().getPrefs('css') %}
{% endif %} {% endif %}
{% for field in fields %} {% for field in fields %}
{% set i = field.get_id() %} {% set i = field.get_id() %}
@@ -127,7 +127,7 @@
<input style="font-size:2px; width:5px;" type="text" id="editFakefocus" /> <input style="font-size:2px; width:5px;" type="text" id="editFakefocus" />
</form> </form>
</div> </div>
<div id="EDIT_TOP" style="height:{{app['phraseanet.user'].getPrefs('editing_top_box')}};"> <div id="EDIT_TOP" style="height:{{app['authentication'].getUser().getPrefs('editing_top_box')}};">
<div id="EDIT_MENU"> <div id="EDIT_MENU">
<div id="EDIT_ZOOMSLIDER" > <div id="EDIT_ZOOMSLIDER" >
</div> </div>
@@ -150,7 +150,7 @@
<div id='EDIT_MID'> <div id='EDIT_MID'>
<div id='EDIT_MID_L' class='ui-corner-all'> <div id='EDIT_MID_L' class='ui-corner-all'>
<div id="divS_wrapper" style="width:{{app['phraseanet.user'].getPrefs('editing_right_box')}}"> <div id="divS_wrapper" style="width:{{app['authentication'].getUser().getPrefs('editing_right_box')}}">
<div id="divS"> <div id="divS">
{{_self.HTML_fieldlist(recordsRequest, fields)}} {{_self.HTML_fieldlist(recordsRequest, fields)}}
</div> </div>
@@ -230,7 +230,7 @@
<div id="idExplain" class="PNB"></div> <div id="idExplain" class="PNB"></div>
</div> </div>
</div> </div>
<div id="EDIT_MID_R" style="width:{{app['phraseanet.user'].getPrefs('editing_left_box')}}"> <div id="EDIT_MID_R" style="width:{{app['authentication'].getUser().getPrefs('editing_left_box')}}">
<div style='position:absolute; top:0; left:0; right:0; bottom:0;' class='tabs'> <div style='position:absolute; top:0; left:0; right:0; bottom:0;' class='tabs'>
<ul> <ul>
{% if thesaurus %} {% if thesaurus %}

View File

@@ -44,9 +44,9 @@
<label for="feed_add_subtitle">{% trans 'publication : sous titre' %}</label> <label for="feed_add_subtitle">{% trans 'publication : sous titre' %}</label>
<textarea id="feed_add_subtitle" name="subtitle">{{desc}}</textarea> <textarea id="feed_add_subtitle" name="subtitle">{{desc}}</textarea>
<label for="feed_add_author_name">{% trans 'publication : autheur' %}</label> <label for="feed_add_author_name">{% trans 'publication : autheur' %}</label>
<input class="required_text" type="text" name="author_name" id="feed_add_author_name" value="{{ app['phraseanet.user'].get_display_name() }}" /> <input class="required_text" type="text" name="author_name" id="feed_add_author_name" value="{{ app['authentication'].getUser().get_display_name() }}" />
<label for="feed_add_author_mail">{% trans 'publication : email autheur' %}</label> <label for="feed_add_author_mail">{% trans 'publication : email autheur' %}</label>
<input class="required_text" type="text" name="author_mail" id="feed_add_author_mail" value="{{ app['phraseanet.user'].get_email() }}" /> <input class="required_text" type="text" name="author_mail" id="feed_add_author_mail" value="{{ app['authentication'].getUser().get_email() }}" />
</div> </div>
</div> </div>
<div class="PNB" style="width:50%;left:auto;"> <div class="PNB" style="width:50%;left:auto;">
@@ -54,7 +54,7 @@
<h1>{% trans 'Fils disponibles' %}</h1> <h1>{% trans 'Fils disponibles' %}</h1>
<div class="list"> <div class="list">
{% for feed in feeds.get_feeds() %} {% for feed in feeds.get_feeds() %}
{% if feed.is_publisher(app['phraseanet.user']) %} {% if feed.is_publisher(app['authentication'].getUser()) %}
<div class="feed {% if loop.index is odd%}odd{% endif %}"> <div class="feed {% if loop.index is odd%}odd{% endif %}">
<span>{{ feed.get_title() }}</span> <span>{{ feed.get_title() }}</span>
{% if feed.is_public() %} {% if feed.is_public() %}

View File

@@ -47,7 +47,7 @@
<div class="list"> <div class="list">
{% set feed_id = entry.get_feed().get_id() %} {% set feed_id = entry.get_feed().get_id() %}
{% for feed in feeds.get_feeds() %} {% for feed in feeds.get_feeds() %}
{% if feed.is_publisher(app['phraseanet.user']) %} {% if feed.is_publisher(app['authentication'].getUser()) %}
<div class="feed {% if loop.index is odd%}odd{% endif %} {% if feed_id == feed.get_id() %}selected{% endif %}"> <div class="feed {% if loop.index is odd%}odd{% endif %} {% if feed_id == feed.get_id() %}selected{% endif %}">
<span>{{ feed.get_title() }}</span> <span>{{ feed.get_title() }}</span>
<input type="hidden" value="{{ feed.get_id() }}"/> <input type="hidden" value="{{ feed.get_id() }}"/>

View File

@@ -15,7 +15,7 @@
</h1> </h1>
</td> </td>
<td style="width:60px;text-align:right;"> <td style="width:60px;text-align:right;">
{% if entry.get_feed().is_owner(app['phraseanet.user']) or entry.is_publisher(app['phraseanet.user']) %} {% if entry.get_feed().is_owner(app['authentication'].getUser()) or entry.is_publisher(app['authentication'].getUser()) %}
<a class="tools options feed_edit" href="/prod/feeds/entry/{{ entry.get_id() }}/edit/"> <a class="tools options feed_edit" href="/prod/feeds/entry/{{ entry.get_id() }}/edit/">
<img src="/skins/icons/file-edit.png" title="{% trans 'boutton::editer' %}"/> <img src="/skins/icons/file-edit.png" title="{% trans 'boutton::editer' %}"/>
</a> </a>

View File

@@ -54,9 +54,9 @@
{% block rss %} {% block rss %}
{% for feed in feeds %} {% for feed in feeds %}
{% set link = feed.get_user_link(app['phraseanet.registry'], app['phraseanet.user'], 'rss') %} {% set link = feed.get_user_link(app['phraseanet.registry'], app['authentication'].getUser(), 'rss') %}
<link rel="alternate" type="{{ link.get_mimetype() }}" title="{{ link.get_title() }}" href="{{ link.get_href() }}" /> <link rel="alternate" type="{{ link.get_mimetype() }}" title="{{ link.get_title() }}" href="{{ link.get_href() }}" />
{% set link = feed.get_user_link(app['phraseanet.registry'], app['phraseanet.user'], 'atom') %} {% set link = feed.get_user_link(app['phraseanet.registry'], app['authentication'].getUser(), 'atom') %}
<link rel="alternate" type="{{ link.get_mimetype() }}" title="{{ link.get_title() }}" href="{{ link.get_href() }}" /> <link rel="alternate" type="{{ link.get_mimetype() }}" title="{{ link.get_title() }}" href="{{ link.get_href() }}" />
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
@@ -110,12 +110,12 @@
<style title="color_selection" type="text/css"> <style title="color_selection" type="text/css">
/* .diapo.ui-selecting,#reorder_box .diapo.selecting, #EDIT_ALL .diapo.selecting, .list.selecting, .list.selecting .diapo { /* .diapo.ui-selecting,#reorder_box .diapo.selecting, #EDIT_ALL .diapo.selecting, .list.selecting, .list.selecting .diapo {
color: #{% if app['phraseanet.user'].getPrefs('fontcolor-selection') != '' %}{{app['phraseanet.user'].getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %}; color: #{% if app['authentication'].getUser().getPrefs('fontcolor-selection') != '' %}{{app['authentication'].getUser().getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %};
background-color: #{% if app['phraseanet.user'].getPrefs('background-selection-disabled') != '' %}{{app['phraseanet.user'].getPrefs('background-selection-disabled')}}{% else %}333333{% endif %}; background-color: #{% if app['authentication'].getUser().getPrefs('background-selection-disabled') != '' %}{{app['authentication'].getUser().getPrefs('background-selection-disabled')}}{% else %}333333{% endif %};
}*/ }*/
.diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo { .diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo {
color: #{% if app['phraseanet.user'].getPrefs('fontcolor-selection') != '' %}{{app['phraseanet.user'].getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %}; color: #{% if app['authentication'].getUser().getPrefs('fontcolor-selection') != '' %}{{app['authentication'].getUser().getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %};
background-color: #{% if app['phraseanet.user'].getPrefs('background-selection') != '' %}{{app['phraseanet.user'].getPrefs('background-selection')}}{% else %}404040{% endif %}; background-color: #{% if app['authentication'].getUser().getPrefs('background-selection') != '' %}{{app['authentication'].getUser().getPrefs('background-selection')}}{% else %}404040{% endif %};
} }
</style> </style>
{% endblock %} {% endblock %}
@@ -140,7 +140,7 @@
<div id="desktop" class="PNB" style="overflow:hidden;"> <div id="desktop" class="PNB" style="overflow:hidden;">
{% set ratio = app['phraseanet.user'].getPrefs('search_window') %} {% set ratio = app['authentication'].getUser().getPrefs('search_window') %}
{% if ratio == 0 %} {% if ratio == 0 %}
{% set ratio = '0.333' %} {% set ratio = '0.333' %}
{% endif %} {% endif %}
@@ -186,7 +186,7 @@
<div id="THPD_tabs"> <div id="THPD_tabs">
<ul> <ul>
<li class="th_tab"><a href="#THPD_T"><span>{% trans 'prod::thesaurusTab:thesaurus' %}</span></a></li> <li class="th_tab"><a href="#THPD_T"><span>{% trans 'prod::thesaurusTab:thesaurus' %}</span></a></li>
{% if app['phraseanet.user'].ACL().has_access_to_module('thesaurus') %} {% if app['authentication'].getUser().ACL().has_access_to_module('thesaurus') %}
<li class="th_tab"><a href="#THPD_C"><span>{% trans 'prod::thesaurusTab:candidats' %}</span></a></li> <li class="th_tab"><a href="#THPD_C"><span>{% trans 'prod::thesaurusTab:candidats' %}</span></a></li>
{% endif %} {% endif %}
</ul> </ul>
@@ -224,7 +224,7 @@
</div> </div>
</div> </div>
</div> </div>
{% if app['phraseanet.user'].ACL().has_access_to_module('thesaurus') %} {% if app['authentication'].getUser().ACL().has_access_to_module('thesaurus') %}
<div id="THPD_C"> <div id="THPD_C">
<div id='THPD_C_treeBox' class="searchZone"> <div id='THPD_C_treeBox' class="searchZone">
<div onclick="Xclick(event);return(false);" ondblclick="CXdblClick(event);"> <div onclick="Xclick(event);return(false);" ondblclick="CXdblClick(event);">
@@ -297,7 +297,7 @@
<div id="headBlock" class="PNB" style="height: 90px; bottom: auto;"> <div id="headBlock" class="PNB" style="height: 90px; bottom: auto;">
<div style="margin: 15px auto; line-height: 30px; width: 580px;"> <div style="margin: 15px auto; line-height: 30px; width: 580px;">
<form id="searchForm" action="/prod/query/" name="phrasea_query" class="phrasea_query"> <form id="searchForm" action="/prod/query/" name="phrasea_query" class="phrasea_query">
<input autocomplete="off" class="search query" id="EDIT_query" name="qry" type="text" name="qry" value="{{app['phraseanet.user'].getPrefs('start_page_query')}}"> <input autocomplete="off" class="search query" id="EDIT_query" name="qry" type="text" name="qry" value="{{app['authentication'].getUser().getPrefs('start_page_query')}}">
<a href="#" class="adv_trigger adv_search_button"> <a href="#" class="adv_trigger adv_search_button">
<img src="/skins/icons/settings.png" title="{% trans 'Advanced Search' %}"/> <img src="/skins/icons/settings.png" title="{% trans 'Advanced Search' %}"/>
</a> </a>
@@ -536,19 +536,19 @@
</span> </span>
{% set actions = {} %} {% set actions = {} %}
{% if app['phraseanet.user'].ACL().has_right('modifyrecord') %} {% if app['authentication'].getUser().ACL().has_right('modifyrecord') %}
{% set label %} {% set label %}
{% trans 'action : editer' %} {% trans 'action : editer' %}
{% endset %} {% endset %}
{% set actions = actions|merge( { 'edit' : {'icon': "/skins/prod/000000/images/ppen_history.gif", 'class':'TOOL_ppen_btn', 'label' : label} }) %} {% set actions = actions|merge( { 'edit' : {'icon': "/skins/prod/000000/images/ppen_history.gif", 'class':'TOOL_ppen_btn', 'label' : label} }) %}
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('changestatus') %} {% if app['authentication'].getUser().ACL().has_right('changestatus') %}
{% set label %} {% set label %}
{% trans 'action : status' %} {% trans 'action : status' %}
{% endset %} {% endset %}
{% set actions = actions|merge( { 'status' : {'icon': "/skins/prod/000000/images/chgstatus_history.gif", 'class':'TOOL_chgstatus_btn', 'label' : label} }) %} {% set actions = actions|merge( { 'status' : {'icon': "/skins/prod/000000/images/chgstatus_history.gif", 'class':'TOOL_chgstatus_btn', 'label' : label} }) %}
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('deleterecord') and app['phraseanet.user'].ACL().has_right('addrecord') %} {% if app['authentication'].getUser().ACL().has_right('deleterecord') and app['authentication'].getUser().ACL().has_right('addrecord') %}
{% set label %} {% set label %}
{% trans 'action : collection' %} {% trans 'action : collection' %}
{% endset %} {% endset %}
@@ -596,7 +596,7 @@
</span> </span>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('push') and app['phraseanet.user'].ACL().has_right('bas_chupub') %} {% if app['authentication'].getUser().ACL().has_right('push') and app['authentication'].getUser().ACL().has_right('bas_chupub') %}
<span class="dropdownButton"> <span class="dropdownButton">
<div class="btn-group"> <div class="btn-group">
<button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse"> <button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse">
@@ -627,7 +627,7 @@
</ul> </ul>
</div> </div>
</span> </span>
{% elseif app['phraseanet.user'].ACL().has_right('push') %} {% elseif app['authentication'].getUser().ACL().has_right('push') %}
<span class="dropdownButton"> <span class="dropdownButton">
<div class="btn-group"> <div class="btn-group">
<button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse" > <button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse" >
@@ -644,7 +644,7 @@
</ul> </ul>
</div> </div>
</span> </span>
{% elseif app['phraseanet.user'].ACL().has_right('bas_chupub') %} {% elseif app['authentication'].getUser().ACL().has_right('bas_chupub') %}
<span class="dropdownButton"> <span class="dropdownButton">
<div class="btn-group"> <div class="btn-group">
<button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse" > <button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse" >
@@ -663,7 +663,7 @@
</span> </span>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('doctools') %} {% if app['authentication'].getUser().ACL().has_right('doctools') %}
<span class="classicButton"> <span class="classicButton">
<div class="btn-group"> <div class="btn-group">
<button class="TOOL_imgtools_btn results_window btn btn-inverse" > <button class="TOOL_imgtools_btn results_window btn btn-inverse" >
@@ -672,7 +672,7 @@
</div> </div>
</span> </span>
{% endif %} {% endif %}
{% if app['phraseanet.user'].ACL().has_right('deleterecord') %} {% if app['authentication'].getUser().ACL().has_right('deleterecord') %}
<span class="classicButton"> <span class="classicButton">
<div class="btn-group"> <div class="btn-group">
<button class="TOOL_trash_btn results_window btn btn-inverse" > <button class="TOOL_trash_btn results_window btn btn-inverse" >
@@ -685,11 +685,11 @@
<div id="answers" class=" PNB10" style="top:48px; bottom:30px;"> <div id="answers" class=" PNB10" style="top:48px; bottom:30px;">
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
{% if app['phraseanet.user'].getPrefs('start_page') == 'QUERY' %} {% if app['authentication'].getUser().getPrefs('start_page') == 'QUERY' %}
$('form[name="phrasea_query"]').addClass('triggerAfterInit') $('form[name="phrasea_query"]').addClass('triggerAfterInit')
{% elseif app['phraseanet.user'].getPrefs('start_page') == 'LAST_QUERY' %} {% elseif app['authentication'].getUser().getPrefs('start_page') == 'LAST_QUERY' %}
$('form[name="phrasea_query"]').addClass('triggerAfterInit') $('form[name="phrasea_query"]').addClass('triggerAfterInit')
{% elseif app['phraseanet.user'].getPrefs('start_page') == 'PUBLI' %} {% elseif app['authentication'].getUser().getPrefs('start_page') == 'PUBLI' %}
getHome('PUBLI'); getHome('PUBLI');
{% endif %} {% endif %}
}); });
@@ -746,7 +746,7 @@
<div id="MESSAGE-push"></div> <div id="MESSAGE-push"></div>
<div id="MESSAGE-publi"></div> <div id="MESSAGE-publi"></div>
<div id="DIALOG"></div> <div id="DIALOG"></div>
<div id="keyboard-dialog" class="{% if app['phraseanet.user'].getPrefs('keyboard_infos') != '0' %}auto{% endif %}" style="display:none;" title="{% trans 'raccourci :: a propos des raccourcis claviers' %}"> <div id="keyboard-dialog" class="{% if app['authentication'].getUser().getPrefs('keyboard_infos') != '0' %}auto{% endif %}" style="display:none;" title="{% trans 'raccourci :: a propos des raccourcis claviers' %}">
<div> <div>
<h1>{% trans 'Raccourcis claviers en cours de recherche : ' %}</h1> <h1>{% trans 'Raccourcis claviers en cours de recherche : ' %}</h1>
<ul> <ul>
@@ -810,7 +810,7 @@
<div class="box"> <div class="box">
<div class="" style="float:left; width:49%;"> <div class="" style="float:left; width:49%;">
<h1>{% trans 'Mode de presentation' %}</h1> <h1>{% trans 'Mode de presentation' %}</h1>
{% set mod = app['phraseanet.user'].getPrefs('view') %} {% set mod = app['authentication'].getUser().getPrefs('view') %}
<label class="radio inline" for="thumbs_view"> <label class="radio inline" for="thumbs_view">
<input onchange="setPref('view',$(this).val())" name="view_type" type="radio" style="margin: 3px 0 0 -18px;" class="radio" value="thumbs" id="thumbs_view" {% if mod == 'thumbs' %}checked="checked"{% endif %}/> <input onchange="setPref('view',$(this).val())" name="view_type" type="radio" style="margin: 3px 0 0 -18px;" class="radio" value="thumbs" id="thumbs_view" {% if mod == 'thumbs' %}checked="checked"{% endif %}/>
{% trans 'reponses:: mode vignettes' %} {% trans 'reponses:: mode vignettes' %}
@@ -829,7 +829,7 @@
</div> </div>
</div> </div>
<div class="box"> <div class="box">
{% set rollover_thumbnail = app['phraseanet.user'].getPrefs('rollover_thumbnail') %} {% set rollover_thumbnail = app['authentication'].getUser().getPrefs('rollover_thumbnail') %}
<h1>{% trans 'Presentation de vignettes' %}</h1> <h1>{% trans 'Presentation de vignettes' %}</h1>
<label class="radio" for="rollover_caption"> <label class="radio" for="rollover_caption">
<input onchange="setPref('rollover_thumbnail',$(this).val())" name="rollover_thumbnail" type="radio" class="radio" value="caption" id="rollover_caption" {% if rollover_thumbnail == 'caption' %}checked="checked" {% endif %}/> <input onchange="setPref('rollover_thumbnail',$(this).val())" name="rollover_thumbnail" type="radio" class="radio" value="caption" id="rollover_caption" {% if rollover_thumbnail == 'caption' %}checked="checked" {% endif %}/>
@@ -841,7 +841,7 @@
</label> </label>
</div> </div>
<div class="box"> <div class="box">
{% set technical_display = app['phraseanet.user'].getPrefs('technical_display') %} {% set technical_display = app['authentication'].getUser().getPrefs('technical_display') %}
<h1>{% trans 'Informations techniques' %}</h1> <h1>{% trans 'Informations techniques' %}</h1>
<label class="radio" for="technical_show"> <label class="radio" for="technical_show">
<input onchange="setPref('technical_display',$(this).val())" name="technical_display" type="radio" class="radio" value="1" id="technical_show" {% if technical_display == '1' %}checked="checked"{% endif %}/> <input onchange="setPref('technical_display',$(this).val())" name="technical_display" type="radio" class="radio" value="1" id="technical_show" {% if technical_display == '1' %}checked="checked"{% endif %}/>
@@ -857,7 +857,7 @@
</label> </label>
</div> </div>
<div class="box"> <div class="box">
{% set doctype_display = app['phraseanet.user'].getPrefs('doctype_display') %} {% set doctype_display = app['authentication'].getUser().getPrefs('doctype_display') %}
<h1>{% trans 'Type de documents' %}</h1> <h1>{% trans 'Type de documents' %}</h1>
<label class="checkbox" for="doctype_display_show"> <label class="checkbox" for="doctype_display_show">
<input onchange="setPref('doctype_display',($(this).attr('checked') ? '1' :'0'))" name="doctype_display" type="checkbox" class="checkbox" value="1" id="doctype_display_show" {% if doctype_display != '0' %}checked="checked"{% endif %}/> <input onchange="setPref('doctype_display',($(this).attr('checked') ? '1' :'0'))" name="doctype_display" type="checkbox" class="checkbox" value="1" id="doctype_display_show" {% if doctype_display != '0' %}checked="checked"{% endif %}/>
@@ -870,14 +870,14 @@
<h1>{% trans 'reponses:: images par pages : ' %}</h1> <h1>{% trans 'reponses:: images par pages : ' %}</h1>
<div class="box"> <div class="box">
<div id="nperpage_slider" class="ui-corner-all" style="width:100px; display:inline-block;"></div> <div id="nperpage_slider" class="ui-corner-all" style="width:100px; display:inline-block;"></div>
<input type="text" readonly style="width:35px;" value="{{app['phraseanet.user'].getPrefs('images_per_page')}}" id="nperpage_value"/> <input type="text" readonly style="width:35px;" value="{{app['authentication'].getUser().getPrefs('images_per_page')}}" id="nperpage_value"/>
</div> </div>
</div> </div>
<div style="float:right; width:49%;"> <div style="float:right; width:49%;">
<h1>{% trans 'reponses:: taille des images : ' %}</h1> <h1>{% trans 'reponses:: taille des images : ' %}</h1>
<div class="box"> <div class="box">
<div id="sizeAns_slider" class="ui-corner-all" style="width:100px;display:inline-block;"></div> <div id="sizeAns_slider" class="ui-corner-all" style="width:100px;display:inline-block;"></div>
<input type="hidden" value="{{app['phraseanet.user'].getPrefs('images_size')}}" id="sizeAns_value"/> <input type="hidden" value="{{app['authentication'].getUser().getPrefs('images_size')}}" id="sizeAns_value"/>
</div> </div>
</div> </div>
</div> </div>
@@ -892,7 +892,7 @@
<div class="box"> <div class="box">
<div class="" style="float:left;width:100%;"> <div class="" style="float:left;width:100%;">
<h1>{% trans 'Affichage au demarrage' %}</h1> <h1>{% trans 'Affichage au demarrage' %}</h1>
{% set start_page_pref = app['phraseanet.user'].getPrefs('start_page') %} {% set start_page_pref = app['authentication'].getUser().getPrefs('start_page') %}
<div class="box" > <div class="box" >
<select class="span2" name="start_page" onchange="start_page_selector();"> <select class="span2" name="start_page" onchange="start_page_selector();">
<option value="LAST_QUERY" {% if start_page_pref == 'LAST_QUERY' %}selected="selected"{% endif %} > <option value="LAST_QUERY" {% if start_page_pref == 'LAST_QUERY' %}selected="selected"{% endif %} >
@@ -908,7 +908,7 @@
{% trans 'Aide' %} {% trans 'Aide' %}
</option> </option>
</select> </select>
<input type="text" class="input-small" name="start_page_value" value="{{app['phraseanet.user'].getPrefs('start_page_query')}}" style="display:{% if start_page_pref == 'QUERY' %}inline{% else %}none{% endif %}" /> <input type="text" class="input-small" name="start_page_value" value="{{app['authentication'].getUser().getPrefs('start_page_query')}}" style="display:{% if start_page_pref == 'QUERY' %}inline{% else %}none{% endif %}" />
<input type="button" class="btn btn-inverse" value="{% trans 'boutton::valider' %}" onclick="set_start_page();" /> <input type="button" class="btn btn-inverse" value="{% trans 'boutton::valider' %}" onclick="set_start_page();" />
</div> </div>
</div> </div>
@@ -978,7 +978,7 @@
<div class="box"> <div class="box">
<h1>{% trans 'Presentation de vignettes de panier' %}</h1> <h1>{% trans 'Presentation de vignettes de panier' %}</h1>
<div> <div>
{% set basket_status_display = app['phraseanet.user'].getPrefs('basket_status_display') %} {% set basket_status_display = app['authentication'].getUser().getPrefs('basket_status_display') %}
<label for="basket_status_display" class="checkbox"> <label for="basket_status_display" class="checkbox">
<input onchange="setPref('basket_status_display',($(this).attr('checked') ? '1' :'0'))" <input onchange="setPref('basket_status_display',($(this).attr('checked') ? '1' :'0'))"
name="basket_status_display" type="checkbox" class="checkbox" value="1" name="basket_status_display" type="checkbox" class="checkbox" value="1"
@@ -987,7 +987,7 @@
</label> </label>
</div> </div>
<div> <div>
{% set basket_caption_display = app['phraseanet.user'].getPrefs('basket_caption_display') %} {% set basket_caption_display = app['authentication'].getUser().getPrefs('basket_caption_display') %}
<label for="basket_caption_display" class="checkbox"> <label for="basket_caption_display" class="checkbox">
<input onchange="setPref('basket_caption_display',($(this).attr('checked') ? '1' :'0'))" <input onchange="setPref('basket_caption_display',($(this).attr('checked') ? '1' :'0'))"
name="basket_caption_display" type="checkbox" class="checkbox" value="1" name="basket_caption_display" type="checkbox" class="checkbox" value="1"
@@ -996,7 +996,7 @@
</label> </label>
</div> </div>
<div> <div>
{% set basket_title_display = app['phraseanet.user'].getPrefs('basket_title_display') %} {% set basket_title_display = app['authentication'].getUser().getPrefs('basket_title_display') %}
<label for="basket_title_display" class="checkbox"> <label for="basket_title_display" class="checkbox">
<input onchange="setPref('basket_title_display',($(this).attr('checked') ? '1' :'0'))" <input onchange="setPref('basket_title_display',($(this).attr('checked') ? '1' :'0'))"
name="basket_title_display" type="checkbox" class="checkbox" value="1" name="basket_title_display" type="checkbox" class="checkbox" value="1"
@@ -1025,7 +1025,7 @@
<script type="text/javascript" src="{{app['phraseanet.registry'].get('GV_STATIC_URL')}}/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script> <script type="text/javascript" src="{{app['phraseanet.registry'].get('GV_STATIC_URL')}}/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
p4.reg_delete="{% if app['phraseanet.user'].getPrefs("warning_on_delete_story") %}true{% else %}false{% endif %}"; p4.reg_delete="{% if app['authentication'].getUser().getPrefs("warning_on_delete_story") %}true{% else %}false{% endif %}";
}); });
function sessionactive(){ function sessionactive(){
@@ -1035,7 +1035,7 @@
dataType: "json", dataType: "json",
data: { data: {
module : 1, module : 1,
usr : {{app['phraseanet.user'].get_id()}} usr : {{app['authentication'].getUser().get_id()}}
}, },
error: function(){ error: function(){
window.setTimeout("sessionactive();", 10000); window.setTimeout("sessionactive();", 10000);

View File

@@ -1,6 +1,6 @@
{% import 'common/caption_templates/preview.html.twig' as caption %} {% import 'common/caption_templates/preview.html.twig' as caption %}
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id, 'canmodifrecord') %} {% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id, 'canmodifrecord') %}
<div class="edit_button" style="text-align:right"> <div class="edit_button" style="text-align:right">
<a href="#" onclick="editThis('IMGT','{{record.get_serialize_key()}}');"> <a href="#" onclick="editThis('IMGT','{{record.get_serialize_key()}}');">
<img style="vertical-align:middle" src="/skins/prod/000000/images/ppen_history.gif" /> <img style="vertical-align:middle" src="/skins/prod/000000/images/ppen_history.gif" />
@@ -11,7 +11,7 @@
<div style="text-align:center;"> <div style="text-align:center;">
{{record.get_status_icons()|raw}} {{record.get_status_icons()|raw}}
</div> </div>
{% set business = app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %} {% set business = app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
{% if record.is_from_reg() %} {% if record.is_from_reg() %}
{{caption.format_caption(record, '', null, business)}} {{caption.format_caption(record, '', null, business)}}
{% else %} {% else %}

View File

@@ -55,8 +55,8 @@
{% trans 'report::Modification du document -- je ne me souviens plus de quoi...' %} {% trans 'report::Modification du document -- je ne me souviens plus de quoi...' %}
{% endif %} {% endif %}
<span class="actor"> <span class="actor">
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canreport') %} {% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canreport') %}
{% if done['user'] and done['user'].get_id() != app['phraseanet.user'].get_id() %} {% if done['user'] and done['user'].get_id() != app['authentication'].getUser().get_id() %}
{% set user_infos = done['user'].get_display_name() %} {% set user_infos = done['user'].get_display_name() %}
{% trans %}report:: par {{ user_infos }}{% endtrans %} {% trans %}report:: par {{ user_infos }}{% endtrans %}
{% endif %} {% endif %}

View File

@@ -1,5 +1,5 @@
{% if (record.is_from_basket is empty) and app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canputinalbum') %} {% if (record.is_from_basket is empty) and app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canputinalbum') %}
<div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}" <div sbas="{{record.get_sbas_id()}}" id="PREV_BASKADD_{{record.get_serialize_key}}"
class="baskAdder" title="{% trans 'action : ajouter au panier' %}" class="baskAdder" title="{% trans 'action : ajouter au panier' %}"
onclick="evt_add_in_chutier('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);"></div> onclick="evt_add_in_chutier('{{record.get_sbas_id()}}','{{record.get_record_id()}}',false,this);return(false);"></div>
@@ -8,7 +8,7 @@
<div class="printer" title="'{% trans 'action : print' %}" <div class="printer" title="'{% trans 'action : print' %}"
onclick="evt_print('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div> onclick="evt_print('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div>
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'candwnldhd') or app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'candwnldpreview') %} {% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'candwnldhd') or app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'candwnldpreview') %}
<div class="downloader" title="{% trans 'action : exporter' %}" <div class="downloader" title="{% trans 'action : exporter' %}"
onclick="evt_dwnl('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div> onclick="evt_dwnl('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div>
{% endif %} {% endif %}

View File

@@ -15,7 +15,7 @@
{% endtrans %} {% endtrans %}
<br/> <br/>
{% endif %} {% endif %}
{% set th_size = app['phraseanet.user'].getPrefs('images_size')%} {% set th_size = app['authentication'].getUser().getPrefs('images_size')%}
<div class="selectable" style="margin:10px 0; float:left;"> <div class="selectable" style="margin:10px 0; float:left;">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>

View File

@@ -14,9 +14,9 @@
<td valign="middle"> <td valign="middle">
<div class='desc' style='max-height:{{th_size+70}}px;overflow-y:auto;'> <div class='desc' style='max-height:{{th_size+70}}px;overflow-y:auto;'>
<div class="fixeddesc"> <div class="fixeddesc">
{% set business = app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %} {% set business = app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
{{caption.format_caption(record, highlight, searchEngine, business)}} {{caption.format_caption(record, highlight, searchEngine, business)}}
{% if app['phraseanet.user'].getPrefs('technical_display') == 'group' %}<hr/>{{record.get_technical_infos|raw}}{% endif %} {% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %}<hr/>{{record.get_technical_infos|raw}}{% endif %}
</div> </div>
</div> </div>
</td> </td>

View File

@@ -20,7 +20,7 @@
<br/> <br/>
{% endif %} {% endif %}
{% set th_size = app['phraseanet.user'].getPrefs('images_size')%} {% set th_size = app['authentication'].getUser().getPrefs('images_size')%}
{% if app['locale.I18n'] == 'fr' %} {% if app['locale.I18n'] == 'fr' %}
<div class="client_help"> <div class="client_help">

View File

@@ -2,7 +2,7 @@
{% import 'common/thumbnail.html.twig' as thumbnail %} {% import 'common/thumbnail.html.twig' as thumbnail %}
{% import 'common/doctype_icons.html.twig' as doctype_icons %} {% import 'common/doctype_icons.html.twig' as doctype_icons %}
{% import 'common/drop_down_options.html.twig' as drop_down %} {% import 'common/drop_down_options.html.twig' as drop_down %}
{% set th_size = app['phraseanet.user'].getPrefs('images_size')%} {% set th_size = app['authentication'].getUser().getPrefs('images_size')%}
{% set sbas_id = record.get_sbas_id %} {% set sbas_id = record.get_sbas_id %}
{% if entry_id %} {% if entry_id %}
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}" <div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}"
@@ -31,8 +31,8 @@
</div> </div>
{% set rollover_gif = record.get_rollover_thumbnail() %} {% set rollover_gif = record.get_rollover_thumbnail() %}
{% set user_technical_display = app['phraseanet.user'].getPrefs('technical_display') %} {% set user_technical_display = app['authentication'].getUser().getPrefs('technical_display') %}
{% set user_rollover_thumbnail = app['phraseanet.user'].getPrefs('rollover_thumbnail') %} {% set user_rollover_thumbnail = app['authentication'].getUser().getPrefs('rollover_thumbnail') %}
{% set extraclass = '' %} {% set extraclass = '' %}
{% if user_rollover_thumbnail == 'caption' and searchEngine is not null %} {% if user_rollover_thumbnail == 'caption' and searchEngine is not null %}
@@ -47,7 +47,7 @@
{% endif %} {% endif %}
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltipsrc}}" style="height:{{th_size}}px; z-index:90;"> <div class="thumb {{extraclass}} " tooltipsrc="{{tooltipsrc}}" style="height:{{th_size}}px; z-index:90;">
<div class="doc_infos"> <div class="doc_infos">
{% if app['phraseanet.user'].getPrefs('doctype_display') == '1' %} {% if app['authentication'].getUser().getPrefs('doctype_display') == '1' %}
{{doctype_icons.format(record)}} {{doctype_icons.format(record)}}
{% endif %} {% endif %}
<span class="duration"> <span class="duration">
@@ -80,7 +80,7 @@
{% endif %} {% endif %}
<td style='text-align:right;width:{{l_width}}px;' valign='bottom'> <td style='text-align:right;width:{{l_width}}px;' valign='bottom'>
{{drop_down.prod(record, entry_id)}} {{drop_down.prod(record, entry_id)}}
{% if record.has_preview() and app['phraseanet.user'].ACL().has_access_to_subdef(record, 'preview') %} {% if record.has_preview() and app['authentication'].getUser().ACL().has_access_to_subdef(record, 'preview') %}
<div tooltipsrc="/prod/tooltip/preview/{{record.get_sbas_id()}}/{{record.get_record_id()}}/" class="previewTips"></div> <div tooltipsrc="/prod/tooltip/preview/{{record.get_sbas_id()}}/{{record.get_record_id()}}/" class="previewTips"></div>
{% endif %} {% endif %}
{% if user_rollover_thumbnail == 'preview' %} {% if user_rollover_thumbnail == 'preview' %}

View File

@@ -304,8 +304,8 @@
</h5> </h5>
<ul class="thumbnails"> <ul class="thumbnails">
{% for record in records %} {% for record in records %}
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), "canaddrecord") {% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), "canaddrecord")
and app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), "candeleterecord") %} and app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), "candeleterecord") %}
<li class="records-subititution span3"> <li class="records-subititution span3">
<div class="thumbnail"> <div class="thumbnail">
<div class="record-thumb" style="text-align:center;"> <div class="record-thumb" style="text-align:center;">

View File

@@ -102,7 +102,7 @@
dataType: 'json', dataType: 'json',
data: { data: {
module : 5, module : 5,
usr : {{ app['phraseanet.user'].get_id() }} usr : {{ app['authentication'].getUser().get_id() }}
}, },
error: function(){ error: function(){
window.setTimeout("sessionactive();", 10000); window.setTimeout("sessionactive();", 10000);

View File

@@ -40,7 +40,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
public function testRouteSlash() public function testRouteSlash()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
$baskets = $this->insertFiveBasket(); $baskets = $this->insertFiveBasket();
@@ -67,7 +67,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
public function testAuthenticationWithToken() public function testAuthenticationWithToken()
{ {
self::$DI['app']->closeAccount(); self::$DI['app']['authentication']->closeAccount();
$Basket = $this->insertOneBasket(); $Basket = $this->insertOneBasket();
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_VIEW, self::$DI['user_alt2']->get_id(), null, $Basket->getId()); $token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_VIEW, self::$DI['user_alt2']->get_id(), null, $Basket->getId());
@@ -189,7 +189,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
public function testValidate() public function testValidate()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
$basket = $this->insertOneValidationBasket(); $basket = $this->insertOneValidationBasket();
@@ -215,7 +215,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
public function testCompare() public function testCompare()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
$basket = $this->insertOneBasket(); $basket = $this->insertOneBasket();
@@ -241,7 +241,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
public function testFeedEntry() public function testFeedEntry()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']); $this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);

View File

@@ -55,7 +55,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
function testDatafilesRouteNotAuthenticated() function testDatafilesRouteNotAuthenticated()
{ {
self::$DI['app']->closeAccount(); self::$DI['app']['authentication']->closeAccount();
self::$DI['client']->request('GET', '/datafiles/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/'); self::$DI['client']->request('GET', '/datafiles/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/');
$this->assertForbiddenResponse(self::$DI['client']->getResponse()); $this->assertForbiddenResponse(self::$DI['client']->getResponse());
@@ -63,7 +63,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
function testDatafilesRouteNotAuthenticatedUnknownSubdef() function testDatafilesRouteNotAuthenticatedUnknownSubdef()
{ {
self::$DI['app']->closeAccount(); self::$DI['app']['authentication']->closeAccount();
self::$DI['client']->request('GET', '/datafiles/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/notfoundreview/'); self::$DI['client']->request('GET', '/datafiles/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/notfoundreview/');
$this->assertForbiddenResponse(self::$DI['client']->getResponse()); $this->assertForbiddenResponse(self::$DI['client']->getResponse());
@@ -71,7 +71,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
function testPermalinkAuthenticated() function testPermalinkAuthenticated()
{ {
$this->assertTrue(self::$DI['app']->isAuthenticated()); $this->assertTrue(self::$DI['app']['authentication']->isAuthenticated());
$this->get_a_permalinkBCcompatibility(array("Content-Type" => "image/jpeg")); $this->get_a_permalinkBCcompatibility(array("Content-Type" => "image/jpeg"));
$this->get_a_permaviewBCcompatibility(array("Content-Type" => "text/html; charset=UTF-8")); $this->get_a_permaviewBCcompatibility(array("Content-Type" => "text/html; charset=UTF-8"));
$this->get_a_permalink(array("Content-Type" => "image/jpeg")); $this->get_a_permalink(array("Content-Type" => "image/jpeg"));
@@ -81,29 +81,29 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
function testPermalinkNotAuthenticated() function testPermalinkNotAuthenticated()
{ {
self::$DI['app']->closeAccount(); self::$DI['app']->closeAccount();
$this->assertFalse(self::$DI['app']->isAuthenticated()); $this->assertFalse(self::$DI['app']['authentication']->isAuthenticated());
$this->get_a_permalinkBCcompatibility(array("Content-Type" => "image/jpeg")); $this->get_a_permalinkBCcompatibility(array("Content-Type" => "image/jpeg"));
$this->get_a_permaviewBCcompatibility(array("Content-Type" => "text/html; charset=UTF-8")); $this->get_a_permaviewBCcompatibility(array("Content-Type" => "text/html; charset=UTF-8"));
$this->get_a_permalink(array("Content-Type" => "image/jpeg")); $this->get_a_permalink(array("Content-Type" => "image/jpeg"));
$this->get_a_permaview(array("Content-Type" => "text/html; charset=UTF-8")); $this->get_a_permaview(array("Content-Type" => "text/html; charset=UTF-8"));
} }
function testCaptionAuthenticated() function testCaptionAuthenticated()
{ {
$this->assertTrue(self::$DI['app']->isAuthenticated()); $this->assertTrue(self::$DI['app']['authentication']->isAuthenticated());
$this->get_a_caption(array("Content-Type" => "application/json")); $this->get_a_caption(array("Content-Type" => "application/json"));
} }
function testCaptionNotAuthenticated() function testCaptionNotAuthenticated()
{ {
self::$DI['app']->closeAccount(); self::$DI['app']->closeAccount();
$this->assertFalse(self::$DI['app']->isAuthenticated()); $this->assertFalse(self::$DI['app']['authentication']->isAuthenticated());
$this->get_a_caption(array("Content-Type" => "application/json")); $this->get_a_caption(array("Content-Type" => "application/json"));
} }
function testCaptionWithaWrongToken() function testCaptionWithaWrongToken()
{ {
$this->assertTrue(self::$DI['app']->isAuthenticated()); $this->assertTrue(self::$DI['app']['authentication']->isAuthenticated());
$token = "unexisting_token"; $token = "unexisting_token";
$url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . "/" . self::$DI['record_1']->get_record_id() . '/caption/?token='.$token; $url = '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . "/" . self::$DI['record_1']->get_record_id() . '/caption/?token='.$token;
@@ -112,10 +112,10 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
$this->assertEquals(404, $response->getStatusCode()); $this->assertEquals(404, $response->getStatusCode());
} }
function testCaptionWithaWrongRecord() function testCaptionWithaWrongRecord()
{ {
$this->assertTrue(self::$DI['app']->isAuthenticated()); $this->assertTrue(self::$DI['app']['authentication']->isAuthenticated());
$url = '/permalink/v1/unexisting_record/unexisting_id/caption/?token=unexisting_token'; $url = '/permalink/v1/unexisting_record/unexisting_id/caption/?token=unexisting_token';
$crawler = self::$DI['client']->request('GET', $url); $crawler = self::$DI['client']->request('GET', $url);
@@ -123,7 +123,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
$this->assertEquals(404, $response->getStatusCode()); $this->assertEquals(404, $response->getStatusCode());
} }
public function testGetAStorythumbnail() public function testGetAStorythumbnail()
{ {
$this->substituteAndCheck('thumbnail'); $this->substituteAndCheck('thumbnail');
@@ -164,44 +164,44 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
$crawler = self::$DI['client']->request('GET', $url); $crawler = self::$DI['client']->request('GET', $url);
$response = self::$DI['client']->getResponse(); $response = self::$DI['client']->getResponse();
foreach ($headers as $name => $value) { foreach ($headers as $name => $value) {
$this->assertEquals($response->headers->get($name), $value); $this->assertEquals($response->headers->get($name), $value);
} }
$caption = self::$DI['record_1']->get_caption()->serialize(\caption_record::SERIALIZE_JSON); $caption = self::$DI['record_1']->get_caption()->serialize(\caption_record::SERIALIZE_JSON);
$this->assertEquals($caption, $response->getContent()); $this->assertEquals($caption, $response->getContent());
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
} }
protected function get_a_permalinkBCcompatibility(array $headers = array()) protected function get_a_permalinkBCcompatibility(array $headers = array())
{ {
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token(); $token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
$url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/'; $url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/';
$crawler = self::$DI['client']->request('GET', $url); $crawler = self::$DI['client']->request('GET', $url);
$response = self::$DI['client']->getResponse(); $response = self::$DI['client']->getResponse();
foreach ($headers as $name => $value) { foreach ($headers as $name => $value) {
$this->assertEquals($response->headers->get($name), $value); $this->assertEquals($response->headers->get($name), $value);
} }
$this->assertEquals($response->headers->get("Link"), "/permalink/v1/1/". self::$DI['record_1']->get_record_id()."/caption/?token=".$token); $this->assertEquals($response->headers->get("Link"), "/permalink/v1/1/". self::$DI['record_1']->get_record_id()."/caption/?token=".$token);
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
} }
protected function get_a_permaviewBCcompatibility(array $headers = array()) protected function get_a_permaviewBCcompatibility(array $headers = array())
{ {
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token(); $token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
$url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/'; $url = '/permalink/v1/whateverIwannt/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/' . $token . '/preview/';
$url = $url . 'view/'; $url = $url . 'view/';
$crawler = self::$DI['client']->request('GET', $url); $crawler = self::$DI['client']->request('GET', $url);
$response = self::$DI['client']->getResponse(); $response = self::$DI['client']->getResponse();
foreach ($headers as $name => $value) { foreach ($headers as $name => $value) {
$this->assertEquals($response->headers->get($name), $value); $this->assertEquals($response->headers->get($name), $value);
} }
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
} }
@@ -216,11 +216,11 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
foreach ($headers as $name => $value) { foreach ($headers as $name => $value) {
$this->assertEquals($response->headers->get($name), $value); $this->assertEquals($response->headers->get($name), $value);
} }
$this->assertEquals($response->headers->get("Link"), "/permalink/v1/1/". self::$DI['record_1']->get_record_id()."/caption/?token=".$token); $this->assertEquals($response->headers->get("Link"), "/permalink/v1/1/". self::$DI['record_1']->get_record_id()."/caption/?token=".$token);
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
} }
protected function get_a_permaview(array $headers = array()) protected function get_a_permaview(array $headers = array())
{ {
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token(); $token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
@@ -232,7 +232,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
foreach ($headers as $name => $value) { foreach ($headers as $name => $value) {
$this->assertEquals($response->headers->get($name), $value); $this->assertEquals($response->headers->get($name), $value);
} }
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
} }
} }

View File

@@ -48,12 +48,12 @@ class ApplicationRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testNoPersistentCookie() public function testNoPersistentCookie()
{ {
$app = self::$DI['app']; $app = self::$DI['app'];
$app->closeAccount(); $app['authentication']->closeAccount();
$boolean = false; $boolean = false;
$app->get('/unit-test-route', function(Application $app) use (&$boolean) { $app->get('/unit-test-route', function(Application $app) use (&$boolean) {
$boolean = $app->isAuthenticated(); $boolean = $app['authentication']->isAuthenticated();
return new Response(); return new Response();
}); });
@@ -67,7 +67,7 @@ class ApplicationRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testPersistentCookie() public function testPersistentCookie()
{ {
$app = self::$DI['app']; $app = self::$DI['app'];
$app->closeAccount(); $app['authentication']->closeAccount();
$browser = $this->getMockBuilder('\Browser') $browser = $this->getMockBuilder('\Browser')
->disableOriginalConstructor() ->disableOriginalConstructor()
@@ -102,7 +102,7 @@ class ApplicationRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$boolean = false; $boolean = false;
$app->get('/unit-test-route', function(Application $app) use (&$boolean) { $app->get('/unit-test-route', function(Application $app) use (&$boolean) {
$boolean = $app->isAuthenticated(); $boolean = $app['authentication']->isAuthenticated();
return new Response(); return new Response();
}); });

View File

@@ -76,27 +76,58 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract
/** /**
* @covers Alchemy\Phrasea\Application * @covers Alchemy\Phrasea\Application
*/ */
public function testOpenAccount() public function testCookieLocale()
{ {
$app = new Application('test'); $app = $this->getAppThatReturnLocale();
$this->assertFalse($app->isAuthenticated()); foreach (array('fr_FR', 'en_GB', 'de_DE') as $locale) {
$app->openAccount($this->getAuthMock()); $client = $this->getClientWithCookie($app, $locale);
$this->assertTrue($app->isAuthenticated()); $client->request('GET', '/');
$this->assertEquals($locale, $client->getResponse()->getContent());
}
} }
/** /**
* @covers Alchemy\Phrasea\Application * @covers Alchemy\Phrasea\Application
*/ */
public function testCloseAccount() public function testNoCookieLocaleReturnsDefaultLocale()
{ {
$app = new Application('test'); $app = $this->getAppThatReturnLocale();
$this->mockRegistryAndReturnLocale($app, 'en_USA');
$this->assertFalse($app->isAuthenticated()); $client = $this->getClientWithCookie($app, null);
$app->openAccount($this->getAuthMock()); $client->request('GET', '/');
$this->assertTrue($app->isAuthenticated());
$app->closeAccount(); $this->assertEquals('en_USA', $client->getResponse()->getContent());
$this->assertFalse($app->isAuthenticated()); }
/**
* @covers Alchemy\Phrasea\Application
*/
public function testWrongCookieLocaleReturnsDefaultLocale()
{
$app = $this->getAppThatReturnLocale();
$this->mockRegistryAndReturnLocale($app, 'en_USA');
$client = $this->getClientWithCookie($app, 'de_PL');
$client->request('GET', '/');
$this->assertEquals('en_USA', $client->getResponse()->getContent());
}
/**
* @covers Alchemy\Phrasea\Application
*/
public function testNoCookieReturnsContentNegotiated()
{
$app = $this->getAppThatReturnLocale();
$this->mockRegistryAndReturnLocale($app, 'en_USA');
$client = $this->getClientWithCookie($app, null);
$client->request('GET', '/', array(), array(), array('accept_language' => 'en-US;q=0.75,en;q=0.8,fr-FR;q=0.9'));
$this->assertEquals('fr_FR', $client->getResponse()->getContent());
} }
/** /**

View File

@@ -12,7 +12,7 @@ class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function tearDown() public function tearDown()
{ {
self::$DI['app']['phraseanet.user'] = self::$DI['user']; self::$DI['app']['authentication']->setUser(self::$DI['user']);
foreach (self::$createdCollections as $collection) { foreach (self::$createdCollections as $collection) {
try { try {
$collection->unmount_collection(self::$DI['app']); $collection->unmount_collection(self::$DI['app']);

View File

@@ -62,7 +62,7 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$databoxes = self::$DI['app']['phraseanet.appbox']->get_databoxes(); $databoxes = self::$DI['app']['phraseanet.appbox']->get_databoxes();
$collection = \collection::create(self::$DI['app'], array_shift($databoxes), self::$DI['app']['phraseanet.appbox'], 'TESTTODELETE'); $collection = \collection::create(self::$DI['app'], array_shift($databoxes), self::$DI['app']['phraseanet.appbox'], 'TESTTODELETE');
self::$DI['app']['phraseanet.user']->ACL(); self::$DI['app']['authentication']->getUser()->ACL();
self::$createdCollections[] = $collection; self::$createdCollections[] = $collection;

View File

@@ -12,7 +12,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testRouteSlash() public function testRouteSlash()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
self::$DI['client']->request('GET', '/admin/', array('section' => 'base:featured')); self::$DI['client']->request('GET', '/admin/', array('section' => 'base:featured'));
$this->assertTrue(self::$DI['client']->getResponse()->isOk()); $this->assertTrue(self::$DI['client']->getResponse()->isOk());

View File

@@ -25,7 +25,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{ {
\phrasea::start(self::$DI['app']['phraseanet.configuration']); \phrasea::start(self::$DI['app']['phraseanet.configuration']);
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
self::$DI['client']->request("GET", "/client/"); self::$DI['client']->request("GET", "/client/");
$this->assertTrue(self::$DI['client']->getResponse()->isOk()); $this->assertTrue(self::$DI['client']->getResponse()->isOk());
} }

View File

@@ -392,7 +392,7 @@ class BridgeApplication extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testDeleteAccount() public function testDeleteAccount()
{ {
$account = \Bridge_Account::create(self::$DI['app'], self::$api, self::$DI['app']['phraseanet.user'], 'hello', 'you'); $account = \Bridge_Account::create(self::$DI['app'], self::$api, self::$DI['app']['authentication']->getUser(), 'hello', 'you');
$url = "/prod/bridge/adapter/" . $account->get_id() . "/delete/"; $url = "/prod/bridge/adapter/" . $account->get_id() . "/delete/";
self::$DI['client']->request('POST', $url); self::$DI['client']->request('POST', $url);
$response = self::$DI['client']->getResponse(); $response = self::$DI['client']->getResponse();

View File

@@ -52,10 +52,10 @@ class DownloadTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
self::$DI['app']['events-manager'] = $eventManagerStub; self::$DI['app']['events-manager'] = $eventManagerStub;
self::$DI['app']['phraseanet.user'] = $this->getMockBuilder('\User_Adapter') self::$DI['app']['authentication']->setUser($this->getMockBuilder('\User_Adapter')
->setMethods(array('ACL')) ->setMethods(array('ACL'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock());
$stubbedACL = $this->getMockBuilder('\ACL') $stubbedACL = $this->getMockBuilder('\ACL')
->disableOriginalConstructor() ->disableOriginalConstructor()
@@ -76,7 +76,7 @@ class DownloadTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
->method('remaining_download') ->method('remaining_download')
->will($this->returnValue(0)); ->will($this->returnValue(0));
self::$DI['app']['phraseanet.user']->expects($this->any()) self::$DI['app']['authentication']->getUser()->expects($this->any())
->method('ACL') ->method('ACL')
->will($this->returnValue($stubbedACL)); ->will($this->returnValue($stubbedACL));

View File

@@ -31,11 +31,11 @@ class QueryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testQueryAnswerTrain() public function testQueryAnswerTrain()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
self::$DI['record_24']; self::$DI['record_24'];
$options = new SearchEngineOptions(); $options = new SearchEngineOptions();
$options->onCollections(self::$DI['app']['phraseanet.user']->ACL()->get_granted_base()); $options->onCollections(self::$DI['app']['authentication']->getUser()->ACL()->get_granted_base());
$serializedOptions = $options->serialize(); $serializedOptions = $options->serialize();
self::$DI['client']->request('POST', '/prod/query/answer-train/', array( self::$DI['client']->request('POST', '/prod/query/answer-train/', array(

View File

@@ -84,11 +84,11 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testGetRecordDetailResult() public function testGetRecordDetailResult()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
self::$DI['record_24']; self::$DI['record_24'];
$options = new SearchEngineOptions(); $options = new SearchEngineOptions();
$acl = self::$DI['app']['phraseanet.user']->ACL(); $acl = self::$DI['app']['authentication']->getUser()->ACL();
$options->onCollections($acl->get_granted_base()); $options->onCollections($acl->get_granted_base());
$serializedOptions = $options->serialize(); $serializedOptions = $options->serialize();
@@ -121,7 +121,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testGetRecordDetailREG() public function testGetRecordDetailREG()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
self::$DI['record_story_1']; self::$DI['record_story_1'];
$this->XMLHTTPRequest('POST', '/prod/records/', array( $this->XMLHTTPRequest('POST', '/prod/records/', array(
@@ -152,7 +152,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testGetRecordDetailBasket() public function testGetRecordDetailBasket()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
$basket = $this->insertOneBasket(); $basket = $this->insertOneBasket();
$record = self::$DI['record_1']; $record = self::$DI['record_1'];
@@ -195,7 +195,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testGetRecordDetailFeed() public function testGetRecordDetailFeed()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
self::$feed = \Feed_Adapter::create( self::$feed = \Feed_Adapter::create(
self::$DI['app'], self::$DI['app'],

View File

@@ -12,7 +12,7 @@ class ControllerRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
public function testRouteSlash() public function testRouteSlash()
{ {
$auth = new \Session_Authentication_None(self::$DI['user']); $auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth); self::$DI['app']['authentication']->openAccount($auth);
$crawler = self::$DI['client']->request('GET', '/prod/'); $crawler = self::$DI['client']->request('GET', '/prod/');

View File

@@ -26,10 +26,10 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
*/ */
public function testRouteSlash() public function testRouteSlash()
{ {
self::$DI['app']['phraseanet.user'] = $this->getMockBuilder('\User_Adapter') self::$DI['app']['authentication']->setUser($this->getMockBuilder('\User_Adapter')
->setMethods(array('ACL')) ->setMethods(array('ACL'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock());
$stubbedACL = $this->getMockBuilder('\ACL') $stubbedACL = $this->getMockBuilder('\ACL')
->disableOriginalConstructor() ->disableOriginalConstructor()
@@ -45,7 +45,7 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
->method('has_access_to_subdef') ->method('has_access_to_subdef')
->will($this->returnValue(true)); ->will($this->returnValue(true));
self::$DI['app']['phraseanet.user']->expects($this->any()) self::$DI['app']['authentication']->getUser()->expects($this->any())
->method('ACL') ->method('ACL')
->will($this->returnValue($stubbedACL)); ->will($this->returnValue($stubbedACL));
@@ -72,10 +72,10 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{ {
$share = new Share(); $share = new Share();
self::$DI['app']['phraseanet.user'] = $this->getMockBuilder('\User_Adapter') self::$DI['app']['authentication']->setUser($this->getMockBuilder('\User_Adapter')
->setMethods(array('ACL')) ->setMethods(array('ACL'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock());
$stubbedACL = $this->getMockBuilder('\ACL') $stubbedACL = $this->getMockBuilder('\ACL')
->disableOriginalConstructor() ->disableOriginalConstructor()
@@ -86,7 +86,7 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
->method('has_access_to_subdef') ->method('has_access_to_subdef')
->will($this->returnValue(false)); ->will($this->returnValue(false));
self::$DI['app']['phraseanet.user']->expects($this->once()) self::$DI['app']['authentication']->getUser()->expects($this->once())
->method('ACL') ->method('ACL')
->will($this->returnValue($stubbedACL)); ->will($this->returnValue($stubbedACL));

View File

@@ -10,7 +10,7 @@ class ControllerStoryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{ {
$route = "/prod/story/"; $route = "/prod/story/";
$collections = self::$DI['app']['phraseanet.user'] $collections = self::$DI['app']['authentication']->getUser()
->ACL() ->ACL()
->get_granted_base(array('canaddrecord')); ->get_granted_base(array('canaddrecord'));
@@ -40,7 +40,7 @@ class ControllerStoryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{ {
$route = "/prod/story/"; $route = "/prod/story/";
$collections = self::$DI['app']['phraseanet.user'] $collections = self::$DI['app']['authentication']->getUser()
->ACL() ->ACL()
->get_granted_base(array('canaddrecord')); ->get_granted_base(array('canaddrecord'));

Some files were not shown because too many files have changed in this diff Show More