WODA: FAQs

 Security

I need record locking for my woda database ?

First, this note: This is *not* how WODA works. It has never been a priority or a likely scenario for me.

Ziga -----

But don't give up, this is a modification from Reiner Voigt:

A file-locking-routine. This behaviour can be implemented by creating a myEdit-routine which takes precedent over cgiEdit.

... sub myEdit {

$id = &wbFixId($CGI{_id}); do recRead($id);

#Lock-File Define $lockfile="/tmp/$id";

#Message if record is locked if(-e "$lockfile") { $lmessage .= <<EOM; #UK Lockfile for this record exists !! Another user is touching data of rec $id !! EOM do wbError($title,$lmessage);

}

#Build Lock-File system "/bin/touch $lockfile";

if ( &isOwner() ) {

... ----------------------------------------------------- and this to remove the lock-file after editing an record ...

... do wbDatabaseChanged();

$p = ":$ENV{SERVER_PORT}"; $p = '' if $p eq ":80"; $url = "http://$ENV{SERVER_NAME}$p$SCRIPT/Show?_id=$newID";

$x = <<EOM ; #UK

<P>Your input are stored at:<A HREF="$url">$url</A>. <P> Record-Lock for rec $newID has been removed !! EOM

# Remove Lock-File $rmlock="/tmp/$newID"; system "/bin/rm $rmlock";

do wbWarn("Sucess!",$x,'WIDTH=600');

$t="Add another record"; push (@Toolbar,<<EOM); <A HREF="$SCRIPT/Add"> <IMG $ICONPAR SRC=$ICONURL/add.gif ALT="$t"></A> EOM

if (&isLoginTable()) { $t = 'WARNING: Login information changed!'; $m = <<EOM; #UK <P>Please note that $newID is a username to <A HREF="$SCRIPT/LoginForm?username=$newID">log into</A> this application. <P>The password is the password that was used to lock this record.

I remember that you had a windows-box. So use "echo xx>$lockfile" to build a lockfile and "delete $rmlock" to remove the logfile. I think the system-call can handle the windows commands ...

I know that the system-calls are a security risk, but the routine works (that`s want I want ... ;-) )

BTW thanks to Ziga, who give me the tips for doing this ...

Friendly greetings Reiner Voigt

modify the informationdelete entire recordexplain the meaning of the fieldsbrowse recordsAdd a new questionHome page of this databaselogin Valid HTML 4.01 Transitional Valid CSS! Powered by WODA 4.6x trunk