Frage

I need to perform an action like save the result for a survey for a guest user(non registered/not logged in) in elgg, in which the user only gets a page having a form of data . I manage to get this thing but, when i submit the action it shows the error

Sorry, you cannot perform this action while logged out.

and redirect to the login page.

How to solve this issue Thanks

War es hilfreich?

Lösung

check the register_action , there is a parameter $public with options true/false

if u set it to true this action be accessed by people not logged into the system.

Andere Tipps

The problem is that each action that is called gets checked by elgg with the action-_gatekeeper() method.

The easiest way to get around this is to not have your survey results sent to a script defined as an action, but rather just have your form submit directly to your script (have the submit URL be something like www.your site.com/mod/yourPlugin/handleSurvey.php )

Yes that's true, you can set action public, but after that for saving results in elgg, you have to override the accesses so that not loggedin user can save data to database.

Check for the Permissions Check

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top