From: Brion Vibber Date: Tue, 29 Jan 2008 00:29:38 +0000 (+0000) Subject: Apply live hack from Wikimedia codebase: add a hook UserCanSendEmail to override... X-Git-Tag: 1.31.0-rc.0~49736 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=a3e1c7fa4fc395e66bb7df9e287504acc7065c1f;p=lhc%2Fweb%2Fwiklou.git Apply live hack from Wikimedia codebase: add a hook UserCanSendEmail to override User::canSendEmail(); make canReceiveEmail() indenpedent of sending permission check. --- diff --git a/includes/User.php b/includes/User.php index ba77fddaf7..08c7a51ac4 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2459,7 +2459,9 @@ class User { * @return bool */ function canSendEmail() { - return $this->isEmailConfirmed(); + $canSend = $this->isEmailConfirmed(); + wfRunHooks( 'UserCanSendEmail', array( &$this, &$canSend ) ); + return $canSend; } /** @@ -2468,7 +2470,7 @@ class User { * @return bool */ function canReceiveEmail() { - return $this->canSendEmail() && !$this->getOption( 'disablemail' ); + return $this->isEmailConfirmed() && !$this->getOption( 'disablemail' ); } /**