[geeklog-cvs] geeklog-1.3/system lib-user.php,1.2,1.3
dhaun at iowaoutdoors.org
dhaun at iowaoutdoors.org
Sat May 15 09:02:23 EDT 2004
Update of /var/cvs/geeklog-1.3/system
In directory www:/tmp/cvs-serv25753/system
Modified Files:
lib-user.php
Log Message:
Moved code to send the registration email to lib-user.php, thus avoiding having the same piece of code in users.php, admin/user.php and admin/moderation.php.
Also fixed sending of the registration email when batch-adding users.
Index: lib-user.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/lib-user.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** lib-user.php 14 Feb 2004 17:26:53 -0000 1.2
--- lib-user.php 15 May 2004 13:02:21 -0000 1.3
***************
*** 146,148 ****
--- 146,178 ----
}
+ /**
+ * Create a new password and send it to the user
+ *
+ * @param string $username user's login name
+ * @param string $useremail user's email address
+ * @return bool true = success, false = an error occured
+ *
+ */
+ function USER_createAndSendPassword ($username, $useremail)
+ {
+ global $_CONF, $_TABLES, $LANG04;
+
+ srand ((double) microtime () * 1000000);
+ $passwd = rand ();
+ $passwd = md5 ($passwd);
+ $passwd = substr ($passwd, 1, 8);
+ $passwd2 = md5 ($passwd);
+ DB_change ($_TABLES['users'], 'passwd', "$passwd2", 'username', $username);
+
+ $mailtext = $LANG04[15] . "\n\n";
+ $mailtext .= $LANG04[2] . ": $username\n";
+ $mailtext .= $LANG04[4] . ": $passwd\n\n";
+ $mailtext .= $LANG04[14] . "\n\n";
+ $mailtext .= $_CONF['site_name'] . "\n";
+ $mailtext .= $_CONF['site_url'] . "\n";
+ $subject = $_CONF['site_name'] . ': ' . $LANG04[16];
+
+ return COM_mail ($useremail, $subject, $mailtext);
+ }
+
?>
More information about the geeklog-cvs
mailing list