Skip to content

Commit

Permalink
[jan] Don't call authusername() hook on administrator names when runn…
Browse files Browse the repository at this point in the history
…ing CLI scripts.
  • Loading branch information
yunosh committed Mar 4, 2016
1 parent 68aa3a6 commit dd172cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions framework/Core/lib/Horde/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,11 @@ public static function appInit($app, array $args = array())
if (empty($GLOBALS['conf']['auth']['admins'])) {
throw new Horde_Exception(Horde_Core_Translation::t("Admin authentication requested, but no admin users defined in configuration."));
}
$registry->setAuth(reset($GLOBALS['conf']['auth']['admins']), array());
$registry->setAuth(
reset($GLOBALS['conf']['auth']['admins']),
array(),
array('no_convert' => true)
);
}

if ($args['permission']) {
Expand Down Expand Up @@ -2559,6 +2563,9 @@ public function remoteHost()
* DEFAULT: No
* - language: (string) The preferred language.
* DEFAULT: null
* - no_convert: (boolean) Don't convert the user name with the
* authusername hook.
* DEFAULT: false
*/
public function setAuth($authId, $credentials, array $options = array())
{
Expand Down Expand Up @@ -2590,7 +2597,9 @@ public function setAuth($authId, $credentials, array $options = array())
if (!empty($GLOBALS['conf']['auth']['lowercase'])) {
$username = Horde_String::lower($username);
}
$username = $this->convertUsername($username, true);
if (empty($options['no_convert'])) {
$username = $this->convertUsername($username, true);
}
$session->set('horde', 'auth/userId', $username);

$this->_cache['auth'] = null;
Expand Down
2 changes: 2 additions & 0 deletions framework/Core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Don&apos;t call authusername() hook on administrator names when running CLI scripts.
* [jan] Update Greek translation (Limperis Antonis &lt;limperis@cti.gr&gt;).
* [mjr] Fix fatal error with broken EAS clients searching the Outbox.
</notes>
Expand Down Expand Up @@ -4158,6 +4159,7 @@
<date>2016-02-23</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Don&apos;t call authusername() hook on administrator names when running CLI scripts.
* [jan] Update Greek translation (Limperis Antonis &lt;limperis@cti.gr&gt;).
* [mjr] Fix fatal error with broken EAS clients searching the Outbox.
</notes>
Expand Down

0 comments on commit dd172cb

Please sign in to comment.