dolibarr
21.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
webportal
controllers
login.controller.class.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17
*/
18
27
class
LoginController
extends
Controller
28
{
34
public
function
checkAccess
()
35
{
36
$this->accessRight =
true
;
37
$context =
Context::getInstance
();
38
return
!$context->userIslog();
39
}
40
47
public
function
action
()
48
{
49
global $langs;
50
$context =
Context::getInstance
();
51
if
(!$context->controllerInstance->checkAccess()) {
52
return
-1;
53
}
54
55
$hookRes = $this->
hookDoAction
();
56
if
(empty($hookRes)) {
57
$context->title = $langs->trans(
'WebPortalHomeTitle'
);
58
$context->desc = $langs->trans(
'WebPortalHomeDesc'
);
59
//$context->doNotDisplayHeaderBar=1;// hide default header
60
}
61
62
return
1;
63
}
64
70
public
function
display
()
71
{
72
$context =
Context::getInstance
();
73
if
(!$context->controllerInstance->checkAccess()) {
74
$this->
display404
();
75
return
;
76
}
77
78
$this->
loadTemplate
(
'header_login'
);
79
80
$hookRes = $this->
hookPrintPageView
();
81
82
if
(empty($hookRes)) {
83
$this->
loadTemplate
(
'login'
);
84
}
85
86
$this->
loadTemplate
(
'footer'
);
87
}
88
}
Context\getInstance
static getInstance()
Singleton method to create one instance of this object.
Definition
context.class.php:197
Controller
Class to manage pages.
Definition
controller.class.php:29
Controller\hookPrintPageView
hookPrintPageView($parameters=array())
Execute hook PrintPageView.
Definition
controller.class.php:171
Controller\display404
display404()
Display error template.
Definition
controller.class.php:135
Controller\hookDoAction
hookDoAction($parameters=array())
Execute hook doActions.
Definition
controller.class.php:148
Controller\loadTemplate
loadTemplate($templateName, $vars=false)
Load a template .tpl file.
Definition
controller.class.php:195
LoginController
Class for LoginController.
Definition
login.controller.class.php:28
LoginController\display
display()
Display.
Definition
login.controller.class.php:70
LoginController\checkAccess
checkAccess()
Check current access to controller.
Definition
login.controller.class.php:34
LoginController\action
action()
Action method is called before html output can be used to manage security and change context.
Definition
login.controller.class.php:47
Generated on Sun Sep 1 2024 01:00:34 for
dolibarr
by Doxygen 1.11.0