1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<?php
/**
* Maintenance module that presents a TOS Agreement page to user.
* If user does not accept terms, user is not allowed to login.
*
* $Horde: imp/lib/Maintenance/Task/tos_agreement.php,v 1.11.10.10 2008/01/02 11:32:05 jan Exp $
*
* Copyright 2002-2008 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*
* @author Michael Slusarz <slusarz@horde.org>
* @package Horde_Maintenance
*/
class Maintenance_Task_tos_agreement extends Maintenance_Task {
/**
* The style of the maintenance page output.
*
* @var integer
*/
var $_display_type = MAINTENANCE_OUTPUT_AGREE;
/**
* Determine if user agreed with the terms or not. If the user does not
* agree, log him/her out immediately.
*/
function doMaintenance()
{
$result = Util::getFormData('not_agree');
if (isset($result)) {
header('Location: ' . Auth::addLogoutParameters(IMP::logoutUrl(), AUTH_REASON_MESSAGE, _("You did not agree to the Terms of Service agreement, so you were not allowed to login.")));
exit;
}
}
/**
* Returns the TOS agreement for display on the maintenance page.
*
* @return string The terms of service agreement.
*/
function describeMaintenance()
{
if (empty($GLOBALS['conf']['tos']['file'])) {
Horde::fatal(PEAR::raiseError(sprintf(_("Terms of Service file not specified in conf.php"))), __FILE__, __LINE__);
}
return file_get_contents($GLOBALS['conf']['tos']['file']);
}
}
|