Revision 3e29b95e
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
26 | 26 |
use constant SESSION_KEY_ROOT_AUTH => 'session_auth_status_root'; |
27 | 27 |
use constant SESSION_KEY_USER_AUTH => 'session_auth_status_user'; |
28 | 28 |
|
29 |
use Rose::Object::MakeMethods::Generic ( |
|
30 |
scalar => [ qw(client) ], |
|
31 |
); |
|
32 |
|
|
33 |
|
|
29 | 34 |
sub new { |
30 | 35 |
$main::lxdebug->enter_sub(); |
31 | 36 |
|
... | ... | |
51 | 56 |
$self->{unique_counter} = 0; |
52 | 57 |
$self->{column_information} = SL::Auth::ColumnInformation->new(auth => $self); |
53 | 58 |
$self->{authenticator}->reset; |
59 |
|
|
60 |
$self->client(undef); |
|
61 |
} |
|
62 |
|
|
63 |
sub set_client { |
|
64 |
my ($self, $id_or_name) = @_; |
|
65 |
|
|
66 |
$self->client(undef); |
|
67 |
|
|
68 |
my $column = $id_or_name =~ m/^\d+$/ ? 'id' : 'name'; |
|
69 |
my $dbh = $self->dbconnect; |
|
70 |
|
|
71 |
return undef unless $dbh; |
|
72 |
|
|
73 |
$self->client($dbh->selectrow_hashref(qq|SELECT * FROM auth.clients WHERE ${column} = ?|, undef, $id_or_name)); |
|
74 |
|
|
75 |
return $self->client; |
|
54 | 76 |
} |
55 | 77 |
|
56 | 78 |
sub get_user_dbh { |
Auch abrufbar als: Unified diff
SL::Auth: Client-Properties aus Auth-DB lesen und in $::auth->client speichern können