[Beeframework-svn] SF.net SVN: beeframework:[38] trunk/framework
Brought to you by:
b_hartmann,
m_plomer
From: <m_p...@us...> - 2013-06-06 14:40:46
|
Revision: 38 http://sourceforge.net/p/beeframework/code/38 Author: m_plomer Date: 2013-06-06 14:40:44 +0000 (Thu, 06 Jun 2013) Log Message: ----------- - merged changes from private AH version Modified Paths: -------------- trunk/framework/Bee/Security/PasswordEncoder/Crypt.php trunk/framework/Bee/Security/Provider/ISaltSource.php trunk/framework/Bee/Text/Normalization/PEARNormalizer.php Added Paths: ----------- trunk/framework/Bee/Security/Provider/UsernameSaltSource.php trunk/framework/BeeFramework.php Modified: trunk/framework/Bee/Security/PasswordEncoder/Crypt.php =================================================================== --- trunk/framework/Bee/Security/PasswordEncoder/Crypt.php 2013-05-21 14:20:15 UTC (rev 37) +++ trunk/framework/Bee/Security/PasswordEncoder/Crypt.php 2013-06-06 14:40:44 UTC (rev 38) @@ -14,15 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + class Bee_Security_PasswordEncoder_Crypt implements Bee_Security_IPasswordEncoder { public function encodePassword($rawPass, $salt) { - return crypt($rawPass); + return crypt($rawPass, $salt); } public function isPasswordValid($encPass, $rawPass, $salt) { - return $encPass === crypt($rawPass); + return $encPass === $this->encodePassword($rawPass, $salt); } - } -?> \ No newline at end of file Modified: trunk/framework/Bee/Security/Provider/ISaltSource.php =================================================================== --- trunk/framework/Bee/Security/Provider/ISaltSource.php 2013-05-21 14:20:15 UTC (rev 37) +++ trunk/framework/Bee/Security/Provider/ISaltSource.php 2013-06-06 14:40:44 UTC (rev 38) @@ -26,5 +26,4 @@ * @return String the salt to use for this <code>Bee_Security_IUserDetails</code> */ public function getSalt(Bee_Security_IUserDetails $user); -} -?> \ No newline at end of file +} \ No newline at end of file Added: trunk/framework/Bee/Security/Provider/UsernameSaltSource.php =================================================================== --- trunk/framework/Bee/Security/Provider/UsernameSaltSource.php (rev 0) +++ trunk/framework/Bee/Security/Provider/UsernameSaltSource.php 2013-06-06 14:40:44 UTC (rev 38) @@ -0,0 +1,31 @@ +<?php +/* + * Copyright 2008-2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Provides alternative sources of the salt to use for encoding passwords. + */ +class Bee_Security_Provider_UsernameSaltSource implements Bee_Security_Provider_ISaltSource { + /** + * Returns the salt to use for the indicated user. + * + * @param Bee_Security_IUserDetails $user from the <code>AuthenticationDao</code> + * @return String the salt to use for this <code>Bee_Security_IUserDetails</code> + */ + public function getSalt(Bee_Security_IUserDetails $user) { + return $user->getUsername(); + } +} \ No newline at end of file Modified: trunk/framework/Bee/Text/Normalization/PEARNormalizer.php =================================================================== --- trunk/framework/Bee/Text/Normalization/PEARNormalizer.php 2013-05-21 14:20:15 UTC (rev 37) +++ trunk/framework/Bee/Text/Normalization/PEARNormalizer.php 2013-06-06 14:40:44 UTC (rev 38) @@ -34,7 +34,7 @@ * @return string */ public function normalize($input, $form = self::UNICODE_NORMALIZATION_COMPOSED) { - $this->normalizer->normalize($input, $form); + return $this->normalizer->normalize($input, $form); } public function __construct() { Added: trunk/framework/BeeFramework.php =================================================================== --- trunk/framework/BeeFramework.php (rev 0) +++ trunk/framework/BeeFramework.php 2013-06-06 14:40:44 UTC (rev 38) @@ -0,0 +1,7 @@ +<?php + +include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Bee'.DIRECTORY_SEPARATOR.'Framework.php'; + +class BeeFramework extends Bee_Framework { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |