PDA

View Full Version : Admin errors galore


GregJ
12-22-2006, 11:51 PM
Turning error_reporting off is never an option for me as I'm not much for band aids.

After a successful install I try to login and on the admin page I am greeted with:

Notice: Undefined index: admin_lng in /var/www/vhosts/<site_directory>/httpdocs/classes/DirAdmin.php on line 34

Notice: Undefined index: language in /var/www/vhosts/<site_directory>/httpdocs/classes/DirAdmin.php on line 35

Notice: Undefined index: language in /var/www/vhosts/<site_directory>/httpdocs/classes/DirAdmin.php on line 36

Notice: Undefined index: action in /var/www/vhosts/<site_directory>/httpdocs/admin/login.php on line 21

Notice: Undefined index: admin_lng in /var/www/vhosts/<site_directory>/httpdocs/admin/login.php on line 27

Notice: Undefined index: language in /var/www/vhosts/<site_directory>/httpdocs/admin/login.php on line 28

Notice: Undefined index: language in /var/www/vhosts/<site_directory>/httpdocs/admin/login.php on line 29

Notice: Undefined index: action in /var/www/vhosts/<site_directory>/httpdocs/admin/login.php on line 34

And on the index page:

Warning: main in /var/www/vhosts/spiffyindex.com/httpdocs/classes/Dir.php on line 21

Warning: main in /var/www/vhosts/spiffyindex.com/httpdocs/classes/Dir.php on line 21

Fatal error: main in /var/www/vhosts/spiffyindex.com/httpdocs/classes/Dir.php on line 21

Anyone else hunted these down so i don't have to?

GregJ
12-22-2006, 11:53 PM
Please note I am running PHP Version 5.0.5

GregJ
12-23-2006, 12:25 AM
I'm just going to start documenting this for anyone else who's using php5 and runs into these issues as from the looks of it nobody has run into these yet.



To log into the admin panel:

classes/DirAdmin.php

FIND
$language = $_COOKIE['admin_lng'] ? $_COOKIE['admin_lng'] : 'English';
$language = $_POST['language'] ? $_POST['language'] : $language;
$lang2 = ('default' == $_POST['language']) ? 'English' : $language;

ADD ABOVE:
if (empty($_COOKIE['admin_lng'])) {$_COOKIE['admin_lng'] = '';}
if (empty($_POST['language'])) {$_POST['language'] = '';}
if (empty($_POST['language'])) {$_POST['language'] = '';}


admin/login.php

FIND
if ('change_lang' == $_POST['action'])

ADD ABOVE:
if (empty($_POST['action'])) {$_POST['action'] = '';}

FIND
if ($err)

ADD ABOVE:
if (empty($err)) {$err = '';}




Now on to the actual admin panel :O

GregJ
12-23-2006, 01:31 AM
To get the index page to load:

classes/Dir.php

FIND
require_once('DirDb.php');
require_once('DirMailer.php');

REPLACE WITH:
if (file_exists('DirDb.php')){
require_once('DirDb.php');}
elseif (file_exists('classes/DirDb.php')){
require_once('classes/DirDb.php');}

if (file_exists('DirMailer.php')){
require_once('DirMailer.php');}
elseif (file_exists('classes/DirMailer.php')){
require_once('classes/DirMailer.php');}

GregJ
12-23-2006, 01:36 AM
At this point you can go ahead and just turn off and you should be fine

a lot of files, but start with header.php...

before any php:
error_reporting(0);


I'll go through and put in the error checking anyway and send my changes to John in hopes it will help someone else.