svnno****@sourc*****
svnno****@sourc*****
2008年 11月 21日 (金) 14:04:58 JST
Revision: 832 http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=832 Author: tach Date: 2008-11-21 14:04:58 +0900 (Fri, 21 Nov 2008) Log Message: ----------- * Fix to show correct error message on new user creation * Add to set more messaging preferences on new user creation Modified Paths: -------------- slashjp/branches/2.5.0.192/debian/changelog slashjp/branches/2.5.0.192/plugins/Login/login.pl -------------- next part -------------- Modified: slashjp/branches/2.5.0.192/debian/changelog =================================================================== --- slashjp/branches/2.5.0.192/debian/changelog 2008-11-20 11:10:17 UTC (rev 831) +++ slashjp/branches/2.5.0.192/debian/changelog 2008-11-21 05:04:58 UTC (rev 832) @@ -16,8 +16,10 @@ * Fix previewSlashbox layout to use template "previewSlashbox;users;default" * Add some wiki page to wikicontents redirection * Fix for invalid form input at Slash/Utility/Environment/Environment.pm + * Fix to show correct error message on new user creation + * Add to set more messaging preferences on new user creation - -- Taku YASUI <tach****@osdn*****> Wed, 19 Nov 2008 08:47:10 +0000 + -- Taku YASUI <tach****@osdn*****> Fri, 21 Nov 2008 05:03:49 +0000 slash (2.5.0.192-20) unstable; urgency=low Modified: slashjp/branches/2.5.0.192/plugins/Login/login.pl =================================================================== --- slashjp/branches/2.5.0.192/plugins/Login/login.pl 2008-11-20 11:10:17 UTC (rev 831) +++ slashjp/branches/2.5.0.192/plugins/Login/login.pl 2008-11-21 05:04:58 UTC (rev 832) @@ -68,18 +68,42 @@ sub newUser { my($slashdb, $reader, $constants, $user, $form) = @_; - if (my $error = _validFormkey(qw(max_post_check valid_check formkey_check), 1)) { - return newUserForm(@_, $error); - } + #if (my $error = _validFormkey(qw(max_post_check valid_check formkey_check), 1)) { + # return newUserForm(@_, $error); + #} my $plugins = $slashdb->getDescriptions('plugins'); my @note; my $error = 0; + my $nc = $constants->{nick_chars} || join('', 'a' .. 'z'); + my $nr = $constants->{nick_regex} || '^[a-z]$'; + my $ns = $constants->{nick_regex_start} || '[a-zA-Z_]'; # check if new nick is OK and if user exists my $newnick = nickFix($form->{newusernick}); my $matchname = nick2matchname($newnick); + + if ($form->{newusernick} !~ /^$ns/) { + push @note, getData('nick_starts_unavailable_chars'); + $error = 1; + } + + if ($form->{newusernick} =~ /\s{2,}/) { + push @note, getData('nick_has_continuous_whitespace'); + $error = 1; + } + + if ($form->{newusernick} !~ /^[$nc]+$/) { + push @note, getData('nick_has_unavailable_chars'); + $error = 1; + } + + if (length($form->{newusernick}) > $constants->{nick_maxlen}) { + push @note, getData('nick_is_too_long'); + $error = 1; + } + if (!$newnick) { push @note, getData('nick_invalid'); $error = 1; @@ -135,7 +159,7 @@ ? strip_nohtml($form->{pubkey}, 1) : ''; - if ($form->{newsletter} || $form->{comment_reply} || $form->{headlines}) { + if (1) { my $messages = getObject('Slash::Messages'); my %params; $params{MSG_CODE_COMMENT_REPLY()} = MSG_MODE_EMAIL() @@ -144,6 +168,16 @@ if $form->{newsletter}; $params{MSG_CODE_HEADLINES()} = MSG_MODE_EMAIL() if $form->{headlines}; + $params{MSG_CODE_ZOO_CHANGE()} = MSG_MODE_EMAIL() + if $form->{zoo_change}; + $params{MSG_CODE_M2()} = MSG_MODE_EMAIL() + if $form->{m2}; + $params{MSG_CODE_COMMENT_MODERATE()} = MSG_MODE_EMAIL() + if $form->{comment_moderate}; + $params{MSG_CODE_JOURNAL_FRIEND()} = MSG_MODE_EMAIL() + if $form->{journal_friend}; + $params{MSG_CODE_JOURNAL_REPLY()} = MSG_MODE_EMAIL() + if $form->{journal_reply}; $messages->setPrefs($uid, \%params); }