Browse code

fix for wrong using of +

Jimako authored on 2019/10/30 07:27:29
Showing 1 changed files
... ...
@@ -27,7 +27,7 @@ if(!defined("_CHARSET")) exit( );
27 27
 // To bridge to another program replace (or add to) this information with the bridge to your other script.  See examples in the includes/bridges/ folder.
28 28
 if (!empty($_COOKIE[$sitekey."_useruid"])) {
29 29
 	$userdata = dbassoc(dbquery("SELECT ap.*, "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_COOKIE[$sitekey."_useruid"]."'"));
30
-	if($userdata && $userdata['level'] != -1 && $_COOKIE[$sitekey.'_salt'] == md5($userdata['email']+$userdata['password'])) {
30
+	if($userdata && $userdata['level'] != -1 && $_COOKIE[$sitekey.'_salt'] == md5($userdata['email'] . $userdata['password'])) {
31 31
 		define("USERUID", $userdata['uid']);
32 32
 		define("USERPENNAME", $userdata['penname']);
33 33
 		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
... ...
@@ -42,7 +42,7 @@ if (!empty($_COOKIE[$sitekey."_useruid"])) {
42 42
 }
43 43
 if(!empty($_SESSION[$sitekey."_useruid"]) && !defined("USERUID")) {
44 44
 	$userdata = dbassoc(dbquery("SELECT ap.*, "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_SESSION[$sitekey."_useruid"]."'"));
45
-	if($userdata && $userdata['level'] != -1 && $_SESSION[$sitekey.'_salt'] == md5($userdata['email']+$userdata['password'])) {
45
+	if($userdata && $userdata['level'] != -1 && $_SESSION[$sitekey.'_salt'] == md5($userdata['email'] . $userdata['password'])) {
46 46
 		define("USERUID", $userdata['uid']);
47 47
 		define("USERPENNAME", $userdata['penname']);
48 48
 		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
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,65 @@
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
+// Get session variables from cookie data if not logged in.
27
+// To bridge to another program replace (or add to) this information with the bridge to your other script.  See examples in the includes/bridges/ folder.
28
+if (!empty($_COOKIE[$sitekey."_useruid"])) {
29
+	$userdata = dbassoc(dbquery("SELECT ap.*, "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_COOKIE[$sitekey."_useruid"]."'"));
30
+	if($userdata && $userdata['level'] != -1 && $_COOKIE[$sitekey.'_salt'] == md5($userdata['email']+$userdata['password'])) {
31
+		define("USERUID", $userdata['uid']);
32
+		define("USERPENNAME", $userdata['penname']);
33
+		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
34
+		else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
35
+		else $siteskin = $defaultskin;
36
+		define("uLEVEL", $userdata['level']);
37
+		define("isADMIN", uLEVEL > 0 ? true : false);
38
+		define("isMEMBER", true);
39
+		if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
40
+		else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
41
+	}
42
+}
43
+if(!empty($_SESSION[$sitekey."_useruid"]) && !defined("USERUID")) {
44
+	$userdata = dbassoc(dbquery("SELECT ap.*, "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_SESSION[$sitekey."_useruid"]."'"));
45
+	if($userdata && $userdata['level'] != -1 && $_SESSION[$sitekey.'_salt'] == md5($userdata['email']+$userdata['password'])) {
46
+		define("USERUID", $userdata['uid']);
47
+		define("USERPENNAME", $userdata['penname']);
48
+		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
49
+		else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
50
+		else $siteskin = $defaultskin;
51
+		define("uLEVEL", $userdata['level']);
52
+		define("isADMIN", uLEVEL > 0 ? true : false);
53
+		define("isMEMBER", true);
54
+		if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
55
+		else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
56
+	}
57
+}
58
+if(!defined("USERUID")) define("USERUID", false);
59
+if(!defined("USERPENNAME")) define("USERPENNAME", false);
60
+if(!defined("uLEVEL")) define("uLEVEL", 0);
61
+if(!defined("isMEMBER")) define("isMEMBER", false);
62
+if(!defined("isADMIN")) define("isADMIN", false);
63
+if(empty($siteskin)) $siteskin = $defaultskin;
64
+
65
+?>
0 66
\ No newline at end of file