Merge "Add hook to allow lazy loading of import sources"
[lhc/web/wiklou.git] / includes / User.php
index dbcbe31..22c90cd 100644 (file)
@@ -1430,8 +1430,8 @@ class User implements IDBAccessObject {
                foreach ( $toPromote as $group ) {
                        $this->addGroup( $group );
                }
-
                // update groups in external authentication database
+               Hooks::run( 'UserGroupsChanged', array( $this, $toPromote, array(), false ) );
                $wgAuth->updateExternalDBGroups( $this, $toPromote );
 
                $newGroups = array_merge( $oldGroups, $toPromote ); // all groups
@@ -1591,7 +1591,7 @@ class User implements IDBAccessObject {
                # We only need to worry about passing the IP address to the Block generator if the
                # user is not immune to autoblocks/hardblocks, and they are the current user so we
                # know which IP address they're actually coming from
-               if ( !$this->isAllowed( 'ipblock-exempt' ) && $this->getID() == $wgUser->getID() ) {
+               if ( !$this->isAllowed( 'ipblock-exempt' ) && $this->equals( $wgUser ) ) {
                        $ip = $this->getRequest()->getIP();
                } else {
                        $ip = null;
@@ -1993,6 +1993,7 @@ class User implements IDBAccessObject {
                global $wgAuth;
                $authUser = $wgAuth->getUserInstance( $this );
                $this->mLocked = (bool)$authUser->isLocked();
+               Hooks::run( 'UserIsLocked', array( $this, &$this->mLocked ) );
                return $this->mLocked;
        }
 
@@ -2010,6 +2011,7 @@ class User implements IDBAccessObject {
                        global $wgAuth;
                        $authUser = $wgAuth->getUserInstance( $this );
                        $this->mHideName = (bool)$authUser->isHidden();
+                       Hooks::run( 'UserIsHidden', array( $this, &$this->mHideName ) );
                }
                return $this->mHideName;
        }