2 /*******************************************************************************
3 * Copyright (C) 2007 Easter-eggs
4 * http://ldapsaisie.labs.libre-entreprise.org
6 * Author: See AUTHORS file in top-level directory.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ******************************************************************************/
24 * Anonymous authentication provider for LSauth
26 * @author Benjamin Renard <brenard@easter-eggs.com>
28 class LSauthMethod_anonymous extends LSauthMethod {
30 function LSauthMethod_anonymous() {
31 LSauth :: disableLoginForm();
32 LSauth :: disableLogoutBtn();
33 LSauth :: disableSelfAccess();
35 if (!parent :: LSauthMethod())
38 if ( (!defined('LSAUTHMETHOD_ANONYMOUS_USER')) || (constant('LSAUTHMETHOD_ANONYMOUS_USER') == "")) {
39 LSerror :: addErrorCode('LSauthMethod_anonymous_01');
48 * Return authentication data or false
50 * @retval Array|false Array of authentication data or False
52 public function getAuthData() {
53 $this -> authData = array(
54 'username' => LSAUTHMETHOD_ANONYMOUS_USER
56 return $this -> authData;
63 LSerror :: defineError('LSauthMethod_anonymous_01',
64 _("LSauthMethod_anonymous : You must define the LSAUTHMETHOD_ANONYMOUS_USER contant in the configuration file.")