Browse code

Password conversion: MD5 -> bcrypt with a cost of 12. This change also causes the user to log off the site every time the password is changed.

Clarissa Walker authored on 2026/07/16 19:43:15
Showing 1 changed files
... ...
@@ -54,7 +54,7 @@ if(isMEMBER) accessDenied( );
54 54
 				mt_srand((double)microtime() * 1000000);
55 55
 				$charset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ';		
56 56
 				$pass = random_string($charset, 10);
57
-				$encryppass = md5($pass);
57
+				$encryppass = password_hash($_POST['password'], PASSWORD_BCRYPT, ['cost' => 12]);
58 58
 				$subject = _NEWPWDSUB;
59 59
 				$mailtext = sprintf(_NEWPWDMSG, $pass);
60 60
 
Browse code

multiple address support

Jimako authored on 2024/04/25 04:12:38
Showing 1 changed files
... ...
@@ -88,7 +88,14 @@ if(isMEMBER) accessDenied( );
88 88
 						$RegMessage .= " Asked for new password";
89 89
 						$RegMessage .= "<br>Profile link: " . "<a href='".$url."/viewuser.php?uid=" . $uid . "'>" . $penname . "</a>";
90 90
 
91
- 						sendemail($sitename, $RegNoticeTo, $siteemail, $siteemail, $RegSubject,  $RegMessage);
91
+						$RegNoticeTo_array = explode(',', $RegNoticeTo);
92
+						foreach ($RegNoticeTo_array as $RegNoticeTo_email)
93
+						{
94
+							if (validEmail($RegNoticeTo_email))
95
+							{
96
+								sendemail($sitename, $RegNoticeTo_email, $siteemail, $siteemail, $RegSubject,  $RegMessage);
97
+							}
98
+						}
92 99
 					}
93 100
 				}	 
94 101
 			}
Browse code

fix for time - user registration

Jimako authored on 2024/04/21 17:50:30
Showing 1 changed files
... ...
@@ -86,6 +86,8 @@ if(isMEMBER) accessDenied( );
86 86
 						$RegNoticeTo = $notifications['registration_toemail'];
87 87
 						$RegMessage = "Username: $penname" . "\r\n" . "Email: $email" . "\r\n" . "IP: $RegIP" . "\r\n" . "Host: $RegHost";
88 88
 						$RegMessage .= " Asked for new password";
89
+						$RegMessage .= "<br>Profile link: " . "<a href='".$url."/viewuser.php?uid=" . $uid . "'>" . $penname . "</a>";
90
+
89 91
  						sendemail($sitename, $RegNoticeTo, $siteemail, $siteemail, $RegSubject,  $RegMessage);
90 92
 					}
91 93
 				}	 
Browse code

3.5.8git notifications

Jimako authored on 2024/04/21 12:53:37
Showing 1 changed files
... ...
@@ -67,6 +67,28 @@ if(isMEMBER) accessDenied( );
67 67
 				else $output .=  write_message(_EMAILFAILED);
68 68
 				if($logging) 
69 69
 					dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_LOST_PASSWORD, $penname, $uid, ($result ? _YES : _NO)))."', '$uid', INET6_ATON('".$_SERVER['REMOTE_ADDR']."'), 'LP', " . time() . ")");
70
+
71
+
72
+				/* lost password notice */
73
+				if (isset($notifications))
74
+				{
75
+					$notifications = unserialize($notifications);
76
+				}
77
+	 
78
+				if (isset($notifications['lostpassword_notify'])  && $notifications['lostpassword_notify'])
79
+				{
80
+				
81
+					if (isset($notifications['registration_toemail'])  && $notifications['registration_toemail'])
82
+					{
83
+						$RegSubject = "Lost Password Notice";
84
+						$RegIP = $_SERVER['REMOTE_ADDR'];
85
+						$RegHost = gethostbyaddr($RegIP);
86
+						$RegNoticeTo = $notifications['registration_toemail'];
87
+						$RegMessage = "Username: $penname" . "\r\n" . "Email: $email" . "\r\n" . "IP: $RegIP" . "\r\n" . "Host: $RegHost";
88
+						$RegMessage .= " Asked for new password";
89
+ 						sendemail($sitename, $RegNoticeTo, $siteemail, $siteemail, $RegSubject,  $RegMessage);
90
+					}
91
+				}	 
70 92
 			}
