PHP code example of ungdev / phputt

1. Go to this page and download the library: Download ungdev/phputt library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ungdev / phputt example snippets

 php


 = new PhpUtt\Cas\SecurityLayer();

// Retourne le login utilisateur. Redirige vers l'interface CAS si l'utilisateur n'est pas connecté.
$userLogin = $security->login();
 php
$security = new PhpUtt\Cas\SecurityLayer();

// Retourne le login utilisateur. Redirige vers l'interface CAS si l'utilisateur n'est pas connecté.
$userLogin = $security->login();
 php
$security = new PhpUtt\Cas\SecurityLayer();

$security->logout();
 php
$ldap = new PhpUtt\Ldap\LdapLayer();

// Retourne un objet décrivant l'utilisateur
$user = $ldap->getUser($login);

// Retourne un objet décrivant l'association
$orga = $ldap->getOrga($login);

// Retourne un tableau de tous les utilisateurs
$users = $ldap->getUsers();

// Retourne un tableau de tous les étudiants (personnel de l'UTT retiré)
$students = $ldap->getStudents();

// Retourne un tableau de toutes les associations
$users = $ldap->getOrgas($login);