Changeset 82

Show
Ignore:
Timestamp:
04/07/05 01:36:54
Author:
brad
Message:

Conditionally provide author parameters to template pages based on whether user is logged in or not.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plugins/spamlookup/mt-spamlookup.cgi

    r79 r82  
    845845    my($file, $param) = @_; 
    846846    $param->{sql} = 1 unless ref(MT::Object->driver) eq 'MT::ObjectDriver::DBM'; 
    847     if (defined $plugins::jayseae::moderate::VERSION) { 
    848         $param->{can_moderate_pings} = 1; 
    849     } 
    850     $param->{author_id} = $app->{author}->id; 
    851     $param->{author_name} = $app->{author}->name; 
    852     $param->{can_configure} = $app->{author}->can_create_blog; 
    853     $param->{can_view_log} = $app->{author}->can_view_log; 
     847    if ($app->{author}) { 
     848        $param->{author_id} = $app->{author}->id; 
     849        $param->{author_name} = $app->{author}->name; 
     850        $param->{can_configure} = $app->{author}->can_create_blog; 
     851        $param->{can_view_log} = $app->{author}->can_view_log; 
     852        if (defined $plugins::jayseae::moderate::VERSION) { 
     853            $param->{can_moderate_pings} = 1; 
     854        } 
     855    } 
    854856    $app->SUPER::build_page($file, $param); 
    855857}