This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Field visible to everyone


  1. grimdesigns
    Member

    Where can I find the function that controls the fields visible to everyone parameter. I am working a customizing this feature and I want to modify the function(s) that control this. If someone can point me in the right direction, I would greatly appreciate it.

    Thanks,
    Garfield

    Posted 14 years ago #
  2. yuniar

    Hmm.. you'll need to be more specific on this, so that we could point you into the right direction.
    What kind of modification would you like to do with the field visibility?


    MachForm Founder

    Posted 14 years ago #
  3. grimdesigns
    Member

    Okay, I modified the software and created different username and passwords to log in. All of the accounts, once logged in, can view the form, but I want a certain account type, to view the form but without the form elements that have been flagged as admin only. These elements should only be viewed by a higher role. The problem is once your logged in, the system currently does not care which user type you are and it shows you all form elements. So I want to target where it's writing the form elements and modify it so it not only checks for session (I'm assuming its a session check you have), but it also checks for the user type. If the user type is not the correct level, then it shows the form without the fields that have been flagged admin only.

    I hope that wasn't too much :-)

    Posted 14 years ago #
  4. grimdesigns
    Member

    I think I solved this for now.
    I changed this:

    if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element
    continue;
    }

    To this:

    if($element_data->is_private){ //don't show private element
    continue;
    }

    So now it never shows the private fields on the view.php page. Now I adjust need to modify this: empty($_SESSION['logged_in']) to target the userID in the session.

    Am I on the right track?

    Posted 14 years ago #
  5. yuniar

    Yep, you have it correct already! :-)


    MachForm Founder

    Posted 14 years ago #

RSS feed for this topic

Reply