mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +00:00
Add AuthenticationServiceProvider
This commit is contained in:
@@ -29,13 +29,13 @@ class Lightbox implements ControllerProviderInterface
|
||||
return;
|
||||
}
|
||||
|
||||
if ($app->isAuthenticated()) {
|
||||
$app->closeAccount();
|
||||
if ($app['authentication']->isAuthenticated()) {
|
||||
$app['authentication']->closeAccount();
|
||||
}
|
||||
|
||||
try {
|
||||
$auth = new \Session_Authentication_Token($app, $request->query->get('LOG'));
|
||||
$app->openAccount($auth);
|
||||
$app['authentication']->openAccount($auth);
|
||||
} catch (Exception $e) {
|
||||
return $app->redirect("/login/?error=" . urlencode($e->getMessage()));
|
||||
}
|
||||
@@ -72,8 +72,8 @@ class Lightbox implements ControllerProviderInterface
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
|
||||
$basket_collection = array_merge(
|
||||
$repository->findActiveByUser($app['phraseanet.user'])
|
||||
, $repository->findActiveValidationByUser($app['phraseanet.user'])
|
||||
$repository->findActiveByUser($app['authentication']->getUser())
|
||||
, $repository->findActiveValidationByUser($app['authentication']->getUser())
|
||||
);
|
||||
|
||||
$template = 'lightbox/index.html.twig';
|
||||
@@ -97,7 +97,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
|
||||
$basketElement = $app['EM']
|
||||
->getRepository('\Entities\BasketElement')
|
||||
->findUserElement($sselcont_id, $app['phraseanet.user']);
|
||||
->findUserElement($sselcont_id, $app['authentication']->getUser());
|
||||
|
||||
$parameters = array(
|
||||
'basket_element' => $basketElement,
|
||||
@@ -111,7 +111,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
/* @var $repository \Repositories\BasketElementRepository */
|
||||
$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()) {
|
||||
$output = $app['twig']->render('lightbox/basket_element.html.twig', array(
|
||||
@@ -199,12 +199,12 @@ class Lightbox implements ControllerProviderInterface
|
||||
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket_collection = $repository->findActiveValidationAndBasketByUser(
|
||||
$app['phraseanet.user']
|
||||
$app['authentication']->getUser()
|
||||
);
|
||||
|
||||
$basket = $repository->findUserBasket(
|
||||
$app, $ssel_id
|
||||
, $app['phraseanet.user']
|
||||
, $app['authentication']->getUser()
|
||||
, false
|
||||
);
|
||||
|
||||
@@ -214,9 +214,9 @@ class Lightbox implements ControllerProviderInterface
|
||||
$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->getValidation()->getParticipant($app['phraseanet.user'], $app)->setIsAware(true);
|
||||
$basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true);
|
||||
$app['EM']->flush();
|
||||
}
|
||||
|
||||
@@ -251,12 +251,12 @@ class Lightbox implements ControllerProviderInterface
|
||||
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket_collection = $repository->findActiveValidationAndBasketByUser(
|
||||
$app['phraseanet.user']
|
||||
$app['authentication']->getUser()
|
||||
);
|
||||
|
||||
$basket = $repository->findUserBasket(
|
||||
$app, $ssel_id
|
||||
, $app['phraseanet.user']
|
||||
, $app['authentication']->getUser()
|
||||
, false
|
||||
);
|
||||
|
||||
@@ -266,9 +266,9 @@ class Lightbox implements ControllerProviderInterface
|
||||
$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->getValidation()->getParticipant($app['phraseanet.user'], $app)->setIsAware(true);
|
||||
$basket->getValidation()->getParticipant($app['authentication']->getUser(), $app)->setIsAware(true);
|
||||
$app['EM']->flush();
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket = $repository->findUserBasket(
|
||||
$app, $ssel_id
|
||||
, $app['phraseanet.user']
|
||||
, $app['authentication']->getUser()
|
||||
, false
|
||||
);
|
||||
|
||||
@@ -357,9 +357,9 @@ class Lightbox implements ControllerProviderInterface
|
||||
/* @var $repository \Repositories\BasketElementRepository */
|
||||
$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);
|
||||
|
||||
@@ -405,14 +405,14 @@ class Lightbox implements ControllerProviderInterface
|
||||
/* @var $repository \Repositories\BasketElementRepository */
|
||||
$basket_element = $repository->findUserElement(
|
||||
$sselcont_id
|
||||
, $app['phraseanet.user']
|
||||
, $app['authentication']->getUser()
|
||||
);
|
||||
/* @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()
|
||||
->getValidation()
|
||||
->getParticipant($app['phraseanet.user'], $app)->getCanAgree()) {
|
||||
->getParticipant($app['authentication']->getUser(), $app)->getCanAgree()) {
|
||||
throw new ControllerException('You can not agree on this');
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
|
||||
$participant = $basket_element->getBasket()
|
||||
->getValidation()
|
||||
->getParticipant($app['phraseanet.user'], $app);
|
||||
->getParticipant($app['authentication']->getUser(), $app);
|
||||
|
||||
$app['EM']->merge($basket_element);
|
||||
|
||||
@@ -453,7 +453,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
/* @var $repository \Repositories\BasketRepository */
|
||||
$basket = $repository->findUserBasket(
|
||||
$app, $ssel_id
|
||||
, $app['phraseanet.user']
|
||||
, $app['authentication']->getUser()
|
||||
, false
|
||||
);
|
||||
|
||||
@@ -461,7 +461,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
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');
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
}
|
||||
|
||||
/* @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');
|
||||
$url = $app['phraseanet.registry']->get('GV_ServerName')
|
||||
@@ -492,7 +492,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
$to = $basket->getValidation()->getInitiator($app)->get_id();
|
||||
$params = array(
|
||||
'ssel_id' => $basket->getId(),
|
||||
'from' => $app['phraseanet.user']->get_id(),
|
||||
'from' => $app['authentication']->getUser()->get_id(),
|
||||
'url' => $url,
|
||||
'to' => $to
|
||||
);
|
||||
|
@@ -32,10 +32,10 @@ return call_user_func(function($environment = null) {
|
||||
});
|
||||
|
||||
$app->before(function(Request $request) use ($app) {
|
||||
if ($request->cookies->has('persistent') && !$app->isAuthenticated()) {
|
||||
if ($request->cookies->has('persistent') && !$app['authentication']->isAuthenticated()) {
|
||||
try {
|
||||
$auth = new \Session_Authentication_PersistentCookie($app, $request->cookies->get('persistent'));
|
||||
$app->openAccount($auth, $auth->getSessionId());
|
||||
$app['authentication']->openAccount($auth, $auth->getSessionId());
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
@@ -11,6 +11,12 @@
|
||||
|
||||
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\ControllerProviderInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -37,6 +43,9 @@ class Oauth2 implements ControllerProviderInterface
|
||||
$request = $app['request'];
|
||||
$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
|
||||
$params = $oauth2_adapter->getAuthorizationRequestParameters($request);
|
||||
|
||||
@@ -65,17 +74,23 @@ class Oauth2 implements ControllerProviderInterface
|
||||
);
|
||||
}
|
||||
|
||||
if (!$app->isAuthenticated()) {
|
||||
if (!$app['authentication']->isAuthenticated()) {
|
||||
if ($action_login !== null) {
|
||||
try {
|
||||
$auth = new \Session_Authentication_Native(
|
||||
$app, $request->get("login"), $request->get("password")
|
||||
);
|
||||
$usr_id = $app['auth.native']->isValid($request->get("login"), $request->get("password"), $request);
|
||||
|
||||
$app->openAccount($auth);
|
||||
} catch (\Exception $e) {
|
||||
return new Response($app['twig']->render($template, array("auth" => $oauth2_adapter)));
|
||||
if (!$usr_id) {
|
||||
$app['session']->getFlashBag()->set('error', _('login::erreur: Erreur d\'authentification'));
|
||||
|
||||
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 {
|
||||
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
|
||||
$user_auth_clients = \API_OAuth2_Application::load_authorized_app_by_user(
|
||||
$app
|
||||
, $app['phraseanet.user']
|
||||
, $app['authentication']->getUser()
|
||||
);
|
||||
|
||||
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();
|
||||
|
||||
@@ -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
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
$app['oauth']->grantAccessToken();
|
||||
$app['oauth']->grantAccessToken($request);
|
||||
ob_flush();
|
||||
flush();
|
||||
|
||||
|
@@ -13,6 +13,8 @@ namespace Alchemy\Phrasea\Controller\Api;
|
||||
|
||||
use Silex\ControllerProviderInterface;
|
||||
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\ApiOAuth2EndEvent;
|
||||
use Silex\Application as SilexApplication;
|
||||
@@ -49,6 +51,9 @@ class V1 implements ControllerProviderInterface
|
||||
* @ throws \API_V1_exception_forbidden
|
||||
*/
|
||||
$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());
|
||||
$oauth2_adapter = new \API_OAuth2_Adapter($app);
|
||||
$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'));
|
||||
}
|
||||
|
||||
if ($app->isAuthenticated()) {
|
||||
if ($app['authentication']->isAuthenticated()) {
|
||||
$app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_END, new ApiOAuth2EndEvent());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$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'));
|
||||
$app['dispatcher']->dispatch(PhraseaEvents::API_OAUTH2_END, new ApiOAuth2EndEvent());
|
||||
|
||||
@@ -646,19 +650,19 @@ class V1 implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/feeds/list/', function(SilexApplication $app) {
|
||||
return $app['api']
|
||||
->search_publications($app['request'], $app['phraseanet.user'])
|
||||
->search_publications($app['request'], $app['authentication']->getUser())
|
||||
->get_response();
|
||||
});
|
||||
|
||||
$controllers->get('/feeds/content/', function(SilexApplication $app) {
|
||||
return $app['api']
|
||||
->get_publications($app['request'], $app['phraseanet.user'])
|
||||
->get_publications($app['request'], $app['authentication']->getUser())
|
||||
->get_response();
|
||||
});
|
||||
|
||||
$controllers->get('/feeds/entry/{entry_id}/', function(SilexApplication $app, $entry_id) {
|
||||
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();
|
||||
})->assert('entry_id', '\d+');
|
||||
|
||||
@@ -675,7 +679,7 @@ class V1 implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/feeds/{feed_id}/content/', function(SilexApplication $app, $feed_id) {
|
||||
return $app['api']
|
||||
->get_publication($app['request'], $feed_id, $app['phraseanet.user'])
|
||||
->get_publication($app['request'], $feed_id, $app['authentication']->getUser())
|
||||
->get_response();
|
||||
})->assert('feed_id', '\d+');
|
||||
|
||||
|
@@ -14,6 +14,10 @@ namespace Alchemy\Phrasea\Core;
|
||||
final class PhraseaEvents
|
||||
{
|
||||
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_END = 'api.oauth2.end';
|
||||
const API_LOAD_START = 'api.load.start';
|
||||
|
@@ -29,13 +29,13 @@ class Prod extends Helper
|
||||
|
||||
$bases = $fields = $dates = array();
|
||||
|
||||
if (! $this->app['phraseanet.user'] instanceof \User_Adapter) {
|
||||
if (! $this->app['authentication']->getUser() instanceof \User_Adapter) {
|
||||
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();
|
||||
|
||||
$bases[$sbas_id] = array(
|
||||
@@ -45,7 +45,7 @@ class Prod extends Helper
|
||||
'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']) &&
|
||||
isset($searchSet['bases'][$sbas_id])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbas_id])) : true;
|
||||
$bases[$sbas_id]['collections'][] =
|
||||
@@ -83,7 +83,7 @@ class Prod extends Helper
|
||||
if (! $bases[$sbas_id]['thesaurus']) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -116,7 +116,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
|
||||
/* @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);
|
||||
|
||||
@@ -125,7 +125,7 @@ class Helper extends \Alchemy\Phrasea\Helper\Helper
|
||||
} elseif (trim($Request->get('story')) !== '') {
|
||||
$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);
|
||||
} else {
|
||||
|
@@ -73,7 +73,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
|
||||
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);
|
||||
|
||||
@@ -86,7 +86,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
|
||||
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
|
||||
b.sbas_id,
|
||||
@@ -366,7 +366,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
public function apply_rights()
|
||||
{
|
||||
$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')));
|
||||
|
||||
$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);
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
$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) {
|
||||
$user = \User_adapter::getInstance($usr_id, $this->app);
|
||||
@@ -642,7 +642,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
|
||||
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) {
|
||||
$user = \User_Adapter::getInstance($usr_id, $this->app);
|
||||
@@ -651,7 +651,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
if ($user->is_template()) {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ class Manage extends Helper
|
||||
->like($this->query_parms['like_field'], $this->query_parms['like_value'])
|
||||
->get_inactives($this->query_parms['inactives'])
|
||||
->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();
|
||||
|
||||
return $this->results->get_results();
|
||||
@@ -109,7 +109,7 @@ class Manage extends Helper
|
||||
->like($this->query_parms['like_field'], $this->query_parms['like_value'])
|
||||
->get_inactives($this->query_parms['inactives'])
|
||||
->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)
|
||||
->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->set_template($this->app['phraseanet.user']);
|
||||
$this->usr_id = $this->app['phraseanet.user']->get_id();
|
||||
$created_user->set_template($this->app['authentication']->getUser());
|
||||
$this->usr_id = $this->app['authentication']->getUser()->get_id();
|
||||
|
||||
return $created_user;
|
||||
}
|
||||
|
@@ -45,13 +45,13 @@ class WorkZone extends Helper
|
||||
|
||||
$ret = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
|
||||
$baskets = $repo_baskets->findActiveByUser($this->app['phraseanet.user'], $sort);
|
||||
$validations = $repo_baskets->findActiveValidationByUser($this->app['phraseanet.user'], $sort);
|
||||
$baskets = $repo_baskets->findActiveByUser($this->app['authentication']->getUser(), $sort);
|
||||
$validations = $repo_baskets->findActiveValidationByUser($this->app['authentication']->getUser(), $sort);
|
||||
|
||||
/* @var $repo_stories \Doctrine\Repositories\StoryWZRepository */
|
||||
$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::VALIDATIONS, $validations);
|
||||
|
@@ -166,7 +166,7 @@ class PDF
|
||||
|
||||
$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) {
|
||||
$fimg = \recordutils_image::watermark($this->app, $subdef);
|
||||
}
|
||||
@@ -430,7 +430,7 @@ class PDF
|
||||
|
||||
$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)
|
||||
$f = \recordutils_image::watermark($this->app, $subdef);
|
||||
|
||||
|
@@ -184,12 +184,12 @@ class PhraseaEngine implements SearchEngineInterface
|
||||
*/
|
||||
private function checkSession()
|
||||
{
|
||||
if (!$this->app['phraseanet.user']) {
|
||||
if (!$this->app['authentication']->getUser()) {
|
||||
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 (!$ses_id = phrasea_create_session((string) $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['authentication']->getUser()->get_id())) {
|
||||
throw new \Exception_InternalServerError('Unable to create phrasea session');
|
||||
}
|
||||
$this->app['session']->set('phrasea_session_id', $ses_id);
|
||||
@@ -557,7 +557,7 @@ class PhraseaEngine implements SearchEngineInterface
|
||||
$stmt->execute($params);
|
||||
$stmt->closeCursor();
|
||||
|
||||
if ($this->app['phraseanet.user']) {
|
||||
if ($this->app['authentication']->getUser()) {
|
||||
\User_Adapter::saveQuery($this->app, $query);
|
||||
}
|
||||
|
||||
|
@@ -623,15 +623,15 @@ class SearchEngineOptions
|
||||
$bas = array_map(function($base_id) use ($app) {
|
||||
return \collection::get_from_base_id($app, $base_id);
|
||||
}, $request->get('bases'));
|
||||
} elseif (!$app->isAuthenticated()) {
|
||||
} elseif (!$app['authentication']->isAuthenticated()) {
|
||||
$bas = $app->getOpenCollections();
|
||||
} 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) {
|
||||
if ($app->isAuthenticated()) {
|
||||
return $app['phraseanet.user']->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord');
|
||||
if ($app['authentication']->isAuthenticated()) {
|
||||
return $app['authentication']->getUser()->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord');
|
||||
} else {
|
||||
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) {
|
||||
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);
|
||||
|
@@ -26,7 +26,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ class Firewall
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class Firewall
|
||||
|
||||
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/'));
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ class Firewall
|
||||
|
||||
public function requireNotAuthenticated()
|
||||
{
|
||||
if ($this->app->isAuthenticated()) {
|
||||
if ($this->app['authentication']->isAuthenticated()) {
|
||||
$this->app->abort(302, 'You are authenticated', array('X-Phraseanet-Redirect' => '/prod/'));
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class Firewall
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
|
@@ -76,7 +76,7 @@ class Installer
|
||||
{
|
||||
$template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml');
|
||||
$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()))
|
||||
->update_rights_to_sbas(
|
||||
$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['phraseanet.user']->ACL()->update_rights_to_base($collection->get_base_id(), array(
|
||||
$this->app['authentication']->getUser()->ACL()->give_access_to_base(array($collection->get_base_id()));
|
||||
$this->app['authentication']->getUser()->ACL()->update_rights_to_base($collection->get_base_id(), array(
|
||||
'canpush' => 1, 'cancmd' => 1
|
||||
, 'canputinalbum' => 1, 'candwnldhd' => 1, 'candwnldpreview' => 1, 'canadmin' => 1
|
||||
, 'actif' => 1, 'canreport' => 1, 'canaddrecord' => 1, 'canmodifrecord' => 1
|
||||
|
@@ -33,7 +33,7 @@
|
||||
<h1 id="namePhr">{{home_title}}</h1>
|
||||
</div>
|
||||
|
||||
{% if not app.isAuthenticated() %}
|
||||
{% if not app['authentication'].isAuthenticated() %}
|
||||
<div id="content-box" class="span6 offset3">
|
||||
<form id="login-form" class="form-vertical" method="post">
|
||||
{% for key,value in auth.getParams %}
|
||||
@@ -56,8 +56,8 @@
|
||||
</p>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if app['phraseanet.user'] is not none %}
|
||||
{% set username = '<b>' ~ app['phraseanet.user'].get_display_name() ~ '</b>' %}
|
||||
{% if app['authentication'].getUser() is not none %}
|
||||
{% set username = '<b>' ~ app['authentication'].getUser().get_display_name() ~ '</b>' %}
|
||||
<div id="hello-box" class="span6 offset3">
|
||||
<p class="login_hello">
|
||||
{% trans %}
|
||||
|
@@ -37,8 +37,8 @@
|
||||
<h1 id="namePhr">{{ app['phraseanet.registry'].get('GV_homeTitle') }}</h1>
|
||||
</div>
|
||||
|
||||
{% if app['phraseanet.user'] is not none %}
|
||||
{% set username = '<b>' ~ app['phraseanet.user'].get_display_name() ~ '</b>' %}
|
||||
{% if app['authentication'].getUser() is not none %}
|
||||
{% set username = '<b>' ~ app['authentication'].getUser().get_display_name() ~ '</b>' %}
|
||||
<div id="hello-box" class="span6 offset3">
|
||||
<p class="login_hello">
|
||||
{% trans %}
|
||||
|
@@ -21,12 +21,12 @@
|
||||
<div data-role="content">
|
||||
{{ thumbnail.format100percent(record.get_preview(),'', record.get_thumbnail()) }}
|
||||
{% 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;">
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<form action="">
|
||||
<textarea class="note_area"
|
||||
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>
|
||||
<input name="sselcont_id" value="{{basket_element.getId()}}" type="hidden"/>
|
||||
</form>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{% 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) %}
|
||||
<li>
|
||||
<h3 style="text-align:left;">
|
||||
|
@@ -24,8 +24,8 @@
|
||||
<ul class="image_set">
|
||||
{% for basket_element in basket.getElements() %}
|
||||
<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() %}
|
||||
<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 %}">
|
||||
{% 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['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>
|
||||
{% endif %}
|
||||
<a href="/lightbox/ajax/LOAD_BASKET_ELEMENT/{{basket_element.getId()}}/">
|
||||
|
@@ -31,7 +31,7 @@
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
|
||||
<div class="controls">
|
||||
<p>{{ app['phraseanet.user'].get_login() }}</p>
|
||||
<p>{{ app['authentication'].getUser().get_login() }}</p>
|
||||
<p class="form_alert help-block"></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,13 +39,13 @@
|
||||
<label class="form_label control-label" for="form_gender">{% trans 'admin::compte-utilisateur sexe' %}</label>
|
||||
<div class="controls">
|
||||
<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' %}
|
||||
</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' %}
|
||||
</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' %}
|
||||
</option>
|
||||
</select>
|
||||
@@ -55,42 +55,42 @@
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_lastname">{% trans 'admin::compte-utilisateur nom' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_firstname">{% trans 'admin::compte-utilisateur email' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_address">{% trans 'admin::compte-utilisateur adresse' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_zip">{% trans 'admin::compte-utilisateur code postal' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_city">{% trans 'admin::compte-utilisateur ville' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,35 +104,35 @@
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_function">{% trans 'admin::compte-utilisateur poste' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_company">{% trans 'admin::compte-utilisateur societe' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_activity">{% trans 'admin::compte-utilisateur activite' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_phone">{% trans 'admin::compte-utilisateur telephone' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_fax">{% trans 'admin::compte-utilisateur fax' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -145,7 +145,7 @@
|
||||
<label class="form_label control-label"></label>
|
||||
<div class="controls">
|
||||
<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'] }}
|
||||
</label>
|
||||
<p class="form_alert help-block"></p>
|
||||
@@ -158,50 +158,50 @@
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_activeFTP">{% trans 'admin::compte-utilisateur:ftp: Activer le compte FTP' %}</label>
|
||||
<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>
|
||||
</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">
|
||||
<label class="form_label control-label" for="form_addrFTP">{% trans 'phraseanet:: adresse' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_loginFTP">{% trans 'admin::compte-utilisateur identifiant' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_pwdFTP">{% trans 'admin::compte-utilisateur mot de passe' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_destFTP">{% trans 'admin::compte-utilisateur:ftp: repertoire de destination ftp' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_passifFTP">{% trans 'admin::compte-utilisateur:ftp: Utiliser le mode passif' %}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -58,7 +58,7 @@ $(document).ready(function(){
|
||||
{% for application in applications %}
|
||||
<li id='app_{{application.get_id}}'>
|
||||
<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 %}
|
||||
<button type='button' class='revoke app-btn' value='{{application.get_id()}}'>{% trans 'Revoquer l\'access' %}</button>
|
||||
{% else %}
|
||||
|
@@ -68,7 +68,7 @@ $(document).ready(function() {
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
|
||||
<div class="controls">
|
||||
<p>{{ app['phraseanet.user'].get_login() }}</p>
|
||||
<p>{{ app['authentication'].getUser().get_login() }}</p>
|
||||
<p class="form_alert help-block"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -64,7 +64,7 @@
|
||||
<div class="control-group">
|
||||
<label class="form_label control-label" for="form_login">{% trans 'admin::compte-utilisateur identifiant' %}</label>
|
||||
<div class="controls">
|
||||
<p>{{ app['phraseanet.user'].get_login() }}</p>
|
||||
<p>{{ app['authentication'].getUser().get_login() }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
@@ -80,7 +80,7 @@
|
||||
<span style="font-size: 10px;">{% trans '8 caracteres minimum' %}</span>
|
||||
</label>
|
||||
<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" />
|
||||
<p class="form_alert help-block"></p>
|
||||
<div class="password-meter">
|
||||
|
@@ -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>
|
||||
</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">
|
||||
<h5>{% trans 'admin::collection:: Gestionnaires des commandes' %}</h5>
|
||||
<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>
|
||||
{% 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>
|
||||
{% 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;">
|
||||
<button class="btn btn-danger btn-mini" >
|
||||
<i class="icon-trash icon-white"></i>
|
||||
@@ -128,7 +128,7 @@
|
||||
</button>
|
||||
</form>
|
||||
{% 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>
|
||||
<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/*" />
|
||||
@@ -141,7 +141,7 @@
|
||||
<h5>{% trans "Watermark" %}</h5>
|
||||
{% if collection.getWatermark(bas_id) is not empty %}
|
||||
<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;">
|
||||
<button class="btn btn-danger btn-mini">
|
||||
<i class="icon-trash icon-white"></i>
|
||||
@@ -149,7 +149,7 @@
|
||||
</button>
|
||||
</form>
|
||||
{% 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>
|
||||
<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/*" />
|
||||
@@ -162,7 +162,7 @@
|
||||
<h5>{% trans "Stamp logo" %}</h5>
|
||||
{% if collection.getStamp(bas_id) is not empty %}
|
||||
<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;">
|
||||
<button class="btn btn-danger btn-mini">
|
||||
<i class="icon-trash icon-white"></i>
|
||||
@@ -170,7 +170,7 @@
|
||||
</button>
|
||||
</form>
|
||||
{% 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>
|
||||
<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/*" />
|
||||
@@ -183,7 +183,7 @@
|
||||
<h5>{% trans 'admin::base:collection: image de presentation : ' %}</h5>
|
||||
{% if collection.getPresentation(bas_id) is not empty %}
|
||||
<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;">
|
||||
<button class="btn btn-danger btn-mini">
|
||||
<i class="icon-trash icon-white"></i>
|
||||
@@ -191,7 +191,7 @@
|
||||
</button>
|
||||
</form>
|
||||
{% 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>
|
||||
<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/*" />
|
||||
|
@@ -32,10 +32,10 @@
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<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>
|
||||
<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>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@@ -37,7 +37,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if app['phraseanet.user'].ACL().is_admin() %}
|
||||
{% if app['authentication'].getUser().ACL().is_admin() %}
|
||||
<div class="db_infos">
|
||||
<h2>{% trans 'admin::base: Version' %}</h2>
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
|
||||
<li>
|
||||
{% 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" />
|
||||
<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()}) }}">
|
||||
@@ -87,7 +87,7 @@
|
||||
</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">
|
||||
<form method="post" action="{{ path('admin_database_set_indexable', {'databox_id': databox.get_sbas_id()}) }}" style="margin:0;">
|
||||
<label class="checkbox" for="is_indexable">
|
||||
@@ -152,7 +152,7 @@
|
||||
<li>
|
||||
<form class="form-inline" method="post" action="{{ path('admin_database_mount_collection', {'databox_id': databox.get_sbas_id(), 'collection_id' : collId }) }}">
|
||||
{% 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>
|
||||
<select id="othcollsel" name="othcollsel" >
|
||||
<option>{% trans "choisir" %}</option>
|
||||
@@ -201,7 +201,7 @@
|
||||
<h4>{% trans "admin::base: logo impression PDF" %}</h4>
|
||||
<div id="printLogoDIV_OK">
|
||||
<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()}) }}" >
|
||||
<button class="btn btn-mini btn-danger">{% trans "admin::base:collection: supprimer le logo" %}</button>
|
||||
</form>
|
||||
@@ -209,7 +209,7 @@
|
||||
</div>
|
||||
<div id="printLogoDIV_NONE">
|
||||
{% 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">
|
||||
<i>{% trans "admin::base: envoyer un logo (jpeg 35px de hauteur max)" %}</i>
|
||||
{% endif %}
|
||||
|
@@ -337,16 +337,16 @@
|
||||
</div>
|
||||
</td>
|
||||
<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 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 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 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 style="text-align:center;width:48px;"></td>
|
||||
</tr>
|
||||
@@ -356,25 +356,25 @@
|
||||
{{rights['base_id']|bas_names(app)}}
|
||||
</td>
|
||||
<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 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 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 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 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 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 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 class="users_col case_right_quota" title="{% trans 'Set download quotas' %}">
|
||||
<div class="quota_trigger quota_{{rights['base_id']}}">
|
||||
@@ -410,34 +410,34 @@
|
||||
<td style="text-align:center;width:100px;"></td>
|
||||
|
||||
<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 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 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 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 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 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 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 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 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 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 colspan="5">
|
||||
|
||||
|
@@ -54,7 +54,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
module : 3,
|
||||
usr : {{ app['phraseanet.user'].get_id() }}
|
||||
usr : {{ app['authentication'].getUser().get_id() }}
|
||||
},
|
||||
error: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
{% if error %}
|
||||
<div class="error alert alert-error">{{ error }}</div>
|
||||
{% endif %}
|
||||
{% if feed.is_owner(app['phraseanet.user']) %}
|
||||
{% if feed.is_owner(app['authentication'].getUser()) %}
|
||||
<h2>{% trans 'Edition' %}</h2>
|
||||
<div class="control-group">
|
||||
<div id="pub_icon">
|
||||
@@ -97,7 +97,7 @@
|
||||
<div class="controls">
|
||||
<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>
|
||||
{% 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() }}">
|
||||
{% 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>
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<div class="controls">
|
||||
<select id="add_pub_base_id" class="input-large" name="base_id">
|
||||
<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() }}">
|
||||
{% for collection in databox.get_collections() %}
|
||||
<option value="{{ collection.get_base_id() }}">{{ collection.get_name() }}</option>
|
||||
@@ -81,7 +81,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<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;">
|
||||
<button class="feed_remover btn btn-mini">{% trans 'boutton::supprimer' %}</button>
|
||||
</form>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<ul id="tree" class="filetree">
|
||||
|
||||
{% if app['phraseanet.user'].ACL().is_admin() %}
|
||||
{% if app['authentication'].getUser().ACL().is_admin() %}
|
||||
<li>
|
||||
<a target="right" href="/admin/dashboard/" class="ajax">
|
||||
<img src="/skins/admin/Dashboard.png" />
|
||||
@@ -15,7 +15,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if app['phraseanet.user'].ACL().is_admin() %}
|
||||
{% if app['authentication'].getUser().ACL().is_admin() %}
|
||||
<li>
|
||||
<a target="right" href="/admin/setup/" class="ajax">
|
||||
<img src="/skins/admin/Setup.png" />
|
||||
@@ -36,7 +36,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% if app['phraseanet.user'].ACL().has_right('manageusers') %}
|
||||
{% if app['authentication'].getUser().ACL().has_right('manageusers') %}
|
||||
<li class="{% if feature == 'users' %}selected{% endif %}">
|
||||
<a target="right" href="/admin/users/search/" class="ajax zone_editusers">
|
||||
<img src="/skins/admin/Users.png" />
|
||||
@@ -51,7 +51,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if app['phraseanet.user'].ACL().has_right('bas_chupub') %}
|
||||
{% if app['authentication'].getUser().ACL().has_right('bas_chupub') %}
|
||||
<li class="">
|
||||
<a target="right" href="/admin/publications/list/" class="ajax">
|
||||
<img src="/skins/icons/rss16.png" />
|
||||
@@ -60,7 +60,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if app['phraseanet.user'].ACL().has_right('taskmanager') %}
|
||||
{% if app['authentication'].getUser().ACL().has_right('taskmanager') %}
|
||||
<li class="{% if feature == 'taskmanager' %}selected{% endif %}">
|
||||
<a target="right" href="/admin/task-manager/tasks/" class="ajax">
|
||||
<img src="/skins/admin/TaskManager.png" />
|
||||
@@ -103,7 +103,7 @@
|
||||
</div>
|
||||
<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>
|
||||
<a target="right" class="ajax" href="/admin/structure/{{ sbas_id }}/">
|
||||
<img src="/skins/icons/miniadjust01.gif"/>
|
||||
@@ -144,7 +144,7 @@
|
||||
{% set seeUsrGene = false %}
|
||||
|
||||
{% 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 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -159,9 +159,9 @@
|
||||
{% endif %}
|
||||
|
||||
{% for collection in databox.get_collections() %}
|
||||
{% if (collection.get_base_id() in app['phraseanet.user'].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['phraseanet.user'].ACL.get_granted_base(['modify_struct'])|keys) %}
|
||||
{% if (collection.get_base_id() in app['authentication'].getUser().ACL.get_granted_base(['canadmin'])|keys
|
||||
or collection.get_base_id() in app['authentication'].getUser().ACL.get_granted_base(['manage'])|keys
|
||||
or collection.get_base_id() in app['authentication'].getUser().ACL.get_granted_base(['modify_struct'])|keys) %}
|
||||
|
||||
<li>
|
||||
<div style="padding:0 0 2px 0;">
|
||||
@@ -171,7 +171,7 @@
|
||||
</div>
|
||||
<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>
|
||||
<a target="right" href="/admin/collection/{{ collection.get_base_id() }}/suggested-values/" class="ajax">
|
||||
<img src="/skins/icons/foldph20open_0.gif"/>
|
||||
@@ -180,10 +180,10 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if (app['phraseanet.user'].ACL.has_right_on_base( collection.get_base_id(), 'canadmin')) %}
|
||||
{% if (app['phraseanet.user'].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['phraseanet.user'].ACL.has_right_on_sbas( sbas_id, 'bas_manage') ) %}
|
||||
{% if (app['authentication'].getUser().ACL.has_right_on_base( collection.get_base_id(), 'canadmin')) %}
|
||||
{% if (app['authentication'].getUser().ACL.has_right_on_base( collection.get_base_id(), 'canmodifrecord')
|
||||
and app['authentication'].getUser().ACL.has_right_on_base( collection.get_base_id(), 'manage')
|
||||
and app['authentication'].getUser().ACL.has_right_on_sbas( sbas_id, 'bas_manage') ) %}
|
||||
<li>
|
||||
<a target="right" href="/admin/users/search/?base_id[]={{ collection.get_base_id() }}" class="ajax">
|
||||
<img src="/skins/admin/Users.png"/>
|
||||
|
@@ -33,7 +33,7 @@
|
||||
<h1 id="namePhr">{{home_title}}</h1>
|
||||
</div>
|
||||
|
||||
{% if not app.isAuthenticated() %}
|
||||
{% if not app['authentication'].isAuthenticated() %}
|
||||
<div id="content-box" class="span6 offset3">
|
||||
<form id="login-form" class="form-vertical" method="post">
|
||||
{% for key,value in auth.getParams %}
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
{% 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">
|
||||
<p class="login_hello">
|
||||
{% trans %}
|
||||
|
@@ -38,7 +38,7 @@
|
||||
</div>
|
||||
|
||||
{% 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">
|
||||
<p class="login_hello">
|
||||
{% trans %}
|
||||
|
@@ -45,7 +45,7 @@
|
||||
<div class="baskCreate" title="{% trans 'action:: nouveau panier' %}" onclick="newBasket();"></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>
|
||||
{% endif %}
|
||||
|
||||
@@ -117,10 +117,10 @@
|
||||
onclick="evt_del_in_chutier({{ element.getId() }});"
|
||||
title="{% trans 'action : supprimer' %}">
|
||||
</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')
|
||||
or app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'cancmd')
|
||||
or app['phraseanet.user'].ACL().has_preview_grant(record) %}
|
||||
{% 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')
|
||||
or app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'cancmd')
|
||||
or app['authentication'].getUser().ACL().has_preview_grant(record) %}
|
||||
<div class="baskOneDownload" onclick="evt_dwnl('{{ record.get_serialize_key() }}');" title="{% trans 'action : exporter' %}"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@@ -446,7 +446,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
app : 2,
|
||||
usr : {{ app['phraseanet.user'].get_id() }}
|
||||
usr : {{ app['authentication'].getUser().get_id() }}
|
||||
},
|
||||
error: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
|
@@ -20,7 +20,7 @@
|
||||
{% set s_width = subdef.get_width() %}
|
||||
{% set s_height = subdef.get_height() %}
|
||||
{% endif %}
|
||||
{% if app.isAuthenticated() == true %}
|
||||
{% if app['authentication'].isAuthenticated() == true %}
|
||||
{% set url = subdef.get_url() %}
|
||||
{% else %}
|
||||
{% set url = subdef.get_permalink().get_url() %}
|
||||
|
@@ -5,8 +5,8 @@
|
||||
{% import 'common/caption_templates/overview.html.twig' as cap_ovr %}
|
||||
{% import 'common/caption_templates/preview.html.twig' as cap_prev %}
|
||||
|
||||
{% if app['phraseanet.user'] %}
|
||||
{% set business = app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
|
||||
{% if app['authentication'].getUser() %}
|
||||
{% set business = app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
|
||||
{% else %}
|
||||
{% set business = false %}
|
||||
{% endif %}
|
||||
|
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
{% 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">
|
||||
p4.Dialog.get(1).Close();
|
||||
parent.login({act:"dwnl",lst:"{{ lst }}",SSTTID:"{{ ssttid }}"});
|
||||
@@ -173,7 +173,7 @@
|
||||
<div>
|
||||
{% trans 'export::mail: destinataire' %}
|
||||
<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 != '' %}
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="reading_confirm" value="1" />
|
||||
@@ -299,9 +299,9 @@
|
||||
<label class="control-label" for="sexe">{% trans 'Civility' %}</label>
|
||||
<div class="controls">
|
||||
<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['phraseanet.user'].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 == 0 %}selected="selected"{% endif %} value="0">{% trans 'admin::compte-utilisateur:sexe: mademoiselle' %}</option>
|
||||
<option {% if app['authentication'].getUser().get_gender == 1 %}selected="selected"{% endif %} value="1">{% trans 'admin::compte-utilisateur:sexe: madame' %}</option>
|
||||
<option {% if app['authentication'].getUser().get_gender == 2 %}selected="selected"{% endif %} value="2">{% trans 'admin::compte-utilisateur:sexe: monsieur' %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -309,70 +309,70 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="usr_lastname">{% trans 'admin::compte-utilisateur nom' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_firstname">{% trans 'admin::compte-utilisateur prenom' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_mail"> {% trans 'admin::compte-utilisateur email' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_tel">{% trans 'admin::compte-utilisateur telephone' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_societe">{% trans 'admin::compte-utilisateur societe' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_function">{% trans 'admin::compte-utilisateur poste' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_address">{% trans 'admin::compte-utilisateur adresse' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_zip_code">{% trans 'admin::compte-utilisateur code postal' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="command_geoname_field">{% trans 'admin::compte-utilisateur ville' %}</label>
|
||||
<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 class="control-group">
|
||||
<label class="control-label" for="usr_fax">{% trans 'admin::compte-utilisateur fax' %}</label>
|
||||
<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>
|
||||
|
||||
@@ -650,7 +650,7 @@
|
||||
$('input[name="obj[]"]:checked', $('#download')).each(function(i,n){
|
||||
$('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);
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<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 class="context-menu-item-inner"
|
||||
onclick="evt_add_in_chutier('{{record.get_sbas_id}}','{{record.get_record_id}}',false,this);return(false);">
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% 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 class="context-menu-item-inner"
|
||||
onclick="evt_dwnl('{{record.get_sbas_id}}_{{record.get_record_id}}',false,this);return(false);">
|
||||
|
@@ -6,7 +6,7 @@
|
||||
Phraseanet
|
||||
</span>
|
||||
</li>
|
||||
{% if module != "lightbox" and app.isAuthenticated() %}
|
||||
{% if module != "lightbox" and app['authentication'].isAuthenticated() %}
|
||||
<li>
|
||||
{% if module == "prod" %}
|
||||
<a target="_self" href="/client/">
|
||||
@@ -33,7 +33,7 @@
|
||||
{% endif %}
|
||||
</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>
|
||||
<a target="_blank" href="/thesaurus/">
|
||||
<span class="{% if module == "thesaurus" %}selected{% endif %}">
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
|
||||
{# MODULE #}
|
||||
{% if app['phraseanet.user'].ACL.has_access_to_module('admin') %}
|
||||
{% if app['authentication'].getUser().ACL.has_access_to_module('admin') %}
|
||||
<li>
|
||||
<a target="_blank" href="/admin/">
|
||||
<span class="{% if module == "admin" %}selected{% endif %}">
|
||||
@@ -56,7 +56,7 @@
|
||||
{% endif %}
|
||||
|
||||
{# MODULE #}
|
||||
{% if app['phraseanet.user'].ACL.has_access_to_module('report') %}
|
||||
{% if app['authentication'].getUser().ACL.has_access_to_module('report') %}
|
||||
<li>
|
||||
<a target="_blank" href="{{ app.path('report_dashboard') }}">
|
||||
<span class="{% if module == "report" %}selected{% endif %}">
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
{# MODULE #}
|
||||
{% if module == "prod" %}
|
||||
{% if app['phraseanet.user'].ACL.has_access_to_module('upload') %}
|
||||
{% if app['authentication'].getUser().ACL.has_access_to_module('upload') %}
|
||||
<li>
|
||||
{% set link = '/prod/upload/' %}
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</li>
|
||||
{% 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>
|
||||
<a href="{{ path('prod_orders') }}" class="dialog full-dialog" title="{% trans 'Orders manager' %}">
|
||||
<span>
|
||||
@@ -122,7 +122,7 @@
|
||||
<div class="PNB" style="left:auto;overflow:hidden;">
|
||||
<ol>
|
||||
|
||||
{% if app.isAuthenticated() and (module == "client" or module == "prod") %}
|
||||
{% if app['authentication'].isAuthenticated() and (module == "client" or module == "prod") %}
|
||||
<li id="notification_trigger">
|
||||
<a href="#" style="font-weight:bold;text-decoration:none;">
|
||||
<span>
|
||||
@@ -142,15 +142,15 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<li>
|
||||
{% if app.isAuthenticated() %}
|
||||
{% if app['phraseanet.user'].is_guest %}
|
||||
{% if app['authentication'].isAuthenticated() %}
|
||||
{% if app['authentication'].getUser().is_guest %}
|
||||
<span>
|
||||
{% trans 'Guest' %}
|
||||
</span>
|
||||
{% else %}
|
||||
<a target="_blank" href="/account/" title="{% trans 'login:: Mon compte' %}">
|
||||
<span>
|
||||
{{app['phraseanet.user'].get_login()}}
|
||||
{{app['authentication'].getUser().get_login()}}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
@@ -185,7 +185,7 @@
|
||||
</table>
|
||||
</li>
|
||||
<li>
|
||||
{% if app.isAuthenticated() %}
|
||||
{% if app['authentication'].isAuthenticated() %}
|
||||
<a href="/login/logout/?app={{module}}" target="_self">
|
||||
<span>
|
||||
{% trans 'phraseanet:: deconnection' %}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
{% 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() %}
|
||||
{% else %}
|
||||
{% set preview_obj = record.get_thumbnail() %}
|
||||
|
@@ -42,7 +42,7 @@
|
||||
|
||||
|
||||
|
||||
{% if app.isAuthenticated() == true %}
|
||||
{% if app['authentication'].isAuthenticated() == true %}
|
||||
{% set url = thumbnail.get_url() %}
|
||||
{% else %}
|
||||
{% 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() %}
|
||||
{% else %}
|
||||
{% set url = thumbnail.get_permalink().get_url() %}
|
||||
|
@@ -14,11 +14,11 @@
|
||||
</table>
|
||||
{% if basket.getValidation() %}
|
||||
<div style="margin-left:10px;width:220px;">
|
||||
{{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }}
|
||||
{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}
|
||||
</div>
|
||||
<ul style="margin:10px 0 0 20px;width:200px;">
|
||||
{% 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 %}
|
||||
{% set classuser = 'agree' %}
|
||||
{% elseif validation_data.getAgreement() is null %}
|
||||
@@ -27,19 +27,19 @@
|
||||
{% set classuser = 'disagree' %}
|
||||
{% endif %}
|
||||
{% 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 %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% 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 style="height:60px;margin-top:15px;">
|
||||
<table cellspacing="0" cellpadding="0" style="width:230px;">
|
||||
<tr>
|
||||
<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 %}">
|
||||
<img src="/skins/lightbox/agree-bigie6.gif" style="vertical-align:middle;"/><span>{% trans 'validation:: OUI' %}</span>
|
||||
</div>
|
||||
|
@@ -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'%}">
|
||||
<img src="/skins/lightbox/envoyerie6.gif"/>
|
||||
{% trans 'validation::envoyer mon rapport'%}
|
||||
|
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="container left">
|
||||
{% 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() %}
|
||||
{% else %}
|
||||
{% 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 id="record_infos">
|
||||
<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 %}
|
||||
{{caption.format_caption(first_item.get_record(), '', null, business)}}
|
||||
{% endif %}
|
||||
|
@@ -56,7 +56,7 @@
|
||||
</h2>
|
||||
{% if basket.getValidation().isFinished() %}
|
||||
{% 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' %}
|
||||
{% else %}
|
||||
{% trans '(validation) a envoyer' %}
|
||||
@@ -72,7 +72,7 @@
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div>{{ basket.getDescription() }}</div>
|
||||
<div>{{ basket.getValidation.getValidationString(app, app['phraseanet.user']) }}</div>
|
||||
<div>{{ basket.getValidation.getValidationString(app, app['authentication'].getUser()) }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@@ -9,9 +9,9 @@
|
||||
{% if basket.getValidation() %}
|
||||
<div class="agreement">
|
||||
<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"
|
||||
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>
|
||||
{% endif %}
|
||||
{{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}}
|
||||
|
@@ -101,7 +101,7 @@
|
||||
<div id="record_infos">
|
||||
<div class="container">
|
||||
{% 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)}}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@@ -13,10 +13,10 @@
|
||||
</tbody>
|
||||
</table>
|
||||
{% if basket.getValidation() %}
|
||||
<div>{{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }}</div>
|
||||
<div>{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}</div>
|
||||
<ul>
|
||||
{% 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 %}
|
||||
{% set classuser = 'agree' %}
|
||||
{% elseif choice.getAgreement() is null %}
|
||||
@@ -25,17 +25,17 @@
|
||||
{% set classuser = 'disagree' %}
|
||||
{% endif %}
|
||||
{% 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 %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
<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 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 %}">
|
||||
<img src="/skins/lightbox/agree-big.png"/><span class="title15">{% trans 'validation:: OUI' %}</span>
|
||||
</div>
|
||||
|
@@ -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'%}">
|
||||
<img src="/skins/lightbox/envoyer.png"/>
|
||||
{% trans 'validation::envoyer mon rapport'%}
|
||||
|
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
<div class="container PNB">
|
||||
{% 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() %}
|
||||
{% else %}
|
||||
{% 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 id="record_infos" class="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 %}
|
||||
{{caption.format_caption(first_item.get_record(), '', null, business)}}
|
||||
{% endif %}
|
||||
|
@@ -57,7 +57,7 @@
|
||||
</h2>
|
||||
{% if basket.getValidation().isFinished() %}
|
||||
{% 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' %}
|
||||
{% else %}
|
||||
{% trans '(validation) a envoyer' %}
|
||||
@@ -73,7 +73,7 @@
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div>{{ basket.getDescription() }}</div>
|
||||
<div>{{ basket.getValidation().getValidationString(app, app['phraseanet.user']) }}</div>
|
||||
<div>{{ basket.getValidation().getValidationString(app, app['authentication'].getUser()) }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@@ -10,9 +10,9 @@
|
||||
{% if basket.getValidation() %}
|
||||
<div class="agreement">
|
||||
<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"
|
||||
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>
|
||||
{% endif %}
|
||||
{{thumbnail.format(element.getRecord(app).get_thumbnail,114,85, '', true, false)}}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<hr/>
|
||||
{% for validationDatas in basket_element.getValidationDatas() %}
|
||||
{% 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">
|
||||
{{validationDatas.getParticipant().getUser(app).get_display_name()}}
|
||||
</span> : {{ validationDatas.getNote()|nl2br }}
|
||||
@@ -17,7 +17,7 @@
|
||||
{% endfor %}
|
||||
|
||||
<form>
|
||||
<textarea>{{basket_element.getUserValidationDatas(app['phraseanet.user'], app).getNote()}}</textarea>
|
||||
<textarea>{{basket_element.getUserValidationDatas(app['authentication'].getUser(), app).getNote()}}</textarea>
|
||||
<div class="buttons">
|
||||
<button class="note_closer ui-corner-all">
|
||||
{% trans 'boutton::fermer' %}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
{% if basket_element and basket_element.getBasket().getValidation() %}
|
||||
<div class="agreement_selector" style="display:none;">
|
||||
<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"
|
||||
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>
|
||||
{% endif %}
|
||||
|
@@ -99,7 +99,7 @@
|
||||
<div id="record_infos" class="PNB">
|
||||
<div class="container PNB">
|
||||
{% 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)}}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -183,7 +183,7 @@
|
||||
<div id="dialog_dwnl" title="{% trans 'action : exporter' %}" style="display:none;"></div>
|
||||
<script type="text/javascript">
|
||||
{% 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 %}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@@ -132,6 +132,9 @@
|
||||
<div style="height:530px;" class="tab-pane">
|
||||
<div id="id-main" class="tab-content" style="display:block;">
|
||||
<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' %}
|
||||
{% include 'login/index_layout_displayx1.html.twig' %}
|
||||
{% elseif display_layout == 'DISPLAYx4' %}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<label>{% trans 'Collection' %}</label>
|
||||
<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>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{% extends 'prod/Tooltip/Tooltip.html.twig'%}
|
||||
|
||||
{% set title %}
|
||||
app['phraseanet.user'].get_display_name()
|
||||
app['authentication'].getUser().get_display_name()
|
||||
{% endset %}
|
||||
{% set width = 300 %}
|
||||
{% set maxwidth = null %}
|
||||
@@ -12,12 +12,12 @@
|
||||
<img style="margin:14px 8px;" src="/skins/icons/user.png"/>
|
||||
</div>
|
||||
<div class="PNB" style="left:100px;">
|
||||
<h1> {{ app['phraseanet.user'].get_display_name() }}</h1>
|
||||
<h1> {{ app['authentication'].getUser().get_display_name() }}</h1>
|
||||
<ul>
|
||||
<li>{{ app['phraseanet.user'].get_email() }}</li>
|
||||
<li>{{ app['phraseanet.user'].get_company() }}</li>
|
||||
<li>{{ app['phraseanet.user'].get_job() }}</li>
|
||||
<li>{{ app['phraseanet.user'].get_position() }}</li>
|
||||
<li>{{ app['authentication'].getUser().get_email() }}</li>
|
||||
<li>{{ app['authentication'].getUser().get_company() }}</li>
|
||||
<li>{{ app['authentication'].getUser().get_job() }}</li>
|
||||
<li>{{ app['authentication'].getUser().get_position() }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -10,36 +10,36 @@
|
||||
<img src="/skins/prod/000000/images/print_history.gif"/>
|
||||
</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' %}">
|
||||
<img src="/skins/prod/000000/images/ppen_history.gif"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/prod/000000/images/chgstatus_history.gif"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/prod/000000/images/chgcoll_history.gif"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/icons/push16.png"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/icons/feedback16.png"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/icons/door.png"/>
|
||||
</button>
|
||||
@@ -48,7 +48,7 @@
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/prod/000000/images/imgtools_history.gif"/>
|
||||
</button>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<td>
|
||||
<h1 class="title">
|
||||
<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' : '' }};">
|
||||
<span>
|
||||
<img src="/skins/prod/Basket/Browser/archive.png"/>
|
||||
|
@@ -49,7 +49,7 @@
|
||||
<td class="content">
|
||||
<h1 class="title">
|
||||
<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' : '' }};">
|
||||
<span>
|
||||
<img src="/skins/prod/Basket/Browser/archive.png"/>
|
||||
|
@@ -276,10 +276,10 @@
|
||||
|
||||
{% macro element(wz_scope, container, contained, record, ord) %}
|
||||
{% 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) %}
|
||||
{% 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) %}
|
||||
{% endif %}
|
||||
|
||||
@@ -289,12 +289,12 @@
|
||||
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 %}">
|
||||
<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">
|
||||
{{record.get_title()}}
|
||||
</div>
|
||||
{% 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;">
|
||||
{{record.get_status_icons|raw}}
|
||||
</div>
|
||||
@@ -317,7 +317,7 @@
|
||||
class="WorkZoneElementRemover {{ wz_scope }}" title="{% trans 'delete'%}" >
|
||||
X
|
||||
</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>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -353,7 +353,7 @@
|
||||
<td style="width:100%;">
|
||||
<table style=width:100%>
|
||||
{% 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>
|
||||
<td> {{ choice.getParticipant().getUser(app).get_display_name() }} </td>
|
||||
<td>
|
||||
|
@@ -9,36 +9,36 @@
|
||||
<img src="/skins/prod/000000/images/print_history.gif"/>
|
||||
</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' %}">
|
||||
<img src="/skins/prod/000000/images/ppen_history.gif"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/prod/000000/images/chgstatus_history.gif"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/prod/000000/images/chgcoll_history.gif"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/icons/push16.png"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/icons/feedback16.png"/>
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/icons/door.png"/>
|
||||
</button>
|
||||
@@ -47,7 +47,7 @@
|
||||
</button>
|
||||
{% 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' %}">
|
||||
<img src="/skins/prod/000000/images/imgtools_history.gif"/>
|
||||
</button>
|
||||
|
@@ -33,7 +33,7 @@
|
||||
<input type="hidden" name="usr_id" value="{{ owner.getUser().get_id() }}" />
|
||||
</td>
|
||||
<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') %}
|
||||
{% trans 'You are Admin' %}
|
||||
{% endif %}
|
||||
@@ -53,7 +53,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<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">
|
||||
<img src="/skins/prod/Push/close_badge.png" title="{% trans 'Remove' %}"/>
|
||||
</a>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<table style="height: 40px;">
|
||||
<tr>
|
||||
<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/">
|
||||
<label>{% trans 'List Name' %}</label>
|
||||
<input type="text" name="name" style="margin: 0 5px;" value="{{ list.getName() }}"/>
|
||||
@@ -16,14 +16,14 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<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">
|
||||
<img src="/skins/prod/Push/list-icon.png" />
|
||||
{% trans "Set sharing permission" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</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;">
|
||||
<button class="deleter btn btn-inverse">
|
||||
{% trans 'Delete' %}
|
||||
@@ -40,20 +40,20 @@
|
||||
<p>
|
||||
{% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %}
|
||||
{% 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>
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<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() %}
|
||||
{{ ListsMacros.badgeReadonly(entry, role) }}
|
||||
{% endfor %}
|
||||
</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;">
|
||||
<form name="list-editor-search" method="POST" action="/prod/push/edit-list/{{ list.getId() }}/">
|
||||
<div class="PNB10" style="height:160px;">
|
||||
|
@@ -14,7 +14,7 @@
|
||||
{% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %}
|
||||
<li class="list" style="padding:2px;">
|
||||
<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" />
|
||||
{% else %}
|
||||
<img src="/skins/icons/SHARE16.png" />
|
||||
|
@@ -48,7 +48,7 @@
|
||||
{% for list in lists %}
|
||||
<li class="list" style="padding:2px;">
|
||||
<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" />
|
||||
{% else %}
|
||||
<img src="/skins/icons/SHARE16.png" />
|
||||
@@ -73,7 +73,7 @@
|
||||
<input class="search" name="users-search" placeholder="{% trans 'Users' %}" type="text" style="width:210px;"/>
|
||||
<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' %}
|
||||
<a href="/prod/push/add-user/" class="user_adder link">{% trans 'Add user' %}</a>
|
||||
{% endif %}
|
||||
|
@@ -4,8 +4,8 @@
|
||||
{% set cont_width = 130 %}
|
||||
{% set cont_height = 140 %}
|
||||
{% else %}
|
||||
{% set cont_width = app['phraseanet.user'].getPrefs('editing_images_size') %}
|
||||
{% set cont_height = app['phraseanet.user'].getPrefs('editing_images_size') %}
|
||||
{% set cont_width = app['authentication'].getUser().getPrefs('editing_images_size') %}
|
||||
{% set cont_height = app['authentication'].getUser().getPrefs('editing_images_size') %}
|
||||
{% endif %}
|
||||
|
||||
{% set i = record.get_number() %}
|
||||
@@ -27,7 +27,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% 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 = '' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
{%trans 'prod::editing::fields: status ' %}
|
||||
</div>
|
||||
{% set cssfile = '000000' %}
|
||||
{% if app['phraseanet.user'].getPrefs('css') %}
|
||||
{% set cssfile = app['phraseanet.user'].getPrefs('css') %}
|
||||
{% if app['authentication'].getUser().getPrefs('css') %}
|
||||
{% set cssfile = app['authentication'].getUser().getPrefs('css') %}
|
||||
{% endif %}
|
||||
{% for field in fields %}
|
||||
{% set i = field.get_id() %}
|
||||
@@ -127,7 +127,7 @@
|
||||
<input style="font-size:2px; width:5px;" type="text" id="editFakefocus" />
|
||||
</form>
|
||||
</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_ZOOMSLIDER" >
|
||||
</div>
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
<div id='EDIT_MID'>
|
||||
<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">
|
||||
{{_self.HTML_fieldlist(recordsRequest, fields)}}
|
||||
</div>
|
||||
@@ -230,7 +230,7 @@
|
||||
<div id="idExplain" class="PNB"></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'>
|
||||
<ul>
|
||||
{% if thesaurus %}
|
||||
|
@@ -44,9 +44,9 @@
|
||||
<label for="feed_add_subtitle">{% trans 'publication : sous titre' %}</label>
|
||||
<textarea id="feed_add_subtitle" name="subtitle">{{desc}}</textarea>
|
||||
<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>
|
||||
<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 class="PNB" style="width:50%;left:auto;">
|
||||
@@ -54,7 +54,7 @@
|
||||
<h1>{% trans 'Fils disponibles' %}</h1>
|
||||
<div class="list">
|
||||
{% 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 %}">
|
||||
<span>{{ feed.get_title() }}</span>
|
||||
{% if feed.is_public() %}
|
||||
|
@@ -47,7 +47,7 @@
|
||||
<div class="list">
|
||||
{% set feed_id = entry.get_feed().get_id() %}
|
||||
{% 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 %}">
|
||||
<span>{{ feed.get_title() }}</span>
|
||||
<input type="hidden" value="{{ feed.get_id() }}"/>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
</h1>
|
||||
</td>
|
||||
<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/">
|
||||
<img src="/skins/icons/file-edit.png" title="{% trans 'boutton::editer' %}"/>
|
||||
</a>
|
||||
|
@@ -54,9 +54,9 @@
|
||||
|
||||
{% block rss %}
|
||||
{% 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() }}" />
|
||||
{% 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() }}" />
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
@@ -110,12 +110,12 @@
|
||||
|
||||
<style title="color_selection" type="text/css">
|
||||
/* .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 %};
|
||||
background-color: #{% if app['phraseanet.user'].getPrefs('background-selection-disabled') != '' %}{{app['phraseanet.user'].getPrefs('background-selection-disabled')}}{% else %}333333{% endif %};
|
||||
color: #{% if app['authentication'].getUser().getPrefs('fontcolor-selection') != '' %}{{app['authentication'].getUser().getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% 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 {
|
||||
color: #{% if app['phraseanet.user'].getPrefs('fontcolor-selection') != '' %}{{app['phraseanet.user'].getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %};
|
||||
background-color: #{% if app['phraseanet.user'].getPrefs('background-selection') != '' %}{{app['phraseanet.user'].getPrefs('background-selection')}}{% else %}404040{% endif %};
|
||||
color: #{% if app['authentication'].getUser().getPrefs('fontcolor-selection') != '' %}{{app['authentication'].getUser().getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %};
|
||||
background-color: #{% if app['authentication'].getUser().getPrefs('background-selection') != '' %}{{app['authentication'].getUser().getPrefs('background-selection')}}{% else %}404040{% endif %};
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
<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 %}
|
||||
{% set ratio = '0.333' %}
|
||||
{% endif %}
|
||||
@@ -186,7 +186,7 @@
|
||||
<div id="THPD_tabs">
|
||||
<ul>
|
||||
<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>
|
||||
{% endif %}
|
||||
</ul>
|
||||
@@ -224,7 +224,7 @@
|
||||
</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_treeBox' class="searchZone">
|
||||
<div onclick="Xclick(event);return(false);" ondblclick="CXdblClick(event);">
|
||||
@@ -297,7 +297,7 @@
|
||||
<div id="headBlock" class="PNB" style="height: 90px; bottom: auto;">
|
||||
<div style="margin: 15px auto; line-height: 30px; width: 580px;">
|
||||
<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">
|
||||
<img src="/skins/icons/settings.png" title="{% trans 'Advanced Search' %}"/>
|
||||
</a>
|
||||
@@ -536,19 +536,19 @@
|
||||
</span>
|
||||
|
||||
{% set actions = {} %}
|
||||
{% if app['phraseanet.user'].ACL().has_right('modifyrecord') %}
|
||||
{% if app['authentication'].getUser().ACL().has_right('modifyrecord') %}
|
||||
{% set label %}
|
||||
{% trans 'action : editer' %}
|
||||
{% endset %}
|
||||
{% set actions = actions|merge( { 'edit' : {'icon': "/skins/prod/000000/images/ppen_history.gif", 'class':'TOOL_ppen_btn', 'label' : label} }) %}
|
||||
{% endif %}
|
||||
{% if app['phraseanet.user'].ACL().has_right('changestatus') %}
|
||||
{% if app['authentication'].getUser().ACL().has_right('changestatus') %}
|
||||
{% set label %}
|
||||
{% trans 'action : status' %}
|
||||
{% endset %}
|
||||
{% set actions = actions|merge( { 'status' : {'icon': "/skins/prod/000000/images/chgstatus_history.gif", 'class':'TOOL_chgstatus_btn', 'label' : label} }) %}
|
||||
{% 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 %}
|
||||
{% trans 'action : collection' %}
|
||||
{% endset %}
|
||||
@@ -596,7 +596,7 @@
|
||||
</span>
|
||||
{% 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">
|
||||
<div class="btn-group">
|
||||
<button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse">
|
||||
@@ -627,7 +627,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
{% elseif app['phraseanet.user'].ACL().has_right('push') %}
|
||||
{% elseif app['authentication'].getUser().ACL().has_right('push') %}
|
||||
<span class="dropdownButton">
|
||||
<div class="btn-group">
|
||||
<button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse" >
|
||||
@@ -644,7 +644,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
{% elseif app['phraseanet.user'].ACL().has_right('bas_chupub') %}
|
||||
{% elseif app['authentication'].getUser().ACL().has_right('bas_chupub') %}
|
||||
<span class="dropdownButton">
|
||||
<div class="btn-group">
|
||||
<button class="TOOL_pushdoc_btn default_action results_window btn btn-inverse" >
|
||||
@@ -663,7 +663,7 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if app['phraseanet.user'].ACL().has_right('doctools') %}
|
||||
{% if app['authentication'].getUser().ACL().has_right('doctools') %}
|
||||
<span class="classicButton">
|
||||
<div class="btn-group">
|
||||
<button class="TOOL_imgtools_btn results_window btn btn-inverse" >
|
||||
@@ -672,7 +672,7 @@
|
||||
</div>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if app['phraseanet.user'].ACL().has_right('deleterecord') %}
|
||||
{% if app['authentication'].getUser().ACL().has_right('deleterecord') %}
|
||||
<span class="classicButton">
|
||||
<div class="btn-group">
|
||||
<button class="TOOL_trash_btn results_window btn btn-inverse" >
|
||||
@@ -685,11 +685,11 @@
|
||||
<div id="answers" class=" PNB10" style="top:48px; bottom:30px;">
|
||||
<script>
|
||||
$(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')
|
||||
{% elseif app['phraseanet.user'].getPrefs('start_page') == 'LAST_QUERY' %}
|
||||
{% elseif app['authentication'].getUser().getPrefs('start_page') == 'LAST_QUERY' %}
|
||||
$('form[name="phrasea_query"]').addClass('triggerAfterInit')
|
||||
{% elseif app['phraseanet.user'].getPrefs('start_page') == 'PUBLI' %}
|
||||
{% elseif app['authentication'].getUser().getPrefs('start_page') == 'PUBLI' %}
|
||||
getHome('PUBLI');
|
||||
{% endif %}
|
||||
});
|
||||
@@ -746,7 +746,7 @@
|
||||
<div id="MESSAGE-push"></div>
|
||||
<div id="MESSAGE-publi"></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>
|
||||
<h1>{% trans 'Raccourcis claviers en cours de recherche : ' %}</h1>
|
||||
<ul>
|
||||
@@ -810,7 +810,7 @@
|
||||
<div class="box">
|
||||
<div class="" style="float:left; width:49%;">
|
||||
<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">
|
||||
<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' %}
|
||||
@@ -829,7 +829,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<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 %}/>
|
||||
@@ -841,7 +841,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<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>
|
||||
<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 %}/>
|
||||
@@ -857,7 +857,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<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>
|
||||
<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 %}/>
|
||||
@@ -870,14 +870,14 @@
|
||||
<h1>{% trans 'reponses:: images par pages : ' %}</h1>
|
||||
<div class="box">
|
||||
<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 style="float:right; width:49%;">
|
||||
<h1>{% trans 'reponses:: taille des images : ' %}</h1>
|
||||
<div class="box">
|
||||
<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>
|
||||
@@ -892,7 +892,7 @@
|
||||
<div class="box">
|
||||
<div class="" style="float:left;width:100%;">
|
||||
<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" >
|
||||
<select class="span2" name="start_page" onchange="start_page_selector();">
|
||||
<option value="LAST_QUERY" {% if start_page_pref == 'LAST_QUERY' %}selected="selected"{% endif %} >
|
||||
@@ -908,7 +908,7 @@
|
||||
{% trans 'Aide' %}
|
||||
</option>
|
||||
</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();" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -978,7 +978,7 @@
|
||||
<div class="box">
|
||||
<h1>{% trans 'Presentation de vignettes de panier' %}</h1>
|
||||
<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">
|
||||
<input onchange="setPref('basket_status_display',($(this).attr('checked') ? '1' :'0'))"
|
||||
name="basket_status_display" type="checkbox" class="checkbox" value="1"
|
||||
@@ -987,7 +987,7 @@
|
||||
</label>
|
||||
</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">
|
||||
<input onchange="setPref('basket_caption_display',($(this).attr('checked') ? '1' :'0'))"
|
||||
name="basket_caption_display" type="checkbox" class="checkbox" value="1"
|
||||
@@ -996,7 +996,7 @@
|
||||
</label>
|
||||
</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">
|
||||
<input onchange="setPref('basket_title_display',($(this).attr('checked') ? '1' :'0'))"
|
||||
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">
|
||||
$(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(){
|
||||
@@ -1035,7 +1035,7 @@
|
||||
dataType: "json",
|
||||
data: {
|
||||
module : 1,
|
||||
usr : {{app['phraseanet.user'].get_id()}}
|
||||
usr : {{app['authentication'].getUser().get_id()}}
|
||||
},
|
||||
error: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{% 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">
|
||||
<a href="#" onclick="editThis('IMGT','{{record.get_serialize_key()}}');">
|
||||
<img style="vertical-align:middle" src="/skins/prod/000000/images/ppen_history.gif" />
|
||||
@@ -11,7 +11,7 @@
|
||||
<div style="text-align:center;">
|
||||
{{record.get_status_icons()|raw}}
|
||||
</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() %}
|
||||
{{caption.format_caption(record, '', null, business)}}
|
||||
{% else %}
|
||||
|
@@ -55,8 +55,8 @@
|
||||
{% trans 'report::Modification du document -- je ne me souviens plus de quoi...' %}
|
||||
{% endif %}
|
||||
<span class="actor">
|
||||
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), 'canreport') %}
|
||||
{% if done['user'] and done['user'].get_id() != app['phraseanet.user'].get_id() %}
|
||||
{% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), 'canreport') %}
|
||||
{% if done['user'] and done['user'].get_id() != app['authentication'].getUser().get_id() %}
|
||||
{% set user_infos = done['user'].get_display_name() %}
|
||||
{% trans %}report:: par {{ user_infos }}{% endtrans %}
|
||||
{% endif %}
|
||||
|
@@ -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}}"
|
||||
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>
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="printer" title="'{% trans 'action : print' %}"
|
||||
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' %}"
|
||||
onclick="evt_dwnl('{{record.get_sbas_id()}}_{{record.get_record_id()}}');return(false);"></div>
|
||||
{% endif %}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
{% endtrans %}
|
||||
<br/>
|
||||
{% 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;">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
@@ -14,9 +14,9 @@
|
||||
<td valign="middle">
|
||||
<div class='desc' style='max-height:{{th_size+70}}px;overflow-y:auto;'>
|
||||
<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)}}
|
||||
{% 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>
|
||||
</td>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% set th_size = app['phraseanet.user'].getPrefs('images_size')%}
|
||||
{% set th_size = app['authentication'].getUser().getPrefs('images_size')%}
|
||||
|
||||
{% if app['locale.I18n'] == 'fr' %}
|
||||
<div class="client_help">
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
||||
{% import 'common/doctype_icons.html.twig' as doctype_icons %}
|
||||
{% 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 %}
|
||||
{% if entry_id %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}"
|
||||
@@ -31,8 +31,8 @@
|
||||
</div>
|
||||
{% set rollover_gif = record.get_rollover_thumbnail() %}
|
||||
|
||||
{% set user_technical_display = app['phraseanet.user'].getPrefs('technical_display') %}
|
||||
{% set user_rollover_thumbnail = app['phraseanet.user'].getPrefs('rollover_thumbnail') %}
|
||||
{% set user_technical_display = app['authentication'].getUser().getPrefs('technical_display') %}
|
||||
{% set user_rollover_thumbnail = app['authentication'].getUser().getPrefs('rollover_thumbnail') %}
|
||||
|
||||
{% set extraclass = '' %}
|
||||
{% if user_rollover_thumbnail == 'caption' and searchEngine is not null %}
|
||||
@@ -47,7 +47,7 @@
|
||||
{% endif %}
|
||||
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltipsrc}}" style="height:{{th_size}}px; z-index:90;">
|
||||
<div class="doc_infos">
|
||||
{% if app['phraseanet.user'].getPrefs('doctype_display') == '1' %}
|
||||
{% if app['authentication'].getUser().getPrefs('doctype_display') == '1' %}
|
||||
{{doctype_icons.format(record)}}
|
||||
{% endif %}
|
||||
<span class="duration">
|
||||
@@ -80,7 +80,7 @@
|
||||
{% endif %}
|
||||
<td style='text-align:right;width:{{l_width}}px;' valign='bottom'>
|
||||
{{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>
|
||||
{% endif %}
|
||||
{% if user_rollover_thumbnail == 'preview' %}
|
||||
|
@@ -304,8 +304,8 @@
|
||||
</h5>
|
||||
<ul class="thumbnails">
|
||||
{% for record in records %}
|
||||
{% if app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), "canaddrecord")
|
||||
and app['phraseanet.user'].ACL().has_right_on_base(record.get_base_id(), "candeleterecord") %}
|
||||
{% if app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), "canaddrecord")
|
||||
and app['authentication'].getUser().ACL().has_right_on_base(record.get_base_id(), "candeleterecord") %}
|
||||
<li class="records-subititution span3">
|
||||
<div class="thumbnail">
|
||||
<div class="record-thumb" style="text-align:center;">
|
||||
|
@@ -102,7 +102,7 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
module : 5,
|
||||
usr : {{ app['phraseanet.user'].get_id() }}
|
||||
usr : {{ app['authentication'].getUser().get_id() }}
|
||||
},
|
||||
error: function(){
|
||||
window.setTimeout("sessionactive();", 10000);
|
||||
|
@@ -40,7 +40,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
public function testRouteSlash()
|
||||
{
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['app']['authentication']->openAccount($auth);
|
||||
|
||||
$baskets = $this->insertFiveBasket();
|
||||
|
||||
@@ -67,7 +67,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testAuthenticationWithToken()
|
||||
{
|
||||
self::$DI['app']->closeAccount();
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
|
||||
$Basket = $this->insertOneBasket();
|
||||
$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()
|
||||
{
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['app']['authentication']->openAccount($auth);
|
||||
|
||||
$basket = $this->insertOneValidationBasket();
|
||||
|
||||
@@ -215,7 +215,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
public function testCompare()
|
||||
{
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['app']['authentication']->openAccount($auth);
|
||||
|
||||
$basket = $this->insertOneBasket();
|
||||
|
||||
@@ -241,7 +241,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
public function testFeedEntry()
|
||||
{
|
||||
$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']);
|
||||
|
||||
|
@@ -55,7 +55,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
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/');
|
||||
|
||||
$this->assertForbiddenResponse(self::$DI['client']->getResponse());
|
||||
@@ -63,7 +63,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
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/');
|
||||
|
||||
$this->assertForbiddenResponse(self::$DI['client']->getResponse());
|
||||
@@ -71,7 +71,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
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_permaviewBCcompatibility(array("Content-Type" => "text/html; charset=UTF-8"));
|
||||
$this->get_a_permalink(array("Content-Type" => "image/jpeg"));
|
||||
@@ -81,29 +81,29 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
function testPermalinkNotAuthenticated()
|
||||
{
|
||||
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_permaviewBCcompatibility(array("Content-Type" => "text/html; charset=UTF-8"));
|
||||
$this->get_a_permalink(array("Content-Type" => "image/jpeg"));
|
||||
$this->get_a_permaview(array("Content-Type" => "text/html; charset=UTF-8"));
|
||||
}
|
||||
|
||||
|
||||
function testCaptionAuthenticated()
|
||||
{
|
||||
$this->assertTrue(self::$DI['app']->isAuthenticated());
|
||||
$this->assertTrue(self::$DI['app']['authentication']->isAuthenticated());
|
||||
$this->get_a_caption(array("Content-Type" => "application/json"));
|
||||
}
|
||||
|
||||
function testCaptionNotAuthenticated()
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
||||
|
||||
function testCaptionWithaWrongToken()
|
||||
{
|
||||
$this->assertTrue(self::$DI['app']->isAuthenticated());
|
||||
$this->assertTrue(self::$DI['app']['authentication']->isAuthenticated());
|
||||
$token = "unexisting_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());
|
||||
}
|
||||
|
||||
|
||||
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';
|
||||
|
||||
$crawler = self::$DI['client']->request('GET', $url);
|
||||
@@ -123,7 +123,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
$this->assertEquals(404, $response->getStatusCode());
|
||||
}
|
||||
|
||||
|
||||
public function testGetAStorythumbnail()
|
||||
{
|
||||
$this->substituteAndCheck('thumbnail');
|
||||
@@ -164,44 +164,44 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
$crawler = self::$DI['client']->request('GET', $url);
|
||||
$response = self::$DI['client']->getResponse();
|
||||
|
||||
foreach ($headers as $name => $value) {
|
||||
foreach ($headers as $name => $value) {
|
||||
$this->assertEquals($response->headers->get($name), $value);
|
||||
}
|
||||
|
||||
|
||||
$caption = self::$DI['record_1']->get_caption()->serialize(\caption_record::SERIALIZE_JSON);
|
||||
$this->assertEquals($caption, $response->getContent());
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
|
||||
protected function get_a_permalinkBCcompatibility(array $headers = array())
|
||||
{
|
||||
$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/';
|
||||
|
||||
|
||||
$crawler = self::$DI['client']->request('GET', $url);
|
||||
$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("Link"), "/permalink/v1/1/". self::$DI['record_1']->get_record_id()."/caption/?token=".$token);
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
|
||||
protected function get_a_permaviewBCcompatibility(array $headers = array())
|
||||
{
|
||||
$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 = $url . 'view/';
|
||||
$crawler = self::$DI['client']->request('GET', $url);
|
||||
$response = self::$DI['client']->getResponse();
|
||||
|
||||
|
||||
foreach ($headers as $name => $value) {
|
||||
$this->assertEquals($response->headers->get($name), $value);
|
||||
}
|
||||
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
@@ -216,11 +216,11 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
foreach ($headers as $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(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
|
||||
protected function get_a_permaview(array $headers = array())
|
||||
{
|
||||
$token = self::$DI['record_1']->get_preview()->get_permalink()->get_token();
|
||||
@@ -232,7 +232,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
foreach ($headers as $name => $value) {
|
||||
$this->assertEquals($response->headers->get($name), $value);
|
||||
}
|
||||
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
}
|
||||
|
@@ -48,12 +48,12 @@ class ApplicationRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testNoPersistentCookie()
|
||||
{
|
||||
$app = self::$DI['app'];
|
||||
$app->closeAccount();
|
||||
$app['authentication']->closeAccount();
|
||||
|
||||
$boolean = false;
|
||||
|
||||
$app->get('/unit-test-route', function(Application $app) use (&$boolean) {
|
||||
$boolean = $app->isAuthenticated();
|
||||
$boolean = $app['authentication']->isAuthenticated();
|
||||
|
||||
return new Response();
|
||||
});
|
||||
@@ -67,7 +67,7 @@ class ApplicationRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testPersistentCookie()
|
||||
{
|
||||
$app = self::$DI['app'];
|
||||
$app->closeAccount();
|
||||
$app['authentication']->closeAccount();
|
||||
|
||||
$browser = $this->getMockBuilder('\Browser')
|
||||
->disableOriginalConstructor()
|
||||
@@ -102,7 +102,7 @@ class ApplicationRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$boolean = false;
|
||||
|
||||
$app->get('/unit-test-route', function(Application $app) use (&$boolean) {
|
||||
$boolean = $app->isAuthenticated();
|
||||
$boolean = $app['authentication']->isAuthenticated();
|
||||
|
||||
return new Response();
|
||||
});
|
||||
|
@@ -76,27 +76,58 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Application
|
||||
*/
|
||||
public function testOpenAccount()
|
||||
public function testCookieLocale()
|
||||
{
|
||||
$app = new Application('test');
|
||||
$app = $this->getAppThatReturnLocale();
|
||||
|
||||
$this->assertFalse($app->isAuthenticated());
|
||||
$app->openAccount($this->getAuthMock());
|
||||
$this->assertTrue($app->isAuthenticated());
|
||||
foreach (array('fr_FR', 'en_GB', 'de_DE') as $locale) {
|
||||
$client = $this->getClientWithCookie($app, $locale);
|
||||
$client->request('GET', '/');
|
||||
|
||||
$this->assertEquals($locale, $client->getResponse()->getContent());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @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());
|
||||
$app->openAccount($this->getAuthMock());
|
||||
$this->assertTrue($app->isAuthenticated());
|
||||
$app->closeAccount();
|
||||
$this->assertFalse($app->isAuthenticated());
|
||||
$client = $this->getClientWithCookie($app, null);
|
||||
$client->request('GET', '/');
|
||||
|
||||
$this->assertEquals('en_USA', $client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -12,7 +12,7 @@ class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
self::$DI['app']['phraseanet.user'] = self::$DI['user'];
|
||||
self::$DI['app']['authentication']->setUser(self::$DI['user']);
|
||||
foreach (self::$createdCollections as $collection) {
|
||||
try {
|
||||
$collection->unmount_collection(self::$DI['app']);
|
||||
|
@@ -62,7 +62,7 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$databoxes = self::$DI['app']['phraseanet.appbox']->get_databoxes();
|
||||
$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;
|
||||
|
||||
|
@@ -12,7 +12,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testRouteSlash()
|
||||
{
|
||||
$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'));
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
|
@@ -25,7 +25,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
\phrasea::start(self::$DI['app']['phraseanet.configuration']);
|
||||
$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/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
@@ -392,7 +392,7 @@ class BridgeApplication extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
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/";
|
||||
self::$DI['client']->request('POST', $url);
|
||||
$response = self::$DI['client']->getResponse();
|
||||
|
@@ -52,10 +52,10 @@ class DownloadTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
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'))
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->getMock());
|
||||
|
||||
$stubbedACL = $this->getMockBuilder('\ACL')
|
||||
->disableOriginalConstructor()
|
||||
@@ -76,7 +76,7 @@ class DownloadTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->method('remaining_download')
|
||||
->will($this->returnValue(0));
|
||||
|
||||
self::$DI['app']['phraseanet.user']->expects($this->any())
|
||||
self::$DI['app']['authentication']->getUser()->expects($this->any())
|
||||
->method('ACL')
|
||||
->will($this->returnValue($stubbedACL));
|
||||
|
||||
|
@@ -31,11 +31,11 @@ class QueryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testQueryAnswerTrain()
|
||||
{
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['app']['authentication']->openAccount($auth);
|
||||
self::$DI['record_24'];
|
||||
|
||||
$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();
|
||||
|
||||
self::$DI['client']->request('POST', '/prod/query/answer-train/', array(
|
||||
|
@@ -84,11 +84,11 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testGetRecordDetailResult()
|
||||
{
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['app']['authentication']->openAccount($auth);
|
||||
self::$DI['record_24'];
|
||||
|
||||
$options = new SearchEngineOptions();
|
||||
$acl = self::$DI['app']['phraseanet.user']->ACL();
|
||||
$acl = self::$DI['app']['authentication']->getUser()->ACL();
|
||||
$options->onCollections($acl->get_granted_base());
|
||||
$serializedOptions = $options->serialize();
|
||||
|
||||
@@ -121,7 +121,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testGetRecordDetailREG()
|
||||
{
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['app']['authentication']->openAccount($auth);
|
||||
self::$DI['record_story_1'];
|
||||
|
||||
$this->XMLHTTPRequest('POST', '/prod/records/', array(
|
||||
@@ -152,7 +152,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testGetRecordDetailBasket()
|
||||
{
|
||||
$auth = new \Session_Authentication_None(self::$DI['user']);
|
||||
self::$DI['app']->openAccount($auth);
|
||||
self::$DI['app']['authentication']->openAccount($auth);
|
||||
$basket = $this->insertOneBasket();
|
||||
$record = self::$DI['record_1'];
|
||||
|
||||
@@ -195,7 +195,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testGetRecordDetailFeed()
|
||||
{
|
||||
$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::$DI['app'],
|
||||
|
@@ -12,7 +12,7 @@ class ControllerRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testRouteSlash()
|
||||
{
|
||||
$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/');
|
||||
|
||||
|
@@ -26,10 +26,10 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRouteSlash()
|
||||
{
|
||||
self::$DI['app']['phraseanet.user'] = $this->getMockBuilder('\User_Adapter')
|
||||
self::$DI['app']['authentication']->setUser($this->getMockBuilder('\User_Adapter')
|
||||
->setMethods(array('ACL'))
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->getMock());
|
||||
|
||||
$stubbedACL = $this->getMockBuilder('\ACL')
|
||||
->disableOriginalConstructor()
|
||||
@@ -45,7 +45,7 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->method('has_access_to_subdef')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
self::$DI['app']['phraseanet.user']->expects($this->any())
|
||||
self::$DI['app']['authentication']->getUser()->expects($this->any())
|
||||
->method('ACL')
|
||||
->will($this->returnValue($stubbedACL));
|
||||
|
||||
@@ -72,10 +72,10 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
$share = new Share();
|
||||
|
||||
self::$DI['app']['phraseanet.user'] = $this->getMockBuilder('\User_Adapter')
|
||||
self::$DI['app']['authentication']->setUser($this->getMockBuilder('\User_Adapter')
|
||||
->setMethods(array('ACL'))
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->getMock());
|
||||
|
||||
$stubbedACL = $this->getMockBuilder('\ACL')
|
||||
->disableOriginalConstructor()
|
||||
@@ -86,7 +86,7 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->method('has_access_to_subdef')
|
||||
->will($this->returnValue(false));
|
||||
|
||||
self::$DI['app']['phraseanet.user']->expects($this->once())
|
||||
self::$DI['app']['authentication']->getUser()->expects($this->once())
|
||||
->method('ACL')
|
||||
->will($this->returnValue($stubbedACL));
|
||||
|
||||
|
@@ -10,7 +10,7 @@ class ControllerStoryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
$route = "/prod/story/";
|
||||
|
||||
$collections = self::$DI['app']['phraseanet.user']
|
||||
$collections = self::$DI['app']['authentication']->getUser()
|
||||
->ACL()
|
||||
->get_granted_base(array('canaddrecord'));
|
||||
|
||||
@@ -40,7 +40,7 @@ class ControllerStoryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
$route = "/prod/story/";
|
||||
|
||||
$collections = self::$DI['app']['phraseanet.user']
|
||||
$collections = self::$DI['app']['authentication']->getUser()
|
||||
->ACL()
|
||||
->get_granted_base(array('canaddrecord'));
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user