Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Wed Dec 22, 2004 11:57 am Reply with quote

Ok this is not the standard weblink mod but can anyone see any reason why i get access denied in the weblinks administration...when trying to access it ?

Admin note: I edited this for brevity. In the future, please just post a link to your code Wink
 
View user's profile Send private message
chatserv
Member Emeritus


Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Wed Dec 22, 2004 1:31 pm Reply with quote

Change:
Code:
if ( !defined('ADMIN_FILE') ) 

{
die("Illegal File Access");
}
global $prefix, $db, $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) { die ("Access Denied"); }
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT radminlink, radminsuper FROM " . $prefix . "_authors WHERE aid='$aid'"));
if (($row['radminlink'] == 1) OR ($row['radminsuper'] == 1)) {

to:
Code:
if ( !defined('ADMIN_FILE') )

{
   die("Illegal File Access");
}
global $prefix, $db, $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) { die ("Access Denied"); }
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM ".$prefix."_modules WHERE title='Web_Links'"));
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name, radminsuper FROM ".$prefix."_authors WHERE aid='$aid'"));
$admins = explode(",", $row['admins']);
$auth_user = 0;
for ($i=0; $i < sizeof($admins); $i++) {
    if ($row2['name'] == "$admins[$i]" AND $row['admins'] != "") {
        $auth_user = 1;   
    }
}

if ($row2['radminsuper'] == 1 || $auth_user == 1) {

If the module is not called Web_Links edit:
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM ".$prefix."_modules WHERE title='Web_Links'"));
and adjust the module's name in the line.
 
View user's profile Send private message Visit poster's website
hitwalker
PostPosted: Wed Dec 22, 2004 1:34 pm Reply with quote

hi cs,yeah i already figured that out.
a lot of thing have changed ...lol
but only problem it seems to have is that it cant seem to find the language...
 
chatserv
PostPosted: Wed Dec 22, 2004 1:41 pm Reply with quote

The case file should have something similar to the following near the top:
Code:
if ( !defined('ADMIN_FILE') )

{
   die("Illegal File Access");
}
global $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) { die ("Access Denied"); }
$module_name = "Web_Links";
include_once("modules/$module_name/admin/language/lang-".$currentlang.".php");

if you don't have a lang file in that location simply place it there.
 
hitwalker
PostPosted: Wed Dec 22, 2004 2:33 pm Reply with quote

No it is just realy blind..

This is how the case looks..

Code:


if ( !defined('ADMIN_FILE') )
{
   die("Illegal File Access");
}
global $admin_file;
if (!stristr($_SERVER['SCRIPT_NAME'], "".$admin_file.".php")) { die ("Access Denied"); }
$module_name = "Web_Links";
include_once("modules/$module_name/admin/language/lang-english.php");

switch($op) {

    case "Links":
    case "LinksDelNew":
    case "LinksAddCat":
    case "LinksAddSubCat":
    case "LinksAddLink":
    case "LinksAddEditorial":
    case "LinksModEditorial":
    case "LinksLinkCheck":
    case "LinksValidate":
    case "LinksDelEditorial":
    case "LinksCleanVotes":
    case "LinksListBrokenLinks":
    case "LinksEditBrokenLinks":
    case "LinksDelBrokenLinks":
    case "LinksIgnoreBrokenLinks":
    case "LinksListModRequests":
    case "LinksChangeModRequests":
    case "LinksChangeIgnoreRequests":
    case "LinksDelCat":
    case "LinksModCat":
    case "LinksModCatS":
    case "LinksModLink":
    case "LinksModLinkS":
    case "LinksDelLink":
    case "LinksDelVote":
    case "LinksDelComment":
    case "LinksTransfer":
    case "LinksSettings":
    case "LinksSaveSettings":
    include("admin/modules/links.php");
    break;

}


Yes i tried first :
Code:


include_once("modules/$module_name/admin/language/lang-".$currentlang.".php");


But the admin language stuff is still messed up...
this is weird..
 
hitwalker
PostPosted: Wed Dec 22, 2004 2:49 pm Reply with quote

Well this turns out to be very frustrating..
whatever i try to include that language it just doersnt recognise it..
 
hitwalker
PostPosted: Wed Dec 22, 2004 3:44 pm Reply with quote

ok its solved...developer was drunk at the time he made it..
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©