Ejemplo n.º 1
0
                    $url = '../' . $prefilter['module'] . '/';
                }
                $url .= $prefilter['action'];
            }
            $url .= '?' . implode('&', array_unique($params));
            header("Location: {$url}");
            return;
        }
    }
}
// Process Authentication
$shibbolethEnabled = isset($configArray['Authentication']['shibboleth']) && $configArray['Authentication']['shibboleth'];
if ($user && $shibbolethEnabled && empty($_SERVER[$configArray['Shibboleth']['username']]) && isset($configArray['Shibboleth']['logout']) && isset($configArray['Shibboleth']['autologout']) && $configArray['Shibboleth']['autologout']) {
    // Special case: Process single log-out for Shibboleth
    include_once 'services/MyResearch/Logout.php';
    Logout::performLogout();
    $user = false;
} else {
    if (!$user) {
        // Special case for Shibboleth:
        $shibLoginNeeded = $shibbolethEnabled && ($module == 'MyResearch' || isset($configArray['Shibboleth']['required_attribute']) && getenv($configArray['Shibboleth']['required_attribute']) !== false);
        // Default case for all other authentication methods:
        $standardLoginNeeded = isset($_POST['username']) && isset($_POST['password']) && $action != 'Account';
        // Perform a login if necessary:
        if ($shibLoginNeeded) {
            $user = UserAccount::login('Shibboleth');
            // If we authenticated, store the user in the session:
            if (PEAR::isError($user)) {
                if ($user->getMessage() == 'authentication_error_admin') {
                    // Suppressed: error_log('User id not set, Shibboleth login not possible');
                } else {
Ejemplo n.º 2
0
 /**
  * Logout
  *
  * @return true
  * @access public
  */
 public function logout()
 {
     Logout::performLogout();
     return $this->output(true, JSON::STATUS_OK);
 }