Revision: 201
http://sourceforge.net/p/beeframework/code/201
Author: m_plomer
Date: 2014-08-27 21:21:55 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
- cleaned up Authentication Providers, fixed wrong exception class names
Modified Paths:
--------------
branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php
branches/0.9-dev/framework/Bee/Security/IAuthentication.php
branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php
branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php
Modified: branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -79,6 +79,4 @@
}
return $principal;
}
-
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/IAuthentication.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/IAuthentication.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/IAuthentication.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -73,5 +73,9 @@
* @return void
*/
function setAuthenticated($authenticated);
-}
-?>
\ No newline at end of file
+
+ /**
+ * @return string
+ */
+ function getName();
+}
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -81,10 +81,9 @@
public final function authenticate(Bee_Security_IAuthentication $authentication) {
Bee_Utils_Assert::isInstanceOf('Bee_Security_UsernamePasswordAuthenticationToken', $authentication, 'Only UsernamePasswordAuthenticationToken is supported');
- /** @var Bee_Security_UsernamePasswordAuthenticationToken $authentication */
// Determine username
- $username = is_null($authentication->getPrincipal()) ? "NONE_PROVIDED" : $authentication->getPrincipal()->getName();
+ $username = is_null($authentication->getPrincipal()) ? "NONE_PROVIDED" : $authentication->getName();
$cacheWasUsed = true;
$user = null;
Modified: branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -20,42 +20,42 @@
*
*/
class Bee_Security_UsernamePasswordAuthenticationToken extends Bee_Security_AbstractAuthenticationToken {
-
- private $credentials;
- private $principal;
-
- /**
- * Enter description here...
- *
- * @param mixed $principal
- * @param mixed $credentials
- * @param Bee_Security_IGrantedAuthority[] $authorities
- */
- public function __construct($principal, $credentials, $authorities = null) {
- parent::__construct($authorities);
- $this->principal = $principal;
- $this->credentials = $credentials;
- parent::setAuthenticated(!is_null($authorities) ? true : false);
- }
-
+ private $credentials;
+
+ private $principal;
+
+ /**
+ * Enter description here...
+ *
+ * @param mixed $principal
+ * @param mixed $credentials
+ * @param Bee_Security_IGrantedAuthority[] $authorities
+ */
+ public function __construct($principal, $credentials, $authorities = null) {
+ parent::__construct($authorities);
+ $this->principal = $principal;
+ $this->credentials = $credentials;
+
+ parent::setAuthenticated(!is_null($authorities) ? true : false);
+ }
+
public function getPrincipal() {
return $this->principal;
}
-
+
public function getCredentials() {
return $this->credentials;
}
-
+
public function setAuthenticated($authenticated) {
- if ($authenticated) {
- throw new Exception("Cannot set this token to trusted - use constructor containing granted authority[]s instead");
- }
- parent::setAuthenticated(false);
+ if ($authenticated) {
+ throw new Exception("Cannot set this token to trusted - use constructor containing granted authority[]s instead");
+ }
+ parent::setAuthenticated(false);
}
- public function __toString() {
- return 'Bee_Security_UsernamePasswordAuthenticationToken['.$this->principal.']';
- }
-}
-?>
\ No newline at end of file
+ public function __toString() {
+ return 'Bee_Security_UsernamePasswordAuthenticationToken[' . $this->principal . ']';
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|