Skip to content
Snippets Groups Projects
Commit f02bd833 authored by enzosim's avatar enzosim
Browse files

Merge remote-tracking branch 'liris/dev_pierre_202401'

parents dc69cb76 de5d230a
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,8 @@ ENTRY_APPROVAL_NB=7 ...@@ -59,6 +59,8 @@ ENTRY_APPROVAL_NB=7
VOTE_APPROVAL_NB=7 VOTE_APPROVAL_NB=7
COMPLETE_DELETE_LABEL_DAYS_DELAY=45 COMPLETE_DELETE_LABEL_DAYS_DELAY=45
WIKSTRAKTOR_COMMAND='python C:\wamp64\www\balex\src\Wikstraktor\wikstraktor.py' WIKSTRAKTOR_COMMAND='python C:\wamp64\www\balex\src\Wikstraktor\wikstraktor.py'
WIKTEXTRACT_COMMAND='changeMe'
WIKTIONARY_TOOL='CHOOSE_WIKSTRAKTOR_OR_WIKTEXTRACT'
MONOLOG_ERROR_MAIL_FROM=babalex@lezinter.net MONOLOG_ERROR_MAIL_FROM=babalex@lezinter.net
MONOLOG_ERROR_MAIL_TO=fleutotp@gmail.com MONOLOG_ERROR_MAIL_TO=fleutotp@gmail.com
......
...@@ -43,6 +43,7 @@ security: ...@@ -43,6 +43,7 @@ security:
# interval: '5 minutes' # interval: '5 minutes'
lazy: true lazy: true
provider: all_users provider: all_users
entry_point: App\Security\AuthenticationEntryPoint # pour retourner une 403 quand une requête ajax est redirigée vers la page de login et pouvoir recharger la page depuis le JS des modals
form_login: form_login:
login_path: app_login login_path: app_login
check_path: app_login check_path: app_login
......
...@@ -594,3 +594,14 @@ audio::-webkit-media-controls-time-remaining-display { ...@@ -594,3 +594,14 @@ audio::-webkit-media-controls-time-remaining-display {
audio::-webkit-media-controls-mute-button { audio::-webkit-media-controls-mute-button {
display: none; display: none;
} }
#selectionActions {
display: inline-block;
position: sticky;
position: -webkit-sticky;
bottom: 50px;
background-color: lightgrey;
padding: 15px;
border-radius: 15px;
box-shadow: 2px 2px 6px 0px rgba(0,0,0,0.63);
}
\ No newline at end of file
...@@ -93,6 +93,13 @@ $(function() { ...@@ -93,6 +93,13 @@ $(function() {
initializeForm(true); initializeForm(true);
} }
}, },
error: function(jqXHR, textStatus, errorThrown) {
switch (jqXHR.status) {
case 403: // Not authenticated anymore
// Reload page from server
window.location.reload(true);
}
},
complete: function() { complete: function() {
$overlay.hide(); $overlay.hide();
} }
......
...@@ -65,8 +65,13 @@ class WiktionaryManager ...@@ -65,8 +65,13 @@ class WiktionaryManager
//$time_start = microtime(true); /*Debug*/ //$time_start = microtime(true); /*Debug*/
//$command = $_ENV['WIKSTRAKTOR_COMMAND'] . ' -l ' . $language . ' -w ' . $language . ' -m "' . $word . '" -A -C 2>&1';
$command = $_ENV['WIKTEXTRACT_COMMAND'] . ' -l ' . $language . ' -w ' . $language . ' -e "' . $word . '"' . ' -zA 2>&1'; if ($_ENV['WIKTIONARY_TOOL'] == 'WIKSTRAKTOR') {
$command = $_ENV['WIKSTRAKTOR_COMMAND'] . ' -l ' . $language . ' -w ' . $language . ' -m "' . $word . '" -A -C 2>&1';
} else {
$command = $_ENV['WIKTEXTRACT_COMMAND'] . ' -l ' . $language . ' -w ' . $language . ' -e "' . $word . '"' . ' -zA 2>&1';
}
$result = exec($command); $result = exec($command);
//dump($word);dump($command);dump(microtime(true)-$time_start);dump($result);die();/*Debug*/ //dump($word);dump($command);dump(microtime(true)-$time_start);dump($result);die();/*Debug*/
// Output and error handling // Output and error handling
......
...@@ -144,13 +144,15 @@ class LabelRepository extends ServiceEntityRepository ...@@ -144,13 +144,15 @@ class LabelRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('l') $qb = $this->createQueryBuilder('l')
->leftJoin('l.group', 'g') ->leftJoin('l.group', 'g')
->leftJoin('g.groupMemberships', 'gms') ->leftJoin('g.groupMemberships', 'gms')
->andWhere('l.master != :personal OR l.user = :user')
->andWhere('l.category != :milestone OR l.user = :user OR gms.user = :user') ->andWhere('l.master != :personal OR l.user = :user') // On ne que ses propres labels personnels
->andWhere('l.category IN (:commonLabelCategories)') ->andWhere('l.master != :group OR gms.user = :user') // On ne que les labels de groupes des groupes dont on est membre
->andWhere('l.category IN (:commonLabelCategories)') // On ne voit que les labels généraux, institutionnels et échéances
->andWhere('l.language = :language') ->andWhere('l.language = :language')
->setParameter('language', $language) ->setParameter('language', $language)
->setParameter('milestone', Label::LABEL_CATEGORY_MILESTONE)
->setParameter('personal', Label::MASTER_PERSONAL) ->setParameter('personal', Label::MASTER_PERSONAL)
->setParameter('group', Label::MASTER_GROUP)
->setParameter('commonLabelCategories', Label::COMMON_LABEL_LIST_CATEGORIES) ->setParameter('commonLabelCategories', Label::COMMON_LABEL_LIST_CATEGORIES)
->setParameter('user', $user) ->setParameter('user', $user)
->orderBy('l.updatedAt', 'DESC') ->orderBy('l.updatedAt', 'DESC')
......
<?php
namespace App\Security;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
class AuthenticationEntryPoint implements AuthenticationEntryPointInterface
{
private $urlGenerator;
public function __construct(UrlGeneratorInterface $urlGenerator)
{
$this->urlGenerator = $urlGenerator;
}
public function start(Request $request, AuthenticationException $authException = null)
{
if ($request->isXmlHttpRequest()) {
return new Response($this->urlGenerator->generate('app_login'), 403);
}
return new RedirectResponse($this->urlGenerator->generate('app_login'));
}
}
\ No newline at end of file
<div id="selectionActions" class="row"> <div id="selectionActions" >
<div class="col-md-12">
<i>{{ "Avec la sélection"|trans }}:</i> <i>{{ "Avec la sélection"|trans }}:</i>
...@@ -12,6 +11,5 @@ ...@@ -12,6 +11,5 @@
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
</button> </button>
</div>
</div> </div>
{% if is_granted('LEXICON_EDIT', lexicon) %} {% if is_granted('LEXICON_EDIT', lexicon) %}
<div id="selectionActions" class="row mb-3"> <div id="selectionActions">
<div class="col-md-12">
<i>{{ "Avec la sélection"|trans }}:</i> <i>{{ "Avec la sélection"|trans }}:</i>
{# ADD label Remosve LAbel, delete entries, export entries, connu, pas connu #} {# ADD label Remosve LAbel, delete entries, export entries, connu, pas connu #}
...@@ -93,7 +92,6 @@ ...@@ -93,7 +92,6 @@
{# </ul>#} {# </ul>#}
{# </div>#} {# </div>#}
</div>
</div> </div>
{% endif %} {% endif %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment