PluginProbe
User Access Manager / trunk
User Access Manager vtrunk
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / src / Controller / Backend / ObjectMembership / UserObjectController.php

UserObjectController.php in User Access Manager trunk, at src/Controller/Backend/ObjectMembership/UserObjectController.php

55 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace UserAccessManager\Controller\Backend\ObjectMembership;
6
7 use UserAccessManager\Object\ObjectHandler;
8 use UserAccessManager\UserGroup\UserGroupTypeException;
9
10 class UserObjectController extends ObjectController
11 {
12 public function addUserColumnsHeader(array $defaults): array
13 {
14 $defaults[self::COLUMN_NAME] = TXT_UAM_COLUMN_USER_GROUPS;
15 return $defaults;
16 }
17
18 /**
19 * @throws UserGroupTypeException
20 */
21 public function addUserColumn(?string $content, string $columnName, int|string|null $id): ?string
22 {
23 if ($columnName === self::COLUMN_NAME) {
24 $this->setObjectInformation(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $id);
25 $content .= $this->getIncludeContents('UserColumn.php');
26 }
27
28 return $content;
29 }
30
31 /**
32 * @throws UserGroupTypeException
33 */
34 public function showUserProfile(): void
35 {
36 $userId = $this->getRequestParameter('user_id');
37 $this->setObjectInformation(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
38
39 echo $this->getIncludeContents('UserProfileEditForm.php');
40 }
41
42 /**
43 * @throws UserGroupTypeException
44 */
45 public function saveUserData(int|string|null $userId): void
46 {
47 $this->saveObjectData(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
48 }
49
50 public function removeUserData(int|string|null $userId): void
51 {
52 $this->removeObjectData(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
53 }
54 }
55