'failed', 'cause' => 'error', 'detail' => 'Database connection failed.')); exit; } //************************************************************************************* switch ( $_SERVER['PATH_INFO'] ) { case "/list_users": // List valid API user-acounts. // Fail with notauthorized if current authentication // does not have write access. case "/authorize_user": // Add or update a valid back-end user in authorization // if the current authentication has write access. // Since the user exists in backend, the only // needed parameters should be username and access level // If the authorization does not exist, add it. // If the user is already authorized, replace access level. case "/add_user": // Add user to backend if backend is read-write and // the current authentication has write access. case "/update_user": // Update the given user in the backend, if the backend // is read-write, and the current authentication has // write access. case "/remove_user": // Delete user from backend if backend is read-write // and the current authentication has write access. case "/list_apikeys": // List valid API keys. // Fail is current authorization does not have write access. case "/new_apikey": // If the current authorization has write access, create // a new API key with requested access (ro/rw). case "/remove_apikey": // If the current authorization has write access, // remove the given API key. print json_encode ( array( 'response' => 'notimplemented') ); break; default: print json_encode ( array( 'response' => 'invalid') ); } //************************************************************************************* mysql_close( $config['sql_link'] ); ?>