dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed strval calls from magicLinkCallback(); items already comes in as one
[lhc/web/wiklou.git]
/
includes
/
User.php
diff --git
a/includes/User.php
b/includes/User.php
index
f87323f
..
4289b2a
100644
(file)
--- a/
includes/User.php
+++ b/
includes/User.php
@@
-141,9
+141,11
@@
class User {
'createtalk',
'delete',
'deletedhistory',
'createtalk',
'delete',
'deletedhistory',
+ 'deleterevision',
'edit',
'editinterface',
'editusercssjs',
'edit',
'editinterface',
'editusercssjs',
+ 'hideuser',
'import',
'importupload',
'ipblock-exempt',
'import',
'importupload',
'ipblock-exempt',
@@
-160,17
+162,22
@@
class User {
'proxyunbannable',
'purge',
'read',
'proxyunbannable',
'purge',
'read',
+ 'reset-passwords',
'reupload',
'reupload-shared',
'rollback',
'siteadmin',
'reupload',
'reupload-shared',
'rollback',
'siteadmin',
+ 'suppressionlog',
'suppressredirect',
'suppressredirect',
+ 'suppressrevision',
'trackback',
'undelete',
'unwatchedpages',
'upload',
'upload_by_url',
'userrights',
'trackback',
'undelete',
'unwatchedpages',
'upload',
'upload_by_url',
'userrights',
+ 'userrights-interwiki',
+ 'writeapi',
);
/**
* \string Cached results of getAllRights()
);
/**
* \string Cached results of getAllRights()
@@
-911,7
+918,7
@@
class User {
$this->mDataLoaded = true;
if ( isset( $row->user_id ) ) {
$this->mDataLoaded = true;
if ( isset( $row->user_id ) ) {
- $this->mId =
$row->user_id
;
+ $this->mId =
intval( $row->user_id )
;
}
$this->mName = $row->user_name;
$this->mRealName = $row->user_real_name;
}
$this->mName = $row->user_name;
$this->mRealName = $row->user_real_name;
@@
-1156,10
+1163,17
@@
class User {
*/
public function isPingLimitable() {
global $wgRateLimitsExcludedGroups;
*/
public function isPingLimitable() {
global $wgRateLimitsExcludedGroups;
+ global $wgRateLimitsExcludedIPs;
if( array_intersect( $this->getEffectiveGroups(), $wgRateLimitsExcludedGroups ) ) {
// Deprecated, but kept for backwards-compatibility config
return false;
}
if( array_intersect( $this->getEffectiveGroups(), $wgRateLimitsExcludedGroups ) ) {
// Deprecated, but kept for backwards-compatibility config
return false;
}
+ if( in_array( wfGetIP(), $wgRateLimitsExcludedIPs ) ) {
+ // No other good way currently to disable rate limits
+ // for specific IPs. :P
+ // But this is a crappy hack and should die.
+ return false;
+ }
return !$this->isAllowed('noratelimit');
}
return !$this->isAllowed('noratelimit');
}
@@
-1315,6
+1329,15
@@
class User {
return $this->mBlockreason;
}
return $this->mBlockreason;
}
+ /**
+ * If user is blocked, return the ID for the block
+ * @return \int Block ID
+ */
+ function getBlockId() {
+ $this->getBlockedStatus();
+ return ($this->mBlock ? $this->mBlock->mId : false);
+ }
+
/**
* Check if user is blocked on all wikis.
* Do not use for actual edit permission checks!
/**
* Check if user is blocked on all wikis.
* Do not use for actual edit permission checks!
@@
-1997,7
+2020,7
@@
class User {
* @return \int User'e edit count
*/
function getEditCount() {
* @return \int User'e edit count
*/
function getEditCount() {
- if ($this->
mId
) {
+ if ($this->
getId()
) {
if ( !isset( $this->mEditCount ) ) {
/* Populate the count, if it has not been populated yet */
$this->mEditCount = User::edits($this->mId);
if ( !isset( $this->mEditCount ) ) {
/* Populate the count, if it has not been populated yet */
$this->mEditCount = User::edits($this->mId);
@@
-2094,7
+2117,7
@@
class User {
if( $action === 'patrol' || $action === 'autopatrol' ) {
global $wgUseRCPatrol, $wgUseNPPatrol;
if( !$wgUseRCPatrol && !$wgUseNPPatrol )
if( $action === 'patrol' || $action === 'autopatrol' ) {
global $wgUseRCPatrol, $wgUseNPPatrol;
if( !$wgUseRCPatrol && !$wgUseNPPatrol )
- return
tru
e;
+ return
fals
e;
}
# Use strict parameter to avoid matching numeric 0 accidentally inserted
# by misconfiguration: 0 == 'foo'
}
# Use strict parameter to avoid matching numeric 0 accidentally inserted
# by misconfiguration: 0 == 'foo'