Custom profile elements not visible to Admin account

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
4/5/2012 10:41:34 AM
Gravatar
Total Posts 104

Custom profile elements not visible to Admin account

I have set up some additional profile elements, and I want to limit the access to change them to just Administrators and Role Administrators...

  <add name="Credentials"     type="System.String"     allowMarkup="false"           resourceFile="ProfileResource"     labelResourceKey="Staff Member Credentials"     lazyLoad="false"     requiredForRegistration="false"     allowAnonymous="false"     visibleToAnonymous="true"     visibleToAuthenticated="true"     visibleToUser="true"     editableByUser="true"     regexValidationExpression=""     regexValidationErrorResourceKey=""     maxLength="100"           cssClass="widetextbox"     onlyAvailableForRoles="Administrators;Role Administrators"     onlyVisibleForRoles=""     includeHelpLink="true"       />

...the problem is that when I set the value in "onlyAvailableForRoles", the main Admin account (myself) cannot see these anymore...

4/5/2012 10:58:45 AM
Gravatar
Total Posts 2253

Re: Custom profile elements not visible to Admin account

Use:

onlyAvailableForRoles="Admins;Role Admins;"

HTH,
Joe D.

4/5/2012 11:05:27 AM
Gravatar
Total Posts 18439

Re: Custom profile elements not visible to Admin account

Put

Admins;Role Administrators

Roles have both a role name and a display name, the Administrators role name is Admins, though I know that is a little confusing it can't be changed for historical reasons. The display name of roles can be edited but the role name cannot.

Note that onlyAvailableForRoles means this property is only available on users who are members of those roles, ie it won't be a property on users who are not in those roles. 

Hope that helps,

Joe

4/5/2012 11:13:28 AM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

Thank you for your response Joe!  : )  I have tried a number of different combinations and nothing seems to be working.

At first, I thought it was the difference between "Admins" and what is set up under "Role Administration" on the main site, which now reads "Administrators", of which I am a member ("Admin").  But I have tried "Admins", "Admins;Administrators;" and just "Administrators" for onlyAvailableForRoles, and nothing seems to make this visible to just my account ("Admin").

I guess I'm also not clear on the difference between onlyAvailableForRoles and onlyVisibleForRoles.

I also tried to create a new member/user and I still cannot get these items to show.

Does one have to restart the server or something after making custom changes to a mojoProfile.config file?  I have tried to go into the Web.config file and make a change, thinking that might do something, but this doesn't seem to make any difference either...

What I am trying to do is set up custom profile items that are only available and/or visible to Administrators and Role Administrators to set up, but I would also want them to be displayed in any member list on the site.

I do appreciate any direction you might be able to provide...  : )  Thanks again!

4/5/2012 11:18:58 AM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

I went back to the main site and changed the display name back to "Admins" (Administration Menu >Role Administration), then updated my custom profile file on the secondary site, mojoCustomProfile.config and set it to onlyAvailableForRoles="Admins;Role Administrators", but the profile item is still not visible.  Is there something that perhaps I need to reset somewhere?

Thanks again Joe and Joe! : )

4/5/2012 11:20:09 AM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

ah ha!  I think I understand what you're saying now Joe A. : )

4/5/2012 11:23:02 AM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

hmmm.... changed two lines to

    onlyAvailableForRoles="Staff Members"     onlyVisibleForRoles="Admins;Role Administrators"

the profile belongs to the role "Staff Members", and my account is a member of "Admins", but I still can't see the profile item...

4/5/2012 11:51:52 AM
Gravatar
Total Posts 18439

Re: Custom profile elements not visible to Admin account

should be:

onlyVisibleForRoles="Admins;Role Admins"

as Joe D pointed out.

Look in the database in the mp_Roles table and make sure your RoleName there is what you think it is ie "Staff Members", if it matches the rolename in the database it should work, I just tested it here and it works for me.

Hope that helps,

Joe

4/5/2012 1:30:00 PM
Gravatar
Total Posts 18439

Re: Custom profile elements not visible to Admin account

fyi, I implemented support for CheckboxList questions in user profile today. It is in the source code repository now so it will be in the next release. There is an example in comments in mojoProfile.config

Best,

Joe

4/5/2012 3:38:27 PM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

Hey thanks! : )  That's speedy!

It looks like I somehow have 3 "Admin" accounts in the database.  I don't suppose you have an UPDATE/JOIN statement you might have used for this kind of thing before do you... ? :D

 

4/5/2012 3:55:56 PM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

ah - nevermind - It's probably because I have three sites lol

4/5/2012 4:33:36 PM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

and you were right there Joe A. - thanks!  looked it up in the table and sure enough, it was a bit different...

4/5/2012 6:35:31 PM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

seem to be running into some more challenges here....   I thought that if I set     visibleToAnonymous="true"     visibleToAuthenticated="true"  , that these elements should show up on the ProfileView page....   which is not happening....

4/5/2012 6:39:26 PM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

I see that if I change - onlyVisibleForRoles="Admins;Role Admins;Staff Members"

to - onlyVisibleForRoles=""

then it now shows up.

So, I am really confused about how these settings are supposed to work together I guess...

    visibleToAnonymous     visibleToAuthenticated

vs.

    onlyAvailableForRoles     onlyVisibleForRoles

4/5/2012 6:58:39 PM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

it also appears that use of the system.boolean, with the true and false images does not appear to be working... instead, I see something like this generated in the HTML source...  

<NeatHtmlReplace_img src_NeatHtmlReplace='/Data/SiteImages/true.png' alt='customItem7' /></div>

is there a library missing perhaps? 

4/6/2012 8:27:52 AM
Gravatar
Total Posts 18439

Re: Custom profile elements not visible to Admin account

onlyVisibleToRoles will trump the other visibleTo settings.

onlyAvailableForRoles determines which users will have the property at all, if they don't have the property it will not be visible to anyone

Keep in mind there are 3 places where these settings matter, "My Account" aka /Secure/UserProfile.aspx which is where the user can manage their own profile, /Admin/ManageUsers.aspx which is where admins can manage user profile properties, and ProfileView.aspx which is where site visitors can view a members profile.

visibleToAnonymous only comes into play on ProfileView.aspx in the case where unauthenticated users are allowed to view the member list they are also allowed to view the user profile, but you may not want them to be able to see all the properties on the user profile if they are not signed into the site, so setting this to false would hide the property in that case, but again, if true will be trumped by more restirctive setting of roles on the onlyVisibleToRoles.

onlyVisibleToRoles applies to all 3 places, ie if the user is not in the roles he will not see it on his user profile.

if you want the user to be able to see it but not edit it just set editableByUser to false

I confirm the problem with the boolean properties not displaying the images for true and false on ProfileView.aspx as a bug, I've just fixed it in my copy so it will be fixed in the next release coming soon.

Hope that helps,

Joe

4/6/2012 11:49:21 AM
Gravatar
Total Posts 104

Re: Custom profile elements not visible to Admin account

thanks again for your time, information and prompt responses : )

4/9/2012 11:02:03 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Custom profile elements not visible to Admin account

In the interest of total clarity, the setting name is actually onlyVisibleForRoles. I'll update the User Profile Configuration document soon with Joe's extra note about how the onlyVisibleForRoles setting takes precedence over all other visibility settings.

Jamie

You must sign in to post in the forums. This thread is closed to new posts.