% unless(defined($valsi)) { I can't very well add a valsi if you don't tell me what to add! % return; % } % unless(defined($session{'username'})) { I'm not going to let you add a valsi unless you log in. % return; % } % unless(defined($confirm)) { Adding valsi "<% $valsi %>"
<%shared> our $valsi; <%method title> Adding valsi <% $valsi %> <%perl> my @result = $dbh->selectrow_array("SELECT count(*) FROM valsi WHERE word=?",{},$valsi); if($result[0]<1) { use Digest::MD5 qw(md5_hex); my $typestr = utils::vlatai($valsi); my $verifier = &produce_verifier($valsi.$typestr); % if($typestr eq "nalvla") {

Sorry, that isn't actually a word in Lojban.

(Did you remember to strip leading and/or trailing pauses?)

% return; % }

So. You want to add a valsi to the database.

This shouldn't be done lightly. Please check the following:

  1. If it is a lujvo, make sure you're using the lowest scoring form of the lujvo. You're not going to get anywhere by using a different form, as the database is periodically swept for noncanonical form lujvo, and they are modified to the appropriate canonical form. (Or removed, and all related data pointed towards the canonical version, if it already exists.)
  2. Also ensure that you're adding the word you actually intend to add, and not something odd.

I've automatically checked the valsi myself, and have decided that it is of type: <% $typestr %>. If this is correct, and you are very sure that you want to add this word, pick a language and then hit the button below:

Initial Definition In:
<%perl> } else { $m->redirect( $valsi ); } } else { my $typestr = utils::vlatai($valsi); unless(produce_verifier($valsi.$typestr) eq $confirm) {

Uhoh. You're really trying to get sneaky on me. We can't have that.

Convinently (for me, anyways), to even get to this point, you would've had to provide a cookie. Since they're rather well encrypted, I know you didn't send me a fake one, <% $session{'username'} %>. I'm afraid Robin is going to have to have a very, very long talk with you.

% return; % } It should no longer be possible to get here. If you got here, please mail lojban@lojban.org with how you did it. % } <%init> our($dbh,%session); sub produce_verifier { my $valsi = shift; my $verifier = md5_hex(pack("f*",map { ord } (split//, $valsi))); return $verifier; } <%args> $valsi => undef $confirm => undef