| Author |
Message |
sybersolutions
Newbie


Joined: Jan 02, 2006
Posts: 5
|
Posted:
Mon Jan 02, 2006 9:37 pm |
|
i am using nuke 7.5 non patched version, i tired editing the files as you directed and i still get access denied within my admin files (modules Administration) and when i click on the module i get an you are not an administrator message, it says that its for PHP-Nuke 6.5 - 7.6 so what's wrong??? |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Mon Jan 02, 2006 10:15 pm |
|
| sybersolutions wrote: |
| i am using nuke 7.5 non patched version, i tired editing the files as you directed and i still get access denied within my admin files (modules Administration) and when i click on the module i get an you are not an administrator message, it says that its for PHP-Nuke 6.5 - 7.6 so what's wrong??? |
Please post the exact error message you are getting. Also, you didn't happen to accidentally upload the files that are in the rootweb/admin folder did you? |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
sybersolutions
Newbie


Joined: Jan 02, 2006
Posts: 5
|
Posted:
Wed Jan 04, 2006 11:12 pm |
|
hi,
okay i deleted the root admin files and now this is how it looks....
html_newsletter.html says
Access Denied - you do not have permission to access the admin file or are not logged in
admin.php?op=HNLAdmin says
Access Denied
i really would like to use this module, can you plz help  |
| |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 383
|
Posted:
Thu Jan 05, 2006 8:15 am |
|
As per the readme, this script is written to work in conjunction with patch series 3.1 as we cannot advocate using none patched phpNuke due to the security vulnerabilities associated with the virgin phpnuke files.
The first thing to try is add the following to your nukeroot/config.php
| Code: |
| $admin_file = "admin"; |
so it looks something like this
| Quote: |
$gfx_chk = 0;
$subscription_url = "";
$admin_file = "admin";
$tipath = "images/topics/";
$display_errors = true; |
That additional line of code was actually introduced in phpnuke 7.6 to help secure the admin file path and the majority of coders are now using it in their scripts to check the admin file path - the html newsletter module employs this check so you will need to add it anyway.
You should at least have access to the admin area now.
You will need to go through the files and look for and change the following;
Find:
| Code: |
| if (defined('NUKE_FILE')) { |
Change to:
| Code: |
| if ($mainfile == 1) { |
Find:
| Code: |
| if (defined('MODULE_FILE')) { |
Change to:
| Code: |
| if ($module == 1) { |
Find:
| Code: |
| if (defined('NUKE_FOOTER')) { |
Change to:
| Code: |
| if ($footer == 1) { |
Find:
| Code: |
| if (defined('NUKE_HEADER')) { |
Change to :
| Code: |
| if ($header == 1) { |
|
| |
|
|
 |
sybersolutions
Newbie


Joined: Jan 02, 2006
Posts: 5
|
Posted:
Mon Jan 23, 2006 3:21 pm |
|
ok i got that issue corrected and all of admin features show up, but now i get this error on my screen..
Parse error: parse error, unexpected '>' in /home/sisnet/public_html/modules/HTML_Newsletter/index.php on line 170 |
| |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 383
|
Posted:
Mon Jan 23, 2006 7:15 pm |
|
I am sitting in the middle of nowhere right now testing some satellite comm stuff so don't have access to my files.
That error would seem to indicate a syntax or spelling error. Check the edit you did to that file or post the code here, a few lines before and after the line 170. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Mon Jan 23, 2006 7:46 pm |
|
Yes, this is definitely a coding issue related to any changes that you made. I do it all the time. Just post maybe 10 lines before and 10 lines after as Guardian has suggested and we'll help you spot it.
Regards, montego |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
sybersolutions
Newbie


Joined: Jan 02, 2006
Posts: 5
|
Posted:
Tue Jan 24, 2006 5:27 am |
|
hi,
i didn't make all the changes that you sugguested in the previous post, the last time i tried i got alot of errors, so i just made changes to the first two lines of code to make it readable to my version of nuke. here's the code to the index script here...
| Code: |
<?php
/************************************************************************
* HTML Newsletter 1.2 module for PHP-Nuke 6.5 - 7.6
* By: NukeWorks (mangaman@nukeworks.biz & montego@montegoscripts.com)
* http://www.nukeworks.biz
* Copyright © 2004, 2005 by NukeWorks
* License: GNU/GPL
************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
define('NW_HNL_LOADED', true);
$index = 1;
@require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
if (!isset($admin_file)) {
$admin_file = "admin";
}
/************************************************************************
* Function: view_newsletter
* Inputs: $nid = the id of the newsletter to view
* Usage: This function is used to view a newsletter
************************************************************************/
function view_newsletter($nid) {
/* Key function initialization */
global $prefix, $db, $admin, $user, $sitename, $module_name, $userinfo, $admin_file;
include_once("./modules/$module_name/NW_HNL_GetConfig.php");
include_once("./modules/$module_name/NW_HNL_Functions.php");
get_lang($module_name);
/* Get the newsletter to view */
$sql = "SELECT filename, hits, view, groups, cid FROM ".$prefix."_hnl_newsletters WHERE nid = '$nid'";
$result1 = $db->sql_query($sql);
list($filename, $hits, $view, $groups, $cid) = $db->sql_fetchrow($result1);
$hits = intval($hits);
$cid = intval($cid);
$view = intval($view);
$groups = stripslashes($groups);
if (HNL_is_viewable($view, $nsngroups, $cid, $groups)) { //User is allowed to view this newsletter
/* Increment hits on the newsletter as long as not admin */
if (!is_admin($admin)) {
$hits++;
$sql = "UPDATE ".$prefix."_hnl_newsletters SET hits = '$hits' WHERE nid = '$nid'";
$db->sql_query($sql);
}
/* Get the newsletter file then echo the newsletter */
if (file_exists("./modules/$module_name/archive/$filename")) {
include("./modules/$module_name/archive/$filename");
} else {
die("Cannot find selected Newsletter file...");
}
echo $emailfile;
} else { //user is not allowed to view this newsletter
echo _HNLNOTAUTHORIZED;
}
} //End of view_newsletter() function
/************************************************************************
* Function: list_newsletters
* Inputs: None
* Usage: This is the main function to list all the viewable newsletters
************************************************************************/
function list_newsletters() {
/* Key function initialization */
global $prefix, $db, $admin, $user, $sitename, $module_name, $userinfo, $admin_file;
include_once("./modules/$module_name/NW_HNL_GetConfig.php");
include_once("./modules/$module_name/NW_HNL_Functions.php");
get_lang($module_name);
/* Start of module content displaying */
include("header.php");
OpenTable();
echo "<center><font class=\"title\">". _HNLARCHIVENAME ."</font></center>\n";
if (is_admin($admin)) {
echo "<center><a href=\"".$admin_file.".php?op=HNLAdmin\">[ ". _HNLADMINLINK ." ]</a></center>\n";
}
echo "<br>\n";
OpenTable();
echo "</td></tr><tr><td>\n";
/* Get Newsletter List and build the module content */
$sql = "SELECT nid, nl.cid, topic, sender, datesent, view, groups, hits, ctitle, cblocklimit FROM ".$prefix."_hnl_newsletters as nl, ".$prefix."_hnl_categories nc WHERE nl.cid = nc.cid ORDER BY ctitle ASC, datesent DESC";
$result2 = $db->sql_query($sql);
$idx_tot_nls = 1; //Index for total number of newsletters displayed
$idx_nl_nbr = 1; //Index for number of newsletters displayed within a category
$prev_category = ""; //For determining category breaks
while ($row = $db->sql_fetchrow($result2)) {
$nid = intval($row['nid']);
$cid = intval($row['cid']);
$topic = stripslashes($row['topic']);
$sender = stripslashes($row['sender']);
$datesent = $row['datesent'];
$view = intval($row['view']);
$groups = stripslashes($row['groups']);
$hits = intval($row['hits']);
$ctitle = stripslashes($row['ctitle']);
$cblocklimit = intval($row['cblocklimit']);
if (HNL_is_viewable($view, $nsngroups, $cid, $groups)) { //Is the newsletter viewable by the user?
if ($ctitle <> $prev_category) { //Do we need to write out a new category heading?
if ($idx_nl_nbr <> 1) {
CloseTable();
OpenTable();
}
echo "<center><strong>$ctitle</strong></center>\n";
//Decided not to split into columns at this time.
// if ($idx_columns == 4){
// echo "</td></tr><tr><td>\n";
// $idx_columns = 0;
// } else {
// echo "</td><td>\n";
// }
// $idx_columns++;
echo "</td></tr><tr><td>\n";
$prev_category = $ctitle;
$idx_nl_nbr = 1;
} //End of show new category title
$mod_row = HNL_get_block_row($idx_nl_nbr, $nid, $topic, $sender, $hits, $datesent, $showhits, $showdates, $showsender);
echo $mod_row;
echo "</td></tr><tr><td>\n";
$idx_nl_nbr++;
} //End of HNL_is_viewable IF
} //End of while loop for list of newsletters
CloseTable();
CloseTable();
include("footer.php");
} //End of list_newsletters() function
/************************************************************************
* Main "switch" code to control what the module is to do
************************************************************************/
switch($op){
case "viewnewsletter":
$nid = intval($nid);
view_newsletter($nid);
break;
default:
list_newsletters();
break;
}
?> |
|
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Tue Jan 24, 2006 8:42 am |
|
Found the problem.
Change:
| Code: |
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
|
To:
| Code: |
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
|
You left off the closing bracket on the IF statement that you added/modified. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
sybersolutions
Newbie


Joined: Jan 02, 2006
Posts: 5
|
Posted:
Fri Jan 27, 2006 6:55 am |
|
That was it!!! Thank you guys.....  |
| |
|
|
 |
|
|