Fixed theme Blogger
[vanilla-miry.git] / library / People / People.Control.Leave.php
blob8be80977883e8fcdf16323be3172976ed54d3626
1 <?php
2 /**
3 * The Leave control is used to sign a user out of an application
4 * and present them with a "good bye" screen.
6 * Copyright 2003 Mark O'Sullivan
7 * This file is part of Lussumo's Software Library.
8 * Lussumo's Software Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
9 * Lussumo's Software Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10 * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
11 * The latest source code is available at www.lussumo.com
12 * Contact Mark O'Sullivan at mark [at] lussumo [dot] com
14 * @author Mark O'Sullivan
15 * @copyright 2003 Mark O'Sullivan
16 * @license http://lussumo.com/community/gpl.txt GPL 2
17 * @package People
18 * @version 1.1.8
22 /**
23 * The Leave control is used to sign a user out of an application
24 * and present them with a "good bye" screen.
25 * @package People
27 class Leave extends PostBackControl {
29 function Leave(&$Context) {
30 $this->Name = 'Leave';
31 $this->ValidActions = array('SignOutNow', 'SignOut');
32 $this->Constructor($Context);
34 if ($this->IsPostBack) {
35 // Set up the page
36 global $Banner, $Foot;
37 $Banner->Properties['CssClass'] = 'SignOut';
38 $Foot->CssClass = 'SignOut';
39 $this->Context->PageTitle = $this->Context->GetDefinition('SignOut');
41 // Occassionally cookies cannot be removed, and rather than
42 // cause an infinite loop where the page continually refreshes
43 // until it crashes (attempting to remove the cookies over and
44 // over again), I just fail out and treat the user as if s/he
45 // has been signed out successfully.
46 $this->PostBackValidated = 1;
47 if ($this->PostBackAction == 'SignOutNow'
48 && $this->IsValidFormPostBack('ErrPostBackKeySignOutInvalid')
49 ) {
50 $this->Context->Session->End($this->Context->Authenticator);
51 } else {
52 $this->PostBackValidated = 0;
57 function Render_ValidPostBack() {
58 $this->CallDelegate('PreValidPostBackRender');
59 include(ThemeFilePath($this->Context->Configuration, 'people_signout_form_validpostback.php'));
60 $this->CallDelegate('PostValidPostBackRender');
63 function Render_NoPostBack() {
64 $this->CallDelegate('PreNoPostBackRender');
65 $this->PostBackParams->Add('PostBackAction', 'SignOutNow');
66 include(ThemeFilePath($this->Context->Configuration, 'people_signout_form_nopostback.php'));
67 $this->CallDelegate('PostNoPostBackRender');