1
|
|
|
<?php |
2
|
|
|
/****************************************************************************** |
3
|
|
|
* Wikipedia Account Creation Assistance tool * |
4
|
|
|
* * |
5
|
|
|
* All code in this file is released into the public domain by the ACC * |
6
|
|
|
* Development Team. Please see team.json for a list of contributors. * |
7
|
|
|
******************************************************************************/ |
8
|
|
|
|
9
|
|
|
namespace Waca\DataObjects; |
10
|
|
|
|
11
|
|
|
use DateTime; |
12
|
|
|
use Waca\IdentificationVerifier; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* User data object |
16
|
|
|
*/ |
17
|
|
|
class CommunityUser extends User |
18
|
|
|
{ |
19
|
|
|
public function getId() |
20
|
|
|
{ |
21
|
|
|
return -1; |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function save() |
25
|
|
|
{ |
26
|
|
|
// Do nothing |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
#region properties |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @return string |
33
|
|
|
*/ |
34
|
|
|
public function getUsername() |
35
|
|
|
{ |
36
|
|
|
global $communityUsername; |
37
|
|
|
|
38
|
|
|
return $communityUsername; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function setUsername($username) |
42
|
|
|
{ |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @return string |
47
|
|
|
*/ |
48
|
|
|
public function getEmail() |
49
|
|
|
{ |
50
|
|
|
global $cDataClearEmail; |
51
|
|
|
|
52
|
|
|
return $cDataClearEmail; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function setEmail($email) |
56
|
|
|
{ |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getStatus() |
60
|
|
|
{ |
61
|
|
|
return "Community"; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getOnWikiName() |
65
|
|
|
{ |
66
|
|
|
return "127.0.0.1"; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function setOnWikiName($onWikiName) |
70
|
|
|
{ |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function getWelcomeSig() |
74
|
|
|
{ |
75
|
|
|
return null; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function setWelcomeSig($welcomeSig) |
79
|
|
|
{ |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function getLastActive() |
83
|
|
|
{ |
84
|
|
|
$now = new DateTime(); |
85
|
|
|
|
86
|
|
|
return $now->format("Y-m-d H:i:s"); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function getForceLogout() |
90
|
|
|
{ |
91
|
|
|
return true; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function setForceLogout($forceLogout) |
95
|
|
|
{ |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @param string $status |
100
|
|
|
*/ |
101
|
|
|
public function setStatus($status) |
102
|
|
|
{ |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
public function getWelcomeTemplate() |
106
|
|
|
{ |
107
|
|
|
return 0; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
public function setWelcomeTemplate($welcomeTemplate) |
111
|
|
|
{ |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
public function getAbortPref() |
115
|
|
|
{ |
116
|
|
|
return 0; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
public function setAbortPref($abortPreference) |
120
|
|
|
{ |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
public function getConfirmationDiff() |
124
|
|
|
{ |
125
|
|
|
return null; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
public function setConfirmationDiff($confirmationDiff) |
129
|
|
|
{ |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
public function getEmailSig() |
133
|
|
|
{ |
134
|
|
|
return null; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
public function setEmailSig($emailSignature) |
138
|
|
|
{ |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
public function setUseAlternateSkin($useAlternate) |
|
|
|
|
142
|
|
|
{ |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
#endregion |
146
|
|
|
|
147
|
|
|
#region user access checks |
148
|
|
|
|
149
|
|
|
public function isIdentified(IdentificationVerifier $iv) |
150
|
|
|
{ |
151
|
|
|
return false; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
public function isSuspended() |
155
|
|
|
{ |
156
|
|
|
return false; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
public function isNewUser() |
160
|
|
|
{ |
161
|
|
|
return false; |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
public function isDeclined() |
165
|
|
|
{ |
166
|
|
|
return false; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
public function isCommunityUser() |
170
|
|
|
{ |
171
|
|
|
return true; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
#endregion |
175
|
|
|
|
176
|
|
|
public function getApprovalDate() |
177
|
|
|
{ |
178
|
|
|
$data = DateTime::createFromFormat("Y-m-d H:i:s", "1970-01-01 00:00:00"); |
179
|
|
|
|
180
|
|
|
return $data; |
181
|
|
|
} |
182
|
|
|
} |
183
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.