diff --git a/cgit.c b/cgit.c index 2039ab1..f6bb0c7 100644 --- a/cgit.c +++ b/cgit.c @@ -51,6 +51,8 @@ void config_cb(const char *name, const char *value) ctx.cfg.virtual_root = ""; } else if (!strcmp(name, "nocache")) ctx.cfg.nocache = atoi(value); + else if (!strcmp(name, "noplainemail")) + ctx.cfg.noplainemail = atoi(value); else if (!strcmp(name, "noheader")) ctx.cfg.noheader = atoi(value); else if (!strcmp(name, "snapshots")) diff --git a/cgit.h b/cgit.h index 8c64efe..acb5e8f 100644 --- a/cgit.h +++ b/cgit.h @@ -168,6 +168,7 @@ struct cgit_config { int max_repodesc_len; int max_stats; int nocache; + int noplainemail; int noheader; int renamelimit; int snapshots; diff --git a/cgitrc.5.txt b/cgitrc.5.txt index a207fe0..7754923 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -158,6 +158,10 @@ nocache:: deprecated, and will not be honored starting with cgit-1.0. Default value: "0". +noplainemail:: + If set to "1" showing full author email adresses will be disabled. + Default value: "0". + noheader:: Flag which, when set to "1", will make cgit omit the standard header 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) html_txt(info->author); html("\n"); } - if (info->author_email) { + if (info->author_email && !ctx.cfg.noplainemail) { mail = xstrdup(info->author_email); t = strchr(mail, '<'); 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) html("
author | "); html_txt(info->author); - html(" "); - html_txt(info->author_email); + if (!ctx.cfg.noplainemail) { + html(" "); + html_txt(info->author_email); + } html(" | "); cgit_print_date(info->author_date, FMT_LONGDATE, ctx.cfg.local_time); html(" |
---|---|---|
committer | "); html_txt(info->committer); - html(" "); - html_txt(info->committer_email); + if (!ctx.cfg.noplainemail) { + html(" "); + html_txt(info->committer_email); + } html(" | "); cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time); html(" |
Tagged by | "); html_txt(info->tagger); - if (info->tagger_email) { + if (info->tagger_email && !ctx.cfg.noplainemail) { html(" "); html_txt(info->tagger_email); } |