After Installing CNB YA 4.4.2 I can no longer access the Forums admin panel, by clicking on the 'Forums Icon' featured in the 'Modules Admin Panel'.
When I click the icon I receive the following error messages:
Warning: main(modules/Your_Account/includes/mainfileend.php): failed to open stream: No such file or directory in /mainfile.php on line 1252
Warning: main(): Failed opening 'modules/Your_Account/includes/mainfileend.php' for inclusion (include_path='.:/include:/usr/lib/php') in /mainfile.php on line 1252
However, as you can see below, the file mentioned in the error messages does not have a line 1252:
1 <?php
2
3 /*********************************************************************************/
4 /* CNB Your Account: An Advanced User Management System for phpnuke */
5 /* ============================================ */
6 /* */
7 /* Copyright (c) 2004 by Comunidade PHP Nuke Brasil */
8 /*
Only registered users can see links on this board! Get registered or login to the forums!
&
Only registered users can see links on this board! Get registered or login to the forums!
*/
9 /* */
10 /* Contact author:
Only registered users can see links on this board! Get registered or login to the forums!
*/
11 /* International Support Forum:
Only registered users can see links on this board! Get registered or login to the forums!
*/
12 /* */
13 /* This program is free software. You can redistribute it and/or modify */
14 /* it under the terms of the GNU General Public License as published by */
15 /* the Free Software Foundation; either version 2 of the License. */
16 /* */
17 /*********************************************************************************/
18 /* CNB Your Account it the official successor of NSN Your Account by Bob Marion */
19 /*********************************************************************************/
20
21 $uinfo = getusrinfo($user);
22 $ulevel = $uinfo['user_level'];
23 $uactive = $uinfo['user_active'];
24 if ( ($ulevel < 1) OR ($uactive < 1) ) {
25 unset($user);
26 unset($cookie);
27 }
28
29 if ( ($_GET['name']=='Forums') && ($_GET['file']=='profile') && ($_GET['mode']=='register') ) Header("Location: modules.php?name=Your_Account&op=new_user");
30
31 // CNB Mod
32 // WARNING THIS SECTION OF CODE PREVENTS NEW POSTS REGISTERING AS UNREAD
33 if (is_user($user)) {
34 //$uinfo = getusrinfo($user);
35 $lv = time();
36 //$db->sql_query("UPDATE ".$user_prefix."_users SET user_lastvisit='$lv' WHERE user_id='".$uinfo['user_id']."'");
37 list($sessiontime) = $db->sql_fetchrow($db->sql_query("SELECT time FROM ".$prefix."_session WHERE uname='$uinfo[username]'"));
38
39 // modified by menelaos dot hetnet dot nl to reduce amount of sql-queries
40 $configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_cnbya_config");
41 while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
42 $config[$config_name] = $config_value;
43 }
44 $ya_config = $config;
45 $cookieinactivity = $ya_config['cookieinactivity'];
46 $cookiepath = $ya_config['cookiepath'];
47 $autosuspend = $ya_config['autosuspend'];
48 $autosuspendmain = $ya_config['autosuspendmain'];
49 // modified by menelaos dot hetnet dot nl to reduce amount of sql-queries
50
51 if (($cookieinactivity != '-') AND ( ($sessiontime + $cookieinactivity < $lv ) ) ) {
52 cookiedecode($user);
53 $r_uid = $uinfo['user_id'];
54 $r_username = $uinfo['username'];
55 setcookie("user");
56 if (trim($cookiepath) != '') setcookie("user","","","$ya_config[cookiepath]");
57 $db->sql_query("DELETE FROM ".$prefix."_session WHERE uname='$r_username'");
58 $db->sql_query("OPTIMIZE TABLE ".$prefix."_session");
59 //$db->sql_query("DELETE FROM ".$prefix."_bbsessions WHERE session_user_id='$r_uid'");
60 //$db->sql_query("OPTIMIZE TABLE ".$prefix."_bbsessions");
61 unset($user);
62 unset($cookie);
63 header("Location: modules.php?name=Your_Account");
64 die();
65 };
66
67 // WARNING THIS SECTION OF CODE CAN SLOW SITE LOAD TIME DOWN!!!!!!!!!!!!!
68 // IF YOU DO NOT WANT TO USE THIS CODE YOU DO NOT HAVE TO.
69 // THIS FUCTION IS IN USER ADMIN AND CAN BE TRIGGERED ONLY
70 // WHEN THE ADMIN WANTS IT RUN.
71 if (($autosuspend > 0) AND ($autosuspendmain==1)) {
72 $st = time() - $autosuspend;
73 $susresult = $db->sql_query("SELECT user_id FROM ".$user_prefix."_users WHERE user_lastvisit <= $st AND user_level > 0");
74 while(list($sus_uid) = $db->sql_fetchrow($susresult)) {
75 $db->sql_query("UPDATE ".$user_prefix."_users SET user_level='0', user_active='0' WHERE user_id='$sus_uid'");
76 }
77 }
78
79 }
80
81 else {
82 setcookie("CNB_test1","value1");
83 setcookie("CNB_test2","value2",time()+3600);
84 setcookie("CNB_test3","value3",time()+3600,"/");
85 setcookie("CNB_test4","value4",time()+3600,"$ya_config[cookiepath]");
86 }
87
88 // CNB Mod
89 ?>
well you didnt read the install very well,it clearly says you have to include the following line into your mainfile.php
As for the rest like line 1252,well thats the result of the include missing...
As the install says :
Code:
A) Mainfile.php
Open mainfile.php in a text editor and goto the end of the file.
Just before the ?> add the following code:
I HAVE already done what you suggest and have the problem occuring.
My mainfile.php reads:
<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/*
Only registered users can see links on this board! Get registered or login to the forums!
*/
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security checking code 2003 by chatserv */
/*
Only registered users can see links on this board! Get registered or login to the forums!
--
Only registered users can see links on this board! Get registered or login to the forums!
*/
/************************************************************************/
//define('NUKE_FILE', true);
if (file_exists("includes/custom_files/custom_mainfile.php")) {
include_once("includes/custom_files/custom_mainfile.php");
}
//Union Tap
//Copyright Zhen-Xjell 2004
Only registered users can see links on this board! Get registered or login to the forums!
//Beta 3 Code to prevent UNION SQL Injections
unset($matches);
unset($loc);
if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", rawurldecode($loc=$_SERVER["QUERY_STRING"]), $matches)) {
die();
}
$queryString = strtolower($_SERVER['QUERY_STRING']);
if (stripos_clone($queryString,'%20union%20') OR stripos_clone($queryString,'/*') OR stripos_clone($queryString,'*/union/*') OR stripos_clone($queryString,'c2nyaxb0')) {
header("Location: index.php");
die();
}
$phpver = phpversion();
if ($phpver < '4.1.0') {
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
$_SERVER = $HTTP_SERVER_VARS;
}
if ($phpver >= '4.0.4pl1' && strstr($_SERVER["HTTP_USER_AGENT"],'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
} else if ($phpver > '4.0') {
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (extension_loaded('zlib')) {
$do_gzip_compress = TRUE;
ob_start(array('ob_gzhandler',5));
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
}
foreach ($_GET as $sec_key => $secvalue) {
if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*img*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) ||
(eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||
(eregi("\"", $secvalue)) ||
(eregi("forum_admin", $sec_key)) ||
(eregi("inside_mod", $sec_key))) {
die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");
}
}
foreach ($_POST as $secvalue) {
if ((eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) || (eregi("<[^>]script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]style*\"?[^>]*>", $secvalue))) {
die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");
}
}
if (stristr($_SERVER['PHP_SELF'], "mainfile.php")) {
Header("Location: index.php");
die();
}
/* FOLLOWING LINES ARE DEPRECATED BUT ARE HERE FOR OLD MODULES COMPATIBILITY */
/* PLEASE START USING THE NEW SQL ABSTRACTION LAYER. SEE MODULES DOC FOR DETAILS */
if (defined('FORUM_ADMIN')) {
@require_once("../../../includes/sql_layer.php");
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
} elseif (defined('INSIDE_MOD')) {
@require_once("../../includes/sql_layer.php");
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
} else {
@require_once("includes/sql_layer.php");
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
}
function delQuotes($string){
/* no recursive function to add quote to an HTML tag if needed */
/* and delete duplicate spaces between attribs. */
$tmp=""; # string buffer
$result=""; # result string
$i=0;
$attrib=-1; # Are us in an HTML attrib ? -1: no attrib 0: name of the attrib 1: value of the atrib
$quote=0; # Is a string quote delimited opened ? 0=no, 1=yes
$len = strlen($string);
while ($i<$len) {
switch($string[$i]) { # What car is it in the buffer ?
case "\"": #" # a quote.
if ($quote==0) {
$quote=1;
} else {
$quote=0;
if (($attrib>0) && ($tmp != "")) { $result .= "=\"$tmp\""; }
$tmp="";
$attrib=-1;
}
break;
case "=": # an equal - attrib delimiter
if ($quote==0) { # Is it found in a string ?
$attrib=1;
if ($tmp!="") $result.=" $tmp";
$tmp="";
} else $tmp .= '=';
break;
case " ": # a blank ?
if ($attrib>0) { # add it to the string, if one opened.
$tmp .= $string[$i];
}
break;
default: # Other
if ($attrib<0) # If we weren't in an attrib, set attrib to 0
$attrib=0;
$tmp .= $string[$i];
break;
}
$i++;
}
if (($quote!=0) && ($tmp != "")) {
if ($attrib==1) $result .= "=";
/* If it is the value of an atrib, add the '=' */
$result .= "\"$tmp\""; /* Add quote if needed (the reason of the function */
}
return $result;
}
function check_html ($str, $strip="") {
/* The core of this code has been lifted from phpslash */
/* which is licenced under the GPL. */
if ($strip == "nohtml")
global $AllowableHTML;
if (!is_array($AllowableHTML)) $AllowableHTML =array('');
$str = stripslashes($str);
$str = eregi_replace("<[[:space:]]*([^>]*)[[:space:]]*>",'<\\1>', $str);
// Delete all spaces from html tags .
$str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?[[:space:]]*([^\" >]*)[[:space:]]*\"?[^>]*>",'<a href="\\1">', $str);
// Delete all attribs from Anchor, except an href, double quoted.
$str = eregi_replace("<[[:space:]]* img[[:space:]]*([^>]*)[[:space:]]*>", '', $str);
// Delete all img tags
$str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?javascript[[:punct:]]*\"?[^>]*>", '', $str);
// Delete javascript code from a href tags -- Zhen-Xjell @
Only registered users can see links on this board! Get registered or login to the forums!
$tmp = "";
while (ereg("<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>",$str,$reg)) {
$i = strpos($str,$reg[0]);
$l = strlen($reg[0]);
if ($reg[1][0] == "/") $tag = strtolower(substr($reg[1],1));
else $tag = strtolower($reg[1]);
if ($a = $AllowableHTML[$tag])
if ($reg[1][0] == "/") $tag = "</$tag>";
elseif (($a == 1) || ($reg[2] == "")) $tag = "<$tag>";
else {
# Place here the double quote fix function.
$attrb_list=delQuotes($reg[2]);
// A VER
$attrb_list = ereg_replace("&","&",$attrb_list);
$tag = "<$tag" . $attrb_list . ">";
} # Attribs in tag allowed
else $tag = "";
$tmp .= substr($str,0,$i) . $tag;
$str = substr($str,$i+$l);
}
$str = $tmp . $str;
return $str;
exit;
/* Squash PHP tags unconditionally */
$str = ereg_replace("<\?","",$str);
return $str;
}
function filter_text($Message, $strip="") {
global $EditedMessage;
check_words($Message);
$EditedMessage=check_html($EditedMessage, $strip);
return ($EditedMessage);
}
function removecrlf($str) {
// Function for Security Fix by Ulf Harnhammar, VSU Security 2002
// Looks like I don't have so bad track record of security reports as Ulf believes
// He decided to not contact me, but I'm always here, digging on the net
return strtr($str, "\015\012", ' ');
}
function paid() {
global $db, $user, $cookie, $adminmail, $sitename, $nukeurl, $subscription_url, $user_prefix, $prefix;
if (is_user($user)) {
if ($subscription_url != "") {
$renew = ""._SUBRENEW." $subscription_url";
} else {
$renew = "";
}
cookiedecode($user);
$sql = "SELECT * FROM ".$prefix."_subscriptions WHERE userid='$cookie[0]'";
$result = $db->sql_query($sql);
$numrows = $db->sql_numrows($result);
$row = $db->sql_fetchrow($result);
if ($numrows == 0) {
return 0;
} elseif ($numrows != 0) {
$time = time();
if ($row[subscription_expire] <= $time) {
$db->sql_query("DELETE FROM ".$prefix."_subscriptions WHERE userid='$cookie[0]' AND id='$row[id]'");
$from = "$sitename <$adminmail>";
$subject = "$sitename: "._SUBEXPIRED."";
$body = ""._HELLO." $cookie[1]:\n\n"._SUBSCRIPTIONAT." $sitename "._HASEXPIRED."\n$renew\n\n"._HOPESERVED."\n\n$sitename "._TEAM."\n$nukeurl";
$row = $db->sql_fetchrow($db->sql_query("SELECT user_email FROM ".$user_prefix."_users WHERE id='$cookie[0]' AND nickname='$cookie[1]' AND password='$cookie[2]'"));
mail($row[user_email], $subject, $body, "From: $from\nX-Mailer: PHP/" . phpversion());
}
return 1;
}
} else {
return 0;
}
}
function stripos_clone($haystack, $needle, $offset=0) {
return strpos(strtoupper($haystack), strtoupper($needle), $offset);
}
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum