2457ddff0e995c91082b475ea03d1abcae3e2860
[kivitendo-erp.git] / bin / mozilla / login.pl
1 #=====================================================================
2 # LX-Office ERP
3 # Copyright (C) 2004
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
6 #
7 ######################################################################
8 # SQL-Ledger Accounting
9 # Copyright (c) 1998-2002
10 #
11 #  Author: Dieter Simader
12 #   Email: dsimader@sql-ledger.org
13 #     Web: http://www.sql-ledger.org
14 #
15 #
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
20 #
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
28 # MA 02110-1335, USA.
29 #######################################################################
30
31 use SL::DB::Default;
32 use SL::Form;
33 use SL::Git;
34 use DateTime;
35
36 require "bin/mozilla/common.pl";
37 require "bin/mozilla/todo.pl";
38
39 use strict;
40
41 our $form;
42 our $auth;
43
44 sub company_logo {
45   $main::lxdebug->enter_sub();
46
47   my %myconfig = %main::myconfig;
48   $form->{todo_list}  =  create_todo_list('login_screen' => 1) if (!$::request->is_mobile) and (!$form->{no_todo_list}) and ($main::auth->check_right($::myconfig{login}, 'productivity'));
49
50   $form->{stylesheet} =  $myconfig{stylesheet};
51   $form->{title}      =  $::locale->text('kivitendo');
52   $form->{interface}  = $::dispatcher->interface_type;
53   $form->{client}     = $::auth->client;
54   $form->{defaults}   = SL::DB::Default->get;
55
56   my $git             = SL::Git->new;
57   ($form->{git_head}) = $git->get_log(since => 'HEAD~1', until => 'HEAD') if $git->is_git_installation;
58   $form->{xmas}       = '_xmas' if (DateTime->today->month == 12 && DateTime->today->day < 27);
59   $form->{xmas}       = '_mir'  if (DateTime->today->month >= 03 && DateTime->today->year == 2022
60                                     && DateTime->today->month <= 05);
61   $form->{xmas}       = '_mir'  if (DateTime->today->day == 24 && DateTime->today->month == 2);
62
63   # create the logo screen
64   $form->header() unless $form->{noheader};
65
66   print $form->parse_html_template('login/company_logo', { version => $::form->read_version });
67
68   $main::lxdebug->leave_sub();
69 }
70
71 1;
72
73 __END__