Fossil

Check-in [a4655a1dab]
Login

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

Overview
Comment:Make the (Remove User Flag) link work even if the "u" query parameter was used instead of "user".
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | andygoth-user-reports
Files: files | file ages | folders
SHA1: a4655a1dab36ec7cc6bd9710166f4e8d3d7a1a8a
User & Date: andygoth 2015-05-18 02:37:03.607
Context
2015-05-18
02:42
Add a field to the reports to directly type a user name. Hide this field on the user report. ... (check-in: bcee2d48ed user: andygoth tags: andygoth-user-reports)
02:37
Make the (Remove User Flag) link work even if the "u" query parameter was used instead of "user". ... (check-in: a4655a1dab user: andygoth tags: andygoth-user-reports)
02:36
Deal with the fact that the Fossil repository has a few null users. Instead of having them match everything, including nonexistent users, make them match nothing. ... (check-in: cbbee17312 user: andygoth tags: andygoth-user-reports)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/statrep.c.
754
755
756
757
758
759
760

761
762
763
764



765
766
767
768
769
770
771

772
773
774
775
776
777
778
**   y=YYYY            The year to report (default is the server's
**                     current year).
*/
void stats_report_page(){
  HQuery url;                        /* URL for various branch links */
  const char *zView = P("view");    /* Which view/report to show. */
  const char *zUserName = P("user");


  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  if(!zUserName) zUserName = P("u");



  if(zUserName && !*zUserName){
    zUserName = NULL;
  }
  url_initialize(&url, "reports");
  if(zUserName){
    url_add_parameter(&url,"user", zUserName);
    statrep_submenu(&url, "(Remove User Flag)", "view", zView, "user");

  }
  statrep_submenu(&url, "By Year", "view", "byyear", 0);
  statrep_submenu(&url, "By Month", "view", "bymonth", 0);
  statrep_submenu(&url, "By Week", "view", "byweek", 0);
  statrep_submenu(&url, "By Weekday", "view", "byweekday", 0);
  statrep_submenu(&url, "By User", "view", "byuser", "user");
  statrep_submenu(&url, "By File", "view", "byfile", "file");







>



|
>
>
>





|
|
>







754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
**   y=YYYY            The year to report (default is the server's
**                     current year).
*/
void stats_report_page(){
  HQuery url;                        /* URL for various branch links */
  const char *zView = P("view");    /* Which view/report to show. */
  const char *zUserName = P("user");
  int haveU = !zUserName;

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  if(!zUserName){
    zUserName = P("u");
    haveU = !!zUserName;
  }
  if(zUserName && !*zUserName){
    zUserName = NULL;
  }
  url_initialize(&url, "reports");
  if(zUserName){
    url_add_parameter(&url, haveU ? "u" : "user", zUserName);
    statrep_submenu(&url, "(Remove User Flag)", "view", zView,
                    haveU ? "u" : "user");
  }
  statrep_submenu(&url, "By Year", "view", "byyear", 0);
  statrep_submenu(&url, "By Month", "view", "bymonth", 0);
  statrep_submenu(&url, "By Week", "view", "byweek", 0);
  statrep_submenu(&url, "By Weekday", "view", "byweekday", 0);
  statrep_submenu(&url, "By User", "view", "byuser", "user");
  statrep_submenu(&url, "By File", "view", "byfile", "file");