bugfix: the slice page was broken when nobody is in slice
[plewww.git] / planetlab / includes / plc_login.php
1 <?php
2 //
3 // Require this file to require login to a page, e.g.
4 //
5 // require_once 'plc_login.php';
6 //
7 // Mark Huang <mlhuang@cs.princeton.edu>
8 // Copyright (C) 2006 The Trustees of Princeton University
9 //
10 // $Id$ $
11 //
12
13 require_once 'plc_session.php';
14 global $plc, $api;
15
16 if (!$plc->person) {
17   // Where they were trying to go
18   $url = $_SERVER['PHP_SELF'];
19   if (!empty($_SERVER['QUERY_STRING'])) {
20     $url .= "?" . $_SERVER['QUERY_STRING'];
21   }
22
23   Header("Location: /db/common/login.php?url=" . urlencode($url));
24   exit();
25 }
26
27 ?>