From: <ch...@us...> - 2011-10-05 16:27:19
|
Revision: 37998 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=37998&view=rev Author: chealer Date: 2011-10-05 16:27:09 +0000 (Wed, 05 Oct 2011) Log Message: ----------- AJAX: return an error if no service matches Modified Paths: -------------- trunk/tiki-ajax_services.php Modified: trunk/tiki-ajax_services.php =================================================================== --- trunk/tiki-ajax_services.php 2011-10-05 16:22:46 UTC (rev 37997) +++ trunk/tiki-ajax_services.php 2011-10-05 16:27:09 UTC (rev 37998) @@ -182,10 +182,7 @@ } $access->output_serialized($ret); } -} - -// Handle Zotero Requests -if ($access->is_serializable_request() && isset($_REQUEST['zotero_tags'])) { +} elseif ($access->is_serializable_request() && isset($_REQUEST['zotero_tags'])) { // Handle Zotero Requests $access->check_feature( array( 'zotero_enabled' ) ); $zoterolib = TikiLib::lib('zotero'); @@ -202,24 +199,20 @@ 'results' => $references, )); } -} - -if (isset($_REQUEST['oauth_request'])) { +} elseif (isset($_REQUEST['oauth_request'])) { $oauthlib = TikiLib::lib('oauth'); $oauthlib->request_token($_REQUEST['oauth_request']); die('Provider not supported.'); -} - -if (isset($_REQUEST['oauth_callback'])) { +} elseif (isset($_REQUEST['oauth_callback'])) { $oauthlib = TikiLib::lib('oauth'); $oauthlib->request_access($_REQUEST['oauth_callback']); $access->redirect(''); -} - -if (isset($_REQUEST['geocode']) && $access->is_serializable_request()) { +} elseif (isset($_REQUEST['geocode']) && $access->is_serializable_request()) { $access->output_serialized(TikiLib::lib('geo')->geocode($_REQUEST['geocode'])); +} else { + $access->display_error(NULL, 'No AJAX service matches request parameters', 404); } function read_icon_dir($dir, &$icons, $max) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |