• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

nologin.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00035 // Don't change username and password
00036 $_POST["username"] = "anonymous";
00037 $_POST["password"] = "anonymous";
00038 
00039 require_once "include/inc.header.php";
00040 
00041 $anon = ANONYMOUS_USER_ID;
00042 
00043 if (empty($anon))
00044 {
00045         echo "<p>You enabled the public section feature without declaring a user account as 'anonymous'.";
00046         echo "<br/>Do the following:<ul>";
00047         echo "<li>Go to login.php and log in with a regular user account</li>";
00048         echo "<li>Remember the object_id of a user account designated for anonymous access (you may also add a new user)</li>";
00049         echo "<li>Username and password MUST BE 'anonymous','anonymous'</li>";
00050         echo "<li>Open your ilias.ini.php and enter the object_id to the directive 'ANONYMOUS_USER_ID'</li></ul></p>";
00051         exit();
00052 }
00053 
00054 if (!$ilias->getSetting("pub_section"))
00055 {
00056         $ilias->auth->logout();
00057         session_destroy();
00058         ilUtil::redirect("login.php");
00059 }
00060 
00061 //echo "-".$_GET["return_to"]."-".$_GET["reload"]."-"; exit;
00062 
00063 // catch reload
00064 if ($_GET["reload"])
00065 {
00066         if (!empty($_GET["return_to"]))
00067         {
00068                 $return_to = "&return_to=".rawurlencode($_GET["return_to"]);
00069         }
00070 
00071     if ($_GET["inactive"])
00072     {
00073         echo "<script language=\"Javascript\">\ntop.location.href = \"./login.php?inactive=true".$return_to."\";\n</script>\n";
00074     }
00075     else
00076     {
00077         echo "<script language=\"Javascript\">\ntop.location.href = \"./login.php?expired=true".$return_to."\";\n</script>\n";
00078     }
00079 
00080         exit();
00081 }
00082 
00083 // check for auth
00084 if ($ilias->auth->getAuth())
00085 {
00086         ilUtil::redirect("start.php");
00087 }
00088 else
00089 {
00090         echo "ANONYMOUS user with the object_id ".ANONYMOUS_USER_ID." not found!";
00091         exit();
00092 }
00093 ?>

Generated on Fri Dec 13 2013 09:06:37 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1