Roxen.git / server / etc / modules / AFS.pmod / Action.pike

version» Context lines:

Roxen.git/server/etc/modules/AFS.pmod/Action.pike:1: - // $Id: Action.pike,v 1.5 2011/04/27 17:43:42 mast Exp $ + // $Id$      //   // AFS.Action interface   //   // (C) 2011 Roxen Internet Software AB   //   //      #if constant(roxen)   // This include is to get ASSERT_IF_DEBUG and the OBJ_COUNT stuff.
Roxen.git/server/etc/modules/AFS.pmod/Action.pike:57:   //! Decodes and type checks the arguments according to   //! @[req_arg_types] and @[opt_arg_types]. The @[real_vars] mapping   //! contains the unparsed @[RequestID.real_variables] style arguments   //! on entry. @[on_error] determines how errors are handled.   //!   //! @returns   //! The decoded arguments.   {    mapping(string:mixed) args = ([]);    foreach (real_vars; string var; array(string) val) { -  if (sizeof (val) > 1) +  if (sizeof (val) > 1) { +  // Non-AFS variables may still be present in multiple copies, e.g. +  // when posting a form state. +  if (req_arg_types[var] || opt_arg_types[var])    return Roxen.raise_err(on_error, "Multiple %O variables found.\n", var); -  +  }    args[var] = val[0];    }       if (string json_arg = m_delete (args, "__afs")) {    mapping(string:mixed) decoded;    if (mixed err = catch (decoded = Standards.JSON.decode (json_arg)))    return Roxen.raise_err (on_error, "Format error in __afs value: %s",    describe_error (err));    if (!mappingp (decoded))    return Roxen.raise_err (on_error, "Format error in __afs value: "
Roxen.git/server/etc/modules/AFS.pmod/Action.pike:239:    ACTION_OK = 0,    ACTION_ERROR,   };      //! @ignore   DECLARE_OBJ_COUNT;   //! @endignore      protected string _sprintf (int flag)   { -  return flag == 'O' && sprintf ("AFS.Action(%s)" + OBJ_COUNT, name); +  return flag == 'O' && sprintf ("AFS.Action(%s)" + OBJ_COUNT, name||"unknown");   }      //! Not yet in use. Intended to be a result wrapper until the response   //! is sent to the client. May not be needed after all...   class ActionResult(void|string tag) {    ActionStatus status = ACTION_OK;       int error_id;    string error;       string|int|float|array|mapping data;   }