Changeset 2393 for branches/release-38/lib/MT/App/Comments.pm
- Timestamp:
- 05/19/08 19:10:48 (19 months ago)
- Files:
-
- 1 modified
-
branches/release-38/lib/MT/App/Comments.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-38/lib/MT/App/Comments.pm
r2377 r2393 114 114 my $session_key; 115 115 116 if (my $blog_id = $q->param('blog_id')) { 117 if (my $blog = MT::Blog->load($blog_id)) { 118 my $auths = $blog->commenter_authenticators || ''; 119 if ( $auths =~ /MovableType/ ) { 120 # First, check for a real MT user login. If one exists, 121 # return that as the commenter identity 122 my ($user, $first_time) = $app->SUPER::login(); 123 if ( $user ) { 124 my $sess = $app->session; 125 return ( $sess->id, $user ); 126 } 116 my $blog = $app->blog; 117 if ($blog) { 118 my $auths = $blog->commenter_authenticators || ''; 119 if ( $auths =~ /MovableType/ ) { 120 # First, check for a real MT user login. If one exists, 121 # return that as the commenter identity 122 my ($user, $first_time) = $app->SUPER::login(); 123 if ( $user ) { 124 my $sess = $app->session; 125 return ( $sess->id, $user ); 127 126 } 128 127 } … … 149 148 ) 150 149 { 151 $app->log("session is invalid; sess_obj = $sess_obj; key = $session_key; user_id = $user_id; user = $user");152 150 $app->_invalidate_commenter_session( \%cookies ); 153 151 return ( undef, undef ); … … 858 856 return $app->handle_error( 859 857 $app->translate("Comment text is required.") ); 858 } 859 860 # validate session parameter 861 if ( my $sid = $q->param('sid') ) { 862 my ( $session, $commenter ) = $app->_get_commenter_session(); 863 if ( $session && $commenter && ( $session eq $sid ) ) { 864 # well, everything is okay 865 } else { 866 return $app->handle_error( 867 $app->translate("Your session has expired. Please sign in again to comment.") 868 ); 869 } 860 870 } 861 871 … … 1446 1456 if ( $blog_id && $blog ) { 1447 1457 my ( $session, $commenter ) = $app->_get_commenter_session(); 1448 use Data::Dumper;1449 1458 if ( $session && $commenter ) { 1450 1459 my $blog_perms = $commenter->blog_perm($blog_id); … … 1467 1476 my $can_post = ($blog_perms && $blog_perms->can_create_post) ? "1" : "0"; 1468 1477 $c = { 1478 sid => $sessobj->id, 1469 1479 name => $commenter->nickname, 1470 1480 url => $commenter->url,
