Revision 4531a6c7
Von Sven Schöling vor mehr als 12 Jahren hinzugefügt
SL/User.pm | ||
---|---|---|
49 | 49 |
sub new { |
50 | 50 |
$main::lxdebug->enter_sub(); |
51 | 51 |
|
52 |
my ($type, $login) = @_;
|
|
52 |
my ($type, %params) = @_;
|
|
53 | 53 |
|
54 | 54 |
my $self = {}; |
55 | 55 |
|
56 |
if ($login ne "") {
|
|
57 |
my %user_data = $main::auth->read_user($login);
|
|
56 |
if ($params{id} || $params{login}) {
|
|
57 |
my %user_data = $main::auth->read_user(%params);
|
|
58 | 58 |
map { $self->{$_} = $user_data{$_} } keys %user_data; |
59 | 59 |
} |
60 | 60 |
|
... | ... | |
102 | 102 |
my $rc = -3; |
103 | 103 |
|
104 | 104 |
if ($self->{login}) { |
105 |
my %myconfig = $main::auth->read_user($self->{login}); |
|
105 |
my %myconfig = $main::auth->read_user(login => $self->{login});
|
|
106 | 106 |
|
107 | 107 |
# check if database is down |
108 | 108 |
my $dbh = SL::DBConnect->connect($myconfig{dbconnect}, $myconfig{dbuser}, $myconfig{dbpasswd}) |
... | ... | |
787 | 787 |
$main::lxdebug->leave_sub(); |
788 | 788 |
} |
789 | 789 |
|
790 |
sub data { |
|
791 |
+{ %{ $_[0] } } |
|
792 |
} |
|
793 |
|
|
790 | 794 |
1; |
791 | 795 |
|
Auch abrufbar als: Unified diff
Usermaske im Adminbereich vor logins aus sessions geschützt.
Notwendigerweise zusätzlich User->new und Auth->read_user auf %params
umgeschrieben.