Browse code

Update eFic2eFic bridge and default file backups

Clarissa Walker authored on 2026/09/08 10:09:37
Showing 1 changed files
... ...
@@ -1,87 +1,136 @@
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("_LOGINCHECK")) exit( );
26
-	if(isset($_POST['submit']) && preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
27
-		define("_BASEDIR", "");
28
-		include_once("config.php");
29
-		$settings = dbquery("SELECT tableprefix, maintenance, sitekey, debug FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
30
-		list($tableprefix, $maintenance, $sitekey, $debug) = dbrow($settings);
31
-		include_once("includes/queries.php");
32
-		$result = dbquery("SELECT *, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs AS ap ON ap.uid = "._UIDFIELD." WHERE "._PENNAMEFIELD." = '".$_POST['penname']."'");
33
-		$passwd = dbassoc($result);
34
-		if($maintenance && $passwd['level'] < 0) {
35
-			header("Location: maintenance.php");
36
-			exit( );
37
-		}
38
-		$encryptedpassword = md5($_POST['password']);
39
-		if($passwd['level'] == -1) {
40
-			require_once("header.php");
41
-			//make a new TemplatePower object
42
-			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
43
-			else $tpl = new TemplatePower("default_tpls/default.tpl");
44
-			include_once("includes/corefunctions.php");
45
-			accessDenied( );
46
-		}
47
-		if(isset($_POST['cookiecheck'])) {
48
-			setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/");
49
-			setcookie($sitekey."_salt", md5($passwd['email']+$encryptedpassword),  time()+60*60*24*30, "/");
50
-		}
51
-		if($passwd['password'] == $encryptedpassword) {
52
-			if(!isset($_SESSION)) session_start( );
53
-			$_SESSION[$sitekey."_useruid"] = $passwd['uid'];
54
-			$_SESSION[$sitekey."_salt"] = md5($passwd['email']+$encryptedpassword);
55
-		}
56
-
57
-		else { 
58
-			require_once("header.php");
59
-			//make a new TemplatePower object
60
-			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
61
-			else $tpl = new TemplatePower("default_tpls/default.tpl");
62
-			include_once("includes/pagesetup.php");
63
-			$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
64
-			$output .= "<div style='text-align: center;'>"._WRONGPASSWORD."</div>";
65
-			$tpl->assign("output", $output);
66
-			$tpl->printToScreen( );
67
-			dbclose( );
68
-			exit( );
69
-		}
70
-	}
71
-	else if(!isMEMBER) {
72
-		$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
73
-		$output .= "<div style=\"width: 250px; margin: 0 auto; text-align: center;\"><form method=\"POST\" enctype=\"multipart/form-data\" action=\"user.php?action=login".(isset($_GET['sid']) && isNumber($_GET['sid']) ? "&amp;sid=".$_GET['sid'] : "")."\">
74
-		<div class=\"label\" style=\"float: left;  width: 30%; text-align: right;\"><label for=\"penname\">"._PENNAME.":</label></div><INPUT type=\"text\" class=\"textbox\" name=\"penname\" id=\"penname\"><br />
75
-		<div class=\"label\" style=\"float: left; width: 30%; text-align: right;\"><label for=\"pswd\">"._PASSWORD.":</label></div><INPUT type=\"password\" class=\"textbox\" id=\"pswd\" name=\"password\"><br />
76
-		<INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookiecheck\" id=\"cookiecheck\" value=\"1\"><label for=\"cookiecheck\">"._REMEMBERME."</label><br />
77
-		<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">
78
-		</form></div>";
79
-		$linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'");
80
-		while($link = dbassoc($linkquery)) {
81
-			if($link['link_access'] && !isMEMBER) continue;
82
-			if($link['link_access'] == 2 && !isADMIN) continue;
83
-			$pagelinks[$link['link_name']] = array("id" => $link['link_id'], "text" => $link['link_text'], "url" => _BASEDIR.$link['link_url'], "link" => "<a href=\"".$link['link_url']."\" title=\"".$link['link_text']."\"".($link['link_target'] ? " target=\"_blank\"" : "").($current == $link['link_name'] ? " id=\"current\"" : "").">".$link['link_text']."</a>");
84
-		}
85
-		$output .= "<div style='text-align: center;'>".$pagelinks['register']['link']." | ".$pagelinks['lostpassword']['link']."</div>";
86
-	}
87
-?>
88 1
\ No newline at end of file
2
+<?php
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+	if(isset($_POST['submit']) && preg_match("!^[-a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
27
+		if(!defined("_LOGINCHECK")) exit( );
28
+		define("_BASEDIR", "");
29
+		include_once("config.php");
30
+		$settings = dbquery("SELECT tableprefix, maintenance, sitekey, debug FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
31
+		list($tableprefix, $maintenance, $sitekey, $debug) = dbrow($settings);
32
+		$tempdebug = $debug;
33
+		$debug = 0;
34
+		define("TABLEPREFIX", $tableprefix);
35
+		define("SITEKEY", $sitekey);
36
+		include_once("includes/queries.php");
37
+		$result = dbquery("SELECT *, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs AS ap ON ap.uid = "._UIDFIELD." WHERE "._PENNAMEFIELD." = '".$_POST['penname']."'");
38
+		$passwd = dbassoc($result);
39
+		if(!dbnumrows($result)) {
40
+			require_once("header.php");
41
+			//make a new TemplatePower object
42
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
43
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
44
+			include_once("includes/pagesetup.php");
45
+			$output = write_error(_NOSUCHACCOUNT);
46
+			$tpl->assign("output", $output);
47
+			$tpl->printToScreen( );
48
+			dbclose( );
49
+			exit( );
50
+		}
51
+		if($maintenance && $passwd['level'] < 0) {
52
+			header("Location: maintenance.php");
53
+			exit( );
54
+		}
55
+		$encryptedpasswordb = $passwd['password'];
56
+		$encryptedpasswordm = md5($_POST['password']);
57
+		if($passwd['level'] == -1) {
58
+			require_once("header.php");
59
+			//make a new TemplatePower object
60
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
61
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
62
+			include_once("includes/pagesetup.php");
63
+			$output = write_error(_ACCOUNTLOCKED);
64
+			$tpl->assign("output", $output);
65
+			$tpl->printToScreen( );
66
+			dbclose( );
67
+			exit( );
68
+		}
69
+		if(password_verify($_POST['password'], $encryptedpasswordb) == $encryptedpasswordb) {
70
+			if(isset($_POST['cookiecheck'])) {
71
+				setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/");
72
+				setcookie($sitekey."_salt", md5($passwd['email'] . $encryptedpasswordb),  time()+60*60*24*30, "/");
73
+			}
74
+			if(!isset($_SESSION)) session_start( );
75
+			$_SESSION[$sitekey."_useruid"] = $passwd['uid'];
76
+			$_SESSION[$sitekey."_salt"] = md5($passwd['email'] . $encryptedpasswordb);
77
+			$logincode = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'login'");
78
+			while($code = dbassoc($logincode)) {
79
+				eval($code['code_text']);
80
+			}
81
+		}
82
+
83
+		else if($passwd['password'] == $encryptedpasswordm) {
84
+			if(isset($_POST['cookiecheck'])) {
85
+				setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/");
86
+				setcookie($sitekey."_salt", md5($passwd['email'] . $encryptedpasswordm),  time()+60*60*24*30, "/");
87
+			}
88
+			if(!isset($_SESSION)) session_start( );
89
+			$_SESSION[$sitekey."_useruid"] = $passwd['uid'];
90
+			$_SESSION[$sitekey."_salt"] = md5($passwd['email'] . $encryptedpasswordm);
91
+			$logincode = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'login'");
92
+			while($code = dbassoc($logincode)) {
93
+				eval($code['code_text']);
94
+			}
95
+		}
96
+
97
+		else { 
98
+			require_once("header.php");
99
+			//make a new TemplatePower object
100
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
101
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
102
+			include_once("includes/pagesetup.php");
103
+			$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
104
+			$output .= "<div style='text-align: center;'>"._WRONGPASSWORD."</div>";
105
+			$tpl->assign("output", $output);
106
+			$tpl->printToScreen( );
107
+			dbclose( );
108
+			exit( );
109
+		}
110
+		$debug = $tempdebug;
111
+	}
112
+	else {
113
+		require_once("header.php");
114
+		if(!isMEMBER) {
115
+		
116
+		$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
117
+		$output .= "<div style=\"width: 250px; margin: 0 auto; text-align: center;\"><form method=\"POST\" enctype=\"multipart/form-data\" action=\"user.php?action=login".(isset($_GET['sid']) && isNumber($_GET['sid']) ? "&amp;sid=".$_GET['sid'] : "")."\">
118
+		<div class=\"label\" style=\"float: left;  width: 30%; text-align: right;\"><label for=\"penname\">"._PENNAME.":</label></div><INPUT type=\"text\" class=\"textbox\" name=\"penname\" id=\"penname\"><br />
119
+		<div class=\"label\" style=\"float: left; width: 30%; text-align: right;\"><label for=\"pswd\">"._PASSWORD.":</label></div><INPUT type=\"password\" class=\"textbox\" id=\"pswd\" name=\"password\"><br />
120
+		<INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookiecheck\" id=\"cookiecheck\" value=\"1\"><label for=\"cookiecheck\">"._REMEMBERME."</label><br />
121
+		<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">
122
+		</form></div>";
123
+		$linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'");
124
+		while($link = dbassoc($linkquery)) {
125
+			if($link['link_access'] && !isMEMBER) continue;
126
+			if($link['link_access'] == 2 && !isADMIN) continue;
127
+			$pagelinks[$link['link_name']] = array("id" => $link['link_id'], "text" => $link['link_text'], "url" => _BASEDIR.$link['link_url'], "link" => "<a href=\"".$link['link_url']."\" title=\"".$link['link_text']."\"".($link['link_target'] ? " target=\"_blank\"" : "").($current == $link['link_name'] ? " id=\"current\"" : "").">".$link['link_text']."</a>");
128
+		}
129
+		$output .= "<div style='text-align: center;'>";
130
+		if(isset($pagelinks['register'])) {
131
+			$output .= $pagelinks['register']['link']." | ";
132
+		}
133
+		$output .= $pagelinks['lostpassword']['link']."</div>";
134
+		 
135
+	}
136
+}
137
+?>
Browse code

Restore eFiction 3.x bridges

Clarissa Walker authored on 2026/07/23 10:30:45
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,87 @@
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("_LOGINCHECK")) exit( );
26
+	if(isset($_POST['submit']) && preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
27
+		define("_BASEDIR", "");
28
+		include_once("config.php");
29
+		$settings = dbquery("SELECT tableprefix, maintenance, sitekey, debug FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
30
+		list($tableprefix, $maintenance, $sitekey, $debug) = dbrow($settings);
31
+		include_once("includes/queries.php");
32
+		$result = dbquery("SELECT *, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs AS ap ON ap.uid = "._UIDFIELD." WHERE "._PENNAMEFIELD." = '".$_POST['penname']."'");
33
+		$passwd = dbassoc($result);
34
+		if($maintenance && $passwd['level'] < 0) {
35
+			header("Location: maintenance.php");
36
+			exit( );
37
+		}
38
+		$encryptedpassword = md5($_POST['password']);
39
+		if($passwd['level'] == -1) {
40
+			require_once("header.php");
41
+			//make a new TemplatePower object
42
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
43
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
44
+			include_once("includes/corefunctions.php");
45
+			accessDenied( );
46
+		}
47
+		if(isset($_POST['cookiecheck'])) {
48
+			setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/");
49
+			setcookie($sitekey."_salt", md5($passwd['email']+$encryptedpassword),  time()+60*60*24*30, "/");
50
+		}
51
+		if($passwd['password'] == $encryptedpassword) {
52
+			if(!isset($_SESSION)) session_start( );
53
+			$_SESSION[$sitekey."_useruid"] = $passwd['uid'];
54
+			$_SESSION[$sitekey."_salt"] = md5($passwd['email']+$encryptedpassword);
55
+		}
56
+
57
+		else { 
58
+			require_once("header.php");
59
+			//make a new TemplatePower object
60
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
61
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
62
+			include_once("includes/pagesetup.php");
63
+			$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
64
+			$output .= "<div style='text-align: center;'>"._WRONGPASSWORD."</div>";
65
+			$tpl->assign("output", $output);
66
+			$tpl->printToScreen( );
67
+			dbclose( );
68
+			exit( );
69
+		}
70
+	}
71
+	else if(!isMEMBER) {
72
+		$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
73
+		$output .= "<div style=\"width: 250px; margin: 0 auto; text-align: center;\"><form method=\"POST\" enctype=\"multipart/form-data\" action=\"user.php?action=login".(isset($_GET['sid']) && isNumber($_GET['sid']) ? "&amp;sid=".$_GET['sid'] : "")."\">
74
+		<div class=\"label\" style=\"float: left;  width: 30%; text-align: right;\"><label for=\"penname\">"._PENNAME.":</label></div><INPUT type=\"text\" class=\"textbox\" name=\"penname\" id=\"penname\"><br />
75
+		<div class=\"label\" style=\"float: left; width: 30%; text-align: right;\"><label for=\"pswd\">"._PASSWORD.":</label></div><INPUT type=\"password\" class=\"textbox\" id=\"pswd\" name=\"password\"><br />
76
+		<INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookiecheck\" id=\"cookiecheck\" value=\"1\"><label for=\"cookiecheck\">"._REMEMBERME."</label><br />
77
+		<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">
78
+		</form></div>";
79
+		$linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'");
80
+		while($link = dbassoc($linkquery)) {
81
+			if($link['link_access'] && !isMEMBER) continue;
82
+			if($link['link_access'] == 2 && !isADMIN) continue;
83
+			$pagelinks[$link['link_name']] = array("id" => $link['link_id'], "text" => $link['link_text'], "url" => _BASEDIR.$link['link_url'], "link" => "<a href=\"".$link['link_url']."\" title=\"".$link['link_text']."\"".($link['link_target'] ? " target=\"_blank\"" : "").($current == $link['link_name'] ? " id=\"current\"" : "").">".$link['link_text']."</a>");
84
+		}
85
+		$output .= "<div style='text-align: center;'>".$pagelinks['register']['link']." | ".$pagelinks['lostpassword']['link']."</div>";
86
+	}
87
+?>
0 88
\ No newline at end of file