Changeset 25118 for trunk/include/ws_functions.inc.php
- Timestamp:
- Oct 24, 2013, 6:21:24 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r25117 r25118 3217 3217 array( 3218 3218 'name' => $params['name'], 3219 'is_default' => $params['is_default'],3219 'is_default' => boolean_to_string($params['is_default']), 3220 3220 ) 3221 3221 ); … … 3313 3313 if ($params['is_default'] !== null) 3314 3314 { 3315 $updates['is_default'] = $params['is_default'];3315 $updates['is_default'] = boolean_to_string($params['is_default']); 3316 3316 } 3317 3317 … … 3555 3555 function ws_users_setInfo($params, &$service) 3556 3556 { 3557 global $conf ;3557 global $conf, $user; 3558 3558 3559 3559 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); … … 3564 3564 } 3565 3565 3566 $updates = array();3566 $updates = $updates_infos = array(); 3567 3567 $params = array_map('trim', $params); 3568 3568 … … 3593 3593 { 3594 3594 $updates[ $conf['user_fields']['password'] ] = $conf['password_hash']($params['password']); 3595 } 3596 3597 if (!empty($params['status'])) 3598 { 3599 if ( $params['status'] == 'webmaster' and !is_webmaster() ) 3600 { 3601 return new PwgError(403, 'Only webmasters can grant "webmaster" status'); 3602 } 3603 if ( $user['id'] == $params['user_id'] ) 3604 { 3605 $params['status'] = $user['status']; 3606 } 3607 if ( $conf['guest_id'] == $params['user_id'] ) 3608 { 3609 $params['status'] = 'guest'; 3610 } 3611 $updates_infos['status'] = $params['status']; 3612 } 3613 3614 if ($params['level'] !== null) 3615 { 3616 if ( !in_array($params['level'], $conf['available_permission_levels']) ) 3617 { 3618 return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid level'); 3619 } 3620 $updates_infos['level'] = $params['level']; 3595 3621 } 3596 3622 … … 3600 3626 array($conf['user_fields']['id'] => $params['user_id']) 3601 3627 ); 3628 3629 single_update( 3630 USER_INFOS_TABLE, 3631 $updates_infos, 3632 array('user_id' => $params['user_id']) 3633 ); 3602 3634 3603 3635 return $service->invoke('pwg.users.getList', array('user_id' => $params['user_id']));
Note: See TracChangeset
for help on using the changeset viewer.