/[drupal]/contributions/modules/accounttypes/accounttypes.module
ViewVC logotype

Diff of /contributions/modules/accounttypes/accounttypes.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5 by rconstantine, Tue Aug 21 16:33:17 2007 UTC revision 1.6 by rconstantine, Tue Sep 4 21:36:39 2007 UTC
# Line 7  Line 7 
7   * make the administration of large role-sets easier.</p>   * make the administration of large role-sets easier.</p>
8   *   *
9   * @version $Id$;   * @version $Id$;
10   * @package NeighborForge   * @package AccountTypes
11   * @category NeighborForge   * @category NeighborForge
12   * @author Ryan Constantine   * @author Ryan Constantine
13   * @filesource   * @filesource
# Line 1189  function accounttypes_user($op, $edit, & Line 1189  function accounttypes_user($op, $edit, &
1189      case 'update':      case 'update':
1190        $problem = 0;        $problem = 0;
1191        $new_valid_rids = array();        $new_valid_rids = array();
1192          $new_initial_rids = array();
1193        $existing_user_rids = array();        $existing_user_rids = array();
1194        $result1 = db_query('SELECT ar.rid, ar.initial FROM {accounttypes_roles} ar WHERE ar.atid = %d', $selectAT);        $result1 = db_query('SELECT ar.rid, ar.initial FROM {accounttypes_roles} ar WHERE ar.atid = %d', $selectAT);
1195        while ($theentry = db_fetch_object($result1)) {        while ($theentry = db_fetch_object($result1)) {
# Line 1222  function accounttypes_user($op, $edit, & Line 1223  function accounttypes_user($op, $edit, &
1223        elseif ($op == 'insert') { //this is just so we don't duplicate error checking; maybe we should.        elseif ($op == 'insert') { //this is just so we don't duplicate error checking; maybe we should.
1224          if (isset($edit['selectAT'])) {          if (isset($edit['selectAT'])) {
1225            $result3 = db_query("INSERT INTO {accounttypes_users} VALUES (%d, %d)", $account->uid, $edit['selectAT']);            $result3 = db_query("INSERT INTO {accounttypes_users} VALUES (%d, %d)", $account->uid, $edit['selectAT']);
1226            $result4 = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", 2, $account->uid);            //$result4 = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", 2, $account->uid);
1227            foreach($new_initial_rids as $key => $value) {            foreach($new_initial_rids as $key => $value) {
1228              $result2b = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", $key, $account->uid);              $result2b = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", $key, $account->uid);
1229            }            }
1230          }          }
1231          else{          else{
1232            $result3 = db_query("INSERT INTO {accounttypes_users} VALUES (%d, %d)", $account->uid, variable_get('accounttypes_default', STD_ACCOUNT_TYPE));            $result3 = db_query("INSERT INTO {accounttypes_users} VALUES (%d, %d)", $account->uid, variable_get('accounttypes_default', STD_ACCOUNT_TYPE));
1233            $result4 = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", 2, $account->uid);            //$result4 = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", 2, $account->uid);
1234            foreach($new_initial_rids as $key => $value) {            foreach($new_initial_rids as $key => $value) {
1235              $result2b = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", $key, $account->uid);              $result2b = db_query("INSERT INTO {users_roles} (rid, uid) VALUES (%d, %d)", $key, $account->uid);
1236            }            }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.3