Created
January 5, 2012 17:55
-
-
Save awartoft/1566367 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Antoine Hedgecock <[email protected]> | |
*/ | |
/** | |
* @namespace | |
*/ | |
namespace App\Auth; | |
/** | |
* @category App | |
* @package Auth | |
*/ | |
class Result extends \Zend_Auth_Result | |
{ | |
const FAILURE_DELETED = -4; | |
const FAILURE_FACEBOOK_ACCOUNT = -5; | |
const FAILURE_NOT_APPROVED = -6; | |
const FAILURE_UNCATEGORIZED = -7; | |
/** | |
* Sets the result code, identity, and failure messages | |
* | |
* who ever wrote this didn't expect for people to extend it... | |
* | |
* @param int $code | |
* @param mixed $identity | |
* @param array $messages | |
* @return void | |
*/ | |
public function __construct($code, $identity, array $messages = array()) | |
{ | |
$code = (int) $code; | |
if ($code < self::FAILURE_UNCATEGORIZED) { | |
$code = self::FAILURE; | |
} elseif ($code > self::SUCCESS ) { | |
$code = 1; | |
} | |
$this->_code = $code; | |
$this->_identity = $identity; | |
$this->_messages = $messages; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment