X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fsquirrelmail_rpc.php;h=92308e75d980738e91b0f376ca8856c653d75156;hp=b262f30597018082f3d0a8ce645bf77399de82f4;hb=a49f857e6e78488abd83d458b59dd49d4d3b7786;hpb=c1c0ce3ea913ecc18feadf46d31d0416586dc215;ds=inline diff --git a/src/squirrelmail_rpc.php b/src/squirrelmail_rpc.php index b262f305..92308e75 100644 --- a/src/squirrelmail_rpc.php +++ b/src/squirrelmail_rpc.php @@ -6,7 +6,7 @@ * This file contains the entry point to the "SquirrelMail API" -- the * remote procedure call request receiver. * - * @copyright © 1999-2007 The SquirrelMail Project Team + * @copyright © 1999-2008 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -55,13 +55,31 @@ require('../include/init.php'); +//FIXME: do we need to put this list somewhere else? +//FIXME: do we want to use constants instead? probably not a bad idea, although plugins probably won't, so we still want to try to keep track of the plugin error codes too if possible (new plugin website should help) +/** + * Known core error codes: + * + * 1 - No RPC action was given in request (please use "rpc_action") + * 2 - RPC action was not understood (perhaps a needed plugin is + * not installed and activated?) + * + * Known plugin error codes: + * + * 500 - Empty Folders plugin efPurgeTrash action failed + * 501 - Empty Folders plugin efPurgeAll action failed + * 502 - Empty Folders plugin efDeleteAll action failed + * + */ + + + /** * Get RPC Action (can be in either GET or POST) * */ if (!sqGetGlobalVar('rpc_action', $rpc_action, SQ_FORM)) { -//FIXME: establish error codes (using 99 in the interim) - sm_rpc_return_error(99, _("No RPC action given")); + sm_rpc_return_error(1, _("No RPC action given")); } @@ -96,6 +114,9 @@ $oTemplate->header('Cache-Control: no-cache'); * in an array in case we can think of more parameters * to add in the future. * + * Known users of this hook: + * empty_folders + * */ $temp = array(&$rpc_action); $handled_by_plugin = boolean_hook_function('squirrelmail_rpc', $temp, 1); @@ -157,7 +178,7 @@ if (!$handled_by_plugin) switch (strtolower($rpc_action)) { * */ default: - sm_rpc_return_error(99, _("RPC action not understood")); + sm_rpc_return_error(2, _("RPC action not understood")); break; }