Roxen.git / server / modules / directories / directories.pike

version» Context lines:

Roxen.git/server/modules/directories/directories.pike:8:   // o Perhaps add <fl> to default template?   // o Add readme support   //      //<locale-token project="mod_directories">LOCALE</locale-token>   //<locale-token project="mod_directories">SLOCALE</locale-token>   #define SLOCALE(X,Y) _STR_LOCALE("mod_directories",X,Y)   #define LOCALE(X,Y) _DEF_LOCALE("mod_directories",X,Y)   // end locale stuff    - constant cvs_version = "$Id: directories.pike,v 1.96 2009/05/07 14:15:54 mast Exp $"; + constant cvs_version = "$Id$";   constant thread_safe = 1;      constant default_template= #"   <if not='' variable='form.sort'>    <set variable='form.sort' value='name' />   </if>      <html>    <head><title>Listing of &page.virtfile;</title></head>    <body bgcolor='white' text='black' link='#ae3c00' vlink='#ae3c00'>
Roxen.git/server/modules/directories/directories.pike:190:    if(f=="" || (f[-1]!='/' && f[-1]!='.'))    return Roxen.http_redirect(f+"/", id);       if(f[-1]=='.' && !override)    return Roxen.http_redirect(f[..sizeof(f)-2], id);       // If the pathname ends with '.', and the 'override' variable    // is set, a directory listing should be sent instead of the    // indexfile.    +  array dir=id->conf->find_dir(f, id, 1)||({});    if(f[-1] == '/') /* Handle indexfiles */    { -  foreach(indexfiles, string file) +  foreach(indexfiles & dir, string file)    {    array s;    if((s = id->conf->stat_file(f+file, id)) && (s[ST_SIZE] >= 0))    {    id->not_query = f + file;    mixed got = id->conf->handle_request(id);    if (got && mappingp(got))    return got;    }    }    // Restore the old query.    id->not_query = f;    }    -  array dir=id->conf->find_dir(f, id, 1)||({}); +     if(!sizeof(dir) || !dir[0])    foreach(dir[1..], string file)    {    string lock=id->conf->try_get_file(f+file, id); -  if(lock) -  { -  if(sizeof(lock)) +  if(lock) { +  if(!sizeof(lock)) { +  lock = +  "<html><head><title>Forbidden</title></head>\n" +  "<body><h1>Forbidden</h1></body></html>\n"; +  }    return Roxen.http_string_answer(lock)+(["error":403]); -  return Roxen.http_redirect(f[..sizeof(f)-3], id); +     }    }    return Roxen.http_rxml_answer( template, id );   }