| MetaStore documentation | Contained in the MetaStore distribution. |
MetaStore::IsAuthed - WebDAO component for check current user.
...
<regclass class="MetaStore::IsAuthed" alias="isauth"/>
<object class="isauth" id="auth_switch1">
<auth>
<object class="man" id="manager">1</object>
</auth>
<noauth>
<object class="main" id="page"/>
</noauth>
...
WebDAO component for check current user.
MetaStore, WebDAO::Element, README
Zahatski Aliaksandr, <zag@cpan.org>
Copyright (C) 2006 by Zahatski Aliaksandr
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
| MetaStore documentation | Contained in the MetaStore distribution. |
package MetaStore::IsAuthed;
use Data::Dumper; use strict; use warnings; use base qw(WebDAO::Element); __PACKAGE__->attributes qw/ __init /; sub init { my $self = shift; my %arg = @_; $self->__init( \%arg ); } sub __get_self_refs { my $self = shift; #get user my %args = %{ $self->__init }; return $self->getEngine->_auth->is_authed ? $args{auth} : $args{noauth}; } 1; __END__