1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace XoopsModules\Newbb; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* User Language Class (moved from 'main' language file) |
7
|
|
|
* @subpackage:: class |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
use XoopsModules\Newbb; |
11
|
|
|
|
12
|
|
|
//require_once $GLOBALS['xoops']->path('modules/newbb/class/user.php'); |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Allows setting for user information |
16
|
|
|
* If you have a customized userbar, define it here. |
17
|
|
|
*/ |
18
|
|
|
class UserLanguage extends Newbb\User |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* UserLanguage constructor. |
22
|
|
|
* @param $user |
23
|
|
|
*/ |
24
|
|
|
public function __construct($user) |
25
|
|
|
{ |
26
|
|
|
parent::__construct($user); |
|
|
|
|
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @return array|null |
31
|
|
|
*/ |
32
|
|
|
public function getUserbar() |
33
|
|
|
{ |
34
|
|
|
global $xoopsModuleConfig, $xoopsUser, $isadmin; |
35
|
|
|
if (empty($GLOBALS['xoopsModuleConfig']['userbar_enabled'])) { |
36
|
|
|
return null; |
|
|
|
|
37
|
|
|
} |
38
|
|
|
$user = $this->user; |
39
|
|
|
$userbar = []; |
40
|
|
|
$userbar[] = [ |
41
|
|
|
'link' => $GLOBALS['xoops']->url('userinfo.php?uid=' . $user->getVar('uid')), |
42
|
|
|
'name' => PROFILE, |
|
|
|
|
43
|
|
|
]; |
44
|
|
|
if (\is_object($xoopsUser)) { |
45
|
|
|
$userbar[] = [ |
46
|
|
|
'link' => "javascript:void openWithSelfMain('" . XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $user->getVar('uid') . "','pmlite', 450, 380);", |
47
|
|
|
'name' => _MD_PM, |
48
|
|
|
]; |
49
|
|
|
} |
50
|
|
|
if ($isadmin || $user->getVar('user_viewemail')) { |
51
|
|
|
$userbar[] = [ |
52
|
|
|
'link' => "javascript:void window.open('mailto:" . $user->getVar('email') . "','new');", |
53
|
|
|
'name' => _MD_EMAIL, |
54
|
|
|
]; |
55
|
|
|
} |
56
|
|
|
if ($user->getVar('url')) { |
57
|
|
|
$userbar[] = [ |
58
|
|
|
'link' => "javascript:void window.open('" . $user->getVar('url') . "','new');", |
59
|
|
|
'name' => _MD_WWW, |
60
|
|
|
]; |
61
|
|
|
} |
62
|
|
|
if ($user->getVar('user_icq')) { |
63
|
|
|
$userbar[] = [ |
64
|
|
|
'link' => "javascript:void window.open('https://wwp.icq.com/scripts/search.dll?to=" . $user->getVar('user_icq') . "','new');", |
65
|
|
|
'name' => _MD_ICQ, |
66
|
|
|
]; |
67
|
|
|
} |
68
|
|
|
if ($user->getVar('user_aim')) { |
69
|
|
|
$userbar[] = [ |
70
|
|
|
'link' => "javascript:void window.open('aim:goim?screenname=" . $user->getVar('user_aim') . '&message=Hi+' . $user->getVar('user_aim') . '+Are+you+there?' . "','new');", |
71
|
|
|
'name' => _MD_AIM, |
72
|
|
|
]; |
73
|
|
|
} |
74
|
|
|
if ($user->getVar('user_yim')) { |
75
|
|
|
$userbar[] = [ |
76
|
|
|
'link' => "javascript:void window.open('https://edit.yahoo.com/config/send_webmesg?.target=" . $user->getVar('user_yim') . '&.src=pg' . "','new');", |
77
|
|
|
'name' => _MD_YIM, |
78
|
|
|
]; |
79
|
|
|
} |
80
|
|
|
if ($user->getVar('user_msnm')) { |
81
|
|
|
$userbar[] = [ |
82
|
|
|
'link' => "javascript:void window.open('https://members.msn.com?mem=" . $user->getVar('user_msnm') . "','new');", |
83
|
|
|
'name' => _MD_MSNM, |
84
|
|
|
]; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
return $userbar; |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.