author | Martin Szulecki <opensuse@sukimashita.com> | 2009-08-07 12:05:17 (UTC) |
---|---|---|
committer | Martin Szulecki <opensuse@sukimashita.com> | 2009-08-08 12:23:28 (UTC) |
commit | 2f56e390f04fe6975b75e512c1436ef173e4aafe (patch) (unidiff) | |
tree | 4e187a5cf039a39a1908623b97e0676c6e7cb756 | |
parent | 286a905842dc0bec6d21a614ec4a97c5f19d5bc4 (diff) | |
download | cgit-2f56e390f04fe6975b75e512c1436ef173e4aafe.zip cgit-2f56e390f04fe6975b75e512c1436ef173e4aafe.tar.gz cgit-2f56e390f04fe6975b75e512c1436ef173e4aafe.tar.bz2 |
Introduce noplainemail option to hide email adresses from spambots
Signed-off-by: Martin Szulecki <opensuse@sukimashita.com>
-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | cgitrc.5.txt | 4 | ||||
-rw-r--r-- | ui-atom.c | 2 | ||||
-rw-r--r-- | ui-commit.c | 12 | ||||
-rw-r--r-- | ui-patch.c | 6 | ||||
-rw-r--r-- | ui-tag.c | 2 |
7 files changed, 22 insertions, 7 deletions
@@ -53,2 +53,4 @@ void config_cb(const char *name, const char *value) | |||
53 | ctx.cfg.nocache = atoi(value); | 53 | ctx.cfg.nocache = atoi(value); |
54 | else if (!strcmp(name, "noplainemail")) | ||
55 | ctx.cfg.noplainemail = atoi(value); | ||
54 | else if (!strcmp(name, "noheader")) | 56 | else if (!strcmp(name, "noheader")) |
@@ -170,2 +170,3 @@ struct cgit_config { | |||
170 | int nocache; | 170 | int nocache; |
171 | int noplainemail; | ||
171 | int noheader; | 172 | int noheader; |
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index a207fe0..7754923 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
@@ -160,2 +160,6 @@ nocache:: | |||
160 | 160 | ||
161 | noplainemail:: | ||
162 | If set to "1" showing full author email adresses will be disabled. | ||
163 | Default value: "0". | ||
164 | |||
161 | noheader:: | 165 | noheader:: |
@@ -34,3 +34,3 @@ void add_entry(struct commit *commit, char *host) | |||
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); |
diff --git a/ui-commit.c b/ui-commit.c index 41ce70e..9fdb8ee 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -42,4 +42,6 @@ void cgit_print_commit(char *hex) | |||
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'>"); |
@@ -49,4 +51,6 @@ void cgit_print_commit(char *hex) | |||
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'>"); |
@@ -110,3 +110,7 @@ void cgit_print_patch(char *hex) | |||
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: "); |
@@ -66,3 +66,3 @@ void cgit_print_tag(char *revname) | |||
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(" "); |