X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAuth.pm;h=e7f8f7bee37403a0de434236f81fdb00031fa807;hb=2508bbb1ab2056ec40635f4dda1c7023a5f3254f;hp=0c8e3b34017720a77ba037003500c2908492ba55;hpb=f633eda2df13cdb685e6bbe3d5b3596bbc317116;p=kivitendo-erp.git diff --git a/SL/Auth.pm b/SL/Auth.pm index 0c8e3b340..e7f8f7bee 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -1,24 +1,21 @@ package SL::Auth; -use constant OK => 0; -use constant ERR_PASSWORD => 1; -use constant ERR_BACKEND => 100; - -use constant SESSION_OK => 0; -use constant SESSION_NONE => 1; -use constant SESSION_EXPIRED => 2; +use DBI; use Digest::MD5 qw(md5_hex); use IO::File; use Time::HiRes qw(gettimeofday); use List::MoreUtils qw(uniq); +use SL::Auth::Constants qw(:all); use SL::Auth::DB; use SL::Auth::LDAP; use SL::User; use SL::DBUtils; +use strict; + sub new { $main::lxdebug->enter_sub(); @@ -140,7 +137,7 @@ sub dbconnect { $dsn .= ';port=' . $cfg->{port}; } - $main::lxdebug->message(LXDebug::DEBUG1, "Auth::dbconnect DSN: $dsn"); + $main::lxdebug->message(LXDebug->DEBUG1, "Auth::dbconnect DSN: $dsn"); $self->{dbh} = DBI->connect($dsn, $cfg->{user}, $cfg->{password}, { 'AutoCommit' => 0 }); @@ -215,7 +212,7 @@ sub create_database { $dsn .= ';port=' . $cfg->{port}; } - $main::lxdebug->message(LXDebug::DEBUG1, "Auth::create_database DSN: $dsn"); + $main::lxdebug->message(LXDebug->DEBUG1(), "Auth::create_database DSN: $dsn"); my $dbh = DBI->connect($dsn, $params{superuser}, $params{superuser_password}); @@ -230,7 +227,7 @@ sub create_database { my $query = qq|CREATE DATABASE "$cfg->{db}" OWNER "$cfg->{user}" TEMPLATE "$params{template}" ENCODING '$encoding'|; - $main::lxdebug->message(LXDebug::DEBUG1, "Auth::create_database query: $query"); + $main::lxdebug->message(LXDebug->DEBUG1(), "Auth::create_database query: $query"); $dbh->do($query); @@ -652,6 +649,7 @@ sub all_rights_full { ["sales_delivery_order_edit", $locale->text("Create and edit sales delivery orders")], ["invoice_edit", $locale->text("Create and edit invoices and credit notes")], ["dunning_edit", $locale->text("Create and edit dunnings")], + ["sales_all_edit", $locale->text("View/edit all employees sales documents")], ["--ap", $locale->text("AP")], ["request_quotation_edit", $locale->text("Create and edit RFQs")], ["purchase_order_edit", $locale->text("Create and edit purchase orders")], @@ -826,7 +824,7 @@ sub evaluate_rights_ary { } } - $main::lxdebug->enter_sub(2); + $main::lxdebug->leave_sub(2); return $value; } @@ -860,7 +858,7 @@ sub _parse_rights_string { pop @stack; if (!@stack) { - $main::lxdebug->enter_sub(2); + $main::lxdebug->leave_sub(2); return 0; } @@ -876,7 +874,7 @@ sub _parse_rights_string { my $result = ($access || (1 < scalar @stack)) ? 0 : evaluate_rights_ary($stack[0]); - $main::lxdebug->enter_sub(2); + $main::lxdebug->leave_sub(2); return $result; }