User profile editing in drupal - drupal-6

1.) I had an implementation for user registration for which I needed to make two extra tables and used "users" table as well(I've made a custom module for this purpose). I've collected the information while user is registering and put them in appropriate tables. Now I need to provide user with an interface where he can update his profile(this includes tables which I mentioned above).
2.) Further more, I need to make filters that admin can see the list of users e.g. who have salary more than $10,000. I need to provide two predefined filters and facility to make more filters for admin.
How can I do both of the above question? is there any module?
Thanks for your reply.

1) You could use hook_user "form" operation to add fields to the user account edit form. You could then use the "submit" operation to write any changes to the database.
2) I recommend using the Table Wizard module to expose the data to Views. Then use Views to do the reporting. That would give you the ability to easily add more filters later, as needed.

Related

Populate data back to form in Kentico

Here's what I'd like to do but not sure how to. I have a form that's like a typical doctor/school form, where the form has 2 sections: [1] Section 1 at the top is for user (with standard fields like First Name, Last Name etc.), and [2] Section 2 at the bottom is for Admin/Office use only (with fields like Reviewed by, Approved/Not Approved etc.)
what I was able to do is to process Section 1 where I got ALL users' submission and display all their data on a webpage using a RepeaterWithCustomQuery. That's pretty basic. But in order to do what described above, I guess that I'll need to pull the submitted data and populate them back to Section 1 of the form (maybe as readonly data at this time) and then the Office/Admin staff can fill in Section 2.
I hope I made sense and hope that someone can point me to the right direction. I only use Portal Engine, no access to file system or backend.
I think I understand your issue you want to have some sort of an editor for biz form data. Similar to what you have in the admin. And the problem is that you don't have access to backend. :( Such thing is available for custom table data (there is web part), but not for biz form data. There is no ready to use web part. Here is old topic on that https://devnet.kentico.com/questions/how-to-edit-the-information-of-a-record-using-the-bizform-layout.
you want to have something like the admin page for editing form records:
/CMSModules/BizForms/Tools/BizForm_Edit_EditRecord.aspx?formID=7&formRecordID=1
but customized :(. I'd say without back end access the only options I see:
Create a new role "Biz Form Editor" (or use existing) that has rights only to edit biz
form data. So all your people who do "validation" part must have a
Kentico account with role "Biz Form Editor".
Add link above to your repeater with appropriate record id.
P.S. There are special code names for alternative forms (https://docs.kentico.com/k8/configuring-kentico/creating-alternative-forms/code-names-of-automatically-used-alternative-forms). If you create an alternative form with special name update the system will automatically load it when you edit the record.
Not sure that I understood correctly your question. But what you need is to use alternative forms. So the idea is that one form is for "registration" and the 2nd one for "validation".
So in your registration form you show only firstName, lastName etc and you don't show "validation" fields. In the validation form you show firstName, lastname etc as label and show textboxes for validation fields.

How to edit a record(s) with multiple form xpage?

I have an xpage that allows the user to choose a customer and then order products for that customer. It's not a simple xpage that created a document, uses a view control to view it and re-edits it. It will be used on the web and in the client. How do I fill in all the data for the various fields when the user wants to look at their order for a company since there are multiple documents that make up that xpage? Is there automatic processes or do I need to do it manually?
The best method is to use multiple datasources (the Notes documents) each with a different datasource name. When saved, be sure to save each of the datasources that have a change. Also, it is helpful to mark to "ignoreRequestParameters", so each one acts independently.
I have found that using the dynamic content control useful when doing things like this, it seems to reduce the number of replication/save conflicts.

How to Enabled a single field for update for a particular role in CRM 2011

What I need
I have a custom Entity with that with multiple fields. Admin Role has "god" access. All other roles except for one have read only. The one non admin role with update access, should only be able to update a single field.
What I believe to be true
I believe I have three main options to implement this requirement:
Enable Update Access to the role for that entity then write Javascript to disable all fields on the form for that role, except for the one that I want that role to be able to edit
Enable Update Access to the role for that entity then create a new form that disables all fields on the form for that role, except for the one that I want that role to be able to edit.
Enable Update Access to the role for that entity then turn on field security for each field, disabling access using the field security, for each field except for the one I want them to edit.
What's the Best Practice?
What options should I choose?
If I go with options 1 or 2, will the user be able to edit the field on the bulk edit form?
From a user perspective, I think it's confusing when a form opens up with things enabled, then they get locked down. Plus someone could possibly get data in there before the fields get locked. I'd say you'd have to combine this with a plugin to prevent changing fields you don't want changed.
I like this option better, although again, the field can be unlocked if someone knows what they're doing, so a plugin to double check would be nice.
This would avoid having to double check in a plugin, but you also have to rely on the admin correctly setting up security for new fields going forward. If that's not a concern, this might be best.
Bulk edit is a global privilege, so they'd have bulk edit for all entities. Also, the bulk edit form does not load scripts, so that knocks out option 1. I'd say if it's just this one field, I might leave the privilege locked down and provide my own Bulk edit button on the grid that would show a custom page that just has that one field on it, then handle the updates though script.
2 is most likely best, or as an alternative put the fields in the header or footer rather than as read-only fields on the form.
This also means the fields won't be available to bulk edit, but other methods such as data import or workflows would let users get round this if they know how and have rights to do such things.
3 Field Security is the most robust and works for all scenarios
Possible option 4: create another entity to contain those fields and apply different security to that entity. If created as a child, show the record in a grid on the form with the values included in the view. If it is a parent then you could use methods such as showing the values via an HTML webresource page included on the form.

Best way to implement RBAC with Access

I'm programming a new application with many users, a few roles and specific permissions for those roles. For that I want to create the following tables:
Users (ID,Login, password,..)
Roles(ID,Rolename)
User_Roles(User_ID, Role_ID)
Permissions(ID,PermissionName)
Permission_Roles(Permission_ID, Role_ID)
My idea was to build a function, which allows to check if a user has a specific permission to access a form. I would do that by creating Permissions/Rules like 'canReadFormX', 'canEditFormX' which would allow me to use one main function to check and perfom those specific rules and a function per form to call it.
Is that a way to go (or rather did I understand everything correctly regarding RBAC) or is that just far to complicated? Any advise is very appreciated!
It seems fair to me, and similar to what we have already set, for the first 3 tables.
You then have to solve the 'action' problem, ie to distribute permissions to use your appl's actions. I am not sure that your 'Permissions' proposal will cover all the situations, as you have to deal with 2 major categories of actions:
The 'Open form' actions, that you already have identified: you effectively have to define 2 levels of authorisation for each form: the 'view' right, and the 'update' right.
All other actions, such as form specific buttons or menus, that will allow you to run a specific action other than just opening a form (execute a report, make a specific calculation, automatically import or update data, etc).
One solution/My advice is to maintain 2 tables for this:
A 'Forms' table
An 'Actions' table
And the corresponding link tables:
A 'Form_Role' table
An 'Action_Role' table
With such a configuration, you are fully covered. You can even decide which role has the right to see a specific report on a specific form, as long as the corresponding action is accessed through a specific control or menu on the form.
Both Forms and Actions tables are very interesting as they both participate in your application metamodel...
EDIT: By the way, if you are on a domain, you can use user's domain credentials to control his\her access rights to your system. In this case you do not need to store a password in your RBAC system.

Drupal: How to add a form and perform functionality on it

I am new to Drupal and trying to get hand on it.
I am not able to find how to have the following functionality on my site. If anyone can help me out, it would be great for me.
I need to have a form that will take 2 fields one of which is supposed to be the login id(how to retrive login id?). I need to store this and display in tabular form also on a new page. Lastly I want to provide an edit form for this functionality using the same form but its use will be like whenever a person adds value in this form, it checks in Table1, if entry is not present it adds in table, else it updates the table.
Apart from this I need to store all the updations in a seperate table or something like that, so that I am able to see the history of all the changes
Eg:
ADD Form:
Fields:
- LoginID
- Phone number
Show Table Page(Tabular with the stored information)
Edit Form(same as above form):
Fields:
- LoginID
- Phone number
Now If I add my phone number to this it will get stored. Later when I try to modify my number it should update in initial table but also store the history of old and new entry in a separate table so that I can perform varies options on it.
I also dont know how to add/enable form fields in drupal. :(
Thanks
I'm not entirely sure what you're asking, but I think the Computed Field module might be helpful. The module allows you to define custom hooks that run when a node is saved.
If you're not creating nodes and are using something like the Webform module, you should be able to write a module to process the data.

Resources