" unless $remote; # bad statusvis? unless ($remote->{statusvis} eq 'V') { $body = ""; return; } # see if they posted and perform actions if so if (LJ::did_post()) { # get info about the community my $cu = LJ::load_user($POST{comm}); $errors{username} = $ML{'.error.notfound'} unless $cu; # the rest of the errors assume a community exists if ($cu) { # status/type errors $errors{username} = $ML{'.error.notcomm'} unless $cu->{journaltype} eq 'C'; $errors{username} = $ML{'.error.badstatus'} if !%errors && $cu->{statusvis} !~ /[VD]/; # are they already a maintainer? $errors{username} = $ML{'.error.alreadyadmin'} if !%errors && LJ::can_manage($remote, $cu); # check the password last $errors{password} = $ML{'.error.nopassword'} if !%errors && !$POST{password}; $errors{password} = $ML{'.error.mismatch'} if !%errors && !LJ::auth_okay($cu, $POST{password}); } # everything checks out, transfer it unless (%errors) { $cu->log_event('maintainer_add', { actiontarget => $remote->{userid}, remote => $remote }); LJ::set_rel($cu, $remote, 'A'); $body = " LJ::ljuser($cu, { type => 'C' }) }); $body .= " p?>"; return; } } # setup the form to transfer the community $body .= ""; $body .= "
"; $body .= ""; $body .= "\n"; $body .= "" if $errors{username}; $body .= ""; $body .= "\n"; $body .= "" if $errors{password}; $body .= ""; $body .= "
$ML{'.account'}" . LJ::html_text({ name => 'comm', id => 'comm', value => $POST{comm} }) . "
$ML{'.password'}" . LJ::html_text({ type => 'password', name => 'password', id => 'password' }) . "
" . LJ::html_submit(undef, $ML{'.button.title'}) . "
"; return; } _code?> body=> page?>