Diff
Not logged in

Differences From Artifact [edcf03080d]:

To Artifact [32aa2f8fa0]:


1796
1797
1798
1799
1800
1801
1802
1803






1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822


1823
1824
1825
1826
1827
1828
1829
1796
1797
1798
1799
1800
1801
1802

1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836







-
+
+
+
+
+
+



















+
+









  /*
  ** Check to see if the first term of PATH_INFO specifies an alternative
  ** skin.  This will be the case if the first term of PATH_INFO
  ** begins with "draftN/" where N is an integer between 1 and 9 or
  ** if it is "skn_X/" where X is one of the built-in skin names.
  ** If either is true, then activate the alternative skin.
  ** If either is true, then activate the alternative skin.a
  **
  ** If there are multiple skn_X entries (ex: /skn_default/skn_ardoise/...)
  ** then skip over all but the last.  This allows one to link to an
  ** alternative skin in hyperlinks even if you are already in an alternative
  ** skin.
  */
  if( zPathInfo && strncmp(zPathInfo,"/draft",6)==0
   && zPathInfo[6]>='1' && zPathInfo[6]<='9'
   && (zPathInfo[7]=='/' || zPathInfo[7]==0)
  ){
    int iSkin = zPathInfo[6] - '0';
    char *zNewScript;
    skin_use_draft(iSkin);
    zNewScript = mprintf("%T/draft%d", P("SCRIPT_NAME"), iSkin);
    if( g.zTop ) g.zTop = mprintf("%R/draft%d", iSkin);
    if( g.zBaseURL ) g.zBaseURL = mprintf("%s/draft%d", g.zBaseURL, iSkin);
    zPathInfo += 7;
    cgi_replace_parameter("PATH_INFO", zPathInfo);
    cgi_replace_parameter("SCRIPT_NAME", zNewScript);
    etag_cancel();
  }else if( zPathInfo && strncmp(zPathInfo, "/skn_", 5)==0 ){
    int i;
    char *zAlt;
    char *zErr;
    char *z;
    while( (z = strstr(zPathInfo+1,"/skn_"))!=0 ) zPathInfo = z;
    for(i=5; zPathInfo[i] && zPathInfo[i]!='/'; i++){}
    zAlt = mprintf("%.*s", i-5, zPathInfo+5);
    zErr = skin_use_alternative(zAlt);
    if( zErr ){
      fossil_free(zErr);
    }else{
      char *zNewScript;