From a035a6f8e33661ac811309ca74b9eeb5005f8af0 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 22 Oct 2010 15:06:49 +0000 Subject: [PATCH] Add registration/fields API Fix $roles array use colliding with global $roles array ($roles should never be used anywhere! its a master list of all of the roles set in the bootstrap!) --- activities.php | 2 +- api.php | 43 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/activities.php b/activities.php index 2313163..06c53d7 100644 --- a/activities.php +++ b/activities.php @@ -97,7 +97,7 @@ case 'save': -0)) { + $ret['status']="ok"; + $ret['fields']=user_get_fields(array_keys($u['roles'])); + } else { + $ret['status']="error"; + $ret['error']="Currently logged in user has no roles"; + } + } else { + $ret['status']="error"; + $ret['error']="No roles submitted and not logged in"; + } + } + break; + + default: + $ret['status']="error"; + $ret['error']="invalid registration API command ({$request[1]})"; + } + break; + default: $ret['status']="error"; $ret['error']="invalid API command ({$request[0]})";