1 | <?php declare(strict_types=1); |
||
2 | /* |
||
3 | You may not change or alter any portion of this comment or credits |
||
4 | of supporting developers from this source code or any supporting source code |
||
5 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
6 | |||
7 | This program is distributed in the hope that it will be useful, |
||
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
10 | */ |
||
11 | |||
12 | /** |
||
13 | * @category Module |
||
14 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||
15 | * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||
16 | * @author Marcello Brandão aka Suico, Mamba, LioMJ <https://xoops.org> |
||
17 | */ |
||
18 | |||
19 | use Xmf\Request; |
||
20 | use XoopsModules\Suico\{ |
||
21 | SuspensionsHandler |
||
22 | }; |
||
23 | |||
24 | |||
25 | require __DIR__ . '/header.php'; |
||
26 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||
27 | redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 3, _MD_SUICO_TOKENEXPIRED); |
||
28 | } |
||
29 | $uid = Request::getInt('uid', 0, 'POST'); |
||
30 | /** |
||
31 | * Creating the factory loading the picture changing its caption |
||
32 | */ |
||
33 | $suspensionsFactory = new SuspensionsHandler( |
||
34 | $xoopsDB |
||
35 | ); |
||
36 | $suspension = $suspensionsFactory->create(false); |
||
37 | $suspension->load($uid); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
38 | if ($xoopsUser->isAdmin(1)) { |
||
39 | /** @var \XoopsMemberHandler $memberHandler */ |
||
40 | $memberHandler = xoops_getHandler('member'); |
||
41 | $thisUser = $memberHandler->getUser($uid); |
||
42 | $thisUser->setVar('email', $suspension->getVar('old_email', 'n')); |
||
43 | $thisUser->setVar('pass', $suspension->getVar('old_pass', 'n')); |
||
44 | $thisUser->setVar('user_sig', $suspension->getVar('old_signature', 'n')); |
||
45 | $memberHandler->insertUser($thisUser); |
||
46 | $criteria = new Criteria('uid', $uid); |
||
47 | $suspensionsFactory->deleteAll($criteria); |
||
48 | redirect_header('index.php?uid=' . $uid, 3, _MD_SUICO_USER_UNSUSPENDED); |
||
49 | } |
||
50 | require \dirname(__DIR__, 2) . '/footer.php'; |
||
51 |