Add custom logged out page #4610

skala
Laurent Opprecht 13 years ago
parent 1440d03a00
commit ea5f1e192e
  1. 57
      custompages/loggedout.php
  2. 12
      index.php
  3. 1
      main/inc/global.inc.php
  4. 36
      main/inc/lib/request.class.php
  5. 1
      main/inc/lib/userportal.lib.php

@ -0,0 +1,57 @@
<?php
/**
* Displayed after the user has been logged out.
*/
$called_direcly = !function_exists('api_get_path');
if ($called_direcly)
{
return '';
}
require_once('language.php');
$www = api_get_path('WEB_PATH');
?>
<!DOCTYPE html>
<html>
<head>
<title>Custompage - logged out</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--[if !IE 6]><!-->
<link rel="stylesheet" type="text/css" href="<?php echo $www ?>custompages/style.css" />
<!--<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
<![endif]-->
<script type="text/javascript" src="<?php echo $www ?>custompages/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
if (top.location != location)
top.location.href = document.location.href ;
});
</script>
</head>
<body>
<div id="backgroundimage">
<img src="<?php echo $www ?>/custompages/images/page-background.png" class="backgroundimage" alt="background"/>
</div>
<div id="wrapper">
<div id="header">
<img src="<?php echo $www ?>/custompages/images/header.png" alt="Logo" />
</div>
<div id="login-form-box" class="form-box">
<div id="login-form-info" class="form-info">
You have been logged out.
</div>
</div>
<a href="<?php echo $www . 'user_portal.php'; ?>">Go to your portal</a>
<div id="footer">
<img src="<?php echo $www ?>/custompages/images/footer.png" alt="footer"/>
</div>
</div>
</body>
</html>

@ -79,9 +79,17 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
unset($_SESSION['info_current_user']);
}
//If we are not logged in and customapages activated
if (!api_get_user_id() && api_get_setting('use_custom_pages') == 'true' ){
if (!api_get_user_id() && api_get_setting('use_custom_pages') == 'true' )
{
require_once api_get_path(LIBRARY_PATH).'custompages.lib.php';
CustomPages::displayPage('index-unlogged');
if(Request::get('loggedout'))
{
CustomPages::displayPage('loggedout');
}
else
{
CustomPages::displayPage('index-unlogged');
}
}
/**

@ -92,6 +92,7 @@ ini_set('include_path', api_create_include_path_setting());
ini_set('auto_detect_line_endings', '1');
// Include the libraries that are necessary everywhere
require_once $lib_path.'request.class.php';
require_once $lib_path.'database.lib.php';
require_once $lib_path.'template.lib.php';
require_once $lib_path.'display.lib.php';

@ -0,0 +1,36 @@
<?php
/**
* Description of request
*
* @author Laurent Opprecht <laurent@opprecht.info>
*/
class Request
{
public static function get($key, $default = null)
{
return isset($_GET[$key]) ? isset($_GET[$key]) : $default;
}
public static function post($key, $default = null)
{
return isset($_POST[$key]) ? isset($_POST[$key]) : $default;
}
static function server($key, $default = null)
{
return isset($_SERVER[$key]) ? isset($_SERVER[$key]) : $default;
}
static function file($key, $default = null)
{
return isset($_FILES[$key]) ? isset($_FILES[$key]) : $default;
}
static function environment($key, $default = null)
{
return isset($_ENV[$key]) ? isset($_ENV[$key]) : $default;
}
}

@ -158,6 +158,7 @@ class IndexManager {
}
exit_of_chat($uid);
api_session_destroy();
$query_string = $query_string ? "$query_string&loggedout=true" : '?loggedout=true';
header("Location: index.php$query_string");
exit();
}

Loading…
Cancel
Save