Koozali.org: home of the SME Server

OrangeHRM

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: OrangeHRM
« Reply #15 on: September 24, 2018, 02:15:16 PM »
OK,

I've been step debugging through the installer this morning.

What a complete horror story.

First thing is in the install.php file (my comments)

Code: [Select]
// These are the same and this is what causes the issue
                //$errorMsg = mysqli_error($conn); // this is set to an empty string but should be uninitialized/unset or it gets picked up by the error routines
                //$mysqlErrNo = mysqli_errorno($conn); // this is unset - should be mysqli_errno


This should be something like:

Code: [Select]
                if (mysqli_error($conn)){
                    $errorMsg = mysqli_error($conn);
                }
                if (mysqli_errno($conn)){
                    $mysqlErrNo = mysqli_errno($conn);
                }

You then get $SESSION['DBINFO'] = OK so we have connected to the DB OK, but still fails.

That's when it goes running off to do a system validation.

Look at the code here that is called from checkSystem.php:

Code: [Select]
    private function getMySqlVersion($host, $userName, $password)
    {
        $mysqli = new mysqli($host, $userName, $password);

        if (mysqli_connect_errno()) {
            printf("Connect failed: %s\n", mysqli_connect_error());
            exit();
        }
        $currentVersion = $mysqli->server_info;

        $mysqli->close();
        return $currentVersion;
    }

So where is the port?? checkSystem.php has the correct DB details:

Code: [Select]
$conn = @mysqli_connect($dbInfo['dbHostName'], $dbInfo['dbUserName'], $dbInfo['dbPassword'], "", $dbInfo['dbHostPort']))

But it fails to send them to the validation as it uses this line:

Code: [Select]
$systemValidator->isMySqlCompatible($dbInfo['dbHostName'], $dbInfo['dbUserName'], $dbInfo['dbPassword']))
Without the correct port etc you get Access denied. <slapshead>

Essentially they give you the option to use a different port or use a socket, and then completely ignore it all.

As a result there are other functions in there that would also need hacking.

I haven't bothered to go any further. I don't have the time, and am not getting paid to do this.

Yes, I am sure I could get it installed. Just needs stepping through and fixing the broken bits, of which there are plenty - I had to override some other hard coded $vars etc etc as well. Probably a good day or two of work as I am sure there will be other issues in there when you actually run it.

However, if that is the standard of their installer, I don't hold much hope for the rest of their spaghetti code....

(remember I am NOT a coder. Just happen to be handy at debugging)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation