[Jifty-commit] r6028 - in jifty/trunk/lib/Jifty/Plugin/Authentication: .

Jifty commits jifty-commit at lists.jifty.org
Sat Nov 22 08:26:34 EST 2008


Author: clkao
Date: Sat Nov 22 08:26:34 2008
New Revision: 6028

Modified:
   jifty/trunk/lib/Jifty/Plugin/Authentication/Password.pm
   jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm

Log:
option for auth::password plugin not to append login/signup into navmenu.

Modified: jifty/trunk/lib/Jifty/Plugin/Authentication/Password.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Authentication/Password.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/Authentication/Password.pm	Sat Nov 22 08:26:34 2008
@@ -4,6 +4,8 @@
 package Jifty::Plugin::Authentication::Password;
 use base qw/Jifty::Plugin/;
 
+__PACKAGE__->mk_accessors(qw(nav_menu));
+
 =head1 NAME
 
 Jifty::Plugin::Authentication::Password - password authentication plugin
@@ -39,6 +41,20 @@
     return ('User', 'LetMe');
 }
 
+=head2 init 
+
+=cut
+
+sub init {
+    my $self = shift;
+    return if $self->_pre_init;
+
+    my %opt  = ( nav_menu => 1,
+                 @_ );
+
+    $self->nav_menu( $opt{nav_menu} );
+}
+
 =head1 SEE ALSO
 
 L<Jifty::Manual::AccessControl>, L<Jifty::Plugin::User>, L<Jifty::Plugin::LetMe>, L<Jifty::Plugin::Authentication::Password::Mixin::Model::User>

Modified: jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm	Sat Nov 22 08:26:34 2008
@@ -37,6 +37,11 @@
 =cut
 
 before '*' =>  run {
+    my ($ap) = Jifty->find_plugin('Jifty::Plugin::Authentication::Password')
+        or return;
+
+    return unless $ap->nav_menu;
+
     if ( Jifty->web->current_user->id ) {
         logged_in_nav();
     } else {


More information about the Jifty-commit mailing list