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

version» Context lines:

Roxen.git/server/etc/modules/Roxen.pmod:217:   }      string http_roxen_id_cookie(void|string unique_id)   {    return "RoxenUserID=" + (unique_id || roxen->create_unique_id()) + "; expires=" +    http_date (3600*24*365*2 + time (1)) + "; path=/";   }      protected mapping(string:function(string, RequestID:string)) cookie_callbacks =    ([]); +    protected class CookieChecker(string cookie)   {    string `()(string path, RequestID id)    {    if (!id->real_cookies) {    id->init_cookies();    }    // Note: Access the real_cookies directly to avoid registering callbacks.    return id->real_cookies[cookie];    }    string _sprintf(int c)    {    return c == 'O' && sprintf("CookieChecker(%O)", cookie);    }   } -  +    function(string, RequestID:string) get_cookie_callback(string cookie)   {    function(string, RequestID:string) cb = cookie_callbacks[cookie];    if (cb) return cb;    cb = CookieChecker(cookie);    return cookie_callbacks[cookie] = cb;   }      protected mapping(string:function(string, RequestID:string)) lang_callbacks = ([ ]);   
Roxen.git/server/etc/modules/Roxen.pmod:4654:       mixed val = c->misc->scope_roxen[var];    if(!zero_type(val))    {    if (objectp(val) && val->rxml_var_eval) return val;    return ENCODE_RXML_TEXT(val, type);    }       switch(var)    { +  case "dist-patch-version": +  string patch_ver = roxen->plib->get_current_patch_version(); +  return ENCODE_RXML_TEXT( +  roxen_dist_version + (patch_ver ? "-" + patch_ver : ""), type); +  case "patch-version": +  return ENCODE_RXML_TEXT(roxen->plib->get_current_patch_version(), type);    case "nodename":    return uname()->nodename;    case "uptime":    c->id->lower_max_cache (1);    return ENCODE_RXML_INT(time(1)-roxenp()->start_time, type);    case "uptime-days":    c->id->lower_max_cache (3600 * 2);    return ENCODE_RXML_INT((time(1)-roxenp()->start_time)/3600/24, type);    case "uptime-hours":    c->id->lower_max_cache (1800);
Roxen.git/server/etc/modules/Roxen.pmod:4822:    val = c->misc[converter[var]];    else    val = c->misc->scope_page[var];    if(!zero_type(val))    {    if (objectp (val) && val->rxml_var_eval)    return val;    return ENCODE_RXML_TEXT(val, type);    }    +  string get_mountpoint() +  { +  string s = c->id->virtfile || ""; +  return ENCODE_RXML_TEXT(s[sizeof(s)-1..sizeof(s)-1] == "/"? s[..sizeof(s)-2]: s, type); +  }; +     switch (var) {    case "pathinfo": return ENCODE_RXML_TEXT(c->id->misc->path_info, type);    case "realfile": return ENCODE_RXML_TEXT(c->id->realfile, type);    case "virtroot": return ENCODE_RXML_TEXT(c->id->virtfile, type); -  +  case "mountpoint-ver": +  string patch_ver = roxen->plib->get_current_patch_version(); +  return "/(" + +  ENCODE_RXML_TEXT( +  roxen_dist_version + (patch_ver ? "-" + patch_ver : ""), type) + +  ")" + +  get_mountpoint();    case "mountpoint": -  string s = c->id->virtfile || ""; -  return ENCODE_RXML_TEXT(s[sizeof(s)-1..sizeof(s)-1] == "/"? s[..sizeof(s)-2]: s, type); +  return get_mountpoint();    case "virtfile": // Fallthrough from deprecated name.    case "path": return ENCODE_RXML_TEXT(c->id->not_query, type);    case "query": return ENCODE_RXML_TEXT(c->id->query, type);    case "url": return ENCODE_RXML_TEXT(c->id->raw_url, type);    case "post-data":    c->id->register_vary_callback(0, hash_query_data);    if (!c->id->data || zero_type(c->id->misc->len)) return RXML.nil;    return ENCODE_RXML_TEXT(c->id->data, type);    case "last-true": return ENCODE_RXML_INT(c->misc[" _ok"], type);    case "language": return ENCODE_RXML_TEXT(c->misc->language, type);