PluginProbe
User Access Manager / 2.2.13
User Access Manager v2.2.13
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
← All changes | src/Controller/Backend/UserObjectController.php +40 -4 2.3.162.2.13 View file →
@@ -1,5 +1,18 @@
1 1 <?php
2 +/**
3 + * UserObjectController.php
4 + *
5 + * The UserObjectController class file.
6 + *
7 + * PHP versions 5
8 + *
9 + * @author Alexander Schneider <alexanderschneider85@gmail.com>
10 + * @copyright 2008-2017 Alexander Schneider
11 + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
12 + * @version SVN: $id$
13 + * @link http://wordpress.org/extend/plugins/user-access-manager/
14 + */
2 15
3 16 declare(strict_types=1);
4 17
5 18 namespace UserAccessManager\Controller\Backend;
@@ -6,10 +19,20 @@
6 19
7 20 use UserAccessManager\Object\ObjectHandler;
8 21 use UserAccessManager\UserGroup\UserGroupTypeException;
9 22
23 +/**
24 + * Class UserObjectController
25 + *
26 + * @package UserAccessManager\Controller\Backend
27 + */
10 28 class UserObjectController extends ObjectController
11 29 {
30 + /**
31 + * The function for the manage_users_columns filter.
32 + * @param array $defaults The table headers.
33 + * @return array
34 + */
12 35 public function addUserColumnsHeader(array $defaults): array
13 36 {
14 37 $defaults[self::COLUMN_NAME] = TXT_UAM_COLUMN_USER_GROUPS;
15 38 return $defaults;
@@ -15,11 +38,16 @@
15 38 return $defaults;
16 39 }
17 40
18 41 /**
42 + * The function for the manage_users_custom_column action.
43 + * @param null|string $return The normal return value.
44 + * @param string $columnName The column name.
45 + * @param int|string $id The id.
46 + * @return string|null
19 47 * @throws UserGroupTypeException
20 48 */
21 - public function addUserColumn(?string $return, string $columnName, int|string|null $id): ?string
49 + public function addUserColumn(?string $return, string $columnName, $id): ?string
22 50 {
23 51 if ($columnName === self::COLUMN_NAME) {
24 52 $this->setObjectInformation(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $id);
25 53 $return .= $this->getIncludeContents('UserColumn.php');
@@ -28,11 +56,12 @@
28 56 return $return;
29 57 }
30 58
31 59 /**
60 + * The function for the edit_user_profile action.
32 61 * @throws UserGroupTypeException
33 62 */
34 - public function showUserProfile(): void
63 + public function showUserProfile()
35 64 {
36 65 $userId = $this->getRequestParameter('user_id');
37 66 $this->setObjectInformation(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
38 67
@@ -39,16 +68,23 @@
39 68 echo $this->getIncludeContents('UserProfileEditForm.php');
40 69 }
41 70
42 71 /**
72 + * The function for the profile_update action.
73 + * @param int|string $userId The user id.
43 74 * @throws UserGroupTypeException
75 + * @throws UserGroupTypeException
44 76 */
45 - public function saveUserData(int|string|null $userId): void
77 + public function saveUserData($userId)
46 78 {
47 79 $this->saveObjectData(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
48 80 }
49 81
50 - public function removeUserData(int|string|null $userId): void
82 + /**
83 + * The function for the delete_user action.
84 + * @param int|string $userId The user id.
85 + */
86 + public function removeUserData($userId)
51 87 {
52 88 $this->removeObjectData(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
53 89 }
54 90 }