Hello All,

I need a php script that will create permissions for the user.Though we have all the access controls in drupal.I still need more than that.I'm new to php,it would be nice if any one can tell me how the php script is built for the controls that we use in drupal access controls.
that way I can try modifying as needed

Thanks

Comments

neruda001’s picture

Hello!
I know it's useful to browse trough your MySQL DB to understand how Drupal thinks.
I've found a table called USERS.
You can insert user account in this table manually.
using password encription is reccomended.
from php for example following code maybe an example:

$link_id = mysql_connect("DB hostname","DBusername", "password");
mysql_select_db(DB name,$link_id);
mysql_query("INSERT INTO USER (NAME, PASS, EMAIL, ETC....) VALUES ('USERNAME', PASSWORD('YOUR-PASS-HERE'), some@thing.ciao");

the php should connect to DB and query creating the account.
All the field of the table must be filled!! so look at the table and fill them with the right values.

and so on, the table PERMISSION contains all access rules, the table ROLE contains ruleset name, and the table USER ROLES contains reference between user and roles-set.
you can make your PHP script using UPDATE and INSERT mySQL's commands. Or edit the tables manually in the SQL query browser.

Nothing too difficult! :D

ciao!

Pablo