Fossil SCM
Convert the g.isHuman variable into g.isRobot.
Commit
6422bca15da624f38fe20cdf1b4f09bab958bb316f58deacfeefa7d72743c50d
Parent
02adced1c1abfd0…
6 files changed
-1
+4
-8
+2
-3
+6
-6
+2
-1
+1
-1
-1
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -1162,11 +1162,10 @@ | ||
| 1162 | 1162 | int showId = PB("showid"); |
| 1163 | 1163 | Stmt q1, q2; |
| 1164 | 1164 | double baseTime; |
| 1165 | 1165 | login_check_credentials(); |
| 1166 | 1166 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1167 | - if( exclude_spiders(0) ) return; | |
| 1168 | 1167 | zName = P("name"); |
| 1169 | 1168 | if( zName==0 ) zName = "tip"; |
| 1170 | 1169 | rid = symbolic_name_to_rid(zName, "ci"); |
| 1171 | 1170 | if( rid==0 ){ |
| 1172 | 1171 | fossil_fatal("not a valid check-in: %s", zName); |
| 1173 | 1172 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -1162,11 +1162,10 @@ | |
| 1162 | int showId = PB("showid"); |
| 1163 | Stmt q1, q2; |
| 1164 | double baseTime; |
| 1165 | login_check_credentials(); |
| 1166 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1167 | if( exclude_spiders(0) ) return; |
| 1168 | zName = P("name"); |
| 1169 | if( zName==0 ) zName = "tip"; |
| 1170 | rid = symbolic_name_to_rid(zName, "ci"); |
| 1171 | if( rid==0 ){ |
| 1172 | fossil_fatal("not a valid check-in: %s", zName); |
| 1173 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -1162,11 +1162,10 @@ | |
| 1162 | int showId = PB("showid"); |
| 1163 | Stmt q1, q2; |
| 1164 | double baseTime; |
| 1165 | login_check_credentials(); |
| 1166 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1167 | zName = P("name"); |
| 1168 | if( zName==0 ) zName = "tip"; |
| 1169 | rid = symbolic_name_to_rid(zName, "ci"); |
| 1170 | if( rid==0 ){ |
| 1171 | fossil_fatal("not a valid check-in: %s", zName); |
| 1172 |
+4
-8
| --- src/captcha.c | ||
| +++ src/captcha.c | ||
| @@ -744,11 +744,11 @@ | ||
| 744 | 744 | (void)exclude_spiders(1); |
| 745 | 745 | @ <hr><p>The captcha is shown above. Add a name=HEX query parameter |
| 746 | 746 | @ to see how HEX would be rendered in the current captcha font. |
| 747 | 747 | @ <h2>Debug/Testing Values:</h2> |
| 748 | 748 | @ <ul> |
| 749 | - @ <li> g.isHuman = %d(g.isHuman) | |
| 749 | + @ <li> g.isRobot = %d(g.isRobot) | |
| 750 | 750 | @ <li> g.zLogin = %h(g.zLogin) |
| 751 | 751 | @ <li> login_cookie_welformed() = %d(login_cookie_wellformed()) |
| 752 | 752 | @ <li> captcha_is_correct(1) = %d(captcha_is_correct(1)). |
| 753 | 753 | @ </ul> |
| 754 | 754 | style_finish_page(); |
| @@ -776,27 +776,23 @@ | ||
| 776 | 776 | ** If the bTest argument is non-zero, then show the captcha regardless of |
| 777 | 777 | ** how the agent identifies. This is used for testing only. |
| 778 | 778 | */ |
| 779 | 779 | int exclude_spiders(int bTest){ |
| 780 | 780 | if( !bTest ){ |
| 781 | - if( g.isHuman ) return 0; /* This user has already proven human */ | |
| 782 | 781 | if( g.zLogin!=0 ) return 0; /* Logged in. Consider them human */ |
| 783 | 782 | if( login_cookie_wellformed() ){ |
| 784 | 783 | /* Logged into another member of the login group */ |
| 785 | 784 | return 0; |
| 786 | 785 | } |
| 787 | 786 | } |
| 788 | 787 | |
| 789 | 788 | /* This appears to be a spider. Offer the captcha */ |
| 790 | 789 | style_set_current_feature("captcha"); |
| 791 | - style_header("I think you are a robot"); | |
| 790 | + style_header("Captcha"); | |
| 792 | 791 | style_submenu_enable(0); |
| 793 | 792 | @ <form method='POST' action='%R/ityaar'> |
| 794 | - @ <p>You seem like a robot. | |
| 795 | - @ | |
| 796 | - @ <p>If you are human, you can prove that by solving the captcha below, | |
| 797 | - @ after which you will be allowed to proceed. | |
| 793 | + @ <h2>Prove that you are human: | |
| 798 | 794 | if( bTest ){ |
| 799 | 795 | @ <input type="hidden" name="istest" value="1"> |
| 800 | 796 | } |
| 801 | 797 | captcha_generate(3); |
| 802 | 798 | @ </form> |
| @@ -830,11 +826,11 @@ | ||
| 830 | 826 | } |
| 831 | 827 | cgi_append_header("X-Robot: 0\r\n"); |
| 832 | 828 | } |
| 833 | 829 | login_redirect_to_g(); |
| 834 | 830 | }else{ |
| 835 | - g.isHuman = 0; | |
| 831 | + g.isRobot = 1; | |
| 836 | 832 | (void)exclude_spiders(bTest); |
| 837 | 833 | if( bTest ){ |
| 838 | 834 | @ <hr><p>Wrong code. Try again |
| 839 | 835 | style_finish_page(); |
| 840 | 836 | } |
| 841 | 837 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -744,11 +744,11 @@ | |
| 744 | (void)exclude_spiders(1); |
| 745 | @ <hr><p>The captcha is shown above. Add a name=HEX query parameter |
| 746 | @ to see how HEX would be rendered in the current captcha font. |
| 747 | @ <h2>Debug/Testing Values:</h2> |
| 748 | @ <ul> |
| 749 | @ <li> g.isHuman = %d(g.isHuman) |
| 750 | @ <li> g.zLogin = %h(g.zLogin) |
| 751 | @ <li> login_cookie_welformed() = %d(login_cookie_wellformed()) |
| 752 | @ <li> captcha_is_correct(1) = %d(captcha_is_correct(1)). |
| 753 | @ </ul> |
| 754 | style_finish_page(); |
| @@ -776,27 +776,23 @@ | |
| 776 | ** If the bTest argument is non-zero, then show the captcha regardless of |
| 777 | ** how the agent identifies. This is used for testing only. |
| 778 | */ |
| 779 | int exclude_spiders(int bTest){ |
| 780 | if( !bTest ){ |
| 781 | if( g.isHuman ) return 0; /* This user has already proven human */ |
| 782 | if( g.zLogin!=0 ) return 0; /* Logged in. Consider them human */ |
| 783 | if( login_cookie_wellformed() ){ |
| 784 | /* Logged into another member of the login group */ |
| 785 | return 0; |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | /* This appears to be a spider. Offer the captcha */ |
| 790 | style_set_current_feature("captcha"); |
| 791 | style_header("I think you are a robot"); |
| 792 | style_submenu_enable(0); |
| 793 | @ <form method='POST' action='%R/ityaar'> |
| 794 | @ <p>You seem like a robot. |
| 795 | @ |
| 796 | @ <p>If you are human, you can prove that by solving the captcha below, |
| 797 | @ after which you will be allowed to proceed. |
| 798 | if( bTest ){ |
| 799 | @ <input type="hidden" name="istest" value="1"> |
| 800 | } |
| 801 | captcha_generate(3); |
| 802 | @ </form> |
| @@ -830,11 +826,11 @@ | |
| 830 | } |
| 831 | cgi_append_header("X-Robot: 0\r\n"); |
| 832 | } |
| 833 | login_redirect_to_g(); |
| 834 | }else{ |
| 835 | g.isHuman = 0; |
| 836 | (void)exclude_spiders(bTest); |
| 837 | if( bTest ){ |
| 838 | @ <hr><p>Wrong code. Try again |
| 839 | style_finish_page(); |
| 840 | } |
| 841 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -744,11 +744,11 @@ | |
| 744 | (void)exclude_spiders(1); |
| 745 | @ <hr><p>The captcha is shown above. Add a name=HEX query parameter |
| 746 | @ to see how HEX would be rendered in the current captcha font. |
| 747 | @ <h2>Debug/Testing Values:</h2> |
| 748 | @ <ul> |
| 749 | @ <li> g.isRobot = %d(g.isRobot) |
| 750 | @ <li> g.zLogin = %h(g.zLogin) |
| 751 | @ <li> login_cookie_welformed() = %d(login_cookie_wellformed()) |
| 752 | @ <li> captcha_is_correct(1) = %d(captcha_is_correct(1)). |
| 753 | @ </ul> |
| 754 | style_finish_page(); |
| @@ -776,27 +776,23 @@ | |
| 776 | ** If the bTest argument is non-zero, then show the captcha regardless of |
| 777 | ** how the agent identifies. This is used for testing only. |
| 778 | */ |
| 779 | int exclude_spiders(int bTest){ |
| 780 | if( !bTest ){ |
| 781 | if( g.zLogin!=0 ) return 0; /* Logged in. Consider them human */ |
| 782 | if( login_cookie_wellformed() ){ |
| 783 | /* Logged into another member of the login group */ |
| 784 | return 0; |
| 785 | } |
| 786 | } |
| 787 | |
| 788 | /* This appears to be a spider. Offer the captcha */ |
| 789 | style_set_current_feature("captcha"); |
| 790 | style_header("Captcha"); |
| 791 | style_submenu_enable(0); |
| 792 | @ <form method='POST' action='%R/ityaar'> |
| 793 | @ <h2>Prove that you are human: |
| 794 | if( bTest ){ |
| 795 | @ <input type="hidden" name="istest" value="1"> |
| 796 | } |
| 797 | captcha_generate(3); |
| 798 | @ </form> |
| @@ -830,11 +826,11 @@ | |
| 826 | } |
| 827 | cgi_append_header("X-Robot: 0\r\n"); |
| 828 | } |
| 829 | login_redirect_to_g(); |
| 830 | }else{ |
| 831 | g.isRobot = 1; |
| 832 | (void)exclude_spiders(bTest); |
| 833 | if( bTest ){ |
| 834 | @ <hr><p>Wrong code. Try again |
| 835 | style_finish_page(); |
| 836 | } |
| 837 |
+2
-3
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2416,15 +2416,15 @@ | ||
| 2416 | 2416 | object_description(rid, objdescFlags, 0, &downloadName); |
| 2417 | 2417 | style_submenu_element("Download", "%R/raw/%s?at=%T", |
| 2418 | 2418 | zUuid, file_tail(blob_str(&downloadName))); |
| 2419 | 2419 | @ <hr> |
| 2420 | 2420 | content_get(rid, &content); |
| 2421 | - if( !g.isHuman ){ | |
| 2421 | + if( blob_size(&content)>100000 ){ | |
| 2422 | 2422 | /* Prevent robots from running hexdump on megabyte-sized source files |
| 2423 | 2423 | ** and there by eating up lots of CPU time and bandwidth. There is |
| 2424 | 2424 | ** no good reason for a robot to need a hexdump. */ |
| 2425 | - @ <p>A hex dump of this file is not available. | |
| 2425 | + @ <p>A hex dump of this file is not available because it is too large. | |
| 2426 | 2426 | @ Please download the raw binary file and generate a hex dump yourself.</p> |
| 2427 | 2427 | }else{ |
| 2428 | 2428 | @ <blockquote><pre> |
| 2429 | 2429 | hexdump(&content); |
| 2430 | 2430 | @ </pre></blockquote> |
| @@ -2702,11 +2702,10 @@ | ||
| 2702 | 2702 | HQuery url; |
| 2703 | 2703 | char *zCIUuid = 0; |
| 2704 | 2704 | int isSymbolicCI = 0; /* ci= exists and is a symbolic name, not a hash */ |
| 2705 | 2705 | int isBranchCI = 0; /* ci= refers to a branch name */ |
| 2706 | 2706 | char *zHeader = 0; |
| 2707 | - int iCost; | |
| 2708 | 2707 | |
| 2709 | 2708 | login_check_credentials(); |
| 2710 | 2709 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2711 | 2710 | cgi_check_for_malice(); |
| 2712 | 2711 | style_set_current_feature("artifact"); |
| 2713 | 2712 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2416,15 +2416,15 @@ | |
| 2416 | object_description(rid, objdescFlags, 0, &downloadName); |
| 2417 | style_submenu_element("Download", "%R/raw/%s?at=%T", |
| 2418 | zUuid, file_tail(blob_str(&downloadName))); |
| 2419 | @ <hr> |
| 2420 | content_get(rid, &content); |
| 2421 | if( !g.isHuman ){ |
| 2422 | /* Prevent robots from running hexdump on megabyte-sized source files |
| 2423 | ** and there by eating up lots of CPU time and bandwidth. There is |
| 2424 | ** no good reason for a robot to need a hexdump. */ |
| 2425 | @ <p>A hex dump of this file is not available. |
| 2426 | @ Please download the raw binary file and generate a hex dump yourself.</p> |
| 2427 | }else{ |
| 2428 | @ <blockquote><pre> |
| 2429 | hexdump(&content); |
| 2430 | @ </pre></blockquote> |
| @@ -2702,11 +2702,10 @@ | |
| 2702 | HQuery url; |
| 2703 | char *zCIUuid = 0; |
| 2704 | int isSymbolicCI = 0; /* ci= exists and is a symbolic name, not a hash */ |
| 2705 | int isBranchCI = 0; /* ci= refers to a branch name */ |
| 2706 | char *zHeader = 0; |
| 2707 | int iCost; |
| 2708 | |
| 2709 | login_check_credentials(); |
| 2710 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2711 | cgi_check_for_malice(); |
| 2712 | style_set_current_feature("artifact"); |
| 2713 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2416,15 +2416,15 @@ | |
| 2416 | object_description(rid, objdescFlags, 0, &downloadName); |
| 2417 | style_submenu_element("Download", "%R/raw/%s?at=%T", |
| 2418 | zUuid, file_tail(blob_str(&downloadName))); |
| 2419 | @ <hr> |
| 2420 | content_get(rid, &content); |
| 2421 | if( blob_size(&content)>100000 ){ |
| 2422 | /* Prevent robots from running hexdump on megabyte-sized source files |
| 2423 | ** and there by eating up lots of CPU time and bandwidth. There is |
| 2424 | ** no good reason for a robot to need a hexdump. */ |
| 2425 | @ <p>A hex dump of this file is not available because it is too large. |
| 2426 | @ Please download the raw binary file and generate a hex dump yourself.</p> |
| 2427 | }else{ |
| 2428 | @ <blockquote><pre> |
| 2429 | hexdump(&content); |
| 2430 | @ </pre></blockquote> |
| @@ -2702,11 +2702,10 @@ | |
| 2702 | HQuery url; |
| 2703 | char *zCIUuid = 0; |
| 2704 | int isSymbolicCI = 0; /* ci= exists and is a symbolic name, not a hash */ |
| 2705 | int isBranchCI = 0; /* ci= refers to a branch name */ |
| 2706 | char *zHeader = 0; |
| 2707 | |
| 2708 | login_check_credentials(); |
| 2709 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2710 | cgi_check_for_malice(); |
| 2711 | style_set_current_feature("artifact"); |
| 2712 |
+6
-6
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -1341,11 +1341,11 @@ | ||
| 1341 | 1341 | ** |
| 1342 | 1342 | ** g.userUid Database USER.UID value. Might be -1 for "nobody" |
| 1343 | 1343 | ** g.zLogin Database USER.LOGIN value. NULL for user "nobody" |
| 1344 | 1344 | ** g.perm Permissions granted to this user |
| 1345 | 1345 | ** g.anon Permissions that would be available to anonymous |
| 1346 | -** g.isHuman True if the user is human, not a spider or robot | |
| 1346 | +** g.isRobot True if the client is known to be a spider or robot | |
| 1347 | 1347 | ** g.perm Populated based on user account's capabilities |
| 1348 | 1348 | ** |
| 1349 | 1349 | */ |
| 1350 | 1350 | void login_check_credentials(void){ |
| 1351 | 1351 | int uid = 0; /* User id */ |
| @@ -1382,11 +1382,11 @@ | ||
| 1382 | 1382 | uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'"); |
| 1383 | 1383 | } |
| 1384 | 1384 | g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid); |
| 1385 | 1385 | zCap = "sxy"; |
| 1386 | 1386 | g.noPswd = 1; |
| 1387 | - g.isHuman = 1; | |
| 1387 | + g.isRobot = 0; | |
| 1388 | 1388 | zSeed = db_text("??", "SELECT uid||quote(login)||quote(pw)||quote(cookie)" |
| 1389 | 1389 | " FROM user WHERE uid=%d", uid); |
| 1390 | 1390 | login_create_csrf_secret(zSeed); |
| 1391 | 1391 | fossil_free(zSeed); |
| 1392 | 1392 | } |
| @@ -1559,15 +1559,15 @@ | ||
| 1559 | 1559 | g.userUid = uid; |
| 1560 | 1560 | if( fossil_strcmp(g.zLogin,"nobody")==0 ){ |
| 1561 | 1561 | g.zLogin = 0; |
| 1562 | 1562 | } |
| 1563 | 1563 | if( PB("isrobot") ){ |
| 1564 | - g.isHuman = 0; | |
| 1564 | + g.isRobot = 1; | |
| 1565 | 1565 | }else if( g.zLogin==0 ){ |
| 1566 | - g.isHuman = isHuman(P("HTTP_USER_AGENT")); | |
| 1566 | + g.isRobot = !isHuman(P("HTTP_USER_AGENT")); | |
| 1567 | 1567 | }else{ |
| 1568 | - g.isHuman = 1; | |
| 1568 | + g.isRobot = 0; | |
| 1569 | 1569 | } |
| 1570 | 1570 | |
| 1571 | 1571 | /* Set the capabilities */ |
| 1572 | 1572 | login_replace_capabilities(zCap, 0); |
| 1573 | 1573 | |
| @@ -1577,11 +1577,11 @@ | ||
| 1577 | 1577 | ** enabled for this repository and make appropriate adjustments to the |
| 1578 | 1578 | ** permission flags if it is. This should be done before the permissions |
| 1579 | 1579 | ** are (potentially) copied to the anonymous permission set; otherwise, |
| 1580 | 1580 | ** those will be out-of-sync. |
| 1581 | 1581 | */ |
| 1582 | - if( zCap[0] && !g.perm.Hyperlink && g.isHuman ){ | |
| 1582 | + if( zCap[0] && !g.perm.Hyperlink && !g.isRobot ){ | |
| 1583 | 1583 | int autoLink = db_get_int("auto-hyperlink",1); |
| 1584 | 1584 | if( autoLink==1 ){ |
| 1585 | 1585 | g.jsHref = 1; |
| 1586 | 1586 | g.perm.Hyperlink = 1; |
| 1587 | 1587 | }else if( autoLink==2 ){ |
| 1588 | 1588 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1341,11 +1341,11 @@ | |
| 1341 | ** |
| 1342 | ** g.userUid Database USER.UID value. Might be -1 for "nobody" |
| 1343 | ** g.zLogin Database USER.LOGIN value. NULL for user "nobody" |
| 1344 | ** g.perm Permissions granted to this user |
| 1345 | ** g.anon Permissions that would be available to anonymous |
| 1346 | ** g.isHuman True if the user is human, not a spider or robot |
| 1347 | ** g.perm Populated based on user account's capabilities |
| 1348 | ** |
| 1349 | */ |
| 1350 | void login_check_credentials(void){ |
| 1351 | int uid = 0; /* User id */ |
| @@ -1382,11 +1382,11 @@ | |
| 1382 | uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'"); |
| 1383 | } |
| 1384 | g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid); |
| 1385 | zCap = "sxy"; |
| 1386 | g.noPswd = 1; |
| 1387 | g.isHuman = 1; |
| 1388 | zSeed = db_text("??", "SELECT uid||quote(login)||quote(pw)||quote(cookie)" |
| 1389 | " FROM user WHERE uid=%d", uid); |
| 1390 | login_create_csrf_secret(zSeed); |
| 1391 | fossil_free(zSeed); |
| 1392 | } |
| @@ -1559,15 +1559,15 @@ | |
| 1559 | g.userUid = uid; |
| 1560 | if( fossil_strcmp(g.zLogin,"nobody")==0 ){ |
| 1561 | g.zLogin = 0; |
| 1562 | } |
| 1563 | if( PB("isrobot") ){ |
| 1564 | g.isHuman = 0; |
| 1565 | }else if( g.zLogin==0 ){ |
| 1566 | g.isHuman = isHuman(P("HTTP_USER_AGENT")); |
| 1567 | }else{ |
| 1568 | g.isHuman = 1; |
| 1569 | } |
| 1570 | |
| 1571 | /* Set the capabilities */ |
| 1572 | login_replace_capabilities(zCap, 0); |
| 1573 | |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | ** enabled for this repository and make appropriate adjustments to the |
| 1578 | ** permission flags if it is. This should be done before the permissions |
| 1579 | ** are (potentially) copied to the anonymous permission set; otherwise, |
| 1580 | ** those will be out-of-sync. |
| 1581 | */ |
| 1582 | if( zCap[0] && !g.perm.Hyperlink && g.isHuman ){ |
| 1583 | int autoLink = db_get_int("auto-hyperlink",1); |
| 1584 | if( autoLink==1 ){ |
| 1585 | g.jsHref = 1; |
| 1586 | g.perm.Hyperlink = 1; |
| 1587 | }else if( autoLink==2 ){ |
| 1588 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1341,11 +1341,11 @@ | |
| 1341 | ** |
| 1342 | ** g.userUid Database USER.UID value. Might be -1 for "nobody" |
| 1343 | ** g.zLogin Database USER.LOGIN value. NULL for user "nobody" |
| 1344 | ** g.perm Permissions granted to this user |
| 1345 | ** g.anon Permissions that would be available to anonymous |
| 1346 | ** g.isRobot True if the client is known to be a spider or robot |
| 1347 | ** g.perm Populated based on user account's capabilities |
| 1348 | ** |
| 1349 | */ |
| 1350 | void login_check_credentials(void){ |
| 1351 | int uid = 0; /* User id */ |
| @@ -1382,11 +1382,11 @@ | |
| 1382 | uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'"); |
| 1383 | } |
| 1384 | g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid); |
| 1385 | zCap = "sxy"; |
| 1386 | g.noPswd = 1; |
| 1387 | g.isRobot = 0; |
| 1388 | zSeed = db_text("??", "SELECT uid||quote(login)||quote(pw)||quote(cookie)" |
| 1389 | " FROM user WHERE uid=%d", uid); |
| 1390 | login_create_csrf_secret(zSeed); |
| 1391 | fossil_free(zSeed); |
| 1392 | } |
| @@ -1559,15 +1559,15 @@ | |
| 1559 | g.userUid = uid; |
| 1560 | if( fossil_strcmp(g.zLogin,"nobody")==0 ){ |
| 1561 | g.zLogin = 0; |
| 1562 | } |
| 1563 | if( PB("isrobot") ){ |
| 1564 | g.isRobot = 1; |
| 1565 | }else if( g.zLogin==0 ){ |
| 1566 | g.isRobot = !isHuman(P("HTTP_USER_AGENT")); |
| 1567 | }else{ |
| 1568 | g.isRobot = 0; |
| 1569 | } |
| 1570 | |
| 1571 | /* Set the capabilities */ |
| 1572 | login_replace_capabilities(zCap, 0); |
| 1573 | |
| @@ -1577,11 +1577,11 @@ | |
| 1577 | ** enabled for this repository and make appropriate adjustments to the |
| 1578 | ** permission flags if it is. This should be done before the permissions |
| 1579 | ** are (potentially) copied to the anonymous permission set; otherwise, |
| 1580 | ** those will be out-of-sync. |
| 1581 | */ |
| 1582 | if( zCap[0] && !g.perm.Hyperlink && !g.isRobot ){ |
| 1583 | int autoLink = db_get_int("auto-hyperlink",1); |
| 1584 | if( autoLink==1 ){ |
| 1585 | g.jsHref = 1; |
| 1586 | g.perm.Hyperlink = 1; |
| 1587 | }else if( autoLink==2 ){ |
| 1588 |
+2
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -233,11 +233,12 @@ | ||
| 233 | 233 | * applicable when using SEE on Windows or Linux. */ |
| 234 | 234 | #endif |
| 235 | 235 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 236 | 236 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 237 | 237 | int userUid; /* Integer user id */ |
| 238 | - int isHuman; /* True if access by a human, not a spider or bot */ | |
| 238 | + int isRobot; /* True if the client is definitely a robot. False | |
| 239 | + ** negatives are common for this flag */ | |
| 239 | 240 | int comFmtFlags; /* Zero or more "COMMENT_PRINT_*" bit flags, should be |
| 240 | 241 | ** accessed through get_comment_format(). */ |
| 241 | 242 | const char *zSockName; /* Name of the unix-domain socket file */ |
| 242 | 243 | const char *zSockMode; /* File permissions for unix-domain socket */ |
| 243 | 244 | const char *zSockOwner; /* Owner, or owner:group for unix-domain socket */ |
| 244 | 245 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -233,11 +233,12 @@ | |
| 233 | * applicable when using SEE on Windows or Linux. */ |
| 234 | #endif |
| 235 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 236 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 237 | int userUid; /* Integer user id */ |
| 238 | int isHuman; /* True if access by a human, not a spider or bot */ |
| 239 | int comFmtFlags; /* Zero or more "COMMENT_PRINT_*" bit flags, should be |
| 240 | ** accessed through get_comment_format(). */ |
| 241 | const char *zSockName; /* Name of the unix-domain socket file */ |
| 242 | const char *zSockMode; /* File permissions for unix-domain socket */ |
| 243 | const char *zSockOwner; /* Owner, or owner:group for unix-domain socket */ |
| 244 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -233,11 +233,12 @@ | |
| 233 | * applicable when using SEE on Windows or Linux. */ |
| 234 | #endif |
| 235 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 236 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 237 | int userUid; /* Integer user id */ |
| 238 | int isRobot; /* True if the client is definitely a robot. False |
| 239 | ** negatives are common for this flag */ |
| 240 | int comFmtFlags; /* Zero or more "COMMENT_PRINT_*" bit flags, should be |
| 241 | ** accessed through get_comment_format(). */ |
| 242 | const char *zSockName; /* Name of the unix-domain socket file */ |
| 243 | const char *zSockMode; /* File permissions for unix-domain socket */ |
| 244 | const char *zSockOwner; /* Owner, or owner:group for unix-domain socket */ |
| 245 |
+1
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1487,11 +1487,11 @@ | ||
| 1487 | 1487 | @ g.zHttpsURL = %h(g.zHttpsURL)<br> |
| 1488 | 1488 | @ g.zTop = %h(g.zTop)<br> |
| 1489 | 1489 | @ g.zPath = %h(g.zPath)<br> |
| 1490 | 1490 | @ g.userUid = %d(g.userUid)<br> |
| 1491 | 1491 | @ g.zLogin = %h(g.zLogin)<br> |
| 1492 | - @ g.isHuman = %d(g.isHuman)<br> | |
| 1492 | + @ g.isRobot = %d(g.isRobot)<br> | |
| 1493 | 1493 | @ g.jsHref = %d(g.jsHref)<br> |
| 1494 | 1494 | if( g.zLocalRoot ){ |
| 1495 | 1495 | @ g.zLocalRoot = %h(g.zLocalRoot)<br> |
| 1496 | 1496 | }else{ |
| 1497 | 1497 | @ g.zLocalRoot = <i>none</i><br> |
| 1498 | 1498 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1487,11 +1487,11 @@ | |
| 1487 | @ g.zHttpsURL = %h(g.zHttpsURL)<br> |
| 1488 | @ g.zTop = %h(g.zTop)<br> |
| 1489 | @ g.zPath = %h(g.zPath)<br> |
| 1490 | @ g.userUid = %d(g.userUid)<br> |
| 1491 | @ g.zLogin = %h(g.zLogin)<br> |
| 1492 | @ g.isHuman = %d(g.isHuman)<br> |
| 1493 | @ g.jsHref = %d(g.jsHref)<br> |
| 1494 | if( g.zLocalRoot ){ |
| 1495 | @ g.zLocalRoot = %h(g.zLocalRoot)<br> |
| 1496 | }else{ |
| 1497 | @ g.zLocalRoot = <i>none</i><br> |
| 1498 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1487,11 +1487,11 @@ | |
| 1487 | @ g.zHttpsURL = %h(g.zHttpsURL)<br> |
| 1488 | @ g.zTop = %h(g.zTop)<br> |
| 1489 | @ g.zPath = %h(g.zPath)<br> |
| 1490 | @ g.userUid = %d(g.userUid)<br> |
| 1491 | @ g.zLogin = %h(g.zLogin)<br> |
| 1492 | @ g.isRobot = %d(g.isRobot)<br> |
| 1493 | @ g.jsHref = %d(g.jsHref)<br> |
| 1494 | if( g.zLocalRoot ){ |
| 1495 | @ g.zLocalRoot = %h(g.zLocalRoot)<br> |
| 1496 | }else{ |
| 1497 | @ g.zLocalRoot = <i>none</i><br> |
| 1498 |