Robert Vogel has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/390254 )
Change subject: BSUserManager: Fixed ps4 autoload path and added first hook
base class
......................................................................
BSUserManager: Fixed ps4 autoload path and added first hook base class
Change-Id: Iac9685e2407ef1d687f86ed09a2cc863151c5f2b
---
M composer.json
A src/Hook/BSUserManagerAfterAddUser.php
2 files changed, 109 insertions(+), 2 deletions(-)
Approvals:
Robert Vogel: Verified; Looks good to me, approved
diff --git a/composer.json b/composer.json
index 1da1ef4..fe8e70a 100644
--- a/composer.json
+++ b/composer.json
@@ -8,8 +8,8 @@
},
"autoload" : {
"psr-4": {
- "BS\\UserManager\\": "src",
- "BS\\UserManager\\Tests\\": "tests/phpunit"
+ "BlueSpice\\UserManager\\": "src",
+ "BlueSpice\\UserManager\\Tests\\": "tests/phpunit"
}
},
"require-dev": {
diff --git a/src/Hook/BSUserManagerAfterAddUser.php
b/src/Hook/BSUserManagerAfterAddUser.php
new file mode 100644
index 0000000..87a4ce4
--- /dev/null
+++ b/src/Hook/BSUserManagerAfterAddUser.php
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Hook handler base class for BlueSpice hook BSUserManagerAfterAddUser in
+ * UserManager
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This file is part of BlueSpice MediaWiki
+ * For further information visit http://bluespice.com
+ *
+ * @author Patric Wirth <[email protected]>
+ * @package BlueSpiceFoundation
+ * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved.
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or
later
+ * @filesource
+ */
+namespace BlueSpice\UserManager\Hook;
+use BlueSpice\Hook;
+
+/**
+ * Located in \UserManager::addUser after a user was initially added
+ */
+abstract class BSUserManagerAfterAddUser extends Hook {
+
+ /**
+ *
+ * @var \UserManager
+ */
+ protected $userManager = null;
+
+ /**
+ *
+ * @var \User
+ */
+ protected $user = null;
+
+ /**
+ *
+ * @var array
+ */
+ protected $metaData = null;
+
+ /**
+ *
+ * @var \Status
+ */
+ protected $status = null;
+
+ /**
+ *
+ * @var \User
+ */
+ protected $performer = null;
+
+ /**
+ * @param \UserManager $userManager
+ * @param \User $user
+ * @param array $metaData
+ * @param \Status $status
+ * @param \User $performer
+ * @return boolean
+ */
+ public static function callback( $userManager, $user, $metaData,
&$status, $performer ) {
+ $className = static::class;
+ $hookHandler = new $className(
+ null,
+ null,
+ $userManager,
+ $user,
+ $metaData,
+ $status,
+ $performer
+ );
+ return $hookHandler->process();
+ }
+
+ /**
+ * @param \IContextSource $context
+ * @param \Config $config
+ * @param \UserManager $userManager
+ * @param \User $user
+ * @param array $metaData
+ * @param \Status $status
+ * @param \User $performer
+ */
+ public function __construct( $context, $config, $userManager, $user,
$metaData, &$status, $performer ) {
+ parent::__construct( $context, $config );
+
+ $this->userManager = $userManager;
+ $this->user = $user;
+ $this->metaData = $metaData;
+ $this->status = &$status;
+ $this->performer = $performer;
+ }
+}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/390254
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iac9685e2407ef1d687f86ed09a2cc863151c5f2b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceUserManager
Gerrit-Branch: master
Gerrit-Owner: Pwirth <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits