srcf
This commit is contained in:
@@ -7,8 +7,7 @@ node_modules/
|
|||||||
.env.*.local
|
.env.*.local
|
||||||
|
|
||||||
# Cache et logs Symfony
|
# Cache et logs Symfony
|
||||||
var/cache/
|
var
|
||||||
var/log/
|
|
||||||
|
|
||||||
# Build front-end
|
# Build front-end
|
||||||
public/build/
|
public/build/
|
||||||
|
@@ -22,7 +22,7 @@ security:
|
|||||||
form_login:
|
form_login:
|
||||||
login_path: app_login
|
login_path: app_login
|
||||||
check_path: app_login
|
check_path: app_login
|
||||||
enable_csrf: true
|
enable_csrf: false
|
||||||
csrf_token_id: authenticate
|
csrf_token_id: authenticate
|
||||||
csrf_parameter: _csrf_token
|
csrf_parameter: _csrf_token
|
||||||
default_target_path: /
|
default_target_path: /
|
||||||
|
@@ -11,9 +11,10 @@ COPY ./misc/docker/apache.conf /etc/apache2/conf.d/nine/site.conf
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Crée vendor à l’avance et donne les droits
|
# Crée vendor à l’avance et donne les droits
|
||||||
RUN mkdir -p /app/vendor && chown -R apache:apache /app
|
RUN mkdir -p /app/vendor && mkdir -p /app/var && chown -R apache:apache /app
|
||||||
|
|
||||||
USER apache
|
USER apache
|
||||||
|
WORKDIR /app
|
||||||
COPY --chown=apache:apache . .
|
COPY --chown=apache:apache . .
|
||||||
|
|
||||||
RUN composer install --no-interaction
|
RUN composer install --no-interaction
|
||||||
|
@@ -12,7 +12,6 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
|
|
||||||
|
|
||||||
class UserController extends AbstractController
|
class UserController extends AbstractController
|
||||||
{
|
{
|
||||||
@@ -126,11 +125,8 @@ class UserController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/user', name: 'app_user_profil')]
|
#[Route('/user', name: 'app_user_profil')]
|
||||||
public function profil(CsrfTokenManagerInterface $csrfTokenManager, Request $request, UserPasswordHasherInterface $passwordHasher, EntityManagerInterface $em): Response
|
public function profil(Request $request, UserPasswordHasherInterface $passwordHasher, EntityManagerInterface $em): Response
|
||||||
{
|
{
|
||||||
$token = $csrfTokenManager->getToken('user')->getValue();
|
|
||||||
dump($token);
|
|
||||||
|
|
||||||
$user = $em->getRepository(User::class)->find($this->getUser());
|
$user = $em->getRepository(User::class)->find($this->getUser());
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
return $this->redirectToRoute('app_home');
|
return $this->redirectToRoute('app_home');
|
||||||
|
@@ -31,11 +31,6 @@ class UserType extends AbstractType
|
|||||||
'label' => 'Login',
|
'label' => 'Login',
|
||||||
])
|
])
|
||||||
|
|
||||||
->add('apikey', TextType::class, [
|
|
||||||
'label' => 'apikey',
|
|
||||||
'required' => false,
|
|
||||||
])
|
|
||||||
|
|
||||||
->add('avatar', HiddenType::class)
|
->add('avatar', HiddenType::class)
|
||||||
|
|
||||||
->add('email', EmailType::class, [
|
->add('email', EmailType::class, [
|
||||||
@@ -56,6 +51,7 @@ class UserType extends AbstractType
|
|||||||
'choice_label' => 'title',
|
'choice_label' => 'title',
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'attr' => ['class' => 'select2'],
|
'attr' => ['class' => 'select2'],
|
||||||
|
'required' => false,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -104,11 +104,11 @@ class DynamicAuthenticator extends AbstractAuthenticator
|
|||||||
|
|
||||||
// \phpCAS::setDebug('/tmp/logcas.log');
|
// \phpCAS::setDebug('/tmp/logcas.log');
|
||||||
\phpCAS::client(
|
\phpCAS::client(
|
||||||
CAS_VERSION_2_0,
|
CAS_VERSION_2_0,
|
||||||
$this->parameterBag->get('casHost'),
|
$this->parameterBag->get('casHost'),
|
||||||
(int) $this->parameterBag->get('casPort'),
|
(int) $this->parameterBag->get('casPort'),
|
||||||
$this->parameterBag->get('casPath'),
|
$this->parameterBag->get('casPath'),
|
||||||
$url,
|
$url,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
\phpCAS::setNoCasServerValidation();
|
\phpCAS::setNoCasServerValidation();
|
||||||
|
@@ -32,13 +32,6 @@
|
|||||||
{{ form_row(form.email) }}
|
{{ form_row(form.email) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card mt-3">
|
|
||||||
<div class="card-header">Redmine</div>
|
|
||||||
<div class="card-body">
|
|
||||||
{{ form_row(form.apikey) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{%if form.roles is defined%}
|
{%if form.roles is defined%}
|
||||||
|
Reference in New Issue
Block a user