diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2008-08-04 04:11:03 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2008-08-04 04:11:03 +0400 |
commit | 2854426e8609e0f9e3ceac2e27327532bf00a408 (patch) | |
tree | 5214705435461179efecb331075a9830a21a5594 /core/Auth.php | |
parent | 42b52b6d8a88b3fa4c4f3978c4e7bf00b1eac778 (diff) |
oops i totally screwed up my last commit, deleting /modules instead of renaming it...
git-svn-id: http://dev.piwik.org/svn/trunk@587 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Auth.php')
-rw-r--r-- | core/Auth.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/core/Auth.php b/core/Auth.php new file mode 100644 index 0000000000..b3d99d5d26 --- /dev/null +++ b/core/Auth.php @@ -0,0 +1,52 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later + * @version $Id: Auth.php 581 2008-07-27 23:07:52Z matt $ + * + * @package Piwik + */ + +interface Piwik_Auth { + /** + * @return Piwik_Auth_Result + */ + public function authenticate(); +} + +/** + * + * @package Piwik + */ +class Piwik_Auth_Result extends Zend_Auth_Result +{ + /** + * token_auth parameter used to authenticate in the API + * + * @var string + */ + protected $_token_auth = null; + + const SUCCESS_SUPERUSER_AUTH_CODE = 42; + + public function __construct($code, $login, $token_auth, array $messages = array()) + { + // Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE, Piwik_Auth_Result::SUCCESS, Piwik_Auth_Result::FAILURE + $this->_code = (int)$code; + $this->_identity = $login; + $this->_messages = $messages; + $this->_token_auth = $token_auth; + } + + /** + * Returns the token_auth to authenticate the current user in the API + * + * @return string + */ + public function getTokenAuth() + { + return $this->_token_auth; + } +} |