• 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 // temporary disabled, this seems to delete main menu
00069 // e.g. if repository.php is loaded in top.location.href
00070 // (public section enabled), the problem can be reproduced
00071 // by uncomment the following line and
00072 // - enter the public section
00073 // - destroy the session (table usr_session)
00074 // - hit repository in the locator bar
00075 // -> ILIAS shows public repository without top menu
00076 
00077                 if (is_int(strpos($_GET["return_to"], "goto.php")))
00078                 {
00079                         $return_to = "&return_to=".rawurlencode($_GET["return_to"]);
00080                 }
00081         }
00082 
00083     if ($_GET["inactive"])
00084     {
00085         echo "<script language=\"Javascript\">\ntop.location.href = \"./login.php?inactive=true".$return_to."\";\n</script>\n";
00086     }
00087     else
00088     {
00089         echo "<script language=\"Javascript\">\ntop.location.href = \"./login.php?expired=true".$return_to."\";\n</script>\n";
00090     }
00091 
00092         exit();
00093 }
00094 
00095 // check for auth
00096 if ($ilias->auth->getAuth())
00097 {
00098         ilUtil::redirect("start.php");
00099 }
00100 else
00101 {
00102         echo "ANONYMOUS user with the object_id ".ANONYMOUS_USER_ID." not found!";
00103         exit();
00104 }
00105 ?>

Generated on Fri Dec 13 2013 10:18:31 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1