api.php 558 Bytes
Newer Older
Stephane Crozat's avatar
Stephane Crozat committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?php
if (!isset($_GET['api'])) {
  header('Location:index.php');
}
else {
  session_start();
  include 'lib/cas_connect.php';
  include 'lib/db.php';
  include 'lib/views.php';
  include 'lib/admin.php';

  $db = new DB();
  $admin = new Admin($db);
  $view = new Views($admin, $_SESSION['utclogin'], $_SESSION['surname'], $_SESSION['firstname']);

  $view->printHtmlBegin($admin);
  $view->printUser($db->isResp($_SESSION['utclogin']), $db->isAdmin($_SESSION['utclogin']));
  $view->apiStudents($db->apiStudents($_SESSION['utclogin'],$_GET['api']));
}

?>