X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Flogin.pl;h=117c184cb810794791f26ce06569d0c96e778b57;hb=35c8a113365e28432580272971dd196c34681c0a;hp=39890982d56b9c5501814ab7e1a48b8cb6f6b778;hpb=d629acd82a27e980899a044ca8b0f4becc8e94bb;p=kivitendo-erp.git diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 39890982d..117c184cb 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -24,222 +24,50 @@ # 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, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. ####################################################################### -use DBI; -use SL::User; +use SL::DB::Default; use SL::Form; +use SL::Git; +use DateTime; require "bin/mozilla/common.pl"; +require "bin/mozilla/todo.pl"; -$form = new Form; +use strict; -$locale = new Locale $language, "login"; - -# customization -if (-f "bin/mozilla/custom_$form->{script}") { - eval { require "bin/mozilla/custom_$form->{script}"; }; - $form->error($@) if ($@); -} - -# per login customization -if (-f "bin/mozilla/$form->{login}_$form->{script}") { - eval { require "bin/mozilla/$form->{login}_$form->{script}"; }; - $form->error($@) if ($@); -} - -# window title bar, user info -$form->{titlebar} = - "Lx-Office " . $locale->text('Version') . " $form->{version}"; - -if ($form->{action}) { - $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}"; - call_sub($locale->findsub($form->{action})); -} else { - &login_screen; -} - -1; - -sub login_screen { - $lxdebug->enter_sub(); - - if (-f "css/lx-office-erp.css") { - $form->{stylesheet} = "lx-office-erp.css"; - } - - $form->{fokus} = "loginscreen.login"; - $form->header; - - print qq| - - - - -
-
-
- -
- - - - -
- - - -|; - - $lxdebug->leave_sub(); -} - -sub login { - $lxdebug->enter_sub(); - - $form->error($locale->text('You did not enter a name!')) - unless ($form->{login}); - - $user = new User $memberfile, $form->{login}; - - # if we get an error back, bale out - if (($errno = $user->login(\%$form, $userspath)) <= -1) { - $errno *= -1; - $err[1] = $err[3] = $locale->text('Incorrect username or password!'); - - if ($errno == 2) { - exit; - } - - $form->error($err[$errno]); - } - - # made it this far, execute the menu - if ($user->{menustyle} eq "v3") { - $form->{callback} = - "menuv3.pl?login=$form->{login}&password=$form->{password}&action=display"; - } elsif ($user->{menustyle} eq "neu") { - $form->{callback} = - "menunew.pl?login=$form->{login}&password=$form->{password}&action=display"; - } else { - $form->{callback} = - "menu.pl?login=$form->{login}&password=$form->{password}&action=display"; - } - - $form->redirect; - - $lxdebug->leave_sub(); -} - -sub logout { - $lxdebug->enter_sub(); - - unlink "$userspath/$form->{login}.conf"; - - # remove the callback to display the message - $form->{callback} = "login.pl?action=&login="; - $form->redirect($locale->text('You are logged out!')); - - $lxdebug->leave_sub(); -} +our $form; +our $auth; sub company_logo { - $lxdebug->enter_sub(); - - require "$userspath/$form->{login}.conf"; - $locale = new Locale $myconfig{countrycode}, "login" - unless ($language eq $myconfig{countrycode}); + $main::lxdebug->enter_sub(); - $myconfig{address} =~ s/\\n/
/g; - $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost}; + my %myconfig = %main::myconfig; + $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')); - map { $form->{$_} = $myconfig{$_} } qw(charset stylesheet); + $form->{stylesheet} = $myconfig{stylesheet}; + $form->{title} = $::locale->text('kivitendo'); + $form->{interface} = $::dispatcher->interface_type; + $form->{client} = $::auth->client; + $form->{defaults} = SL::DB::Default->get; - $form->{title} = $locale->text('About'); + my $git = SL::Git->new; + ($form->{git_head}) = $git->get_log(since => 'HEAD~1', until => 'HEAD') if $git->is_git_installation; + $form->{xmas} = '_xmas' if (DateTime->today->month == 12 && DateTime->today->day < 27); + $form->{xmas} = '_mir' if (DateTime->today->month >= 03 && DateTime->today->year == 2022 + && DateTime->today->month <= 09); + $form->{xmas} = '_mir' if (DateTime->today->day == 24 && DateTime->today->month == 2); # create the logo screen - $form->header unless $form->{noheader}; + $form->header() unless $form->{noheader}; - print qq| - -
- - + print $form->parse_html_template('login/company_logo', { version => $::form->read_version }); -| . $locale->text('Licensed to') . qq| -

- -$myconfig{company} -
$myconfig{address} -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
| . $locale->text('User') . qq|$myconfig{name}
| . $locale->text('Dataset') . qq|$myconfig{dbname}
| . $locale->text('Database Host') . qq|$myconfig{dbhost}
http://lx-office.org
info@lx-office.org
- -

+ $main::lxdebug->leave_sub(); +} - - -|; +1; - $lxdebug->leave_sub(); -} +__END__