Example #1
0
File: Auth.php Project: arhe/pwak
 /**
  * Retourne le tableau des profiles autorisés pour la page en cours.
  *
  * @access public
  * @param  string path optionnel, le nom de la page en cours sans l'extension
  * @return array of integer
  */
 public function getProfileArrayForPage($path = false)
 {
     if (!$path) {
         $path = UrlTools::getPageNameFromURL();
     }
     $nav = Navigation::singleton();
     $nav->authFunction = array(Auth::singleton(), 'checkProfiles');
     $nav->useCookie = true;
     $profiles = $nav->getProfileArrayForActivePage($path);
     return $profiles;
 }
Example #2
0
File: index.php Project: arhe/pwak
 * PHP version 5.1.0+
 * 
 * LICENSE: This source file is subject to the MIT license that is available
 * through the world-wide-web at the following URI:
 * http://opensource.org/licenses/mit-license.php
 *
 * @package   PWAK
 * @author    ATEOR dev team <*****@*****.**>
 * @copyright 2003-2008 ATEOR <*****@*****.**> 
 * @license   http://opensource.org/licenses/mit-license.php MIT License 
 * @version   SVN: $Id$
 * @link      http://pwak.googlecode.com
 * @since     File available since release 0.1.0
 * @filesource
 */
define('SKIP_CONNECTION', true);
define('IGNORE_SESSION_TIMEOUT', true);
require_once '../config.inc.php';
$script = 'ajax/CustomAjaxServer.php';
if (file_exists(PROJECT_ROOT . '/' . WWW_DIR . '/' . $script)) {
    require_once $script;
    $class = 'CustomAjaxServer';
} else {
    require_once 'lib/Ajax/Server.php';
    $class = 'AjaxServer';
}
// ne planter pour de vilaines notices
error_reporting(E_ALL ^ E_NOTICE);
$auth = Auth::singleton();
$ajax = new $class();
$ajax->handleRequest();
Example #3
0
 *
 * Copyright 1999-2004 Charles J. Hagenbuch <*****@*****.**>
 * Copyright 1999-2004 Jon Parise <*****@*****.**>
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */
@define('AUTH_HANDLER', true);
@define('HORDE_BASE', dirname(__FILE__));
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_LIBS . 'Horde/Menu.php';
require_once HORDE_LIBS . 'Horde/Secret.php';
/* Initialize the Auth credentials key. */
Secret::setKey('auth');
/* Get an Auth object. */
$auth =& Auth::singleton($conf['auth']['driver']);
if (is_a($auth, 'PEAR_Error')) {
    Horde::fatal($auth, __FILE__, __LINE__);
}
/* Get parameters. */
$logout_reason = $auth->getLogoutReason();
$url_param = Util::getFormData('url');
if ($logout_reason) {
    $login_screen = $auth->_getLoginScreen();
    if (Util::removeParameter($login_screen, array('url', 'nocache')) != Util::removeParameter(Horde::url(Horde::selfUrl(), true), array('url', 'nocache'))) {
        $url = Auth::addLogoutParameters($login_screen);
        if ($url_param) {
            $url = Util::addParameter($login_screen, 'url', $url_param);
        }
        header('Location: ' . $url);
        exit;
Example #4
0
 /**
  * auth
  *
  * @access protected
  * @return void
  */
 protected function auth()
 {
     $this->auth = Auth::singleton();
     if (count($this->profiles) == 0) {
         $this->profiles = $this->auth->getProfileArrayForPage($this->altname . 'List');
     }
     $this->auth->checkProfiles($this->profiles);
 }