Profile fields privacy settings

How can I set profile fields first_name and last_name access to "Public" and prevent Users from changing the setting to "Private"? 

  • Are you using any profile plugin? If you're just using the core stuff, then you'll need to create a new view to overwrite the core view located at views/default/forms/default/edit.php

    Then check the $shortname and only print out access level if its not first_name or last_name, if it is, print out a hidden input e.g.

    if($shortname!='first_name' && $shortname!='last_name'){

    echo elgg_view('input/access', $params);

    }

    else{

    //print out hidden field with access set to public

    echo elgg_view('input/hidden', array('name' => 'accesslevel[$shortname]', 'value' => 2));

    }

    At least thats how I'd do it:)

  • @Mark... Yes, I'm using Profile Manager on a elgg 1.8.3 install and used it to create the two fields, first_name and last_name and I'm wanting to set them as being always accessible to the public.

  • The person who is going to answer this topic has the patience of a saint.

  • Surely setting them to public would be as simple as finding them in the admin backend and setting the access controls for them to public? Am I missing something here? I've not used profile manager for quite some time but I'm pretty sure it was in the backend when managing the profile fields.

  • lolz ;-P -- in *your install* (code + db) -- just need to:=

    • find the metadata names for those '..fields first_name, last_name "
    • locate the P/M code that formats the 'form' for user defined fields via metadata names
    • check for fields first_name and last_name
    • detect if *your metadata names are being dispayed on form
    • zap out the form access pulldown options for 'public'
    • and code the corresponding dtects in the P/M actions code for user defined fields' forms.

    could become a fair bit of code browsing|grepping|reading minor headache ;-)

    'ere yew go - and dis warnt a saintly act ;-oO

  • @Trajan... PM gives to option to... 

    Show just one access control pulldown on edit profile form 

    Hide the non editable fields from the Edit Profile form

    What I need is...

    Make access control for this field - 1.User defined  2.Public  3.Friends  4.Private

     

    @Dhrup... Thanks, you're on your way to being a saint.

  • Scoopy Duh PoopZy DitzY Sainty LOLZIEs ? ! don't let them hear yeeuw say datz :-P coz maybe ;-P