Monday, April 27, 2009

Affliations

Affiliations are special realms that cross over multiple web-groups in Epiware.  Affiliations are assigned under a user's profile.  Affiliations are also to be found in the Library permissions area.


If you need to change the affiliations in your Epiware install, you are just a few short SQL statements away.

SQL Statments for Affliations:

To find affiliations:
select * from `realms` where `group_id`=0 and `key_realm` = 400;

To add a new affiliation:
insert into `realms` (`group_id`,`realm_name`,`description`,`key_realm`) values (0,'My Affiliation','default user classification',400);
    * the key values to remember here are group_id = 0 and key_realm=400
    To get the new realm_id, one can use the following immediately after running the insert statement(or do the select statement above):
    set @new_realm_id = last_insert_id();


To remove all current affiliations:
delete from `realms` where `group_id` = 0 and `key_realm`=400;

To reassign all users to a new default realm
update `users` set `classification`=@new_realm_id;

No comments:

Post a Comment