Example #1
0
/**
 * Exposes the authentication functions
 * 
 * @return void
 */
function ws_pack_auth_expose_functions()
{
    expose_function("auth.get_api_keys", "ws_pack_auth_get_api_keys", array("application_id" => array("type" => "string", "required" => true), "title" => array("type" => "string", "required" => true), "description" => array("type" => "string", "required" => false, "default" => ""), "icon_url" => array("type" => "string", "required" => false, "default" => ""), "application_info" => array("type" => "array", "required" => false, "default" => array())), elgg_echo("ws_pack:api:auth:get_api_keys"), "GET", false, false);
    // reregister login function to allow login by email
    unexpose_function("auth.gettoken");
    expose_function("auth.gettoken", "ws_pack_auth_gettoken", array("username" => array("type" => "string"), "password" => array("type" => "string")), elgg_echo("auth.gettoken"), "POST", false, false);
}
 public function testUnexposeFunction()
 {
     global $API_METHODS;
     $this->registerFunction();
     unexpose_function('test');
     $this->assertIdentical(array(), $API_METHODS);
 }