Browse code

fix for wrong using of +

Jimako authored on 2019/10/30 07:29:05
Showing 1 changed files
... ...
@@ -67,11 +67,11 @@
67 67
 		if($passwd['password'] == $encryptedpassword) {
68 68
 			if(isset($_POST['cookiecheck'])) {
69 69
 				setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/");
70
-				setcookie($sitekey."_salt", md5($passwd['email']+$encryptedpassword),  time()+60*60*24*30, "/");
70
+				setcookie($sitekey."_salt", md5($passwd['email'] . $encryptedpassword),  time()+60*60*24*30, "/");
71 71
 			}
72 72
 			if(!isset($_SESSION)) session_start( );
73 73
 			$_SESSION[$sitekey."_useruid"] = $passwd['uid'];
74
-			$_SESSION[$sitekey."_salt"] = md5($passwd['email']+$encryptedpassword);
74
+			$_SESSION[$sitekey."_salt"] = md5($passwd['email'] . $encryptedpassword);
75 75
 			$logincode = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'login'");
76 76
 			while($code = dbassoc($logincode)) {
77 77
 				eval($code['code_text']);
Browse code

Initial uplad w/ php7 fixes

Rainer Volkrodt authored on 2016/03/12 15:54:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,112 @@
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(isset($_POST['submit']) && preg_match("!^[-a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
26
+		if(!defined("_LOGINCHECK")) exit( );
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
+		$tempdebug = $debug;
32
+		$debug = 0;
33
+		define("TABLEPREFIX", $tableprefix);
34
+		define("SITEKEY", $sitekey);
35
+		include_once("includes/queries.php");
36
+		$result = dbquery("SELECT *, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs AS ap ON ap.uid = "._UIDFIELD." WHERE "._PENNAMEFIELD." = '".$_POST['penname']."'");
37
+		$passwd = dbassoc($result);
38
+		if(!dbnumrows($result)) {
39
+			require_once("header.php");
40
+			//make a new TemplatePower object
41
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
42
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
43
+			include_once("includes/pagesetup.php");
44
+			$output = write_error(_NOSUCHACCOUNT);
45
+			$tpl->assign("output", $output);
46
+			$tpl->printToScreen( );
47
+			dbclose( );
48
+			exit( );
49
+		}
50
+		if($maintenance && $passwd['level'] < 0) {
51
+			header("Location: maintenance.php");
52
+			exit( );
53
+		}
54
+		$encryptedpassword = md5($_POST['password']);
55
+		if($passwd['level'] == -1) {
56
+			require_once("header.php");
57
+			//make a new TemplatePower object
58
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
59
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
60
+			include_once("includes/pagesetup.php");
61
+			$output = write_error(_ACCOUNTLOCKED);
62
+			$tpl->assign("output", $output);
63
+			$tpl->printToScreen( );
64
+			dbclose( );
65
+			exit( );
66
+		}
67
+		if($passwd['password'] == $encryptedpassword) {
68
+			if(isset($_POST['cookiecheck'])) {
69
+				setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/");
70
+				setcookie($sitekey."_salt", md5($passwd['email']+$encryptedpassword),  time()+60*60*24*30, "/");
71
+			}
72
+			if(!isset($_SESSION)) session_start( );
73
+			$_SESSION[$sitekey."_useruid"] = $passwd['uid'];
74
+			$_SESSION[$sitekey."_salt"] = md5($passwd['email']+$encryptedpassword);
75
+			$logincode = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'login'");
76
+			while($code = dbassoc($logincode)) {
77
+				eval($code['code_text']);
78
+			}
79
+		}
80
+
81
+		else { 
82
+			require_once("header.php");
83
+			//make a new TemplatePower object
84
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
85
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
86
+			include_once("includes/pagesetup.php");
87
+			$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
88
+			$output .= "<div style='text-align: center;'>"._WRONGPASSWORD."</div>";
89
+			$tpl->assign("output", $output);
90
+			$tpl->printToScreen( );
91
+			dbclose( );
92
+			exit( );
93
+		}
94
+		$debug = $tempdebug;
95
+	}
96
+	else if(!isMEMBER) {
97
+		$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
98
+		$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'] : "")."\">
99
+		<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 />
100
+		<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 />
101
+		<INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookiecheck\" id=\"cookiecheck\" value=\"1\"><label for=\"cookiecheck\">"._REMEMBERME."</label><br />
102
+		<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">
103
+		</form></div>";
104
+		$linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'");
105
+		while($link = dbassoc($linkquery)) {
106
+			if($link['link_access'] && !isMEMBER) continue;
107
+			if($link['link_access'] == 2 && !isADMIN) continue;
108
+			$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>");
109
+		}
110
+		$output .= "<div style='text-align: center;'>".$pagelinks['register']['link']." | ".$pagelinks['lostpassword']['link']."</div>";
111
+	}
112
+?>
0 113
\ No newline at end of file