This topic is locked

only 1 record per user?

3/17/2008 5:20:10 PM
PHPRunner General questions
P
paul paulousek author

I just created my first phprunner-app. The goal was to create an application-application, which provides this functions:

  • form-filling, uploading, every user can only see his own stuff. all that works perfectly
    but:

    How can I prevent a user from creating more and more records?

    But to open/edit his first (and only) one again? (And automatically redirect him to his record after log-in?)
    Since one can only apply for a job once ....
    Any hints?
    thanks!

A
alang 3/17/2008

You can add some code to the "Before record added" event. The code would then return false if the user already had a record in the system.

P
paul paulousek author 3/17/2008

You can add some code to the "Before record added" event. The code would then return false if the user already had a record in the system.


Thanks!

"some code" means to perform a search for a unique-key and then forwarding to an "edit record" form, right?

But: Isn't "before record added" too late? When this event is triggered, the user has already filled out a new form, doesn't he?

So I guess the best solution would be to perform the functionality mentioned above using a "user has logged in" event.

Do I have this event predefinied in PHPrunner?
best regards,
paul

Alexey admin 3/18/2008

Paul,
Yes, there is the "After successful Login" event.
There is another way to do that.

Disable Add page for the table.

When the user is created (registered) add a corresponding record to the table manually in a PHPRunner event.

P
paul paulousek author 3/18/2008

Paul,

Yes, there is the "After successful Login" event.
There is another way to do that.

Disable Add page for the table.

When the user is created (registered) add a corresponding record to the table manually in a PHPRunner event.


Thanks again! That's exactly what I was looking for!