v. 0.6.3 from http://dev.piwik.org/trac/ticket/598
[piwik-CASLogin.git] / CASLogin.php
1 <?php
2 /**
3  * Piwik - Open source web analytics
4  * 
5  * @link http://piwik.org
6  * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
7  * @version $Id: ExamplePlugin.php 838 2008-12-17 17:26:15Z matt $
8  * 
9  * @package Piwik_CASLogin
10  */
11
12 require PIWIK_INCLUDE_PATH . '/plugins/CASLogin/Auth.php';
13
14 class Piwik_CASLogin extends Piwik_Plugin
15 {
16         public function getInformation()
17         {
18                 return array(
19                         'name' => 'CAS Login',
20                         'description' => 'CAS Login plugin. It uses JA-SIG Central Authentication Services to authenticate users and grant them access to piwik.',
21                         'author' => 'OW',
22                         'homepage' => 'http://dev.piwik.org/trac/ticket/598/',
23                         'version' => '0.6',
24                 );
25         }
26
27         function getListHooksRegistered()
28         {
29                 $hooks = array(
30                         'FrontController.initAuthenticationObject'      => 'initAuthenticationObject',
31                         );
32                 return $hooks;
33         }
34
35         function initAuthenticationObject($notification)
36         {
37         set_include_path(get_include_path() . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/plugins/CASLogin/CAS');
38         require_once('CAS/CAS.php');
39                 $auth = new Piwik_CASLogin_Auth();
40                 Zend_Registry::set('auth', $auth);
41         }
42 }