The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Finished ajaxUserData template

Signed-off-by: Gergely Polonkai <polesz@w00d5t0ck.info>
master
Polonkai Gergely 10 years ago
parent f8ae647716
commit 30576a94c2
  1. 2
      src/KekRozsak/FrontBundle/Entity/Group.php
  2. 41
      src/KekRozsak/SecurityBundle/Entity/User.php
  3. 42
      src/KekRozsak/SecurityBundle/Resources/views/Default/ajaxUserdata.html.twig

@ -48,7 +48,7 @@ class Group
/**
* @var KekRozsak\SecurityBundle\Entity\User $leader
* @ORM\ManyToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User")
* @ORM\ManyToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User", inversedBy="ledGroups")
*/
protected $leader;

@ -27,6 +27,7 @@ class User implements UserInterface, AdvancedUserInterface
{
$this->groups = new ArrayCollection();
$this->roles = new ArrayCollection();
$this->ledGroups = new ArrayCollection();
}
/**
@ -348,6 +349,46 @@ class User implements UserInterface, AdvancedUserInterface
return $this->groups;
}
/**
* Get all groups, including led groups (which are sometimes not included
* in $groups)
*
* @return Doctrine\Common\Collections\ArrayCollection
*/
public function getAllGroups()
{
$groups = $this->ledGroups;
$this->getGroups()->forAll(function($i, $membership) use ($groups) {
$group = $membership->getGroup();
if ($groups->contains($group)) {
return true;
}
$groups->add($group);
return true;
});
return $groups;
}
/**
* Groups led by this User
*
* @var Doctrine\Common\Collections\ArrayCollection $ledGroups
*
* @ORM\OneToMany(targetEntity="KekRozsak\FrontBundle\Entity\Group", mappedBy="leader", fetch="LAZY")
*/
protected $ledGroups;
/**
* Get ledGroups
*
* @return Doctrine\Common\Collections\ArrayCollection
*/
public function getLedGroups()
{
return $this->ledGroups;
}
/**
* The Roles belonging to this User
*

@ -5,6 +5,46 @@
<title>{{ user.displayName }}</title>
</head>
<body>
Tagság kezdete: {{ user.registeredAt|date('Y-m-d') }}
<strong>Tagság kezdete</strong>: {{ user.registeredAt|date('Y-m-d') }}<br />
{% if is_granted('ROLE_ADMIN') %}
<strong>Felhasználónév</strong>: {{ user.username }}<br />
{% endif %}
{% if is_granted('ROLE_ADMIN') or (user.userData and user.userData.emailPublic) %}
<strong>E-mail</strong>: {{ user.email }}<br />
{% endif %}
{% if user.userData and (is_granted('ROLE_ADMIN') or (user.userData.realNamePublic and (user.userData.realName == ''))) %}
<strong>Valódi név</strong>: {{ user.userData.realName }}<br />
{% endif %}
{% if user.userData and user.userData.msnAddress != '' and (is_granted('ROLE_ADMIN') or user.userData.msnAddressPublic) %}
<strong>MSN cím</strong>: {{ user.userData.msnAddress }}<br />
{% endif %}
{% if user.userData and user.userData.googleTalk != '' and (is_granted('ROLE_ADMIN') or user.userData.googleTalkPublic) %}
<strong>Google Talk cím</strong>: {{ user.userData.googleTalk }}
{% endif %}
{% if user.userData and user.userData.skype != '' and (is_granted('ROLE_ADMIN') or user.userData.skypePublic) %}
<strong>Skype név</strong>: {{ user.userData.skypePublic }}
{% endif %}
{% if user.userData and user.userData.phoneNumber != '' and (is_granted('ROLE_ADMIN') or user.userData.phoneNumberPublic) %}
<strong>Telefonszám</strong>: {{ user.userData.phoneNumber }}<br />
{% endif %}
{% if user.userData and user.userData.selfDescription != '' %}
<strong>Leírás</strong>: {{ user.userData.selfDescription }}<br />
{% endif %}
<strong>Csoportok</strong>:<br />
{% set groupCount = 0 %}
{% for group in user.allGroups %}
{#% if is_granted('ROLE_ADMIN') or group.isMember(app.user) or group.open %#}
{% set groupCount = groupCount + 1 %}
{{ group.name }}<br />
{#% endif %#}
{% endfor %}
{% if groupCount == 0 %}
Egy csoportnak sem tagja.<br />
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
<strong>Jóváhagyta</strong>: {{ user.acceptedBy.displayName }}<br />
<strong>Utolsó bejelentkezés</strong>: {{ user.lastLoginAt|date('Y-m-d H:i') }}<br />
<strong>Jogok</strong>:
{% endif %}
</body>
</html>

Loading…
Cancel
Save