Author |
Message |
hitwalker
Sells PC To Pay For Divorce

Joined:
Posts: 5661
|
Posted:
Wed Dec 22, 2004 11:57 am |
|
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  |
|
|
|
 |
chatserv
Member Emeritus

Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico
|
Posted:
Wed Dec 22, 2004 1:31 pm |
|
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. |
|
|
|
 |
hitwalker

|
Posted:
Wed Dec 22, 2004 1:34 pm |
|
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

|
Posted:
Wed Dec 22, 2004 1:41 pm |
|
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

|
Posted:
Wed Dec 22, 2004 2:33 pm |
|
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

|
Posted:
Wed Dec 22, 2004 2:49 pm |
|
Well this turns out to be very frustrating..
whatever i try to include that language it just doersnt recognise it.. |
|
|
|
 |
hitwalker

|
Posted:
Wed Dec 22, 2004 3:44 pm |
|
ok its solved...developer was drunk at the time he made it.. |
|
|
|
 |
|