login.php 1.53 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/*
 * Copyright (C) 2015 Michael Herold <quabla@hemio.de>
 *
 * This program 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

namespace hemio\edentata;

use hemio\form;
use hemio\html;

Michael Herold's avatar
Michael Herold committed
24
$document = new form\Document(new html\String(_('Edentata Login')));
25

Michael Herold's avatar
Michael Herold committed
26
$document->getHtml()->getHead()->setBaseUrl($config['base_url']);
Michael Herold's avatar
Michael Herold committed
27
$document->getHtml()->getHead()->addJsFile('static/js/login.js');
28
if ($authMethod === 'logout')
Michael Herold's avatar
Michael Herold committed
29
    $document->getHtml()->getHead()->addJsFile('static/js/logout.js');
30

Michael Herold's avatar
Michael Herold committed
31
$document->getHtml()->getHead()->addCssFile('static/design/style.css');
32

Michael Herold's avatar
Michael Herold committed
33
$pdo = new sql\Connection($config['database_dsn']);
34

35
$loadedModule = new LoadModule('login_http', $pdo, $i10n);
36
37
38
$i10n->setDomainModule($loadedModule);

$document->getHtml()->getBody()->addChild(
39
40
41
42
43
44
45
46
    $loadedModule->getContent(
        new Request(
        $_GET
        , Utils::getPost(), $_SERVER['REQUEST_URI']
        , $config['base_url']
        )
        , $i10n
    )
47
48
49
);

echo $document->__toString();