$this->make_api_hook('user', AUTH_COOKIE, 'api_user_readonly'), ); } // This handler supports the following URL patterns: // /api/1/user/{forlife}/isRegistered function handler_user(PlPage& $page, PlUser& $authUser, $payload, $user = null, $selector = null) { // Retrieve the PlUser referenced in the request. Note that this is the // target user, not the authenticated user. $user = PlUser::getSilent($user); if (empty($user)) { return PL_NOT_FOUND; } if ($selector == 'isRegistered') { $page->jsonAssign('isRegistered', $user->isActive()); return PL_JSON; } else { return PL_NOT_FOUND; } } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>