Skip to content
Snippets Groups Projects
Select Git revision
  • 7401316f4031ab9adf3b85da755d94c38a09a7db
  • 3.9 default
  • develop
  • 6.0
  • 5.0
  • 4.0
  • scrutinizer-patch-4
  • scrutinizer-patch-3
  • scrutinizer-patch-2
  • scrutinizer-patch-1
  • 3.7
  • 3.8
  • 3.6
  • 3.9_backported
  • 3.8_backported
  • 3.7_backported
  • 3.5
  • 3.6_backported
  • 3.5_backported
  • 3.4
  • 3.3_backported
  • 6.0.4
  • 6.0.3
  • 5.0.7
  • 6.0.2
  • 6.0.1
  • 5.0.6
  • 6.0.0
  • 5.0.5
  • 6.0.0-rc
  • 5.0.4
  • 6.0.0-beta
  • 5.0.3
  • 4.0.6
  • 5.0.2
  • 5.0.1
  • 4.0.5
  • 5.0.0
  • 4.0.4
  • 5.0.0-rc2
  • 5.0.0-rc1
41 results

functions.inc.php

Blame
  • CAS_example.php 562 B
    <?php
    ini_set('display_errors', true);
    error_reporting(E_ALL);
    chdir(dirname(__FILE__).'/../../');
    require_once 'UNL/Auth.php';
    
    $auth = UNL_Auth::factory('CAS');
    
    if (isset($_GET['login'])) {
    	$auth->login();
    } elseif (isset($_GET['logout'])) {
    	$auth->logout();
    }
    
    if (!$auth->isLoggedIn()) {
        // Could call $auth->login() here to get the party started.
    	echo "You are not logged in.\n<br />\n";
    	echo '<a href="?login=true">Click here to log in!</a>';
    } else {
    	echo "You are logged in as {$auth->getUser()}<br />";
    	echo "<a href='?logout'>logout</a>";
    }