|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Suico; |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
You may not change or alter any portion of this comment or credits |
|
7
|
|
|
of supporting developers from this source code or any supporting source code |
|
8
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
9
|
|
|
|
|
10
|
|
|
This program is distributed in the hope that it will be useful, |
|
11
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @category Module |
|
17
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
|
18
|
|
|
* @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
|
19
|
|
|
* @author Marcello Brandão aka Suico, Mamba, LioMJ <https://xoops.org> |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
use Criteria; |
|
23
|
|
|
|
|
24
|
|
|
require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
25
|
|
|
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
26
|
|
|
require_once XOOPS_ROOT_PATH . '/class/criteria.php'; |
|
27
|
|
|
require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Class PhotosController |
|
31
|
|
|
*/ |
|
32
|
|
|
class PhotosController extends Controller |
|
33
|
|
|
{ |
|
34
|
|
|
/** |
|
35
|
|
|
* @return bool|void |
|
36
|
|
|
*/ |
|
37
|
|
|
public function checkPrivilege() |
|
38
|
|
|
{ |
|
39
|
|
|
if (0 === $this->helper->getConfig('enable_pictures')) { |
|
40
|
|
|
\redirect_header('index.php?uid=' . $this->owner->getVar('uid'), 3, \_MD_SUICO_PICTURES_ENABLED_NOT); |
|
41
|
|
|
} |
|
42
|
|
|
$criteria = new Criteria('config_uid', $this->owner->getVar('uid')); |
|
|
|
|
|
|
43
|
|
|
if (1 == $this->configsFactory->getCount($criteria)) { |
|
44
|
|
|
$configs = $this->configsFactory->getObjects($criteria); |
|
45
|
|
|
$config = $configs[0]->getVar('pictures'); |
|
|
|
|
|
|
46
|
|
|
/* |
|
47
|
|
|
if (!$this->checkPrivilegeLevel($config)) { |
|
48
|
|
|
// \redirect_header('index.php?uid=' . $this->owner->getVar('uid'), 10, \_MD_SUICO_NOPRIVILEGE); |
|
49
|
|
|
\redirect_header('index.php', 10, sprintf(_MD_SUICO_NOPRIVILEGE,'Photos')); |
|
50
|
|
|
} |
|
51
|
|
|
*/ |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
return true; |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|