Roxen.git / server / base_server / module.pike

version» Context lines:

Roxen.git/server/base_server/module.pike:63:    if(!strlen(var))    error("No name for variable!\n");      // if(var[0]=='_' && previous_object() != roxen)   // error("Variable names beginning with '_' are reserved for"   // " internal usage.\n");       if (!stringp(name))    name = var;    +  if((search(name, "\"") != -1)) +  error("Please do not use \" in variable names"); +     if (!stringp(doc_str))    doc_str = "No documentation";       switch (type & VAR_TYPE_MASK)    { -  +  case TYPE_NODE: +  if(!arrayp(value)) +  error("TYPE_NODE variables should contain a list of variables to use as " +  "subnodes.\n"); +  break; +  case TYPE_CUSTOM: +  if(!misc +  && arrayp(misc) +  && (sizeof(misc)>=3) +  && functionp(misc[0]) +  && functionp(misc[1]) +  && functionp(misc[2])) +  error("When defining a TYPE_CUSTOM variable, the MISC " +  "field must be an array of functionpointers: \n" +  "({describe,describe_form,set_from_form})\n"); +  break; +     case TYPE_TEXT_FIELD:    case TYPE_FILE:    case TYPE_STRING:    case TYPE_LOCATION:    if(value && !stringp(value))    report_error("Passing illegal value to string type variable.\n");    break;       case TYPE_FLOAT:    if(!floatp(value))
Roxen.git/server/base_server/module.pike:208:    } else    variables[var][VAR_VALUE][p]=to;   }      void set(string var, mixed value)   {    if(!variables[var])    error( "Setting undefined variable.\n" );    else    if(variables[var][VAR_TYPE] == TYPE_MODULE && stringp(value)) -  roxen->register_module_load_hook( value, set, var ); +  roxenp()->register_module_load_hook( value, set, var );    else if(variables[var][VAR_TYPE] == TYPE_MODULE_LIST)    {    variables[var][VAR_VALUE]=value;    if(arrayp(value))    foreach(value, value)    if(stringp(value)) -  roxen->register_module_load_hook(value,set_module_list,var,value); +  roxenp()->register_module_load_hook(value,set_module_list,var,value);    }    else    variables[var][VAR_VALUE]=value;   }      int setvars( mapping (string:mixed) vars )   {    string v;    int err;   
Roxen.git/server/base_server/module.pike:280:    {    case "allowip":    patterns += ({ ({ MOD_ALLOW, Regexp(value)->match, }) });    break;       case "denyip":    patterns += ({ ({ MOD_DENY, Regexp(value)->match, }) });    break;       case "allowuser": -  value = replace("(^"+(value/",")*"$)|(^"+"$)","(^any$)","(.*)"); -  if(this->proxy_auth_needed) { +  array(string) users = (value/"," - ({""})); +  int i; +  +  for(i=0; i < sizeof(users); i++) { +  if (users[i] == "any") { +  if(this->register_module()[0] & MODULE_PROXY) +  patterns += ({ ({ MOD_PROXY_USER, lambda(){ return 1; } }) }); +  else +  patterns += ({ ({ MOD_USER, lambda(){ return 1; } }) }); +  break; +  } else { +  users[i & 0x0f] = "(^"+users[i]+"$)"; +  } +  if ((i & 0x0f) == 0x0f) { +  value = users[0..0x0f]*"|"; +  if(this->register_module()[0] & MODULE_PROXY) {    patterns += ({ ({ MOD_PROXY_USER, Regexp(value)->match, }) });    } else {    patterns += ({ ({ MOD_USER, Regexp(value)->match, }) });    } -  +  } +  } +  if (i & 0x0f) { +  value = users[0..(i-1)&0x0f]*"|"; +  if(this->register_module()[0] & MODULE_PROXY) { +  patterns += ({ ({ MOD_PROXY_USER, Regexp(value)->match, }) }); +  } else { +  patterns += ({ ({ MOD_USER, Regexp(value)->match, }) }); +  } +  }    break;    }    }    }    return patterns;   }    -  +    mixed stat_file(string f, object id){}   mixed find_dir(string f, object id){}   mixed real_file(string f, object id){}