Fossil

Check-in [98cc520652]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add configuration options under /Admin/Access to enable the automatic hyperlink enabling for nobody based on User-Agent.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 98cc52065294a49e1b25652136622567051aeb51
User & Date: drh 2011-10-26 14:58:59.228
Context
2011-10-26
15:41
Improvements to the User-Agent bot recognizer. Add the test-ishuman command for testing the bot recognizer. ... (check-in: 06e0cb7005 user: drh tags: trunk)
15:17
Merge updates from trunk. ... (check-in: 7017c87b40 user: mistachkin tags: tcl-integration)
14:58
Add configuration options under /Admin/Access to enable the automatic hyperlink enabling for nobody based on User-Agent. ... (check-in: 98cc520652 user: drh tags: trunk)
14:00
Automatically enable hyperlinks for user agents that appear to be human. ... (check-in: e059e5a24d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/cgi.c.
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064

1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
      cgi_setenv("HTTPS", zVal);
    }else if( fossil_strcmp(zFieldName,"host:")==0 ){
      cgi_setenv("HTTP_HOST", zVal);
    }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
      cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
    }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
      cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);
    }
#if 0
    else if( fossil_strcmp(zFieldName,"referer:")==0 ){
      cgi_setenv("HTTP_REFERER", zVal);

    }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
      cgi_setenv("HTTP_USER_AGENT", zVal);
    }
#endif
  }

  cgi_init();
}

#if INTERFACE
/* 







<

|

>



<







1054
1055
1056
1057
1058
1059
1060

1061
1062
1063
1064
1065
1066
1067

1068
1069
1070
1071
1072
1073
1074
      cgi_setenv("HTTPS", zVal);
    }else if( fossil_strcmp(zFieldName,"host:")==0 ){
      cgi_setenv("HTTP_HOST", zVal);
    }else if( fossil_strcmp(zFieldName,"if-none-match:")==0 ){
      cgi_setenv("HTTP_IF_NONE_MATCH", zVal);
    }else if( fossil_strcmp(zFieldName,"if-modified-since:")==0 ){
      cgi_setenv("HTTP_IF_MODIFIED_SINCE", zVal);

#if 0
    }else if( fossil_strcmp(zFieldName,"referer:")==0 ){
      cgi_setenv("HTTP_REFERER", zVal);
#endif
    }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
      cgi_setenv("HTTP_USER_AGENT", zVal);
    }

  }

  cgi_init();
}

#if INTERFACE
/* 
Changes to src/login.c.
744
745
746
747
748
749
750
751

752
753
754
755
756
757
758
  if( fossil_strcmp(g.zLogin,"nobody")==0 ){
    g.zLogin = 0;
  }

  /* Set the capabilities */
  login_set_capabilities(zCap, 0);
  login_set_anon_nobody_capabilities();
  if( zCap[0] && !g.perm.History && isHuman() ){

    g.perm.History = 1;
  }
}

/*
** Memory of settings
*/







|
>







744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
  if( fossil_strcmp(g.zLogin,"nobody")==0 ){
    g.zLogin = 0;
  }

  /* Set the capabilities */
  login_set_capabilities(zCap, 0);
  login_set_anon_nobody_capabilities();
  if( zCap[0] && !g.perm.History && db_get_boolean("auto-enable-hyperlinks",1)
      && isHuman() ){
    g.perm.History = 1;
  }
}

/*
** Memory of settings
*/
Changes to src/setup.c.
884
885
886
887
888
889
890











891
892
893
894
895
896
897
  entry_attribute("Download packet limit", 10, "max-download", "mxdwn",
                  "5000000");
  @ <p>Fossil tries to limit out-bound sync, clone, and pull packets
  @ to this many bytes, uncompressed.  If the client requires more data
  @ than this, then the client will issue multiple HTTP requests.
  @ Values below 1 million are not recommended.  5 million is a
  @ reasonable number.</p>












  @ <hr />
  onoff_attribute("Allow users to register themselves",
                  "self-register", "selfregister", 0);
  @ <p>Allow users to register themselves through the HTTP UI. 
  @ The registration form always requires filling in a CAPTCHA 
  @ (<em>auto-captcha</em> setting is ignored). Still, bear in mind that anyone







>
>
>
>
>
>
>
>
>
>
>







884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
  entry_attribute("Download packet limit", 10, "max-download", "mxdwn",
                  "5000000");
  @ <p>Fossil tries to limit out-bound sync, clone, and pull packets
  @ to this many bytes, uncompressed.  If the client requires more data
  @ than this, then the client will issue multiple HTTP requests.
  @ Values below 1 million are not recommended.  5 million is a
  @ reasonable number.</p>

  @ <hr />
  onoff_attribute("Enable hyperlinks for \"nobody\" based on User-Agent",
                  "auto-enable-hyperlinks", "autohyperlink", 1);
  @ <p>Enable hyperlinks (the equivalent of the "h" permission) for all users
  @ including user "nobody", as long as the User-Agent string in the HTTP header
  @ indicates that the request is coming from an actual human being and not a
  @ a robot or script.  Note:  Bots can specify whatever User-Agent string they
  @ that want.  So a bot that wants to impersonate a human can easily do so.
  @ Hence, this technique does not necessarily exclude malicious bots.
  @ </p>

  @ <hr />
  onoff_attribute("Allow users to register themselves",
                  "self-register", "selfregister", 0);
  @ <p>Allow users to register themselves through the HTTP UI. 
  @ The registration form always requires filling in a CAPTCHA 
  @ (<em>auto-captcha</em> setting is ignored). Still, bear in mind that anyone