Example #1
0
<?php

/* -----------------------------------------------------
 * File name	: logout.php	
 * Created by 	: M. Aryo N. Pratama				
 * -----------------------------------------------------			
 * Purpose		: Do logout using auth.class.php	
 * -----------------------------------------------------						                 			
 */
require_once 'init.php';
require_once LIB_PATH . 'functions.lib.php';
require_once CONT_PATH . 'auth.class.php';
$logout = new Auth();
$logout->doLogout();
if (count($logout->_errors) > 0) {
    $err_msg = "<ul>";
    foreach ($logout->_errors as $errors) {
        $err_msg .= "<li>{$errors}</li>";
    }
    $err_msg .= "</ul>";
    $status = "<div class=\"alert alert-danger\">{$err_msg}</div>";
}
echo $status;
?>
<html>
	<head>
		<title>&copy 2014 - Aryo</title>
	</head>
<body>
<?php 
echo $status;
Example #2
0
*
* Copyright (C) 2003 - 2007 phpScheduleIt
* License: GPL, see LICENSE
*/
/**
* Include Template class
*/
include_once 'lib/Template.class.php';
// Auth included in Template.php
$auth = new Auth();
$t = new Template();
$msg = '<h2>*** THIS SERVICE IS TEMPORARILY UNAVAILABLE [10/08/2011] ***</h2> ';
$resume = isset($_POST['resume']) ? $_POST['resume'] : '';
// Logging user out
if (isset($_GET['logout'])) {
    $auth->doLogout();
} else {
    if (isset($_POST['login'])) {
        if ($conf['app']['wrlc']) {
            $msg = $auth->doLoginGwid($_POST['gwid'], $_POST['name']);
        } else {
            $msg = $auth->doLogin($_POST['email'], $_POST['password'], isset($_POST['setCookie']) ? 'y' : null, false, $resume, $_POST['language']);
        }
    } else {
        if (isset($_COOKIE['ID'])) {
            $msg = $auth->doLogin('', '', 'y', $_COOKIE['ID'], $resume);
            // Check if user has cookies set up. If so, log them in automatically
        }
    }
}
$t->printHTMLHeader();