Check-in [5fe3aee839]
Not logged in
Overview

SHA1 Hash:5fe3aee8394b13baf8e71aef12228abce54aa2c6
Date: 2009-08-30 01:22:15
User: drh
Comment:Disable additional hyperlinks when "history" privilege is disabled (by default when the user has not signed in as "anonymous" or other known user.) Help prevent spiders for soaking up bandwidth.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/info.c from [9956b9b09c] to [7cbe41c03c].

@@ -364,11 +364,18 @@
     int pid = db_column_int(&q,0);
     int fid = db_column_int(&q,1);
     const char *zName = db_column_text(&q,2);
     const char *zOld = db_column_text(&q,3);
     const char *zNew = db_column_text(&q,4);
-    if( zOld && zNew ){
+    if( !g.okHistory ){
+      if( zNew==0 ){
+        @ <p>Deleted %h(zName)</p>
+        continue;
+      }else{
+        @ <p>Changes to %h(zName)</p>
+      }
+    }else if( zOld && zNew ){
       @ <p>Modified <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
       @ from <a href="%s(g.zBaseURL)/artifact/%s(zOld)">[%s(zOld)]</a>
       @ to <a href="%s(g.zBaseURL)/artifact/%s(zNew)">[%s(zNew)]</a></p>
     }else if( zOld ){
       @ <p>Deleted <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
@@ -584,12 +591,15 @@
     const char *zComment = db_column_text(&q, 1);
     @ <h2>Check-in %s(zUuid)</h2>
     @ <p>Made by
     hyperlink_to_user(zUser,zDate," on");
     hyperlink_to_date(zDate, ":");
-    @ %w(zComment). <a href="%s(g.zBaseURL)/ci/%s(zUuid)">[details]</a></p>
-    @ <hr>
+    @ %w(zComment).
+    if( g.okHistory ){
+      @ <a href="%s(g.zBaseURL)/ci/%s(zUuid)">[details]</a>
+    }
+    @ </p><hr>
   }
   db_finalize(&q);
   db_prepare(&q,
      "SELECT pid, fid, name"
      "  FROM mlink, filename"
@@ -600,11 +610,15 @@
   );
   while( db_step(&q)==SQLITE_ROW ){
     int pid = db_column_int(&q,0);
     int fid = db_column_int(&q,1);
     const char *zName = db_column_text(&q,2);
-    @ <p><a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a></p>
+    if( g.okHistory ){
+      @ <p><a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a></p>
+    }else{
+      @ <p>%h(zName)</p>
+    }
     @ <blockquote><pre>
     append_diff(pid, fid);
     @ </pre></blockquote>
   }
   db_finalize(&q);
@@ -656,11 +670,15 @@
     if( cnt>0 ){
       @ Also file
     }else{
       @ File
     }
-    @ <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
+    if( g.okHistory ){
+      @ <a href="%s(g.zBaseURL)/finfo?name=%T(zName)">%h(zName)</a>
+    }else{
+      @ %h(zName)
+    }
     @ part of check-in
     hyperlink_to_uuid(zVers);
     @ - %w(zCom) by
     hyperlink_to_user(zUser,zDate," on");
     hyperlink_to_date(zDate,".");
@@ -687,11 +705,15 @@
     if( cnt>0 ){
       @ Also wiki page
     }else{
       @ Wiki page
     }
-    @ [<a href="%s(g.zBaseURL)/wiki?name=%t(zPagename)">%h(zPagename)</a>]
+    if( g.okHistory ){
+      @ [<a href="%s(g.zBaseURL)/wiki?name=%t(zPagename)">%h(zPagename)</a>]
+    }else{
+      @ [%h(zPagename)]
+    }
     @ by
     hyperlink_to_user(zUser,zDate," on");
     hyperlink_to_date(zDate,".");
     nWiki++;
     cnt++;
@@ -741,11 +763,11 @@
     char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
     @ Control artifact.
     if( pDownloadName && blob_size(pDownloadName)==0 ){
       blob_append(pDownloadName, zUuid, -1);
     }
-  }else if( linkToView ){
+  }else if( linkToView && g.okHistory ){
     @ <a href="%s(g.zBaseURL)/artifact/%d(rid)">[view]</a>
   }
 }
 
 
@@ -1029,16 +1051,23 @@
   }
   style_header("Ticket Change Details");
   zDate = db_text(0, "SELECT datetime(%.12f)", m.rDate);
   memcpy(zTktName, m.zTicketUuid, 10);
   zTktName[10] = 0;
-  @ <h2>Changes to ticket <a href="%s(m.zTicketUuid)">%s(zTktName)</a></h2>
-  @
-  @ <p>By %h(m.zUser) on %s(zDate).  See also:
-  @ <a href="%s(g.zTop)/artifact/%T(zUuid)">artifact content</a>, and
-  @ <a href="%s(g.zTop)/tkthistory/%s(m.zTicketUuid)">ticket history</a>
-  @ </p>
+  if( g.okHistory ){
+    @ <h2>Changes to ticket <a href="%s(m.zTicketUuid)">%s(zTktName)</a></h2>
+    @
+    @ <p>By %h(m.zUser) on %s(zDate).  See also:
+    @ <a href="%s(g.zTop)/artifact/%T(zUuid)">artifact content</a>, and
+    @ <a href="%s(g.zTop)/tkthistory/%s(m.zTicketUuid)">ticket history</a>
+    @ </p>
+  }else{
+    @ <h2>Changes to ticket %s(zTktName)</h2>
+    @
+    @ <p>By %h(m.zUser) on %s(zDate).
+    @ </p>
+  }
   @
   @ <ol>
   free(zDate);
   ticket_output_change_artifact(&m);
   manifest_clear(&m);

Modified src/report.c from [dff9f62bfb] to [911a1c587a].

@@ -783,11 +783,15 @@
         wiki_convert(&content, 0, 0);
         blob_reset(&content);
       }
     }else if( azName[i][0]=='#' ){
       zTid = zData;
-      @ <td valign="top"><a href="tktview?name=%h(zData)">%h(zData)</a></td>
+      if( g.okHistory ){
+        @ <td valign="top"><a href="tktview?name=%h(zData)">%h(zData)</a></td>
+      }else{
+        @ <td valign="top">%h(zData)</td>
+      }
     }else if( zData[0]==0 ){
       @ <td valign="top">&nbsp;</td>
     }else{
       @ <td valign="top">
       @ %h(zData)