From ff34cd3341501066f300fb9051d3685e1458efec Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Fri, 21 Apr 2006 19:02:19 +0000
Subject: [PATCH] Tracker1's module to send new user details to the sysop (via
 email).

---
 exec/load/user_info_to_sysop.js | 62 +++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 exec/load/user_info_to_sysop.js

diff --git a/exec/load/user_info_to_sysop.js b/exec/load/user_info_to_sysop.js
new file mode 100644
index 0000000000..d54c3c230c
--- /dev/null
+++ b/exec/load/user_info_to_sysop.js
@@ -0,0 +1,62 @@
+/*******************************************************************************
+This work is copyright Michael J. Ryan (c) 2006
+
+It is licenced under the GNU General Public License (GPL, version 2)
+http://www.gnu.org/licenses/gpl.html
+--------------------------------------------------------------------------------
+
+FILE NAME	:	user_info_to_sysop.js
+
+CVS ID		:	$Id$
+
+CREATED		:	2006-04-20
+BY			:	Michael J. Ryan <tracker1(at)theroughnecks(dot)net>
+
+TABSTOPS	:	4
+
+REQUIRES	:	sbbsdefs.js	- must be loaded before this file
+
+MIN VERSION	:	Synchronet 3.12b
+
+--------------------------------------------------------------------------------
+
+Utility function for sending the details of a user to the sysop,
+It's primary purpose would be to send information for a new user.
+
+*******************************************************************************/
+
+function sendUserInfoToSysop(u, subject, note) {
+	var hdr = {
+		to: system.operator.toLowerCase(),
+		to_ext: '1',
+		from: u.alias,
+		replyto: u.alias,
+		subject: subject
+	};
+	if (u.netmail != '')
+		hdr.replyto_net_addr = u.netmail
+
+	var msg = "" +
+		"Alias         : " + u.alias+"  ("+u.security.password+")\r\n" +
+		"Real name     : " + u.name+"\r\n" +
+		"Chat handle   : " + u.handle+"\r\n" +
+		"Location      : " + u.location+"\r\n" +
+		"Gender        : " + ((u.gender=="F")?"Female":"Male")+"\r\n" +
+		"Date of birth : " + u.birthdate+"\r\n" +
+		"Email         : " + u.netmail +
+		(((u.settings & USER_NETMAIL) != 0)?" (forwarded)":"") + "\r\n" +
+		"---------------------------------------------------------------------------\r\n" +
+		note + "\r\n";
+
+	var mail = new MsgBase("mail");
+	if(mail.open != undefined && mail.open() == false) {
+
+		var err_msg = "!ERROR " + mail.error;
+		log(err_msg);
+
+		throw err_msg;
+	}
+	mail.save_msg(hdr,msg);
+	mail.close();
+
+}
\ No newline at end of file
-- 
GitLab