Merge branch 'master' of github.com:kivitendo/kivitendo-erp
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 9 Apr 2015 08:23:03 +0000 (10:23 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 9 Apr 2015 08:23:03 +0000 (10:23 +0200)
15 files changed:
.gitignore
SL/Dispatcher.pm
SL/Dispatcher/AuthHandler/Admin.pm
SL/Dispatcher/AuthHandler/None.pm
SL/Dispatcher/AuthHandler/User.pm
SL/Layout/Base.pm
SL/User.pm
config/.gitignore [deleted file]
locale/de/.gitignore [deleted file]
locale/en/.gitignore [deleted file]
templates/.gitignore [deleted file]
users/.gitignore [deleted file]
users/.openoffice.org2/user/config/.gitignore [deleted file]
users/.openoffice.org2/user/psprint/.gitignore [deleted file]
users/.openoffice.org2/user/registry/.gitignore [deleted file]

index 941e1c7..7ade8b1 100644 (file)
@@ -1,16 +1,28 @@
-tags
-crm
-/users/datev-export*
-/users/templates-cache/
-/users/session_files/
-/users/pid/
-/users/.cache/
-/users/kivitendo-print*
-users/.openoffice.org2/
-/config/lx_office.conf
+/config/authentication.pl
+/config/console.conf
 /config/kivitendo.conf
-/doc/online/*/*.html
-pod2html*
+/config/lx-erp-local.conf
+/config/lx_office.conf
 /doc/build/dobudish*
+/doc/online/*/*.html
+/locale/*/missing
+/locale/*/lost
 /spool/*
+/templates/demo*
+/users/*_finanzamt.ini
+/users/.cache/
+/users/.fonts.cache*
+/users/.openoffice.org2/
+/users/.recently-used
+/users/.texmf-var
+/users/console_history
+/users/datev-export*
+/users/kivitendo-print*
+/users/pid/
+/users/session_files/
+/users/templates-cache/
+/users/xvfb_display
 /webdav/*
+crm
+pod2html*
+tags
index 7ce18a4..43d6fa7 100644 (file)
@@ -38,6 +38,7 @@ use SL::Form;
 use SL::Helper::DateTime;
 use SL::InstanceConfiguration;
 use SL::Template::Plugin::HTMLFixes;
+use SL::User;
 
 # Trailing new line is added so that Perl will not add the line
 # number 'die' was called in.
@@ -157,8 +158,8 @@ sub pre_startup_setup {
     $::lxdebug     = LXDebug->new;
     $::auth        = SL::Auth->new;
     $::form        = undef;
-    %::myconfig    = ();
     $::request     = undef;
+    %::myconfig    = User->get_default_myconfig;
   }
 
   $SIG{__WARN__} = sub {
index ebb4a4d..9ef6ef3 100644 (file)
@@ -8,7 +8,7 @@ use SL::Layout::Dispatcher;
 sub handle {
   my ($self, %params) = @_;
 
-  %::myconfig = ();
+  %::myconfig = User->get_default_myconfig;
 
   my $ok =  $::auth->is_api_token_cookie_valid;
   $ok  ||=  $::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::form->{'{AUTH}admin_password'})            == $::auth->OK());
index 255740d..b581b44 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use parent qw(Rose::Object);
 
 sub handle {
-  %::myconfig = ();
+  %::myconfig = User->get_default_myconfig;
   return 1;
 }
 
index 7a8fd1d..a1a5bdc 100644 (file)
@@ -14,7 +14,7 @@ sub handle {
   my $client_id = $::form->{'{AUTH}client_id'} || $::auth->get_session_value('client_id');
   return $self->_error(%param) if !$client_id || !$::auth->set_client($client_id);
 
-  %::myconfig = $::auth->read_user(login => $login);
+  %::myconfig = User->get_default_myconfig($::auth->read_user(login => $login));
 
   return $self->_error(%param) unless $::myconfig{login};
 
index c470a05..a8bf139 100644 (file)
@@ -115,7 +115,6 @@ sub get_stylesheet_for_user {
   } else {
     $css_path = "$css_path/kivitendo";
   }
-  $::myconfig{css_path} = $css_path; # needed for menunew, FIXME: don't do this here
 
   return $css_path;
 }
index f077eef..44efe5c 100644 (file)
@@ -412,4 +412,18 @@ sub data {
   +{ %{ $_[0] } }
 }
 
+sub get_default_myconfig {
+  my ($self_or_class, %user_config) = @_;
+
+  return (
+    countrycode  => 'de',
+    css_path     => 'css',      # Needed for menunew, see SL::Layout::Base::get_stylesheet_for_user
+    dateformat   => 'dd.mm.yy',
+    numberformat => '1.000,00',
+    stylesheet   => 'kivitendo.css',
+    timeformat   => 'hh:mm',
+    %user_config,
+  );
+}
+
 1;
diff --git a/config/.gitignore b/config/.gitignore
deleted file mode 100644 (file)
index 401467c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-lx-erp-local.conf
-authentication.pl
-console.conf
diff --git a/locale/de/.gitignore b/locale/de/.gitignore
deleted file mode 100644 (file)
index ccdb7e2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-missing
-lost
diff --git a/locale/en/.gitignore b/locale/en/.gitignore
deleted file mode 100644 (file)
index ccdb7e2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-missing
-lost
diff --git a/templates/.gitignore b/templates/.gitignore
deleted file mode 100644 (file)
index ab6f884..0000000
+++ /dev/null
@@ -1 +0,0 @@
-demo*
diff --git a/users/.gitignore b/users/.gitignore
deleted file mode 100644 (file)
index 141edb5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-.recently-used
-.fonts.cache*
-*_finanzamt.ini
-xvfb_display
-console_history
-.texmf-var
diff --git a/users/.openoffice.org2/user/config/.gitignore b/users/.openoffice.org2/user/config/.gitignore
deleted file mode 100644 (file)
index 940afb4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-imagecache
diff --git a/users/.openoffice.org2/user/psprint/.gitignore b/users/.openoffice.org2/user/psprint/.gitignore
deleted file mode 100644 (file)
index babcd73..0000000
+++ /dev/null
@@ -1 +0,0 @@
-pspfontcache
diff --git a/users/.openoffice.org2/user/registry/.gitignore b/users/.openoffice.org2/user/registry/.gitignore
deleted file mode 100644 (file)
index 06cf653..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cache