about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--cgitrc.5.txt4
-rw-r--r--ui-atom.c2
-rw-r--r--ui-commit.c12
-rw-r--r--ui-patch.c6
-rw-r--r--ui-tag.c2
-rw-r--r--ui-tree.c8
8 files changed, 29 insertions, 8 deletions
diff --git a/cgit.c b/cgit.c index 4f414c3..aa1107a 100644 --- a/cgit.c +++ b/cgit.c
@@ -59,6 +59,8 @@ void config_cb(const char *name, const char *value)
59 ctx.cfg.virtual_root = ""; 59 ctx.cfg.virtual_root = "";
60 } else if (!strcmp(name, "nocache")) 60 } else if (!strcmp(name, "nocache"))
61 ctx.cfg.nocache = atoi(value); 61 ctx.cfg.nocache = atoi(value);
62 else if (!strcmp(name, "noplainemail"))
63 ctx.cfg.noplainemail = atoi(value);
62 else if (!strcmp(name, "noheader")) 64 else if (!strcmp(name, "noheader"))
63 ctx.cfg.noheader = atoi(value); 65 ctx.cfg.noheader = atoi(value);
64 else if (!strcmp(name, "snapshots")) 66 else if (!strcmp(name, "snapshots"))
diff --git a/cgit.h b/cgit.h index 9259f33..1194eb0 100644 --- a/cgit.h +++ b/cgit.h
@@ -169,6 +169,7 @@ struct cgit_config {
169 int max_repodesc_len; 169 int max_repodesc_len;
170 int max_stats; 170 int max_stats;
171 int nocache; 171 int nocache;
172 int noplainemail;
172 int noheader; 173 int noheader;
173 int renamelimit; 174 int renamelimit;
174 int snapshots; 175 int snapshots;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 7256ec0..0412f64 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt
@@ -162,6 +162,10 @@ nocache::
162 deprecated, and will not be honored starting with cgit-1.0. Default 162 deprecated, and will not be honored starting with cgit-1.0. Default
163 value: "0". 163 value: "0".
164 164
165noplainemail::
166 If set to "1" showing full author email adresses will be disabled.
167 Default value: "0".
168
165noheader:: 169noheader::
166 Flag which, when set to "1", will make cgit omit the standard header 170 Flag which, when set to "1", will make cgit omit the standard header
167 on all pages. Default value: none. See also: "embedded". 171 on all pages. Default value: none. See also: "embedded".
diff --git a/ui-atom.c b/ui-atom.c index e5c31d9..808b2d0 100644 --- a/ui-atom.c +++ b/ui-atom.c
@@ -32,7 +32,7 @@ void add_entry(struct commit *commit, char *host)
32 html_txt(info->author); 32 html_txt(info->author);
33 html("</name>\n"); 33 html("</name>\n");
34 } 34 }
35 if (info->author_email) { 35 if (info->author_email && !ctx.cfg.noplainemail) {
36 mail = xstrdup(info->author_email); 36 mail = xstrdup(info->author_email);
37 t = strchr(mail, '<'); 37 t = strchr(mail, '<');
38 if (t) 38 if (t)
diff --git a/ui-commit.c b/ui-commit.c index 41ce70e..9fdb8ee 100644 --- a/ui-commit.c +++ b/ui-commit.c
@@ -40,15 +40,19 @@ void cgit_print_commit(char *hex)
40 html("<table summary='commit info' class='commit-info'>\n"); 40 html("<table summary='commit info' class='commit-info'>\n");
41 html("<tr><th>author</th><td>"); 41 html("<tr><th>author</th><td>");
42 html_txt(info->author); 42 html_txt(info->author);
43 html(" "); 43 if (!ctx.cfg.noplainemail) {
44 html_txt(info->author_email); 44 html(" ");
45 html_txt(info->author_email);
46 }
45 html("</td><td class='right'>"); 47 html("</td><td class='right'>");
46 cgit_print_date(info->author_date, FMT_LONGDATE, ctx.cfg.local_time); 48 cgit_print_date(info->author_date, FMT_LONGDATE, ctx.cfg.local_time);
47 html("</td></tr>\n"); 49 html("</td></tr>\n");
48 html("<tr><th>committer</th><td>"); 50 html("<tr><th>committer</th><td>");
49 html_txt(info->committer); 51 html_txt(info->committer);
50 html(" "); 52 if (!ctx.cfg.noplainemail) {
51 html_txt(info->committer_email); 53 html(" ");
54 html_txt(info->committer_email);
55 }
52 html("</td><td class='right'>"); 56 html("</td><td class='right'>");
53 cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time); 57 cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time);
54 html("</td></tr>\n"); 58 html("</td></tr>\n");
diff --git a/ui-patch.c b/ui-patch.c index 5d665d3..2a8f7a5 100644 --- a/ui-patch.c +++ b/ui-patch.c
@@ -108,7 +108,11 @@ void cgit_print_patch(char *hex)
108 ctx.page.filename = patchname; 108 ctx.page.filename = patchname;
109 cgit_print_http_headers(&ctx); 109 cgit_print_http_headers(&ctx);
110 htmlf("From %s Mon Sep 17 00:00:00 2001\n", sha1_to_hex(sha1)); 110 htmlf("From %s Mon Sep 17 00:00:00 2001\n", sha1_to_hex(sha1));
111 htmlf("From: %s %s\n", info->author, info->author_email); 111 htmlf("From: %s", info->author);
112 if (!ctx.cfg.noplainemail) {
113 htmlf(" %s", info->author_email);
114 }
115 html("\n");
112 html("Date: "); 116 html("Date: ");
113 cgit_print_date(info->author_date, "%a, %d %b %Y %H:%M:%S %z%n", ctx.cfg.local_time); 117 cgit_print_date(info->author_date, "%a, %d %b %Y %H:%M:%S %z%n", ctx.cfg.local_time);
114 htmlf("Subject: %s\n\n", info->subject); 118 htmlf("Subject: %s\n\n", info->subject);
diff --git a/ui-tag.c b/ui-tag.c index 0e056e0..a9c8670 100644 --- a/ui-tag.c +++ b/ui-tag.c
@@ -64,7 +64,7 @@ void cgit_print_tag(char *revname)
64 if (info->tagger) { 64 if (info->tagger) {
65 html("<tr><td>Tagged by</td><td>"); 65 html("<tr><td>Tagged by</td><td>");
66 html_txt(info->tagger); 66 html_txt(info->tagger);
67 if (info->tagger_email) { 67 if (info->tagger_email && !ctx.cfg.noplainemail) {
68 html(" "); 68 html(" ");
69 html_txt(info->tagger_email); 69 html_txt(info->tagger_email);
70 } 70 }
diff --git a/ui-tree.c b/ui-tree.c index 553dbaa..61fcf5a 100644 --- a/ui-tree.c +++ b/ui-tree.c
@@ -103,6 +103,7 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
103{ 103{
104 char *name; 104 char *name;
105 char *fullpath; 105 char *fullpath;
106 char *class;
106 enum object_type type; 107 enum object_type type;
107 unsigned long size = 0; 108 unsigned long size = 0;
108 109
@@ -135,7 +136,12 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
135 cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, 136 cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head,
136 curr_rev, fullpath); 137 curr_rev, fullpath);
137 } else { 138 } else {
138 cgit_tree_link(name, NULL, "ls-blob", ctx.qry.head, 139 class = strrchr(name, '.');
140 if (class != NULL) {
141 class = fmt("ls-blob %s", class + 1);
142 } else
143 class = "ls-blob";
144 cgit_tree_link(name, NULL, class, ctx.qry.head,
139 curr_rev, fullpath); 145 curr_rev, fullpath);
140 } 146 }
141 htmlf("</td><td class='ls-size'>%li</td>", size); 147 htmlf("</td><td class='ls-size'>%li</td>", size);