71 93
 
72 94
 		}
Browse code

version 3.5.7

Jimako authored on 2024/04/08 12:21:57
Showing 1 changed files
... ...
@@ -66,7 +66,7 @@ if(isMEMBER) accessDenied( );
66 66
 				}
67 67
 				else $output .=  write_message(_EMAILFAILED);
68 68
 				if($logging) 
69
-					dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_LOST_PASSWORD, $penname, $uid, ($result ? _YES : _NO)))."', '$uid', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'LP', " . time() . ")");
69
+					dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_LOST_PASSWORD, $penname, $uid, ($result ? _YES : _NO)))."', '$uid', INET6_ATON('".$_SERVER['REMOTE_ADDR']."'), 'LP', " . time() . ")");
70 70
 			}
71 71
 
72 72
 		}
... ...
@@ -80,4 +80,4 @@ if(isMEMBER) accessDenied( );
80 80
 		</td></tr></table>";
81 81
 	}
82 82
 
83
-?>
84 83
\ No newline at end of file
84
+?>
Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,83 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+if(!function_exists("random_char")) {
27
+
28
+function random_char($string)
29
+{
30
+	$length = strlen($string);
31
+	$position = mt_rand(0, $length - 1);
32
+	return ($string[$position]);
33
+}
34
+
35
+function random_string ($charset_string, $length)
36
+{
37
+	$return_string = random_char($charset_string);
38
+	for ($x = 1; $x < $length; $x++)
39
+	$return_string .= random_char($charset_string);
40
+	return $return_string;
41
+}
42
+
43
+}
44
+if(isMEMBER) accessDenied( );
45
+	$output = "<div id=\"pagetitle\">"._LOSTPASSWORD."</div>";
46
+
47
+	  if(isset($_POST['submit'])) {
48
+		if(validEmail($_POST['email'])) {
49
+			$result = dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." AS email FROM "._AUTHORTABLE." WHERE email = '".strtolower(escapestring(descript($_POST['email'])))."'");
50
+			list($uid, $penname, $email) = dbrow($result);
51
+			if(dbnumrows($result) == 0) $output .= write_message(_BADEMAIL);
52
+			else {
53
+				include("includes/emailer.php");
54
+				mt_srand((double)microtime() * 1000000);
55
+				$charset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ';		
56
+				$pass = random_string($charset, 10);
57
+				$encryppass = md5($pass);
58
+				$subject = _NEWPWDSUB;
59
+				$mailtext = sprintf(_NEWPWDMSG, $pass);
60
+
61
+		
62
+				$result = sendemail($penname, $email, $sitename, $siteemail, $subject, $mailtext, "html");
63
+				if($result) {
64
+					$output .= write_message(_PASSWORDSENT);
65
+					dbquery("UPDATE ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))." SET password='$encryppass' WHERE uid = '".$uid."'");
66
+				}
67
+				else $output .=  write_message(_EMAILFAILED);
68
+				if($logging) 
69
+					dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_LOST_PASSWORD, $penname, $uid, ($result ? _YES : _NO)))."', '$uid', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'LP', " . time() . ")");
70
+			}
71
+
72
+		}
73
+		else $output .= write_message(_BADEMAIL);
74
+	}
75
+	else {
76
+		$output .= "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"user.php?action=lostpassword\">
77
+		<table align=\"center\" width=\"300\">
78
+		<tr><td>"._ENTEREMAIL."</td></tr>
79
+		<tr><td><INPUT  type=\"text\" class=\"textbox=\" name=\"email\"> <INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\"></form>
80
+		</td></tr></table>";
81
+	}
82
+
83
+?>
0 84
\ No newline at end of file