From: Moritz Bunkus Date: Wed, 12 Jun 2013 15:15:39 +0000 (+0200) Subject: Versionsanzeige im Adminlogin nach forçiertem Logout fixen X-Git-Tag: release-3.1.0beta1~331^2~27 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d3160c04203753f81f6a8ce5321997b726312caf;p=kivitendo-erp.git Versionsanzeige im Adminlogin nach forçiertem Logout fixen --- diff --git a/SL/Controller/Admin.pm b/SL/Controller/Admin.pm index c1b2ec1e8..5fdc308fc 100644 --- a/SL/Controller/Admin.pm +++ b/SL/Controller/Admin.pm @@ -455,7 +455,7 @@ sub use_multiselect_js { sub login_form { my ($self, %params) = @_; $::request->layout->focus('#admin_password'); - $self->render('admin/adminlogin', title => t8('kivitendo v#1 administration', $::form->{version}), %params); + $self->render('admin/adminlogin', title => t8('kivitendo v#1 administration', $::form->read_version), %params); } sub edit_user_form { diff --git a/SL/Form.pm b/SL/Form.pm index 330799766..8a82587e9 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -86,6 +86,17 @@ sub disconnect_standard_dbh { undef $standard_dbh; } +sub read_version { + my ($self) = @_; + + open VERSION_FILE, "VERSION"; # New but flexible code reads version from VERSION-file + my $version = ; + $version =~ s/[^0-9A-Za-z\.\_\-]//g; # only allow numbers, letters, points, underscores and dashes. Prevents injecting of malicious code. + close VERSION_FILE; + + return $version; +} + sub new { $main::lxdebug->enter_sub(); @@ -101,10 +112,7 @@ sub new { bless $self, $type; - open VERSION_FILE, "VERSION"; # New but flexible code reads version from VERSION-file - $self->{version} = ; - close VERSION_FILE; - $self->{version} =~ s/[^0-9A-Za-z\.\_\-]//g; # only allow numbers, letters, points, underscores and dashes. Prevents injecting of malicious code. + $self->{version} = $self->read_version; $main::lxdebug->leave_sub();