| 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 |
| 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)) { |
| 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 |
} |
} |