diff --git a/admin/admin-cli.php b/admin/admin-cli.php index 85eece5918..d6ceb3d959 100755 --- a/admin/admin-cli.php +++ b/admin/admin-cli.php @@ -6,9 +6,8 @@ * @link http://www.egroupware.org * @package admin * @author Ralf Becker - * @copyright (c) 2006-16 by Ralf Becker + * @copyright (c) 2006-18 by Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @version $Id$ */ use EGroupware\Api; @@ -298,12 +297,9 @@ function load_egw($user,$passwd,$domain='default') */ function _check_pw($hash_or_cleartext,$pw) { - //echo "_check_pw($hash_or_cleartext,$pw) md5=".md5($pw)."\n"; - if (preg_match('/^[0-9a-f]{32}$/',$hash_or_cleartext)) - { - return $hash_or_cleartext == md5($pw); - } - return $hash_or_cleartext == $pw; + return Api\Auth::compare_password($pw, $hash_or_cleartext, + // old header.inc.php allows md5 or plain passwords with out {type} prefix, which takes precedence + preg_match('/^[0-9a-f]{32}$/', $hash_or_cleartext) ? 'md5' : 'plain'); } /**