Changeset 2821
- Timestamp:
- 07/20/08 01:04:38 (1 month ago)
- Files:
-
- branches/release-41/lib/MT/App/Comments.pm (modified) (8 diffs)
- branches/release-41/tmpl/comment/profile.tmpl (modified) (1 diff)
- branches/release-41/tmpl/comment/register.tmpl (modified) (1 diff)
- branches/release-41/tmpl/comment/signup.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-41/lib/MT/App/Comments.pm
r2749 r2821 29 29 signup => \&signup, 30 30 do_signup => \&do_signup, 31 register => \®ister,31 # register => \®ister, 32 32 do_register => \&do_register, 33 33 preview => \&preview, … … 294 294 my $param = {}; 295 295 $param->{$_} = $app->param($_) foreach qw(blog_id entry_id static username return_url ); 296 my $blog = $app->model('blog')->load( $param->{blog_id} )296 my $blog = $app->model('blog')->load( $param->{blog_id} || 0 ) 297 297 or return $app->error($app->translate('Can\'t load blog #[_1].', $param->{blog_id})); 298 298 my $cfg = $app->config; … … 315 315 my $q = $app->param; 316 316 317 return $app->error( $app->translate("Invalid request") ) 318 if $app->request_method() ne 'POST'; 319 317 320 my $param = {}; 318 321 $param->{$_} = $q->param($_) … … 320 323 qw(blog_id entry_id static email url username nickname email hint return_url ); 321 324 322 my $user = $app->create_user_pending($param); 325 my $filter_result = $app->run_callbacks( 'api_save_filter.author', $app ); 326 327 my $user; 328 $user = $app->create_user_pending($param) if $filter_result; 323 329 unless ($user) { 324 330 my $blog = $app->model('blog')->load( $param->{blog_id} ) … … 328 334 } 329 335 $param->{error} = $app->errstr; 336 $param->{ 'auth_mode_' . $app->config->AuthenticationModule } = 1; 330 337 return $app->build_page( 'signup.tmpl', $param ); 331 338 } 339 340 ## Assign default role 341 $user->add_default_roles; 342 343 my $original = $user->clone(); 344 $app->run_callbacks( 'api_post_save.author', $app, $user, $original ); 332 345 333 346 ## Send confirmation email in the background. … … 1668 1681 my $q = $app->param; 1669 1682 1683 return $app->error( $app->translate("Invalid request") ) 1684 if $app->request_method() ne 'POST'; 1685 1670 1686 my ( $sess_obj, $cmntr ) = $app->get_commenter_session(); 1671 1687 return $app->handle_error( $app->translate('Invalid login') ) … … 1680 1696 $app->user($cmntr); 1681 1697 $app->{session} = $sess_obj; 1698 my $original = $cmntr->clone(); 1682 1699 1683 1700 $app->validate_magic … … 1713 1730 if $param{password} && !$param{external_auth}; 1714 1731 if ( $cmntr->save ) { 1732 $app->run_callbacks( 'api_post_save.author', $app, $cmntr, $original ); 1733 1715 1734 $param{saved} = 1716 1735 $app->translate('Commenter profile has successfully been updated.'); branches/release-41/tmpl/comment/profile.tmpl
r2784 r2821 89 89 </mtapp:setting> 90 90 91 <mt:Loop name="field_loop"> 92 <mt:If name="__first__"> 93 <input type="hidden" name="_type" value="author" id="obj_type" /> 94 <input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" /> 95 </mt:If> 96 <!-- start-customfield_<$mt:Var name="basename"$> --> 97 <mtapp:setting 98 id="$field_id" 99 label="$name" 100 hint="$description" 101 shown="$show_field" 102 show_hint="$show_hint" 103 required="$required"> 104 105 <$mt:Var name="field_html"$> 106 107 </mtapp:setting> 108 <!-- end-customfield_<$mt:Var name="basename"$> --> 109 </mt:Loop> 110 91 111 <p><input type="submit" name="submit" id="save-button" class="ti" accesskey="s" value="<__trans phrase="Save">" /></p> 92 112 branches/release-41/tmpl/comment/register.tmpl
r2088 r2821 87 87 </mtapp:setting> 88 88 89 <mt:Loop name="field_loop"> 90 <mt:If name="__first__"> 91 <input type="hidden" name="_type" value="author" id="obj_type" /> 92 <input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" /> 93 </mt:If> 94 <!-- start-customfield_<$mt:Var name="basename"$> --> 95 <mtapp:setting 96 id="$field_id" 97 label="$name" 98 hint="$description" 99 shown="$show_field" 100 show_hint="$show_hint" 101 required="$required"> 102 103 <$mt:Var name="field_html"$> 104 105 </mtapp:setting> 106 <!-- end-customfield_<$mt:Var name="basename"$> --> 107 </mt:Loop> 108 89 109 <div class="actions-bar"> 90 110 <div class="actions-bar-inner pkg actions"> branches/release-41/tmpl/comment/signup.tmpl
r2146 r2821 103 103 </mt:if> 104 104 105 <mt:Loop name="field_loop"> 106 <mt:If name="__first__"> 107 <input type="hidden" name="_type" value="author" id="obj_type" /> 108 <input type="hidden" name="customfield_beacon" value="1" id="customfield_beacon" /> 109 </mt:If> 110 <!-- start-customfield_<$mt:Var name="basename"$> --> 111 <mtapp:setting 112 id="$field_id" 113 label="$name" 114 hint="$description" 115 shown="$show_field" 116 show_hint="$show_hint" 117 required="$required"> 118 119 <$mt:Var name="field_html"$> 120 121 </mtapp:setting> 122 <!-- end-customfield_<$mt:Var name="basename"$> --> 123 </mt:Loop> 124 105 125 <div class="actions-bar"> 106 126 <div class="actions-bar-inner pkg actions">
