. * * @category AccountManager * @package StatusNet * @author Craig Andrews * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ if (!defined('STATUSNET')) { exit(1); } /** * Implements the JSON Account Management endpoint * * @category AccountManager * @package StatusNet * @author ECraig Andrews * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ class AccountManagementControlDocumentAction extends Action { /** * handle the action * * @param array $args unused. * * @return void */ function handle(array $args=array()) { parent::handle($args); header('Content-Type: application/json; charset=utf-8'); $amcd = array(); if(Event::handle('StartAccountManagementControlDocument', array(&$amcd))) { $amcd['version'] = 1; $amcd['sessionstatus'] = array( 'method' => 'GET', 'path' => common_local_url('AccountManagementSessionStatus') ); $amcd['auth-methods'] = array( 'username-password-form' => array( 'connect' => array( 'method' => 'POST', 'path' => common_local_url('login'), 'params' => array( 'username' => 'nickname', 'password' => 'password' ) ), 'disconnect' => array( 'method' => 'GET', 'path' => common_local_url('logout') ) ) ); Event::handle('EndAccountManagementControlDocument', array(&$amcd)); } print json_encode($amcd); return true; } function isReadOnly() { return true; } }