Fossil SCM
Make "off" the preferred way to diable robot-restrict
Commit
db69c47abda94b61ea5df13633d3d69348f3bf43fdc5f55e09d81d6a7ccc2d8d
Parent
26a9b0333631068…
2 files changed
+5
-2
+1
-1
+5
-2
| --- src/robot.c | ||
| +++ src/robot.c | ||
| @@ -156,11 +156,11 @@ | ||
| 156 | 156 | ** also covers /tarball and /sqlar. If a tag has an "X" character appended, |
| 157 | 157 | ** then it only applies if query parameters are such that the page is |
| 158 | 158 | ** particularly difficult to compute. In all other case, the tag should |
| 159 | 159 | ** exactly match the page name. |
| 160 | 160 | ** |
| 161 | -** Make this setting "none" or "off" to disable all robot restrictions. | |
| 161 | +** Change this setting "off" to disable all robot restrictions. | |
| 162 | 162 | */ |
| 163 | 163 | |
| 164 | 164 | /* |
| 165 | 165 | ** Return the default restriction GLOB |
| 166 | 166 | */ |
| @@ -182,11 +182,14 @@ | ||
| 182 | 182 | const char *zToken; |
| 183 | 183 | static int bKnownPass = 0; |
| 184 | 184 | if( g.zLogin ) return 0; /* Logged in users always get through */ |
| 185 | 185 | if( bKnownPass ) return 0; /* Already known to pass robot restrictions */ |
| 186 | 186 | zGlob = db_get("robot-restrict",robot_restrict_default()); |
| 187 | - if( zGlob==0 || zGlob[0]==0 ){ bKnownPass = 1; return 0; } | |
| 187 | + if( zGlob==0 || zGlob[0]==0 || fossil_strcmp(zGlob, "off")==0 ){ | |
| 188 | + bKnownPass = 1; | |
| 189 | + return 0; /* Robot restriction is turned off */ | |
| 190 | + } | |
| 188 | 191 | if( !glob_multi_match(zGlob, zPage) ) return 0; |
| 189 | 192 | zToken = P("token"); |
| 190 | 193 | if( zToken!=0 |
| 191 | 194 | && db_exists("SELECT 1 FROM config" |
| 192 | 195 | " WHERE name='token-%q'" |
| 193 | 196 |
| --- src/robot.c | |
| +++ src/robot.c | |
| @@ -156,11 +156,11 @@ | |
| 156 | ** also covers /tarball and /sqlar. If a tag has an "X" character appended, |
| 157 | ** then it only applies if query parameters are such that the page is |
| 158 | ** particularly difficult to compute. In all other case, the tag should |
| 159 | ** exactly match the page name. |
| 160 | ** |
| 161 | ** Make this setting "none" or "off" to disable all robot restrictions. |
| 162 | */ |
| 163 | |
| 164 | /* |
| 165 | ** Return the default restriction GLOB |
| 166 | */ |
| @@ -182,11 +182,14 @@ | |
| 182 | const char *zToken; |
| 183 | static int bKnownPass = 0; |
| 184 | if( g.zLogin ) return 0; /* Logged in users always get through */ |
| 185 | if( bKnownPass ) return 0; /* Already known to pass robot restrictions */ |
| 186 | zGlob = db_get("robot-restrict",robot_restrict_default()); |
| 187 | if( zGlob==0 || zGlob[0]==0 ){ bKnownPass = 1; return 0; } |
| 188 | if( !glob_multi_match(zGlob, zPage) ) return 0; |
| 189 | zToken = P("token"); |
| 190 | if( zToken!=0 |
| 191 | && db_exists("SELECT 1 FROM config" |
| 192 | " WHERE name='token-%q'" |
| 193 |
| --- src/robot.c | |
| +++ src/robot.c | |
| @@ -156,11 +156,11 @@ | |
| 156 | ** also covers /tarball and /sqlar. If a tag has an "X" character appended, |
| 157 | ** then it only applies if query parameters are such that the page is |
| 158 | ** particularly difficult to compute. In all other case, the tag should |
| 159 | ** exactly match the page name. |
| 160 | ** |
| 161 | ** Change this setting "off" to disable all robot restrictions. |
| 162 | */ |
| 163 | |
| 164 | /* |
| 165 | ** Return the default restriction GLOB |
| 166 | */ |
| @@ -182,11 +182,14 @@ | |
| 182 | const char *zToken; |
| 183 | static int bKnownPass = 0; |
| 184 | if( g.zLogin ) return 0; /* Logged in users always get through */ |
| 185 | if( bKnownPass ) return 0; /* Already known to pass robot restrictions */ |
| 186 | zGlob = db_get("robot-restrict",robot_restrict_default()); |
| 187 | if( zGlob==0 || zGlob[0]==0 || fossil_strcmp(zGlob, "off")==0 ){ |
| 188 | bKnownPass = 1; |
| 189 | return 0; /* Robot restriction is turned off */ |
| 190 | } |
| 191 | if( !glob_multi_match(zGlob, zPage) ) return 0; |
| 192 | zToken = P("token"); |
| 193 | if( zToken!=0 |
| 194 | && db_exists("SELECT 1 FROM config" |
| 195 | " WHERE name='token-%q'" |
| 196 |
+1
-1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -511,11 +511,11 @@ | ||
| 511 | 511 | @ /praise. The "zip" covers itself and also /tarball and /sqlar. If a |
| 512 | 512 | @ tag has an "X" character appended, then it only applies if query |
| 513 | 513 | @ parameters are such that the page is particularly difficult to compute. |
| 514 | 514 | @ In all other case, the tag should exactly match the page name. |
| 515 | 515 | @ |
| 516 | - @ To disable robot restrictions, make this setting "none" or "off". | |
| 516 | + @ To disable robot restrictions, change this setting to "off". | |
| 517 | 517 | @ (Property: robot-restrict) |
| 518 | 518 | @ <br> |
| 519 | 519 | textarea_attribute("", 2, 80, |
| 520 | 520 | "robot-restrict", "rbrestrict", robot_restrict_default(), 0); |
| 521 | 521 | |
| 522 | 522 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -511,11 +511,11 @@ | |
| 511 | @ /praise. The "zip" covers itself and also /tarball and /sqlar. If a |
| 512 | @ tag has an "X" character appended, then it only applies if query |
| 513 | @ parameters are such that the page is particularly difficult to compute. |
| 514 | @ In all other case, the tag should exactly match the page name. |
| 515 | @ |
| 516 | @ To disable robot restrictions, make this setting "none" or "off". |
| 517 | @ (Property: robot-restrict) |
| 518 | @ <br> |
| 519 | textarea_attribute("", 2, 80, |
| 520 | "robot-restrict", "rbrestrict", robot_restrict_default(), 0); |
| 521 | |
| 522 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -511,11 +511,11 @@ | |
| 511 | @ /praise. The "zip" covers itself and also /tarball and /sqlar. If a |
| 512 | @ tag has an "X" character appended, then it only applies if query |
| 513 | @ parameters are such that the page is particularly difficult to compute. |
| 514 | @ In all other case, the tag should exactly match the page name. |
| 515 | @ |
| 516 | @ To disable robot restrictions, change this setting to "off". |
| 517 | @ (Property: robot-restrict) |
| 518 | @ <br> |
| 519 | textarea_attribute("", 2, 80, |
| 520 | "robot-restrict", "rbrestrict", robot_restrict_default(), 0); |
| 521 | |
| 522 |