CVS update: /cowiki/htdocs/setup/class/task/
[email protected] 29 Apr 2005 22:37:57 -0000
| Newsgroups | gmane.comp.php.cowiki.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: dgorski Date: 2005/04/29 15:37:57 Modified: cowiki/htdocs/setup/class/task/class.TaskAdminCredentialsChecker.php Log: Remember root user password even if this is an "update" and not an initial setup. This password will be crypted at the end of the process again. File Changes: Directory: /cowiki/htdocs/setup/class/task/ =========================================== File [changed]: class.TaskAdminCredentialsChecker.php Url: http://cowiki.tigris.org/source/browse/cowiki/htdocs/setup/class/task/class.TaskAdminCredentialsChecker.php?r1=1.1&r2=1.2 Delta lines: +11 -5 -------------------- --- class.TaskAdminCredentialsChecker.php 21 Apr 2005 00:17:14 -0000 1.1 +++ class.TaskAdminCredentialsChecker.php 29 Apr 2005 22:37:55 -0000 1.2 @@ -2,7 +2,7 @@ /** * - * $Id: class.TaskAdminCredentialsChecker.php,v 1.1 2005/04/21 00:17:14 dgorski Exp $ + * $Id: class.TaskAdminCredentialsChecker.php,v 1.2 2005/04/29 22:37:55 dgorski Exp $ * * This file is part of coWiki. coWiki is free software under the terms of * the GNU General Public License (GPL). Read the LICENSE file. If you did @@ -17,7 +17,7 @@ * @author Daniel T. Gorski, <[email protected]> * @copyright (C) Daniel T. Gorski, {@link http://www.develnet.org} * @license http://www.gnu.org/licenses/gpl.html - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * */ @@ -57,17 +57,17 @@ $sLogin = 'root'; $sPasswd = $_POST['passwd']; - // Get the root password if this is an inital setup + // Get the root password if this is an initial setup if ($this->State->isInitialSetup()) { if (strlen($sPasswd) < 5) { return $this->addError( 'The password is too short and hence unsecure. - Enter a longer password.' + Enter a longer (better) password.' ); } - $this->State->setKeyValue('rootPassword', $sPasswd); + $this->State->setRootUserPassword($sPasswd); $this->State->setIsValidUser(true); return true; @@ -97,7 +97,13 @@ // Check password if ($sLogin == 'root') { + if (crypt($sPasswd, $sRootPass) == $sRootPass) { + + // Must be set as it will crypted at the end. + $this->State->setRootUserPassword($sPasswd); + + // Set the user valid $this->State->setIsValidUser(true); return true; }