[dw-free] Require (and store) birthdate on account creation
[commit: http://hg.dwscoalition.org/dw-free/rev/0ad52dde2d7a]
http://bugs.dwscoalition.org/show_bug.cgi?id=156
* Require birthdate on account creation
* Don't allow people under 13 to create accounts
* Remove all underage-related code as it's not going to be used
* Remove minor (under 14)-related code as it's not going to be used (bug 561
will do more related to this)
Patch by
juliet.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=156
* Require birthdate on account creation
* Don't allow people under 13 to create accounts
* Remove all underage-related code as it's not going to be used
* Remove minor (under 14)-related code as it's not going to be used (bug 561
will do more related to this)
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/maint/clean_caches.pl
- bin/upgrading/en.dat
- bin/upgrading/proplists.dat
- bin/worker/ljtalk-gm
- cgi-bin/Apache/LiveJournal.pm
- cgi-bin/DW/Logic/ProfilePage.pm
- cgi-bin/DW/Worker/PaidStatus.pm
- cgi-bin/LJ/Comment.pm
- cgi-bin/LJ/ConfCheck/General.pm
- cgi-bin/LJ/Console/Command.pm
- cgi-bin/LJ/Console/Command/Finduser.pm
- cgi-bin/LJ/Console/Command/SetUnderage.pm
- cgi-bin/LJ/PageStats.pm
- cgi-bin/LJ/Setting/UserMessaging.pm
- cgi-bin/LJ/Setting/ViewingAdultContent.pm
- cgi-bin/LJ/User.pm
- cgi-bin/LJ/Widget/CreateAccount.pm
- cgi-bin/ljcapabilities.pl
- cgi-bin/ljdefaults.pl
- cgi-bin/ljprotocol.pl
- cgi-bin/talklib.pl
- cgi-bin/weblib.pl
- doc/raw/build/ljconfig/ljconfig2db.pl
- doc/raw/lj.book/admin/console.ref.gen.xml
- doc/raw/lj.book/features/support.xml
- etc/config.pl
- htdocs/community/create.bml
- htdocs/editjournal.bml
- htdocs/editpics.bml
- htdocs/js/widgets/createaccount.js
- htdocs/manage/profile/index.bml
- htdocs/manage/profile/index.bml.text
- htdocs/manage/pubkey.bml
- htdocs/register.bml
- htdocs/stc/widgets/createaccount.css
- htdocs/support/see_request.bml
- htdocs/support/see_request.bml.text
- htdocs/update.bml
- t/birthday.t
- t/console-setunderage.t
- t/underage.t
-------------------------------------------------------------------------------- diff -r 91128c403d5e -r 0ad52dde2d7a bin/maint/clean_caches.pl --- a/bin/maint/clean_caches.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/bin/maint/clean_caches.pl Sun Mar 29 00:08:41 2009 +0000 @@ -20,7 +20,7 @@ print "-I- Cleaning commenturl.\n"; $dbh->do("DELETE FROM commenturls WHERE timecreate < UNIX_TIMESTAMP() - 86400*30 LIMIT 50000"); - if ($LJ::COPPA_CHECK && $LJ::UNIQ_COOKIES) { + if ($LJ::UNIQ_COOKIES) { print "-I- Cleaning underage uniqs.\n"; $dbh->do("DELETE FROM underage WHERE timeof < (UNIX_TIMESTAMP() - 86400*90) LIMIT 2000"); } diff -r 91128c403d5e -r 0ad52dde2d7a bin/upgrading/en.dat --- a/bin/upgrading/en.dat Sat Mar 28 14:17:36 2009 +0000 +++ b/bin/upgrading/en.dat Sun Mar 29 00:08:41 2009 +0000 @@ -3408,6 +3408,8 @@ widget.createaccount.btn=Create Account widget.createaccount.error.birthdate.invalid=You must enter a valid birthdate. +widget.createaccount.error.birthdate.underage=You must be over 13 to create an account. + widget.createaccount.error.cannotcreate=There was an error creating your account. widget.createaccount.error.captcha.invalid=Invalid answer to previous challenge. Try another. @@ -3456,7 +3458,7 @@ widget.createaccount.field.username.avai widget.createaccount.tip.birthdate=Required by law. No worries, you can set privacy on this after you're done creating an account. -widget.createaccount.tip.birthdate2=Required by law. By default, we only display the month and day. +widget.createaccount.tip.birthdate2=Required by law. You must put your real birthdate (you can change it after account creation if you want to). By default, we only display the month and day. widget.createaccount.tip.captcha=If you can't read the text, type "audio" to take a sound test instead. diff -r 91128c403d5e -r 0ad52dde2d7a bin/upgrading/proplists.dat --- a/bin/upgrading/proplists.dat Sat Mar 28 14:17:36 2009 +0000 +++ b/bin/upgrading/proplists.dat Sun Mar 29 00:08:41 2009 +0000 @@ -1102,14 +1102,6 @@ userproplist.trusted_s1: multihomed: 0 prettyname: Trusted S1 Styles -userproplist.underage_status: - cldversion: 4 - datatype: char - des: Notes about underage status; Y: underage due to birthday; C: underage due to cookie. - indexed: 0 - multihomed: 0 - prettyname: Underage Status - userproplist.url: cldversion: 4 datatype: char diff -r 91128c403d5e -r 0ad52dde2d7a bin/worker/ljtalk-gm --- a/bin/worker/ljtalk-gm Sat Mar 28 14:17:36 2009 +0000 +++ b/bin/worker/ljtalk-gm Sun Mar 29 00:08:41 2009 +0000 @@ -304,32 +304,26 @@ sub _avatar_want { } my $vcard_data; - if ($u->underage) { - # we can't release any info if the user is underage - $vcard_data = qq{<NICKNAME>$u->{user}</NICKNAME>}; - } else { - $u->preload_props(qw(city state zip country url )); + $u->preload_props(qw(city state zip country url )); + $vcard_data = '<NICKNAME>' . LJ::exml($u->{user}) . '</NICKNAME>'; + $vcard_data .= '<N><GIVEN>' . LJ::exml($u->{name}) . '</GIVEN></N>' if($u->{name}); + $vcard_data .= ("<URL>" . ( $u->prop('url') ? LJ::exml($u->prop('url')) : ( $u->journal_base . '/') ) . "</URL>"); - $vcard_data = '<NICKNAME>' . LJ::exml($u->{user}) . '</NICKNAME>'; - $vcard_data .= '<N><GIVEN>' . LJ::exml($u->{name}) . '</GIVEN></N>' if($u->{name}); - $vcard_data .= ("<URL>" . ( $u->prop('url') ? LJ::exml($u->prop('url')) : ( $u->journal_base . '/') ) . "</URL>"); + if (my $bday = $u->bday_string) { + $bday = "0000-$bday" unless $bday =~ /\d\d\d\d/; + $vcard_data .= qq{<BDAY>$bday</BDAY>}; + } - if (my $bday = $u->bday_string) { - $bday = "0000-$bday" unless $bday =~ /\d\d\d\d/; - $vcard_data .= qq{<BDAY>$bday</BDAY>}; - } + if ($u->can_show_location && + ($u->prop('city') || $u->prop('state') || $u->prop('country') || $u->prop('zip') )) { + $vcard_data .= '<ADR>'; + $vcard_data .= '<CTRY>' . LJ::exml($u->prop('country')) . '</CTRY>' if $u->prop('country'); + $vcard_data .= '<PCODE>' . LJ::exml($u->prop('zip')) . '</PCODE>' if $u->prop('zip'); + $vcard_data .= '<REGION>' . LJ::exml($u->prop('state')) . '</REGION>' if $u->prop('state'); + $vcard_data .= '<LOCALITY>' . LJ::exml($u->prop('city')) . '</LOCALITY>' if $u->prop('city'); + $vcard_data .= '</ADR>'; - if ($u->can_show_location && - ($u->prop('city') || $u->prop('state') || $u->prop('country') || $u->prop('zip') )) { - $vcard_data .= '<ADR>'; - $vcard_data .= '<CTRY>' . LJ::exml($u->prop('country')) . '</CTRY>' if $u->prop('country'); - $vcard_data .= '<PCODE>' . LJ::exml($u->prop('zip')) . '</PCODE>' if $u->prop('zip'); - $vcard_data .= '<REGION>' . LJ::exml($u->prop('state')) . '</REGION>' if $u->prop('state'); - $vcard_data .= '<LOCALITY>' . LJ::exml($u->prop('city')) . '</LOCALITY>' if $u->prop('city'); - $vcard_data .= '</ADR>'; - - } } my $vcard = qq{<vCard xmlns='vcard-temp'> diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/Apache/LiveJournal.pm --- a/cgi-bin/Apache/LiveJournal.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/Apache/LiveJournal.pm Sun Mar 29 00:08:41 2009 +0000 @@ -493,7 +493,7 @@ sub trans # logged in users with defined ages are blocked from content that's above their age level # logged in users without defined ages and logged out users are given confirmation pages (unless they have already confirmed) if ($remote) { - if (($adult_content eq "explicit" && $remote->is_minor) || ($adult_content eq "concepts" && $remote->is_child)) { + if ($adult_content eq "explicit" && $remote->is_minor) { return $bml_handler->(LJ::ContentFlag->adult_interstitial_path(type => "${adult_content}_blocked")); } elsif (!$remote->best_guess_age && !$cookie) { return $bml_handler->(LJ::ContentFlag->adult_interstitial_path(type => $adult_content)); diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/DW/Logic/ProfilePage.pm --- a/cgi-bin/DW/Logic/ProfilePage.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/DW/Logic/ProfilePage.pm Sun Mar 29 00:08:41 2009 +0000 @@ -310,7 +310,7 @@ sub _basic_info_display_name { text => "<img src='$LJ::IMGPREFIX/xml.gif' width='36' height='14' align='absmiddle' border='0' alt=\"" . LJ::Lang::ml( '.syn.xml' ) . "\" /></a>", }; } else { - unless ( $u->underage || $name eq $u->prop( 'journaltitle' ) ) { + unless ( $name eq $u->prop( 'journaltitle' ) ) { $ret->[0] = LJ::Lang::ml( '.label.name' ); $ret->[1] = $name; } diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/DW/Worker/PaidStatus.pm --- a/cgi-bin/DW/Worker/PaidStatus.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/DW/Worker/PaidStatus.pm Sun Mar 29 00:08:41 2009 +0000 @@ -92,8 +92,6 @@ EOF password => $pw, get_ljnews => 1, inviter => $pmt->{from_userid} ? LJ::load_userid( $pmt->{from_userid} ) : undef, - underage => 0, - ofage => 1, ); LJ::send_mail( { diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/Comment.pm --- a/cgi-bin/LJ/Comment.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/Comment.pm Sun Mar 29 00:08:41 2009 +0000 @@ -897,10 +897,9 @@ sub user_can_edit { $$errref = LJ::Lang::ml('talk.error.cantedit.invalid'); return 0 unless $self && $self->valid; - # comment editing must be enabled and the user can't be underage and must have the cap + # comment editing must be enabled and the user must have the cap $$errref = LJ::Lang::ml('talk.error.cantedit'); return 0 unless LJ::is_enabled("edit_comments"); - return 0 if $u->underage; return 0 unless $u->get_cap("edit_comments"); # entry cannot be suspended diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/ConfCheck/General.pm --- a/cgi-bin/LJ/ConfCheck/General.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/ConfCheck/General.pm Sun Mar 29 00:08:41 2009 +0000 @@ -114,12 +114,6 @@ add_conf('@COOKIE_DOMAIN_RESET', required => 0, des => "Array of cookie domain values to send when deleting cookies from users. Only useful when changing domains, and even then kinda useless.", STUPID_BECAUSE => "ancient hack for one old specific use", - ); - -add_conf('$COPPA_CHECK', - required => 0, - type => "bool", - des => "If set, new users are asked for their birthday for COPPA compliance.", ); add_conf('$DB_LOG_HOST', @@ -454,10 +448,6 @@ add_conf('$TOOLS_RECENT_COMMENTS_MAX', add_conf('$TOOLS_RECENT_COMMENTS_MAX', type => 'int', des => "Number of recent comments to show on /tools/recent_comments.bml"); - -add_conf('$UNDERAGE_ERROR', - type => 'html', - des => "Error message to show underage users."); add_conf('$USE_ADS', type => 'int', diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/Console/Command.pm --- a/cgi-bin/LJ/Console/Command.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/Console/Command.pm Sun Mar 29 00:08:41 2009 +0000 @@ -115,9 +115,6 @@ sub execute_safely { return $cmd->error("Your account status prevents you from using the console.") if $cmd->requires_remote && !$remote->is_visible; - return $cmd->error("Underage users are not permitted to use the console.") - if $cmd->requires_remote && $remote->underage; - return $cmd->error("You are not authorized to run this command.") unless $cmd->can_execute; diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/Console/Command/Finduser.pm --- a/cgi-bin/LJ/Console/Command/Finduser.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/Console/Command/Finduser.pm Sun Mar 29 00:08:41 2009 +0000 @@ -97,18 +97,6 @@ sub execute { $self->info(" User is currently in read-only mode.") if $u->readonly; - if ($u->underage) { - my $reason; - if ($u->underage_status eq 'M') { - $reason = "manual set (see statushistory type set_underage)"; - } elsif ($u->underage_status eq 'Y') { - $reason = "provided birthdate"; - } elsif ($u->underage_status eq 'O') { - $reason = "unique cookie"; - } - $self->info(" User is marked underage due to $reason"); - } - $self->info(" Last updated: " . ($timeupdate->{$userid} ? LJ::time_to_http($timeupdate->{$userid}) : "Never")) if $opt eq 'timeupdate'; diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/Console/Command/SetUnderage.pm --- a/cgi-bin/LJ/Console/Command/SetUnderage.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/Console/Command/SetUnderage.pm Sun Mar 29 00:08:41 2009 +0000 @@ -1,64 +0,0 @@ -package LJ::Console::Command::SetUnderage; - -use strict; -use base qw(LJ::Console::Command); -use Carp qw(croak); - -sub cmd { "set_underage" } - -sub desc { "Change an account's underage status." } - -sub args_desc { [ - 'user' => "The username of the journal to mark/unmark", - 'state' => "Either 'on' (to mark as being underage) or 'off' (to unmark)", - 'reason' => "Required information about why you are setting this status.", - ] } - -sub usage { '<user> <state> <reason>' } - -sub can_execute { - my $remote = LJ::get_remote(); - return LJ::check_priv($remote, "siteadmin", "underage"); -} - -sub execute { - my ($self, $user, $state, $reason, @args) = @_; - - return $self->error("This command takes three arguments. Consult the reference.") - unless $user && $state && $reason && scalar(@args) == 0; - - my $u = LJ::load_user($user); - return $self->error("Invalid user: $user") - unless $u; - return $self->error("Account is not a personal account.") - unless $u->is_person; - - return $self->error("Second argument must be 'on' or 'off'.") - unless $state =~ /^(?:on|off)/; - my $on = ($state eq "on") ? 1 : 0; - - return $self->error("User is already marked as underage.") - if $on && $u->underage; - return $self->error("User is not currently marked as underage.") - if !$on && !$u->underage; - - my ($status, $msg); - if ($on) { - $status = 'M'; # "M"anually turned on - $self->print("User marked as underage."); - $msg = "marked; $reason"; - } else { - $status = undef; # no status change - $self->print("User no longer marked as underage."); - $msg = "unmarked; $reason"; - } - - # now record this change (yes, we log it twice) - my $remote = LJ::get_remote(); - LJ::statushistory_add($u, $remote, "set_underage", $msg); - $u->underage($on, $status, "manual"); - - return 1; -} - -1; diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/PageStats.pm --- a/cgi-bin/LJ/PageStats.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/PageStats.pm Sun Mar 29 00:08:41 2009 +0000 @@ -37,16 +37,14 @@ sub render { return "<div id='hello-world' style='text-align: left; font-size:0; line-height:0; height:0; overflow:hidden;'>$output</div>"; } -# method on root object (LJ::PageStats instance) to decide if user has optted-out of page -# stats tracking, or if it's a bad idea to show one to this user (underage). but -# this isn't pagestat-specific logic. that's in the "should_render" method. +# method on root object (LJ::PageStats instance) to decide if user has +# opted-out of page stats tracking. Note: this isn't pagestat-specific logic. +# that's in the "should_render" method. sub should_do_pagestats { my $self = shift; my $u = $self->get_user; - # Make sure the user isn't underage or said no to tracking - return 0 if $u && $u->underage; return 0 if $u && $u->prop('opt_exclude_stats'); return 1; } diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/Setting/UserMessaging.pm --- a/cgi-bin/LJ/Setting/UserMessaging.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/Setting/UserMessaging.pm Sun Mar 29 00:08:41 2009 +0000 @@ -16,11 +16,9 @@ sub as_html { 'class' => "select", 'selected' => $u->opt_usermsg }, { text => LJ::Lang::ml('settings.usermessaging.opt.Y'), - value => "Y", - disabled => $u->is_child,}, + value => "Y",}, { text => LJ::Lang::ml('settings.usermessaging.opt.F'), - value => "F", - disabled => $u->is_child,}, + value => "F",}, { text => LJ::Lang::ml('settings.usermessaging.opt.M'), value => "M",}, { text => LJ::Lang::ml('settings.usermessaging.opt.N'), diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/Setting/ViewingAdultContent.pm --- a/cgi-bin/LJ/Setting/ViewingAdultContent.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/Setting/ViewingAdultContent.pm Sun Mar 29 00:08:41 2009 +0000 @@ -36,7 +36,7 @@ sub option { { value => "explicit", text => $class->ml('setting.viewingadultcontent.option.select.explicit'), - disabled => $u->is_child || !$u->best_guess_age ? 1 : 0, + disabled => !$u->best_guess_age ? 1 : 0, }, { value => "concepts", @@ -74,7 +74,7 @@ sub save { my $val = $class->get_arg($args, "viewingadultcontent"); - if ($u->is_child || !$u->best_guess_age) { + if (!$u->best_guess_age) { $val = "concepts"; } elsif ($u->is_minor) { $val = "explicit" unless $val eq "concepts"; diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/User.pm --- a/cgi-bin/LJ/User.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/User.pm Sun Mar 29 00:08:41 2009 +0000 @@ -247,11 +247,6 @@ sub create_personal { # }, \%res, { 'u' => $u, 'noauth' => 1, } # ); # - $u->set_prop("newpost_minsecurity", "friends") if $u->is_child; - - # now flag as underage (and set O to mean was old or Y to mean was young) - $u->underage(1, $opts{ofage} ? 'O' : 'Y', 'account creation') if $opts{underage}; - # subscribe to default events $u->subscribe( event => 'OfficialPost', method => 'Inbox' ); $u->subscribe( event => 'OfficialPost', method => 'Email' ) if $opts{get_news}; @@ -1713,7 +1708,6 @@ sub can_show_location { croak "invalid user object passed" unless LJ::isu($u); my $remote = LJ::get_remote(); - return 0 if $u->underage; return 0 if $u->opt_showlocation eq 'N'; return 0 if $u->opt_showlocation eq 'R' && !$remote; return 0 if $u->opt_showlocation eq 'F' && !$u->trusts( $remote ); @@ -1929,7 +1923,6 @@ sub opt_showcontact { if ($u->{'allow_contactshow'} =~ /^(N|Y|R|F)$/) { return $u->{'allow_contactshow'}; } else { - return 'N' if $u->underage || $u->is_child; return 'F' if $u->is_minor; return 'Y'; } @@ -1948,7 +1941,6 @@ sub opt_showlocation { if ($u->raw_prop('opt_showlocation') =~ /^(N|Y|R|F)$/) { return $u->raw_prop('opt_showlocation'); } else { - return 'N' if ($u->underage || $u->is_child); return 'F' if ($u->is_minor); return 'Y'; } @@ -2057,7 +2049,7 @@ sub share_contactinfo { sub share_contactinfo { my ($u, $remote) = @_; - return 0 if $u->underage || $u->{journaltype} eq "Y"; + return 0 if $u->{journaltype} eq "Y"; return 0 if $u->opt_showcontact eq 'N'; return 0 if $u->opt_showcontact eq 'R' && !$remote; return 0 if $u->opt_showcontact eq 'F' && !$u->trusts( $remote ); @@ -2538,7 +2530,6 @@ sub bday_string { sub bday_string { my $u = shift; croak "invalid user object passed" unless LJ::isu($u); - return 0 if $u->underage; my $bdate = $u->{'bdate'}; my ($year,$mon,$day) = split(/-/, $bdate); @@ -2577,7 +2568,7 @@ sub can_join_adult_comm { my $adult_content = $comm->adult_content_calculated; $$adultref = $adult_content; - if ($adult_content eq "concepts" && ($u->is_child || !$u->best_guess_age)) { + if ($adult_content eq "concepts" && (!$u->best_guess_age)) { return 0; } elsif ($adult_content eq "explicit" && ($u->is_minor || !$u->best_guess_age)) { return 0; @@ -2746,7 +2737,6 @@ sub opt_sharebday { if ($u->raw_prop('opt_sharebday') =~ /^(A|F|N|R)$/) { return $u->raw_prop('opt_sharebday'); } else { - return 'N' if $u->underage || $u->is_child; return 'F' if $u->is_minor; return 'A'; } @@ -3302,7 +3292,7 @@ sub hide_adult_content { my $prop_value = $u->prop('hide_adult_content'); - if ($u->is_child || !$u->best_guess_age) { + if (!$u->best_guess_age) { return "concepts"; } @@ -4869,7 +4859,6 @@ sub opt_usermsg { if ($u->raw_prop('opt_usermsg') =~ /^(Y|F|M|N)$/) { return $u->raw_prop('opt_usermsg'); } else { - return 'N' if $u->underage || $u->is_child; return 'M' if $u->is_minor; return 'Y'; } @@ -5125,53 +5114,6 @@ sub userpic_quota { ######################################################################## ### 99. Miscellaneous Legacy Items -### 99A. Underage functions (FIXME: we shouldn't need these) - -# returns a true value if the user is underage; or if you give it an argument, -# will turn on/off that user's underage status. can also take a second argument -# when you're setting the flag to also update the underage_status userprop -# which is used to record if a user was ever marked as underage. -sub underage { - # has no bearing if this isn't on - return undef unless LJ::class_bit("underage"); - - # now get the args and continue - my $u = shift; - return LJ::get_cap($u, 'underage') unless @_; - - # now set it on or off - my $on = shift() ? 1 : 0; - if ($on) { - $u->add_to_class("underage"); - } else { - $u->remove_from_class("underage"); - } - - # now set their status flag if one was sent - my $status = shift(); - if ($status || $on) { - # by default, just records if user was ever underage ("Y") - $u->underage_status($status || 'Y'); - } - - # add to statushistory - if (my $shwhen = shift()) { - my $text = $on ? "marked" : "unmarked"; - my $status = $u->underage_status; - LJ::statushistory_add($u, undef, "coppa", "$text; status=$status; when=$shwhen"); - } - - # now fire off any hooks that are available - LJ::run_hooks('set_underage', { - u => $u, - on => $on, - status => $u->underage_status, - }); - - # return true if no failures - return 1; -} - # return true if we know user is a minor (< 18) sub is_minor { @@ -5183,34 +5125,6 @@ sub is_minor { } -# return true if we know user is a child (< 14) -sub is_child { - my $self = shift; - my $age = $self->best_guess_age; - - return 0 unless $age; - return 1 if ($age < 14); - return 0; -} - - -# return or set the underage status userprop -sub underage_status { - return undef unless LJ::class_bit("underage"); - - my $u = shift; - - # return if they aren't setting it - unless (@_) { - return $u->prop("underage_status"); - } - - # set and return what it got set to - $u->set_prop('underage_status', shift()); - return $u->{underage_status}; -} - - ######################################################################## ### 99B. Ad functions (FIXME: we shouldn't need these) @@ -5251,7 +5165,6 @@ sub age_for_adcall { my $u = shift; croak "Invalid user object" unless LJ::isu($u); - return undef if $u->underage; return eval {$u->age || $u->init_age}; } diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/LJ/Widget/CreateAccount.pm --- a/cgi-bin/LJ/Widget/CreateAccount.pm Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/LJ/Widget/CreateAccount.pm Sun Mar 29 00:08:41 2009 +0000 @@ -44,7 +44,6 @@ sub render_body { if ($alt_layout) { $ret .= "<script type='text/javascript'>\n"; $ret .= "CreateAccount.alt_layout = true;\n"; - $ret .= "CreateAccount.coppa_check = " . ( $LJ::COPPA_CHECK ? "true" : "false" ) . ";\n"; $ret .= "</script>\n"; } else { $ret .= "<script type='text/javascript'>\n"; @@ -52,7 +51,6 @@ sub render_body { $ret .= "CreateAccount.email = \"$tip_email\"\n"; $ret .= "CreateAccount.password = \"$tip_password\"\n"; $ret .= "CreateAccount.username = \"$tip_username\"\n"; - $ret .= "CreateAccount.coppa_check = " . ( $LJ::COPPA_CHECK ? "true" : "false" ) . ";\n"; $ret .= "</script>\n"; $ret .= "<div id='tips_box_arrow'></div>"; $ret .= "<div id='tips_box'></div>"; @@ -149,45 +147,43 @@ sub render_body { $ret .= "</td></tr>\n" unless $alt_layout; ### birthdate - if ($LJ::COPPA_CHECK) { - if ($alt_layout) { - $ret .= "<label for='create_bday_mm' class='label_create'>" . $class->ml('widget.createaccount.field.birthdate') . "</label>"; - $ret .= "<div class='bubble' id='bubble_bday_mm'>"; - $ret .= "<div class='bubble-arrow'></div>"; - $ret .= "<div class='bubble-text'>$tip_birthdate</div>"; - $ret .= "</div>"; - $ret .= $class->html_select( - name => "bday_mm", - id => "create_bday_mm", - selected => $post->{bday_mm} || 1, - list => [ map { $_, LJ::Lang::month_long_ml( $_ ) } (1..12) ], - ) . " "; - $ret .= $class->html_text( - name => "bday_dd", - id => "create_bday_dd", - class => 'date', - maxlength => '2', - value => $post->{bday_dd} || "", - ); - $ret .= $class->html_text( - name => "bday_yyyy", - id => "create_bday_yyyy", - class => 'year', - maxlength => '4', - value => $post->{bday_yyyy} || "", - ); - } else { - $ret .= "<tr><td class='field-name'>" . $class->ml('widget.createaccount.field.birthdate') . "</td>\n<td>"; - $ret .= $class->html_datetime( - name => 'bday', - id => 'create_bday', - notime => 1, - default => sprintf("%04d-%02d-%02d", $post->{bday_yyyy}, $post->{bday_mm}, $post->{bday_dd}), - ); - } - $ret .= $error_msg->('bday', '<br /><span class="formitemFlag">', '</span>'); - $ret .= "</td></tr>\n" unless $alt_layout; + if ($alt_layout) { + $ret .= "<label for='create_bday_mm' class='label_create'>" . $class->ml('widget.createaccount.field.birthdate') . "</label>"; + $ret .= "<div class='bubble' id='bubble_bday_mm'>"; + $ret .= "<div class='bubble-arrow'></div>"; + $ret .= "<div class='bubble-text'>$tip_birthdate</div>"; + $ret .= "</div>"; + $ret .= $class->html_select( + name => "bday_mm", + id => "create_bday_mm", + selected => $post->{bday_mm} || 1, + list => [ map { $_, LJ::Lang::month_long_ml( $_ ) } (1..12) ], + ) . " "; + $ret .= $class->html_text( + name => "bday_dd", + id => "create_bday_dd", + class => 'date', + maxlength => '2', + value => $post->{bday_dd} || "", + ); + $ret .= $class->html_text( + name => "bday_yyyy", + id => "create_bday_yyyy", + class => 'year', + maxlength => '4', + value => $post->{bday_yyyy} || "", + ); + } else { + $ret .= "<tr><td class='field-name'>" . $class->ml('widget.createaccount.field.birthdate') . "</td>\n<td>"; + $ret .= $class->html_datetime( + name => 'bday', + id => 'create_bday', + notime => 1, + default => sprintf("%04d-%02d-%02d", $post->{bday_yyyy}, $post->{bday_mm}, $post->{bday_dd}), + ); } + $ret .= $error_msg->('bday', '<br /><span class="formitemFlag">', '</span>'); + $ret .= "</td></tr>\n" unless $alt_layout; ### captcha if ($LJ::HUMAN_CHECK{create}) { @@ -359,12 +355,6 @@ sub handle_post { my $email = LJ::trim(lc $post->{email}); # set up global things that can be used to modify the user later - my $is_underage = 0; # turn on if the user should be marked as underage - my $ofage = 0; # turn on to note that the user is over 13 in actuality - # (but is_underage might be on which just means - # that their account is being marked as underage - # even if they're old [unique cookie check]) - # reject this email? return LJ::sysban_block(0, "Create user blocked based on email", { new_user => $user, @@ -420,41 +410,44 @@ sub handle_post { $from_post{errors}->{password} = $class->ml('widget.createaccount.error.password.asciionly'); } - ### start COPPA_CHECK # age checking to determine how old they are - if ($LJ::COPPA_CHECK) { - my $uniq; - if ($LJ::UNIQ_COOKIES) { - $uniq = BML::get_request()->notes('uniq'); - if ($uniq) { - my $timeof = $dbh->selectrow_array('SELECT timeof FROM underage WHERE uniq = ?', undef, $uniq); - $is_underage = 1 if $timeof && $timeof > 0; - } - } - - my ($year, $mon, $day) = ( $post->{bday_yyyy}+0, $post->{bday_mm}+0, $post->{bday_dd}+0 ); - if ($year < 100 && $year > 0) { - $post->{bday_yyyy} += 1900; - $year += 1900; - } - - my $nyear = (gmtime())[5] + 1900; - - # require dates in the 1900s (or beyond) - if ($year && $mon && $day && $year >= 1900 && $year < $nyear) { - my $age = LJ::calc_age($year, $mon, $day); - $is_underage = 1 if $age < 13; - $ofage = 1 if $age >= 13; - } else { - $from_post{errors}->{bday} = $class->ml('widget.createaccount.error.birthdate.invalid'); - } - - # note this unique cookie as underage (if we have a unique cookie) - if ($is_underage && $uniq) { - $dbh->do("REPLACE INTO underage (uniq, timeof) VALUES (?, UNIX_TIMESTAMP())", undef, $uniq); + my $uniq; + my $is_underage = 0; + if ($LJ::UNIQ_COOKIES) { + $uniq = DW::Request->get->note('uniq'); + if ($uniq) { + my $timeof = $dbh->selectrow_array('SELECT timeof FROM underage WHERE uniq = ?', undef, $uniq); + $is_underage = 1 if $timeof && $timeof > 0; } } - ### end COPPA_CHECK + + my ($year, $mon, $day) = ( $post->{bday_yyyy}+0, $post->{bday_mm}+0, $post->{bday_dd}+0 ); + if ($year < 100 && $year > 0) { + $post->{bday_yyyy} += 1900; + $year += 1900; + } + + my $nyear = (gmtime())[5] + 1900; + + # require dates in the 1900s (or beyond) + if ($year && $mon && $day && $year >= 1900 && $year < $nyear) { + my $age = LJ::calc_age($year, $mon, $day); + $is_underage = 1 if $age < 13; + } else { + $from_post{errors}->{bday} = $class->ml('widget.createaccount.error.birthdate.invalid'); + } + + # note this unique cookie as underage (if we have a unique cookie) + if ($is_underage && $uniq) { + $dbh->do("REPLACE INTO underage (uniq, timeof) VALUES (?, UNIX_TIMESTAMP())", undef, $uniq); + } + + if ( $is_underage ) { + $from_post{errors}->{bday} = + $class->ml('widget.createaccount.error.birthdate.underage'); + } + + ### end age check # check the email address my @email_errors; @@ -501,8 +494,6 @@ sub handle_post { password => $post->{password1}, get_news => $post->{news} ? 1 : 0, inviter => $post->{from}, - underage => $is_underage, - ofage => $ofage, extra_props => $opts{extra_props}, status_history => $opts{status_history}, ); @@ -514,35 +505,33 @@ sub handle_post { } # send welcome mail... unless they're underage - unless ($is_underage) { - my $aa = LJ::register_authaction($nu->id, "validateemail", $email); + my $aa = LJ::register_authaction($nu->id, "validateemail", $email); - my $body = LJ::Lang::ml('email.newacct5.body', { - sitename => $LJ::SITENAME, - regurl => "$LJ::SITEROOT/confirm/$aa->{'aaid'}.$aa->{'authcode'}", - journal_base => $nu->journal_base, - username => $nu->user, - siteroot => $LJ::SITEROOT, - sitenameshort => $LJ::SITENAMESHORT, - lostinfourl => "$LJ::SITEROOT/lostinfo.bml", - editprofileurl => "$LJ::SITEROOT/manage/profile/", - searchinterestsurl => "$LJ::SITEROOT/interests.bml", - editpicsurl => "$LJ::SITEROOT/editpics.bml", - customizeurl => "$LJ::SITEROOT/customize/", - postentryurl => "$LJ::SITEROOT/update.bml", - setsecreturl => "$LJ::SITEROOT/set_secret.bml", - LJ::run_hook('extra_fields_in_postreg_esn'), - }); + my $body = LJ::Lang::ml('email.newacct5.body', { + sitename => $LJ::SITENAME, + regurl => "$LJ::SITEROOT/confirm/$aa->{'aaid'}.$aa->{'authcode'}", + journal_base => $nu->journal_base, + username => $nu->user, + siteroot => $LJ::SITEROOT, + sitenameshort => $LJ::SITENAMESHORT, + lostinfourl => "$LJ::SITEROOT/lostinfo.bml", + editprofileurl => "$LJ::SITEROOT/manage/profile/", + searchinterestsurl => "$LJ::SITEROOT/interests.bml", + editpicsurl => "$LJ::SITEROOT/editpics.bml", + customizeurl => "$LJ::SITEROOT/customize/", + postentryurl => "$LJ::SITEROOT/update.bml", + setsecreturl => "$LJ::SITEROOT/set_secret.bml", + LJ::run_hook('extra_fields_in_postreg_esn'), + }); - LJ::send_mail({ - to => $email, - from => $LJ::ADMIN_EMAIL, - fromname => $LJ::SITENAME, - charset => 'utf-8', - subject => LJ::Lang::ml('email.newacct.subject', { sitename => $LJ::SITENAME }), - body => $body, - }); - } + LJ::send_mail({ + to => $email, + from => $LJ::ADMIN_EMAIL, + fromname => $LJ::SITENAME, + charset => 'utf-8', + subject => LJ::Lang::ml('email.newacct.subject', { sitename => $LJ::SITENAME }), + body => $body, + }); if ( $LJ::TOS_CHECK ) { my $err = ""; diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/ljcapabilities.pl --- a/cgi-bin/ljcapabilities.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/ljcapabilities.pl Sun Mar 29 00:08:41 2009 +0000 @@ -56,15 +56,7 @@ sub caps_in_group { sub caps_in_group { my ($caps, $class) = @_; my $bit = LJ::class_bit($class); - unless (defined $bit) { - # this site has no underage class? 'underage' is the only - # general class. - return 0 if $class eq "underage"; - - # all other classes are site-defined, so we die on those not existing. - die "unknown class '$class'"; - } - + die "unknown class '$class'" unless defined $bit; return ($caps+0 & (1 << $bit)) ? 1 : 0; } @@ -200,11 +192,6 @@ sub get_cap } } - # underage/coppa check etc - if ($cname eq "underage" && $u && $u->in_class("underage")) { - return 1; - } - # is there a hook for this cap name? if (! $opts->{no_hook} && LJ::are_hooks("check_cap_$cname")) { die "Hook 'check_cap_$cname' requires full user object" diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/ljdefaults.pl --- a/cgi-bin/ljdefaults.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/ljdefaults.pl Sun Mar 29 00:08:41 2009 +0000 @@ -172,9 +172,6 @@ # Default to allow all reproxying. %REPROXY_DISABLE = () unless %REPROXY_DISABLE; - - # Default error message for age verification needed - $UNDERAGE_ERROR ||= "Sorry, your account needs to be <a href='$SITEROOT/agecheck/'>age verified</a> before you can leave any comments."; # Terms of Service revision requirements foreach ( diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/ljprotocol.pl --- a/cgi-bin/ljprotocol.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/ljprotocol.pl Sun Mar 29 00:08:41 2009 +0000 @@ -1035,9 +1035,6 @@ sub postevent $u->{'journaltype'} eq "I" || $u->{'journaltype'} eq "N"); - # underage users can't do this - return fail($err,310) if $u->underage; - # suspended users can't post return fail($err,305) if ($u->{'statusvis'} eq "S"); @@ -1587,9 +1584,6 @@ sub editevent my $sth; my $itemid = $req->{'itemid'}+0; - - # underage users can't do this - return fail($err,310) if $u->underage; # check the journal's read-only bit return fail($err,306) if LJ::get_cap($uowner, "readonly"); diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/talklib.pl --- a/cgi-bin/talklib.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/talklib.pl Sun Mar 29 00:08:41 2009 +0000 @@ -1210,10 +1210,6 @@ sub talkform { } my $pics = LJ::Talk::get_subjecticons(); - - # early bail if the user can't be making comments yet - return $LJ::UNDERAGE_ERROR - if $remote && $remote->underage; # once we clean out talkpost.bml, this will need to be changed. BML::set_language_scope('/talkpost.bml'); @@ -3376,12 +3372,6 @@ sub post_comment { $parent->{state} = 'A'; } - # make sure they're not underage - if ($comment->{u} && $comment->{u}->underage) { - $$errref = $LJ::UNDERAGE_ERROR; - return 0; - } - # check for duplicate entry (double submission) # Note: we don't do it inside a locked section like ljprotocol.pl's postevent, # so it's not perfect, but it works pretty well. diff -r 91128c403d5e -r 0ad52dde2d7a cgi-bin/weblib.pl --- a/cgi-bin/weblib.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/cgi-bin/weblib.pl Sun Mar 29 00:08:41 2009 +0000 @@ -648,7 +648,6 @@ sub create_qr_div { my $u = LJ::want_user($user); my $remote = LJ::get_remote(); return undef unless $u && $remote && $ditemid; - return undef if $remote->underage; $stylemine ||= 0; my $qrhtml; diff -r 91128c403d5e -r 0ad52dde2d7a doc/raw/build/ljconfig/ljconfig2db.pl --- a/doc/raw/build/ljconfig/ljconfig2db.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/doc/raw/build/ljconfig/ljconfig2db.pl Sun Mar 29 00:08:41 2009 +0000 @@ -777,10 +777,6 @@ Please see <a href='http://status.exa 'policy_options' => { 'name' => "Policy Options", - 'coppa_check' => { - 'desc' => "Collect birthdays to mark users as underage (under 13). To make this work, you first need to create a new capability class for - underage users. Then, set [ljconfig[underage_bit]] to be the bit number for the cap class to put underage users in. Off by default.", - }, 'no_password_check' => { 'desc' => "Set this option true if you are running an installation using <literal>ljcom</literal> code and if you haven't installed the <package>Crypt::Cracklib</package> perl module. When enabled, the installation will not do strong password checks. Users can use any old dumb password they like.", }, @@ -822,14 +818,6 @@ Please see <a href='http://status.exa "The account creation dialog can also check for new instances of the Terms of Service if the Terms of Service text is located in an ". "&svn; managed include file (<filename><parameter>\$<envar>LJHOME</envar></parameter>/htdocs/inc/legal-tos</filename>), ". "and if the include file includes the following line at the top: <programlisting><![CDATA[<!-- \$Revision\$ -->]]></programlisting>", - }, - 'underage_bit' => { - 'desc' => "Used in conjunction with [ljconfig[coppa_check]].", - }, - 'underage_error' => { - 'desc' => "Error message to show underage users.", - 'default' => "Sorry, your account needs to be <a href='\$SITEROOT/agecheck/'>age verified</> -before you can leave any comments.;", }, 'use_acct_codes' => { 'desc' => "A boolean setting that makes joining the site require an <quote>invite code</quote> before being able to create a new account. Not all features are implemented in the <literal>livejournal</literal>-only tree. &ljcom; used this for a period until late 2003. Note that this code might've bitrotted, so perhaps it should be kept off.", diff -r 91128c403d5e -r 0ad52dde2d7a doc/raw/lj.book/admin/console.ref.gen.xml --- a/doc/raw/lj.book/admin/console.ref.gen.xml Sat Mar 28 14:17:36 2009 +0000 +++ b/doc/raw/lj.book/admin/console.ref.gen.xml Sun Mar 29 00:08:41 2009 +0000 @@ -501,24 +501,6 @@ Change a journal's badpassword prop. </para></listitem> </varlistentry> <varlistentry> - <term><literal role="console.command">set_underage</literal></term> - <listitem><para> -Change a journal's underage flag. - <itemizedlist> - <title>Arguments:</title> - <listitem><formalpara><title>journal</title> - <para>The username of the journal that type is changing.</para> - </formalpara></listitem> - <listitem><formalpara><title>on/off</title> - <para>Either 'on' or 'off' which is whether to turn it on or off.</para> - </formalpara></listitem> - <listitem><formalpara><title>note</title> - <para>Required information about why you are setting this status.</para> - </formalpara></listitem> - </itemizedlist> - </para></listitem> -</varlistentry> -<varlistentry> <term><literal role="console.command">shared</literal></term> <listitem><para> Add or remove access for a user to post in a shared journal. diff -r 91128c403d5e -r 0ad52dde2d7a doc/raw/lj.book/features/support.xml --- a/doc/raw/lj.book/features/support.xml Sat Mar 28 14:17:36 2009 +0000 +++ b/doc/raw/lj.book/features/support.xml Sun Mar 29 00:08:41 2009 +0000 @@ -109,12 +109,6 @@ an <acronym>ISO</acronym> language code. </listitem> </varlistentry> -<varlistentry><term>Underage</term> -<listitem> -<para>Status of the underage flag on the user account.</para> -</listitem> -</varlistentry> - <varlistentry><term>Support Category</term> <listitem> <para>To help sort open/pending and closed requests, you can set up categories. diff -r 91128c403d5e -r 0ad52dde2d7a etc/config.pl --- a/etc/config.pl Sat Mar 28 14:17:36 2009 +0000 +++ b/etc/config.pl Sun Mar 29 00:08:41 2009 +0000 @@ -60,13 +60,6 @@ ### ### Policy Options ### - - # collect birthdays to mark users as underage (under 13). note that you will - # need to create a new cap class for underage users... - $COPPA_CHECK = 0; - #$UNDERAGE_BIT = ?; - # and then set $UNDERAGE_BIT to be the bit number for the capability class to - # put underage users in. off by default. $TOS_CHECK = 0; # require users to agree to TOS $UNIQ_COOKIES = 1; # give users uniq cookies to help fight abuse diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/community/create.bml --- a/htdocs/community/create.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/community/create.bml Sun Mar 29 00:08:41 2009 +0000 @@ -21,9 +21,6 @@ body<= unless $remote->is_visible; return "<?h1 $ML{'Error'} h1?><?p " . BML::ml('.error.notvalidated2', { aopts => "'href='$LJ::SITEROOT/register.bml'" }) . " p?>" unless $remote->is_validated; - - return BML::redirect("$LJ::SITEROOT/agecheck/?s=1") - if $remote->underage; # fix up the incoming data (is used in getinfo mode and submit mode so it's here) $POST{membership} = 'open' diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/editjournal.bml --- a/htdocs/editjournal.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/editjournal.bml Sun Mar 29 00:08:41 2009 +0000 @@ -14,10 +14,6 @@ body<= my $remote = LJ::get_remote(); return "<?needlogin?>" unless $remote; - - if ($remote->underage) { - return BML::redirect("$LJ::SITEROOT/agecheck/?s=1"); - } my $mode = $GET{'mode'} || $POST{'mode'} || "init"; if ($GET{'itemid'} || $POST{'itemid'}) { $mode = "edit"; } diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/editpics.bml --- a/htdocs/editpics.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/editpics.bml Sun Mar 29 00:08:41 2009 +0000 @@ -30,10 +30,6 @@ use strict; unless ($remote) { $body = "<?needlogin?>"; return; - } - - if ($remote->underage) { - return BML::redirect("$LJ::SITEROOT/agecheck/?s=1"); } LJ::need_res(qw( diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/js/widgets/createaccount.js --- a/htdocs/js/widgets/createaccount.js Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/js/widgets/createaccount.js Sun Mar 29 00:08:41 2009 +0000 @@ -4,11 +4,9 @@ CreateAccount.init = function () { if (!$('create_user')) return; if (!$('create_email')) return; if (!$('create_password1')) return; - if ( CreateAccount.coppa_check ) { - if (!$('create_bday_mm')) return; - if (!$('create_bday_dd')) return; - if (!$('create_bday_yyyy')) return; - } + if (!$('create_bday_mm')) return; + if (!$('create_bday_dd')) return; + if (!$('create_bday_yyyy')) return; CreateAccount.bubbleid = ""; @@ -16,22 +14,18 @@ CreateAccount.init = function () { DOM.addEventListener($('create_email'), "focus", CreateAccount.eventShowTip.bindEventListener("create_email")); DOM.addEventListener($('create_password1'), "focus", CreateAccount.eventShowTip.bindEventListener("create_password1")); DOM.addEventListener($('create_password2'), "focus", CreateAccount.eventShowTip.bindEventListener("create_password1")); - if ( CreateAccount.coppa_check ) { - DOM.addEventListener($('create_bday_mm'), "focus", CreateAccount.eventShowTip.bindEventListener("create_bday_mm")); - DOM.addEventListener($('create_bday_dd'), "focus", CreateAccount.eventShowTip.bindEventListener("create_bday_mm")); - DOM.addEventListener($('create_bday_yyyy'), "focus", CreateAccount.eventShowTip.bindEventListener("create_bday_mm")); - } + DOM.addEventListener($('create_bday_mm'), "focus", CreateAccount.eventShowTip.bindEventListener("create_bday_mm")); + DOM.addEventListener($('create_bday_dd'), "focus", CreateAccount.eventShowTip.bindEventListener("create_bday_mm")); + DOM.addEventListener($('create_bday_yyyy'), "focus", CreateAccount.eventShowTip.bindEventListener("create_bday_mm")); if (CreateAccount.alt_layout) { DOM.addEventListener($('create_user'), "blur", CreateAccount.eventHideTip.bindEventListener("create_user")); DOM.addEventListener($('create_email'), "blur", CreateAccount.eventHideTip.bindEventListener("create_email")); DOM.addEventListener($('create_password1'), "blur", CreateAccount.eventHideTip.bindEventListener("create_password1")); DOM.addEventListener($('create_password2'), "blur", CreateAccount.eventHideTip.bindEventListener("create_password1")); - if ( CreateAccount.coppa_check ) { - DOM.addEventListener($('create_bday_mm'), "blur", CreateAccount.eventHideTip.bindEventListener("create_bday_mm")); - DOM.addEventListener($('create_bday_dd'), "blur", CreateAccount.eventHideTip.bindEventListener("create_bday_mm")); - DOM.addEventListener($('create_bday_yyyy'), "blur", CreateAccount.eventHideTip.bindEventListener("create_bday_mm")); - } + DOM.addEventListener($('create_bday_mm'), "blur", CreateAccount.eventHideTip.bindEventListener("create_bday_mm")); + DOM.addEventListener($('create_bday_dd'), "blur", CreateAccount.eventHideTip.bindEventListener("create_bday_mm")); + DOM.addEventListener($('create_bday_yyyy'), "blur", CreateAccount.eventHideTip.bindEventListener("create_bday_mm")); } if (!$('username_check')) return; diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/manage/profile/index.bml --- a/htdocs/manage/profile/index.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/manage/profile/index.bml Sun Mar 29 00:08:41 2009 +0000 @@ -26,10 +26,6 @@ body<= my $remote = LJ::get_remote() or return $print_with_ad->("<?needlogin?>"); - - if ($remote->underage) { - return BML::redirect("$LJ::SITEROOT/agecheck/?s=1"); - } my $authas = $GET{'authas'} || $remote->{'user'}; my $u = LJ::get_authas_user($authas); @@ -172,23 +168,18 @@ body<= '', '', map { $_, LJ::Lang::month_long_ml($_) } (1..12)) . " "; $ret .= LJ::html_text({ 'name' => 'day', 'value' => $bdpart{'day'}, 'size' => '3', 'maxlength' => '2' }) . " "; $ret .= LJ::html_text({ 'name' => 'year', 'value' => $bdpart{'year'}, 'size' => '5', 'maxlength' => '4' }); - $ret .= "<div class='helper'>$ML{'.birthday.underage'}</div>" if $u->is_child; - # For children only allow them to update birthdate info if it already exists $ret .= "<div style=\"padding-top: .5em;\">\n"; $ret .= " <label for='opt_sharebday'>$ML{'.share.birthday'}</label>\n"; my $opt_sharebday = ($u->opt_sharebday =~ m/^(A|F|N|R)$/) ? $u->opt_sharebday : 'F'; $ret .= LJ::html_select({ 'name' => 'opt_sharebday', 'selected' => $opt_sharebday }, { text => BML::ml(".security.visibility.everybody"), - value => "A", - disabled => $u->is_child,}, + value => "A",}, { text => BML::ml(".security.visibility.regusers"), - value => "R", - disabled => $u->is_child,}, + value => "R",}, { text => BML::ml(".security.visibility.friends"), - value => "F", - disabled => $u->is_child,}, + value => "F",}, { text => BML::ml(".security.visibility.nobody"), value => "N",}); @@ -313,11 +304,9 @@ body<= $ret .= LJ::html_select({ 'name' => 'allow_contactshow', 'selected' => $u->opt_showcontact}, { text => BML::ml(".security.visibility.everybody"), - value => "Y", - disabled => $u->is_child,}, + value => "Y",}, { text => BML::ml(".security.visibility.regusers"), - value => "R", - disabled => $u->is_child,}, + value => "R",}, { text => BML::ml(".security.visibility.friends"), value => "F",}, { text => BML::ml(".security.visibility.nobody"), @@ -540,10 +529,6 @@ body<= push @errors, $ML{'.error.day.outofrange'}; } - if ($u->is_child && $POST{'opt_sharebday'} ne "N") { - push @errors, $ML{'.error.bday.child'}; - } - if (@errors == 0 && $POST{'day'} > LJ::days_in_month($POST{'month'}, $POST{'year'})) { push @errors, $ML{'.error.day.notinmonth'}; } @@ -565,10 +550,6 @@ body<= unless (@errors) { LJ::check_email($POST{'email'}, \@errors); } - } - - if ($u->is_child && $POST{'allow_contactshow'} =~ /[YR]/) { - push @errors, $ML{'.error.contact.child'}; } if ($POST{'LJ__Setting__UserMessaging_opt_usermsg'} && !$POST{'LJ__Setting__UserMessaging_opt_usermsg'} =~ /^[MFNY]$/) { diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/manage/profile/index.bml.text --- a/htdocs/manage/profile/index.bml.text Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/manage/profile/index.bml.text Sun Mar 29 00:08:41 2009 +0000 @@ -2,8 +2,6 @@ .birthday=Show your birthday to other users .birthday.year.opt=year is optional - -.birthday.underage=Users under the age of 14 cannot display their age on profiles. .chat.aolim=AOL IM diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/manage/pubkey.bml --- a/htdocs/manage/pubkey.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/manage/pubkey.bml Sun Mar 29 00:08:41 2009 +0000 @@ -14,8 +14,6 @@ body<= my $u = LJ::get_remote(); return "<?needlogin?>" unless $u; - return BML::redirect("$LJ::SITEROOT/agecheck/?s=1") - if $u->underage; return $LJ::MSG_READONLY_USER if $u->readonly; diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/register.bml --- a/htdocs/register.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/register.bml Sun Mar 29 00:08:41 2009 +0000 @@ -16,8 +16,6 @@ body<= $title = $ML{'.title'}; my $remote = LJ::get_remote(); - return BML::redirect("$LJ::SITEROOT/agecheck/?s=1") - if $remote && $remote->underage; return "<?p " . BML::ml('.error.identity_no_email', {'aopts' => "href='$LJ::SITEROOT/changeemail.bml'"}) . " p?>" if $remote && $remote->is_identity && !$remote->email_raw; diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/stc/widgets/createaccount.css --- a/htdocs/stc/widgets/createaccount.css Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/stc/widgets/createaccount.css Sun Mar 29 00:08:41 2009 +0000 @@ -28,8 +28,8 @@ position: absolute; background-color: #fcf6db; border: 1px solid #ffdfc0; - padding: 10px; - width: 300px; + padding: 5px; + width: 400px; left: 500px; } diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/support/see_request.bml --- a/htdocs/support/see_request.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/support/see_request.bml Sun Mar 29 00:08:41 2009 +0000 @@ -417,25 +417,6 @@ body<= $ret .= "$ML{'.dataversion'}: <b>$u->{dversion}</b>"; $ret .= "<br />$ML{'.scheme'}: <b>" . ($u->{schemepref} ? $u->{schemepref} : "default") . "</b>; "; $ret .= "$ML{'.language'}: <b>" . ($u->{browselang} ? $u->{browselang} : "default") . "</b>"; - unless ($clusterdown || (LJ::isu($u) && $u->is_expunged)) { - $ret .= "<br />$ML{'.underage'}? "; - if ($u->underage) { - $ret .= "<strong>"; - $ret .= $ML{'.yesbirthday'} if $u->underage_status eq 'Y'; - $ret .= $ML{'.yesuniquecookie'} if $u->underage_status eq 'O'; - $ret .= $ML{'.yesmanualset'} if $u->underage_status eq 'M'; - $ret .= "</strong>"; - } else { - $ret .= "<strong>$ML{'.no'}"; - if ($u->underage_status) { - $ret .= "; $ML{'.wasby'} "; - $ret .= $ML{'.birthday'} if $u->underage_status eq 'Y'; - $ret .= $ML{'.uniquecookie'} if $u->underage_status eq 'O'; - $ret .= $ML{'.manualset'} if $u->underage_status eq 'M'; - } - $ret .= "</strong>"; - } - } my $view_history = LJ::check_priv($remote, 'historyview'); my $view_userlog = LJ::check_priv($remote, 'canview', 'userlog') || LJ::check_priv($remote, 'canview', '*'); @@ -656,9 +637,6 @@ body<= if ($sp->{'state'} eq "closed") { return $ret; } - - # underage users can't interact with this - return $ret if $remote && $remote->underage; $ret .= "<p style='margin-bottom: 0px;'><b>$ML{'.post.comment'}:</b></p>\n"; @@ -892,7 +870,7 @@ body<= } # Prefill an e-mail validation nag, if needed. my $validationnag; - if (!(LJ::isu($u) && ($u->underage && $u->{'status'} eq 'T')) && + if (!(LJ::isu($u) && ($u->{'status'} eq 'T')) && ($u->{'status'} eq "N" || $u->{'status'} eq "T") && $u->{'journaltype'} ne 'I' && ! $is_poster) { my $reminder = LJ::load_include('validationreminder'); diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/support/see_request.bml.text --- a/htdocs/support/see_request.bml.text Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/support/see_request.bml.text Sun Mar 29 00:08:41 2009 +0000 @@ -165,8 +165,6 @@ and correct, it will be sent to the user .unable.connect=(unable to connect to cluster, some data temporarily unavailable) -.underage=underage - .uniquecookie=unique cookie .uniq=Uniq: diff -r 91128c403d5e -r 0ad52dde2d7a htdocs/update.bml --- a/htdocs/update.bml Sat Mar 28 14:17:36 2009 +0000 +++ b/htdocs/update.bml Sun Mar 29 00:08:41 2009 +0000 @@ -41,10 +41,6 @@ # Errors that are unlikely to change between starting # to compose an entry and submitting it. if ($remote) { - if ($remote->underage) { - return BML::redirect("$LJ::SITEROOT/agecheck/?s=1"); - } - return if LJ::bad_password_redirect(); if ($remote->identity) { diff -r 91128c403d5e -r 0ad52dde2d7a t/birthday.t --- a/t/birthday.t Sat Mar 28 14:17:36 2009 +0000 +++ b/t/birthday.t Sun Mar 29 00:08:41 2009 +0000 @@ -16,13 +16,6 @@ sub run_tests { my $u = temp_user(); my $rv = eval { $u->can_show_bday }; ok(!$@, "can_show_bday: Called on valid user object"); - } - - { - my $u = temp_user(); - $u->underage(1); - my $rv = eval { $u->can_show_bday }; - ok(!$rv, "can_show_bday: Underage"); } { @@ -62,13 +55,6 @@ sub run_tests { { my $u = temp_user(); - $u->underage(1); - my $rv = eval { $u->can_show_bday_year }; - ok(!$rv, "can_show_bday_year: Underage"); - } - - { - my $u = temp_user(); my $rv = eval { $u->can_show_bday_year }; if ($rv == 0) { ok(!$rv, "can_show_bday_year: opt_showbday is not set"); @@ -102,13 +88,6 @@ sub run_tests { { my $u = temp_user(); - $u->underage(1); - my $rv = eval { $u->can_show_full_bday }; - ok(!$rv, "can_show_full_bday: Underage"); - } - - { - my $u = temp_user(); my $rv = eval { $u->can_show_full_bday }; if ($rv == 0) { ok(!$rv, "can_show_full_bday: opt_showbday is not set"); @@ -138,13 +117,6 @@ sub run_tests { my $u = temp_user(); my $rv = eval { $u->bday_string }; ok(!$@, "bday_string: Called on valid user object"); - } - - { - my $u = temp_user(); - $u->underage(1); - my $rv = eval { $u->bday_string }; - ok(!$rv, "bday_string: Underage"); } my @props = ('','D','F','N','Y'); diff -r 91128c403d5e -r 0ad52dde2d7a t/console-setunderage.t --- a/t/console-setunderage.t Sat Mar 28 14:17:36 2009 +0000 +++ b/t/console-setunderage.t Sun Mar 29 00:08:41 2009 +0000 @@ -1,33 +0,0 @@ -# -*-perl-*- -use strict; -use Test::More 'no_plan'; -use lib "$ENV{LJHOME}/cgi-bin"; -require 'ljlib.pl'; -use LJ::Console; -use LJ::Test qw (temp_user temp_comm temp_feed memcache_stress); -local $LJ::T_NO_COMMAND_PRINT = 1; - -my $u = temp_user(); -my $u2 = temp_user(); - -my $run = sub { - my $cmd = shift; - return LJ::Console->run_commands_text($cmd); -}; - -LJ::set_remote($u); - -is($run->("set_underage " . $u2->user . " on \"is underage\""), - "error: You are not authorized to run this command."); -$u->grant_priv("siteadmin", "underage"); - -$u = LJ::load_user($u->user); - -is($run->("set_underage " . $u2->user . " on \"is underage\""), - "success: User marked as underage."); -ok($u2->underage, "Badpassword prop set correctly."); - -is($run->("set_underage " . $u2->user . " off \"removing bad password\""), - "success: User no longer marked as underage."); -ok(!$u2->underage, "User is no longer marked as underage."); -$u->revoke_priv("siteadmin", "underage"); diff -r 91128c403d5e -r 0ad52dde2d7a t/underage.t --- a/t/underage.t Sat Mar 28 14:17:36 2009 +0000 +++ b/t/underage.t Sun Mar 29 00:08:41 2009 +0000 @@ -1,38 +0,0 @@ -# -*-perl-*- - -use strict; -use Test::More 'no_plan'; -use lib "$ENV{LJHOME}/cgi-bin"; -require 'ljlib.pl'; - -my $u = LJ::load_user("system"); -ok($u); - -{ - local %LJ::CAP = (); - is(LJ::class_bit("underage"), undef, "no class bit"); - eval { $u->in_class("non_exist") }; - like($@, qr/unknown class/i, "checking in_class on bogus class dies"); - is($u->in_class("underage"), 0, "checking in_class on underage doesn't fail"); -} - -# make this test work on general or policyconfig'ed sites -unless (LJ::class_bit("underage")) { - $LJ::CAP{15} = { '_key' => 'underage' }; -} - -ok(LJ::class_bit("underage"), "got the class bit"); -ok($u->underage(0)); -ok(! $u->underage); -ok($u->underage(1)); -ok($u->underage); -ok($u->underage_status("C")); # set due to cookie -is($u->underage_status, "C", "still set to cookie"); - -{ - local %LJ::CAP = (); - ok(! $u->underage, "no longer underage, feature disabled"); - is($u->underage_status, undef, "status gone"); -} - - --------------------------------------------------------------------------------