WSO2 IS 5.3.0 Unable to change attribute list in user profile - user-profile

I have setup WSO2 IS 5.3.0 with an Active Directory as secundary user store.
I am able to find users from the AD, and view their user profile in the management console.
I would now like to modify the list of attributes that are displayed in the user profile screen. I already found documentation saying I should edit the corresponding claims, setting the attribute 'Supported by Default' to true for the desired claims, and also setting the desired number in the 'Display Order' attribute. So I modified some local claims, but these changes have no effect on the User Profile screen: I keep getting the same original list of attributes (First Name, Last Name, Organisation, Country, ...). Can anyone tell me what I could be doing wrong ?
The secondary user store is configured with the following settings:
screenshot AD configuration
This is the user profile screen for my user account in the AD.
An example of a claim modification is for the local Country claim where I set the 'Supported by Default' to false and changing the 'Display Order' from 4 to 0. When opening the user profile screen again, the content remains unchanged (country field is still there).
Another example is when I try to add another claim in the user profile screen, such as the local Date of Birth claim, by setting the 'Supported by Default' to true and changing the 'Display Order' from 0 to 4. Again, nothing changes in the user profile screen either (date of birth field is not present).
For the Organisation claim that is present in the user profile screen, but that is currently empty, I added an attribute mapping to the 'company' attribute that exists in the AD, but when looking at the user profile screen again, this field remains empty.
Let me know if any further details are needed (I would have added some more screenshots, but as a new user on this forum, I'm currently limited to 2 links in my posts...).

In the end, I did a complete reinstallation (including setting up an oracle DB as carbon DB instead of the H2 DB), and this time everything works correctly. Something must have gone wrong during the first installation.

Related

Show only content of the visitor

I have an app where I want visitors to be able to write down some text.
They are the only ones that are allowed to see their own entries.
In order to allow people to create an entry I have set the security of the content type: crud is permitted for those who have viewing rights.
In the query designer I have basically just the list of the content type. So, of course any visitor that can see the page, sees all entries.
How can I limit the results so the visitor only sees her/his own entries? If I add the ownerfilter in the query designer, the results come up empty.
So basically what you should do is give these permissions on the type:
Registered users (or those who may add) should have c permission (create). They must be logged in - so don't use "everybody" - otherwise you won't know who added it.
Owners (those who created the record) should have edit permission (I wouldn't give them delete)
In the visual query, you should then use the owner-permissions. As a host-user you can only test it, if you also made some records.
OK? otherwise just add more infos.
Or just add a field that stores the username. When you show the entries, only show the ones where the current username matches the username field :)

Drupal how to have certain admins only see the users they've created

I use Drupal 7 and would prefer to do so but if I need to use Drupal 6 I will. I have a Drupal 7 site that I allow "advisors" to create authenticated users. I am an admin on the site so I see and can do everything. All that an "advisor" can do is create and edit authenticated users. Is there a way to make a view that displays the users that the particular advisor has created while the advisor is logged in?
If you don't understand what I'm saying let me put it this way. I am the admin of the site so I can do everything. I created a user role called advisor. There's also an authenticated role for users. Advisors can create authenticated users. So I have Advisor 1. Advisor 1 created 10 users. I also have Advisor 2. Advisor 2 created 3 users. I'd like a page (more than likely built with views - and I've used views before on other sites so I'm familiar with them) - I'd like a page that Advisor 1 could go to once logged in and it would display all of the 10 users that they created. Advisor 1 wouldn't see the users that Advisor 2 create.
Is this possible? Any help on this would be greatly appreciated. Thank you in advance.
I have implemented something similar and I can give you some guidelines.
First of all drupal 7 doesn't store the information of the creator of the users.
So, in order to track this you will need to attach a custom field to the user to keep this information.
In such case you ll have to make sure that every creator can insert only himself in this field and not anyone else or you 'll have to find an automated way to fill it in.
I suggest you use field permission module for setting permissions to this field (users probably should not even have view, creators should not be able to change it etc ) and computed field module for automatically populate the field (eg creator_field) upon creation for example with the uid of the creator.
Finally when creating the view you could add contextual filtering by using the logged in user on the creator_field.
You should also have a look at Organic Groups. I haven't use it but might be helpful
Hope it helps.
Updated
Add
global $user;
$entity_field[0]['value'] = $user -> uid;
to the Computed Code (PHP) in the computed field settings and store the value as integer in "Database store settings". Then in your view you should add a view of user with contextual filter of creator_field. In the contextual filter settings you must set "provide default value" -> "User ID from logged in user" in the "WHEN THE FILTER VALUE IS NOT IN THE URL" section.
This could be done relatively easily in Drupal 7 by adding a field to the user profile that points back to the user creator (using the Entity Reference module). Profile2 could offer a shortcut to making this field available on a profile, though if this is the only customization that you need to add to your profiles, it would be cleaner to do this in a custom module.
A view (Views module) could be configured to output a list of users with the current logged in user as the creator.
You'll also need to add similar logic for user_access to allow/restrict profile editing (if the current user is the user referenced in the profile). A permissions hook also could be useful if you plan to have different admin levels.
The Tokens module should work to insert this value for the new user, by inserting the current user into the field. Or you can do this before the user is saved. It would go a little something like this:
function mymodule_user_presave(&$edit, $account, $category) {
if ($account->is_new) {
global $user;
$created_by = $user->uid;
$edit['created_by'] = $created_by;
}
}
Good luck.

How i can change my assign user role in wordpress 3.5.1 database

This time my user role is 'Admin' but i have to change my role 'Editor' by change in database and give to assign that role.
I also read it
Here's a link!
Thank you.
There is a table called wp_usemeta. In it, there is a setting for your admin user's priviledges. You'll find a field that contains something like "a:1:{s:6:"administrator";b:1;}", and you want to change it to be "a:1:{s:13:"editor";b:1;}". (not including the quotes).
Back up the mysql database first beforehand in case it's further broken.
Credits

send a mail to a user with a link

In my project i am sending a mail to the user to create a user account. I want to enable that link for the first time he/she clicks the link. if he clicks the link for more than 2 times,then it should go to custom error page.how to do this?
This depends on how the link is generated.
For example: If your link contains a username as GET-parameter, then you could simply query your database if the username is already in use. I would advise against that, because the user can easily change that GET-Parameter
I would recommend this: Your link should contain a unique identifier, most likly a hash. This hash is stored somewhere, to garantee it's uniqueness, like in the usertable of your database (a column for the hash of the registration link). That might also come handy, because you could create new user rows and already prefill them with necessary information. You could use these information upon rendering to insert text into the textboxes

Drupal Views Content Profile User as an argument

I have a normal Drupal User. I have used the content_profile module to create a profile content type. This content type contains a node reference to another content type company. The company node then references a type of node called Task.
I want to create a view that list all the tasks for a given user id.
So I imagine I would create a view with an argument of user id. Then I would add the relationship to the profile and the company and output the Task title.
The user id used seems to work on the created used ID and not the user id of the content profile that it is referencing. In our system the "admin" user creates the profiles so it causing some problems.
Any ideas? I feel I may need to write a custom module to do what I want.
i have answered a similar question in the past about how to create a view using part of the url as an argument to filter the view by the user profile. check out this url. the answer you are looking for may be a variation of my original response.
also, how are you creating those profiles? on one of my sites, when i created the profile page, its author ID is automatically changed to the user it is associated with.

Resources