1
|
|
|
<?php |
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
|
|
|
* SmallWorld |
14
|
|
|
* |
15
|
|
|
* @package \XoopsModules\SmallWorld |
16
|
|
|
* @license GNU GPL (https://www.gnu.org/licenses/gpl-2.0.html/) |
17
|
|
|
* @copyright The XOOPS Project (https://xoops.org) |
18
|
|
|
* @copyright 2011 Culex |
19
|
|
|
* @author Michael Albertsen (http://culex.dk) <[email protected]> |
20
|
|
|
* @link https://github.com/XoopsModules25x/smallworld |
21
|
|
|
* @since 1.0 |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
require_once __DIR__ . '/admin_header.php'; |
25
|
|
|
/** |
26
|
|
|
* Vars defined by inclusion of ./admin_header.php |
27
|
|
|
* |
28
|
|
|
* @var \XoopsModules\Smallworld\Admin $admin |
29
|
|
|
* @var \XoopsModules\Smallworld\SwUserHandler $swUserHandler |
30
|
|
|
* @var \XoopsModules\Smallworld\DoSync $d |
31
|
|
|
* @var \XoopsModules\Smallworld\User $check |
32
|
|
|
* @var \XoopsModules\Smallworld\SwDatabase $swDB |
33
|
|
|
* @var \XoopsModules\Smallworld\WallUpdates $wall |
34
|
|
|
* @var \Xmf\Module\Admin $adminObject |
35
|
|
|
* @var \XoopsModules\Smallworld\Helper $helper |
36
|
|
|
* @var string $moduleDirName |
37
|
|
|
* @var string $moduleDirNameUpper |
38
|
|
|
*/ |
39
|
|
|
require_once $helper->path('include/functions.php'); |
40
|
|
|
require_once XOOPS_ROOT_PATH . '/class/template.php'; |
41
|
|
|
|
42
|
|
|
$GLOBALS['xoopsTpl']->caching = false; |
43
|
|
|
|
44
|
|
|
xoops_cp_header(); |
45
|
|
|
|
46
|
|
|
$ai = []; |
47
|
|
|
$ani = []; |
48
|
|
|
|
49
|
|
|
/** @var Xmf\Module\Admin $adminObject */ |
50
|
|
|
$adminObject->displayNavigation(basename(__FILE__)); |
51
|
|
|
|
52
|
|
|
$allusers_inspect = $admin->getAllUsers('yes'); |
53
|
|
View Code Duplication |
foreach ($allusers_inspect as $data) { |
|
|
|
|
54
|
|
|
$ai['id'] = $data['id']; |
55
|
|
|
$ai['userid'] = $data['userid']; |
56
|
|
|
$ai['username'] = $data['username']; |
57
|
|
|
$ai['realname'] = $data['realname']; |
58
|
|
|
$ai['userimage'] = $swUserHandler->getAvatarLink($data['userid'], $data['userimage']); |
59
|
|
|
$ai['avatar_size'] = smallworld_getImageSize(80, 100, $ai['userimage']); |
60
|
|
|
$ai['avatar_highwide'] = smallworld_imageResize($ai['avatar_size'][0], $ai['avatar_size'][1], 50); |
61
|
|
|
$ai['ip'] = $data['ip']; |
62
|
|
|
$ai['complaint'] = $data['complaint']; |
63
|
|
|
$ai['inspect_start'] = $data['inspect_start']; |
64
|
|
|
$ai['inspect_stop'] = $data['inspect_stop']; |
65
|
|
|
$ai['userinspect_timetotal'] = ($data['inspect_start'] + $data['inspect_stop']) - time(); |
66
|
|
|
$GLOBALS['xoopsTpl']->append('allusersinspect', $ai); |
67
|
|
|
} |
68
|
|
|
$GLOBALS['xoopsTpl']->assign('allusersinspectcounter', count($ai)); |
69
|
|
|
|
70
|
|
|
|
71
|
|
|
$allusers_noinspect = $admin->getAllUsers('no'); |
72
|
|
View Code Duplication |
foreach ($allusers_noinspect as $data) { |
|
|
|
|
73
|
|
|
$ani['id'] = $data['id']; |
74
|
|
|
$ani['userid'] = $data['userid']; |
75
|
|
|
$ani['username'] = $data['username']; |
76
|
|
|
$ani['realname'] = $data['realname']; |
77
|
|
|
$ani['userimage'] = $swUserHandler->getAvatarLink($data['userid'], $data['userimage']); |
78
|
|
|
$ani['avatar_size'] = smallworld_getImageSize(80, 100, $ani['userimage']); |
79
|
|
|
$ani['avatar_highwide'] = smallworld_imageResize($ani['avatar_size'][0], $ani['avatar_size'][1], 50); |
80
|
|
|
$ani['ip'] = $data['ip']; |
81
|
|
|
$ani['complaint'] = $data['complaint']; |
82
|
|
|
$ani['inspect_start'] = ''; |
83
|
|
|
$ani['inspect_stop'] = ''; |
84
|
|
|
$ani['userinspect_timetotal'] = ''; |
85
|
|
|
$GLOBALS['xoopsTpl']->append('allusersnoinspect', $ani); |
86
|
|
|
} |
87
|
|
|
$GLOBALS['xoopsTpl']->assign('allusersnoinspectcounter', count($ani)); |
88
|
|
|
// ---------------- end of tabs ---------------- // |
89
|
|
|
|
90
|
|
|
// template assignments |
91
|
|
|
// tab titles |
92
|
|
|
$GLOBALS['xoopsTpl']->assign('lang_useradmin', _AM_SMALLWORLD_USERADMIN_TITLE); |
93
|
|
|
|
94
|
|
|
// help file from admin |
95
|
|
|
$GLOBALS['xoopsTpl']->display($helper->path('templates/admin_useradmin.tpl')); |
96
|
|
|
|
97
|
|
|
//Check Language |
98
|
|
|
$lang = $GLOBALS['xoopsConfig']['language']; |
99
|
|
|
// GET various variables from language folder |
100
|
|
View Code Duplication |
if (file_exists($helper->path('language/' . $lang . '/js/variables.js'))) { |
|
|
|
|
101
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('language/' . $lang . '/js/variables.js')); |
102
|
|
|
} else { |
103
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('language/english/js/variables.js')); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
$adminscript = <<<SCRIPT |
107
|
|
|
var smallworld_url="XOOPS_URL/modules/smallworld/"; |
108
|
|
|
//var $ = jQuery(); |
109
|
|
|
SCRIPT; |
110
|
|
|
$GLOBALS['xoTheme']->addStylesheet($helper->url('assets/css/SmallworldAdmin.css')); |
111
|
|
|
$GLOBALS['xoTheme']->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js'); |
112
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery-ui-1.8.11.custom.js')); |
113
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('assets/js/smallworld_tabs.js')); |
114
|
|
|
$GLOBALS['xoTheme']->addScript('', '', $adminscript); |
115
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.form.js')); |
116
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('assets/js/jquery.countdown.js')); |
117
|
|
View Code Duplication |
if (file_exists($helper->path('language/assets/' . $lang . '/js/jquery.ui.datepicker-language.js'))) { |
|
|
|
|
118
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('language/' . $lang . '/js/jquery.ui.datepicker-language.js')); |
119
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('language/' . $lang . '/js/jquery.countdown.js')); |
120
|
|
|
} else { |
121
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('language/english/js/jquery.ui.datepicker-language.js')); |
122
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('language/english/js/jquery.countdown.js')); |
123
|
|
|
} |
124
|
|
|
$GLOBALS['xoTheme']->addScript($helper->url('assets/js/adminsmallworld.js')); |
125
|
|
|
|
126
|
|
|
require_once __DIR__ . '/admin_footer.php'; |
127
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.