SKG Web

23 - Install Looping/ooking for Install Dir still after install and its removal

What steps will reproduce the problem?
1. Installed MySQL (5.1.35-community) and PHP (5.2.10)
2. Configured the php.ini file
3. Completed the 5 step install process without error.
4. Deleted the install directory and clicked "let's get started"

What is the expected output? What do you see instead?
I expected a login screen but I got...
PHP Warning: require_once(D:\wwwroot\IU\skg_web/install/install.php [function.require-once]: failed to open stream: No such file or directory in D:\wwwroot\IU\skg_web\index.php on line 175 PHP Fatal error: require_once() [function.require]: Failed opening required 'D:\wwwroot\IU\skg_web/install/install.php' (include_path='.;C:\php5\pear') in D:\wwwroot\IU\skg_web\index.php on line 175

What version of the product are you using?
1.9.0-beta

Do you have an error log of what happened?
No

Please provide any additional information below.
- I checked that the following tables were properly created in the SQL database
mysql> show tables;
+--------------------+
| Tables_in_skg_web  |
+--------------------+
| skg_list_admin     |
| skg_list_alts      |
| skg_list_log       |
| skg_list_players   |
| skg_list_rolllists |
| skg_list_users     |
+--------------------+
6 rows in set (0.00 sec)

skg_list_admin contains only the current version 1.9.0-beta
skg_list_users contains one user that has canAdmin and canUpdate flags
all other tables are empty

If I replace the install folder it takes back to step one of the install but from looking at the code I would expect even then to get an error that reads
die("The installation file is still present on your webserver.<br />
                         This is a huge security risk.<br />
                         Please delete the file:<br /><br />
                         <strong><em>".$_SERVER['DOCUMENT_ROOT'].SKG_DIR."/install/install.php</em></strong><br /><br />
                         Your SKG Web installation is disabled until you have deleted this file from the webserver.");

Since I'm not getting that ... well... I'm not sure, my PHP is weakFu.

This is an install on an XP machine and it is quite clear that the code is written for *nix but php should be portable enough to not require a platform.

You can find my phpinfo here ... http://www.immortalunion.org/info.php

Name Size MD5
Copy_of_config.php 6.1 KiB 68c055d1579fee50e3f8489641f243c5
uploader.php 16.4 KiB fd663f63da019627d385864f52290011
uploader.php 16.4 KiB fd663f63da019627d385864f52290011
uploader.php 16.4 KiB fd663f63da019627d385864f52290011
User When Change
tinlar Sat, 27 Jun 2009 19:15:55

Added attachment uploader.php

tinlar Sat, 27 Jun 2009 19:15:43

Added attachment uploader.php

tinlar Sat, 27 Jun 2009 19:15:25

Added attachment uploader.php

tinlar Sat, 20 Jun 2009 15:15:34 Changed description:
-
  What steps will reproduce the problem?
  1. Installed MySQL (5.1.35-community) and PHP (5.2.10)
  2. Configured the php.ini file
----------------------------------------
  Since I'm not getting that ... well... I'm not sure, my PHP is weakFu.

  This is an install on an XP machine and it is quite clear that the code is written for *nix but php should be portable enough to not require a platform.
+
+ You can find my phpinfo here ... http://www.immortalunion.org/info.php
+
tinlar Sat, 20 Jun 2009 15:06:31

Added attachment Copy_of_config.php

tinlar Sat, 20 Jun 2009 15:06:24 Create

You must login to post a comment. Don't have an account? Register to get one!

  • 4 comments
  • Avatar of tinlar tinlar Sat, 27 Jun 2009 19:21:29

    Okay so that appears to have everything up and running as far as I know to test. To recap the changes I made.

    In uploader.php I changed line 104 from

    $rollListSQL = "INSERT INTO skg_list_rolllists (id, listName, position, main_id, lastUpdate) values ('', '".addslashes($rollList)."', '".$position."', '".$main_id."', '".$updateTime."');";

    to

    $rollListSQL = "INSERT INTO skg_list_rolllists (listName, position, main_id, lastUpdate) values ('".addslashes($rollList)."', '".$position."', '".$main_id."', '".$updateTime."');";

    in functions.php change the case statements to be all lower case as follows

    if ($forceInstall !== "forceInstall" OR $forceInstall == ''){
        $sql = "SHOW TABLES FROM ".MYSQL_DB;
        $result = mysql_query($sql);
        while ($row = mysql_fetch_array($result)){
            switch ($row['Tables_in_'.MYSQL_DB]){
                case "skg_list_alts":
                    $check1 = true;
                    break;
                case "skg_list_log":
                    $check2 = true;
                    break;
                case "skg_list_players":
                    $check3 = true;
                    break;
                case "skg_list_rolllists":
                    $check4 = true;
                    break;
                case "skg_list_users":
                    $check5 = true;
                    break;
                case "skg_list_admin":
                    $check6 = true;
                    break;
            }
        }
    }
    
  • Avatar of tinlar tinlar Sat, 27 Jun 2009 18:54:24

    next obsticle is indeed the insert into the skg_list_rolllists

    adding this to the code...

    $result = mysql_query($rollListSQL); if (!$result) { die('Invalid query: ' . mysql_error());}

    shows the problem as this

    INSERT INTO skg_list_rolllists (id, listName, position, main_id, lastUpdate) values ('', '25-Man Raids', '1', '54696E6C6172323232323232', '1246127587'); Invalid query: Incorrect integer value: '' for column 'id' at row 1

    So we are passing a big fat nothing to a database that is expecting an Int there... no good.

    in uploader.php I changed line 104 from

    $rollListSQL = "INSERT INTO skg_list_rolllists (id, listName, position, main_id, lastUpdate) values ('', '".addslashes($rollList)."', '".$position."', '".$main_id."', '".$updateTime."');";

    to

    $rollListSQL = "INSERT INTO skg_list_rolllists (listName, position, main_id, lastUpdate) values ('".addslashes($rollList)."', '".$position."', '".$main_id."', '".$updateTime."');";

    That seemed to do the trick

  • Avatar of tinlar tinlar Sat, 27 Jun 2009 18:18:52

    The dirty hack only fixes one problem, others appear after that which I'm now looking into.

    It appears that the switch is case sensitive so changing all the case statements to be lower case gets you past the checkInstall without my original dirty hack.

    I was able to get a lua file imported but the akg_lists_rolllists table is still empty which doesn't seem correct to me and is pretty much keeping anything from being displayed properly I suspect. I'll keep digging.

  • Avatar of tinlar tinlar Sat, 27 Jun 2009 02:33:36

    If it helps it is the while loop and switch check in the checkInstall function that is failing. The cases appear to never be triggers so it try's to send you back through an install.

    a _dirty_dirty_dirty_ hack to get around this is to insert a return; on line 89 before the return 'InstallSystem';

    You would, of coarse, need to have completed the install at least once before making this change.

  • 4 comments

Facts

Last updated on
20 Jun 2009
Reported on
20 Jun 2009
Status
New - Issue has not had initial review yet.
Type
Other - Some other kind of issue
Priority
Medium - Normal priority.

Reported by

Possible assignees