From 55f06531ce718850c4f3ea2437132a8fda874e01 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sun, 4 Dec 2011 01:10:03 +0000
Subject: [PATCH] Add bool 'send_password_via_email' (default: true). This
 should be a modopt.

---
 web/root/newuser.ssjs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/web/root/newuser.ssjs b/web/root/newuser.ssjs
index 6f5b8ae09c..4fdb725d4d 100644
--- a/web/root/newuser.ssjs
+++ b/web/root/newuser.ssjs
@@ -7,6 +7,7 @@
 /* ToDo: Deal with UQ_NODEF */
 
 var send_user_info_to_sysop=false;
+var send_password_via_email=true;
 
 /* These two strings *must* be different! */
 var required_str="*";
@@ -304,7 +305,7 @@ else {
     newpw=genpass();
 
     /* Generate and send email */
-    if(http_request.query.netmail != undefined && http_request.query.netmail != '') {
+    if(send_password_via_email && http_request.query.netmail != undefined && http_request.query.netmail != '') {
         var hdrs = new Object;
         hdrs.to=http_request.query.name;
         hdrs.to_net_type=netaddr_type(http_request.query.netmail);
@@ -373,7 +374,7 @@ else {
 	    load(leftnav_html);
 	if(do_rightnav)
 		write_template("rightnav.inc");
-    if(http_request.query.netmail != undefined && http_request.query.netmail != '')
+    if(send_password_via_email && http_request.query.netmail != undefined && http_request.query.netmail != '')
         template.response=format("Your account has been created and the password has been mailed to: %s." ,http_request.query.netmail);
     else
         template.response=format("Your account has been created and the password is: %s " ,newpw);
-- 
GitLab