Please upgrade here. These earlier versions are no longer being updated and have security issues.

Data and parameters in vanilla popup form

steamsteam www.planamigo.org - #1 foro planes amigo
edited November 2015 in Vanilla 2.0 - 2.8

Hi,
I have some questions.

first question:
I have popup form created by vanilla with textarea.
When I save textarea value I need to do sanitize ?

second question:
On the DiscussionController_AuthorInfo_Handler I create the link to open popup window like:
Anchor(T('evaluate'), "discussion/evaluate/{$UserID}/{$Email}", 'Evaluate Popup');

To pass the user email to my event (DiscussionController_Evaluate_Create) is only by the parameters way ?

I don't like pass user email by parameter and don't like make a select user email from database by user Id
Can I save user email in the user session and then remove it ? Or save it an global variable ?

Thanks.

Tagged:

Comments

  • steamsteam www.planamigo.org - #1 foro planes amigo
    edited November 2015

    @R_J dijo:
    You can use the function "stash" from the session class

    Is this "stash" function save values on the db ? Not on the memory ?

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    My fault: you wanted to not use the memory, correct? As you can see from the code: https://github.com/vanilla/vanilla/blob/master/library/core/class.session.php#L631 it uses the db.

    I really would recommend to use the frameworks benefits. In this case it would be the cached user from userModel->getID()


  • steamsteam www.planamigo.org - #1 foro planes amigo

    @R_J dijo:
    My fault: you wanted to not use the memory, correct? As you can see from the code: https://github.com/vanilla/vanilla/blob/master/library/core/class.session.php#L631 it uses the db.

    I really would recommend to use the frameworks benefits. In this case it would be the cached user from userModel->getID()

    No @R_J its my fault for not being able to explain well.
    I wanted to use the session and save in memory the value and after get it remove the value for clean the memory. Save and clean on the session (memory) small value is less costly than open and close the connection to bd
    I'm more used to program in java and java keeps session in memory.

    If you use userModel->getID(), the user info is taken from the cache

    But I want to get another user email, no logged session user. I think that value will not be cached.

    Another solution could be use ajax

    I try to see all possibilities of vanilla framework and play with it =)

  • steamsteam www.planamigo.org - #1 foro planes amigo
    edited November 2015

    I have another question.
    How can I redirect from my method to the end of the discussion with refreshing the page ? With the popup window I save the comment and I want to show it.

Sign In or Register to comment.