From ecedd44fee3f11c212e7b4662bc5aa30e2634b01 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Thu, 22 Dec 2011 00:14:34 +0000 Subject: [PATCH] Added %c substitution to mod_welcome to print the current user credentials. --- GNUmakefile | 2 +- src/plugins/mod_welcome.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index fabf19b..acc845f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -327,9 +327,9 @@ else install: $(uhub_BINARY) @echo Copying $(uhub_BINARY) to $(UHUB_PREFIX)/bin/ @cp $(uhub_BINARY) $(UHUB_PREFIX)/bin/ + @cp $(uhub-passwd_BINARY) $(UHUB_PREFIX)/bin/ @if [ ! -d $(UHUB_CONF_DIR) ]; then echo Creating $(UHUB_CONF_DIR); mkdir -p $(UHUB_CONF_DIR); fi @if [ ! -f $(UHUB_CONF_DIR)/uhub.conf ]; then cp doc/uhub.conf $(UHUB_CONF_DIR); fi - @if [ ! -f $(UHUB_CONF_DIR)/users.conf ]; then cp doc/users.conf $(UHUB_CONF_DIR); fi @if [ ! -f $(UHUB_CONF_DIR)/rules.txt ]; then cp doc/rules.txt $(UHUB_CONF_DIR); fi @if [ ! -f $(UHUB_CONF_DIR)/plugins.conf ]; then cp doc/plugins.conf $(UHUB_CONF_DIR); fi @if [ ! -d $(UHUB_MOD_DIR) ]; then echo Creating $(UHUB_MOD_DIR); mkdir -p $(UHUB_MOD_DIR); fi diff --git a/src/plugins/mod_welcome.c b/src/plugins/mod_welcome.c index 4d0743d..1549bcf 100644 --- a/src/plugins/mod_welcome.c +++ b/src/plugins/mod_welcome.c @@ -184,6 +184,9 @@ static struct cbuffer* parse_message(struct plugin_user* user, const char* msg) case 'a': cbuf_append(buf, ip_convert_to_string(&user->addr)); break; + case 'c': + cbuf_append(buf, auth_cred_to_string(user->credentials)); + break; case '%': cbuf_append(buf, "%");