Changeset 2751
- Timestamp:
- 07/10/08 22:23:01 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-41/lib/MT/Template/ContextHandlers.pm
r2742 r2751 4214 4214 permit user registration. 4215 4215 4216 B<Attributes:> 4217 4218 =over 4 4219 4220 =item * type (optional) 4221 4222 If specified, can be used to test if a particular type of registration 4223 is enabled. The core types include "OpenID", "Vox", "LiveJournal", "TypeKey" 4224 and "MovableType". The identifier is case-insensitive. 4225 4226 =back 4227 4216 4228 =for tags comments 4217 4229 … … 4219 4231 4220 4232 sub _hdlr_reg_allowed { 4221 my ($ctx ) = @_;4233 my ($ctx, $args) = @_; 4222 4234 my $blog = $ctx->stash('blog'); 4223 4235 if ($blog->allow_reg_comments && $blog->commenter_authenticators) { 4236 if (my $type = $args->{type}) { 4237 my %types = map { lc($_) => 1 } 4238 split /,/, $blog->commenter_authenticators; 4239 return $types{lc $type} ? 1 : 0; 4240 } 4224 4241 return 1; 4225 4242 } else { branches/release-41/php/lib/block.mtifregistrationallowed.php
r1174 r2751 9 9 if (!isset($content)) { 10 10 $blog = $ctx->stash('blog'); 11 return $ctx->_hdlr_if($args, $content, $ctx, $repeat, $blog['blog_allow_reg_comments'] && $blog['blog_commenter_authenticators']); 11 $allowed = $blog['blog_allow_reg_comments'] && $blog['blog_commenter_authenticators']; 12 if ($args['type']) 13 $allowed = in_array(strtolower($args['type']), 14 preg_split('/,/', strtolower($blog['blog_commenter_authenticators']))); 15 return $ctx->_hdlr_if($args, $content, $ctx, $repeat, $allowed); 12 16 } else { 13 17 return $ctx->_hdlr_if($args, $content, $ctx, $repeat); 14 18 } 15 19 } 16 ?>
