Roxen.git / server / etc / modules / Variable.pmod / module.pmod

version» Context lines:

Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1: - // $Id: module.pmod,v 1.51 2001/06/13 19:36:51 nilsson Exp $ + // $Id: module.pmod,v 1.52 2001/06/13 22:03:26 nilsson Exp $      #include <module.h>   #include <roxen.h>      // Locale macros   //<locale-token project="roxen_config"> LOCALE </locale-token>      #define LOCALE(X,Y) \    ([string](mixed)Locale.translate("roxen_config",roxenp()->locale->get(),X,Y))   
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:593:   // =====================================================================   // Password   // =====================================================================   class Password   //! Password variable (uses crypt)   {    inherit String;    constant width = 20;    constant type = "Password";    -  void set_from_form( RequestID id ) +  int(0..1) set_from_form( RequestID id )    {    mapping val;    if( sizeof( val = get_form_vars(id)) && -  val[""] && strlen(val[""]) ) +  val[""] && strlen(val[""]) ) {    set( crypt( val[""] ) ); -  +  return 1;    } -  +  return 0; +  }       string render_view( RequestID id )    {    return "******";    }       string render_form( RequestID id, void|mapping additional_args )    {    additional_args = additional_args || ([]);    additional_args->type="password";
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:920:    {    return (string)what;    }       mixed transform_from_form( string what,mapping v )    {    return what;    }       static int _current_count = time()*100+(gethrtime()/10000); -  void set_from_form(RequestID id) +  int(0..1) set_from_form(RequestID id)    {    int rn, do_goto;    array l = query();    mapping vl = get_form_vars(id);    // first do the assign...    if( (int)vl[".count"] != _current_count ) -  return; +  return 0;    _current_count++;       foreach( indices( vl ), string vv )    if( sscanf( vv, ".set.%d", rn ) && (vv == ".set."+rn) )    {    m_delete( id->variables, path()+vv );    l[rn] = transform_from_form( vl[vv], vl );    m_delete( vl, vv );    }    // then the move...
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:978:       array b;    mixed q = catch( b = verify_set_from_form( l ) );    if( q || sizeof( b ) != 2 )    {    if( q )    set_warning( q );    else    set_warning( "Internal error: Illegal sized array "    "from verify_set_from_form\n" ); -  return; +  return 0;    } -  +  +  int ret;    if( b )    {    set_warning( b[0] );    set( b[1] ); -  +  ret = 1;    } -  +     if( do_goto && !id->misc->do_not_goto )    {    RequestID nid = id;    while( nid->misc->orig )    nid = id->misc->orig;       string section = RXML.get_var("section", "var");    string query = nid->query;    if( !query )    query = "";
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1009:    nid->misc->moreheads =    ([    "Location":nid->not_query+(nid->misc->path_info||"")+    "?"+query+"#"+path(),    ]);    if( nid->misc->defines )    nid->misc->defines[ " _error" ] = 302;    else if( id->misc->defines )    id->misc->defines[ " _error" ] = 302;    } +  +  return ret;    }          string render_row(string prefix, mixed val, int width)    {    return input( prefix, val, width );    }       string render_form( RequestID id, void|mapping additional_args )    {