Skip to content

Commit

Permalink
bugfix with user editing
Browse files Browse the repository at this point in the history
  • Loading branch information
antedebaas committed Aug 18, 2024
1 parent 4efab72 commit fbdfef2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public function add(Request $request, UserPasswordHasherInterface $userPasswordH

$domain_roles = $form->get("roles")->getData();
$roles = array();
foreach($domain_roles as $domain_role) {
array_push($roles, $domain_role->getId());
foreach($domain_roles as $domain) {
$formdata->addDomain($domain);
}
if($is_admin == true) {
array_push($roles, "ROLE_ADMIN");
Expand Down Expand Up @@ -166,8 +166,8 @@ public function edit(Users $user, Request $request, UserPasswordHasherInterface

$domain_roles = $form->get("roles")->getData();
$roles = array();
foreach($domain_roles as $domain_role) {
array_push($roles, $domain_role->getId());
foreach($domain_roles as $domain) {
$formdata->addDomain($domain);
}
if($is_admin == true) {
array_push($roles, "ROLE_ADMIN");
Expand Down
9 changes: 6 additions & 3 deletions templates/users/edit.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{% extends 'base.html.twig' %}

{% block title %}
{% if user != null %}Edit user {{ user.email }}{% else %}Add user{% endif %}
{% endblock %}

{% if user != null %}
{% set title = "Edit user " ~ user.email %}
{% else %}
{% set title = "Add user" %}
{% endif %}

{% block stylesheets %}{% endblock %}

Expand Down

0 comments on commit fbdfef2

Please sign in to comment.