mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
@@ -49,7 +49,7 @@ class Oauth2 implements ControllerProviderInterface
|
||||
$params = $oauth2_adapter->getAuthorizationRequestParameters($request);
|
||||
|
||||
$app_authorized = false;
|
||||
$errorMessage = false;
|
||||
$error = $request->get('error', '');
|
||||
|
||||
$client = \API_OAuth2_Application::load_from_client_id($app, $params['client_id']);
|
||||
|
||||
@@ -79,26 +79,24 @@ class Oauth2 implements ControllerProviderInterface
|
||||
$usr_id = $app['auth.native']->getUsrId($request->get("login"), $request->get("password"), $request);
|
||||
|
||||
if (null === $usr_id) {
|
||||
$app['session']->getFlashBag()->set('error', _('login::erreur: Erreur d\'authentification'));
|
||||
|
||||
return $app->redirectPath('oauth2_authorize');
|
||||
return $app->redirectPath('oauth2_authorize', array_merge(array('error' => 'login'), $params));
|
||||
}
|
||||
} catch (RequireCaptchaException $e) {
|
||||
return $app->redirectPath('oauth2_authorize', array('error' => 'captcha'));
|
||||
return $app->redirectPath('oauth2_authorize', array_merge(array('error' => 'captcha'), $params));
|
||||
} catch (AccountLockedException $e) {
|
||||
return $app->redirectPath('oauth2_authorize', array('error' => 'account-locked'));
|
||||
return $app->redirectPath('oauth2_authorize', array_merge(array('error' => 'account-locked'), $params));
|
||||
}
|
||||
|
||||
$app['authentication']->openAccount(\User_Adapter::getInstance($usr_id, $app));
|
||||
} else {
|
||||
return new Response($app['twig']->render($template, array('error' => $error, "auth" => $oauth2_adapter)));
|
||||
}
|
||||
|
||||
return new Response($app['twig']->render($template, array("auth" => $oauth2_adapter)));
|
||||
}
|
||||
|
||||
//check if current client is already authorized by current user
|
||||
$user_auth_clients = \API_OAuth2_Application::load_authorized_app_by_user(
|
||||
$app
|
||||
, $app['authentication']->getUser()
|
||||
$app, $app['authentication']->getUser()
|
||||
);
|
||||
|
||||
foreach ($user_auth_clients as $auth_client) {
|
||||
@@ -114,7 +112,7 @@ class Oauth2 implements ControllerProviderInterface
|
||||
if (!$app_authorized && $action_accept === null) {
|
||||
$params = array(
|
||||
"auth" => $oauth2_adapter,
|
||||
"errorMessage" => $errorMessage,
|
||||
"error" => $error,
|
||||
);
|
||||
|
||||
return new Response($app['twig']->render($template, $params));
|
||||
|
||||
@@ -234,14 +234,22 @@ class Basket implements ControllerProviderInterface
|
||||
{
|
||||
$basket = $app['EM']->getRepository('\Entities\Basket')
|
||||
->findUserBasket($app, $basket_id, $app['authentication']->getUser(), true);
|
||||
$basketElement = $app['EM']->getRepository('\Entities\BasketElement')
|
||||
->find($basket_element_id);
|
||||
$ord = $basketElement->getOrd();
|
||||
|
||||
foreach ($basket->getElements() as $basket_element) {
|
||||
if ($basket_element->getOrd() > $ord) {
|
||||
$basket_element->setOrd($basket_element->getOrd() - 1);
|
||||
}
|
||||
/* @var $basket_element \Entities\BasketElement */
|
||||
if ($basket_element->getId() == $basket_element_id) {
|
||||
$basket->removeElement($basket_element);
|
||||
$app['EM']->remove($basket_element);
|
||||
}
|
||||
}
|
||||
|
||||
$app['EM']->persist($basket);
|
||||
$app['EM']->flush();
|
||||
|
||||
$data = array(
|
||||
|
||||
@@ -110,11 +110,11 @@ class databox_status
|
||||
$this->status[$bit]["img_on"] = null;
|
||||
|
||||
if (is_file($path . "-stat_" . $bit . "_0.gif")) {
|
||||
$this->status[$bit]["img_off"] = $url . "-stat_" . $bit . "_0.gif";
|
||||
$this->status[$bit]["img_off"] = $url . "-stat_" . $bit . "_0.gif?etag=".md5_file($path . "-stat_" . $bit . "_0.gif");
|
||||
$this->status[$bit]["path_off"] = $path . "-stat_" . $bit . "_0.gif";
|
||||
}
|
||||
if (is_file($path . "-stat_" . $bit . "_1.gif")) {
|
||||
$this->status[$bit]["img_on"] = $url . "-stat_" . $bit . "_1.gif";
|
||||
$this->status[$bit]["img_on"] = $url . "-stat_" . $bit . "_1.gif?etag=".md5_file($path . "-stat_" . $bit . "_1.gif");
|
||||
$this->status[$bit]["path_on"] = $path . "-stat_" . $bit . "_1.gif";
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,9 @@
|
||||
{% for key,value in auth.getParams %}
|
||||
<input type="hidden" name="{{key}}" value="{{value}}">
|
||||
{% endfor %}
|
||||
{% if errorMessage is defined %}
|
||||
<p class="login_error">{% trans 'Erreur de login / mot de passe' %}</p>
|
||||
{% if error == 'login' %}
|
||||
<br />
|
||||
<p class="alert alert-error" style="color: #E0215D;padding:10px">{% trans 'Erreur de login / mot de passe' %}</p>
|
||||
{% endif %}
|
||||
<p class="login_hello">
|
||||
{% trans %}
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
{% else %}
|
||||
<td class="w160px">
|
||||
{% endif %}
|
||||
<div class="diapo w160px" style="margin-bottom:0;border-bottom:none;overflow:hidden;">
|
||||
<div class="diapo w160px" style="margin-bottom:0;border-bottom:none;">
|
||||
<div class="title" style="max-height:100%" title="{{ record.get_title() }}">{{ record.get_title() }}</div>
|
||||
<div class="status">{{ record.get_status_icons()|raw }}</div>
|
||||
<table cellpadding="0" cellspacing="0" style="margin: 0pt auto;">
|
||||
|
||||
@@ -25,9 +25,8 @@
|
||||
</td>
|
||||
{% 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">
|
||||
<button class="deleter btn btn-inverse" data-list-id="{{ list.getId() }}">
|
||||
{% trans 'Delete' %}
|
||||
<input type="hidden" name="list_id" value="{{ list.getId() }}"/>
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
onDblClick="openPreview('RESULT',{{record.get_number}});">
|
||||
{% endif %}
|
||||
<div style="padding: 4px;">
|
||||
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;overflow:hidden;">
|
||||
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
||||
<div class="title" style="max-height:100%" title="{{ record.get_title() }}">
|
||||
{{ record.get_title() }}
|
||||
</div>
|
||||
|
||||
@@ -394,13 +394,19 @@ $(document).ready(function () {
|
||||
//on submit file
|
||||
$('#fileupload', UploaderManager.getContainer()).bind('fileuploadsubmit', function (e, data) {
|
||||
var $this = $(this);
|
||||
var params = [];
|
||||
data.formData = [];
|
||||
|
||||
//get form datas attached to the file
|
||||
data.formData = $.extend(
|
||||
data.context.find('input, select').serializeArray(),
|
||||
$("input", $('.collection-status:visible', UploaderManager.getSettingsBox())).serializeArray(),
|
||||
$("select", UploaderManager.getSettingsBox()).serializeArray()
|
||||
);
|
||||
params.push(data.context.find('input, select').serializeArray());
|
||||
params.push($("input", $('.collection-status:visible', UploaderManager.getSettingsBox())).serializeArray());
|
||||
params.push($("select", UploaderManager.getSettingsBox()).serializeArray());
|
||||
|
||||
$.each(params, function(i, p) {
|
||||
$.each(p, function (i, f){
|
||||
data.formData.push(f);
|
||||
});
|
||||
});
|
||||
|
||||
data.formData.push({
|
||||
"name": "b64_image",
|
||||
|
||||
@@ -149,13 +149,13 @@
|
||||
|
||||
buttons[language.send] = function () {
|
||||
if ($.trim($('input[name="name"]', $dialog.getDomElement()).val()) === '') {
|
||||
options = {
|
||||
var options = {
|
||||
size: 'Alert',
|
||||
closeButton: true,
|
||||
title: language.warning
|
||||
},
|
||||
$dialog = p4.Dialog.Create(options, 3);
|
||||
$dialog.setContent(language.FeedBackNameMandatory);
|
||||
}
|
||||
var $dialogAlert = p4.Dialog.Create(options, 3);
|
||||
$dialogAlert.setContent(language.FeedBackNameMandatory);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -514,7 +514,7 @@
|
||||
var options = {
|
||||
cancelButton: true,
|
||||
buttons: buttons,
|
||||
size: 'Alert'
|
||||
size: '700x170'
|
||||
};
|
||||
|
||||
p4.Dialog.Create(options, 2).setContent(box);
|
||||
@@ -626,7 +626,7 @@
|
||||
|
||||
$('button.deleter', $container).bind('click', function (event) {
|
||||
|
||||
var list_id = $(this).find('input[name=list_id]').val();
|
||||
var list_id = $(this).data("list-id");
|
||||
|
||||
var makeDialog = function (box) {
|
||||
|
||||
|
||||
@@ -155,6 +155,8 @@ var p4 = p4 || {};
|
||||
}
|
||||
|
||||
selectedItem.remove();
|
||||
} else {
|
||||
return p4.WorkZone.reloadCurrent();
|
||||
}
|
||||
} else {
|
||||
humane.error(data.message);
|
||||
@@ -308,8 +310,8 @@ var p4 = p4 || {};
|
||||
$('a.WorkZoneElementRemover', dest).bind('mousedown',function (event) {
|
||||
return false;
|
||||
}).bind('click', function (event) {
|
||||
return WorkZoneElementRemover($(this), false);
|
||||
});
|
||||
return WorkZoneElementRemover($(this), false);
|
||||
});
|
||||
|
||||
dest.droppable({
|
||||
accept: function (elem) {
|
||||
|
||||
Reference in New Issue
Block a user