How to fix login problems with PBX Maint

OK all… I beat my head against the wall for awhile on this one.

Here was my situation and below is the fix:

  1. Mysql was up and running.
  2. Apache was a-ok.
  3. php was version 5.1.6
  4. Last time this box ran a-ok, there was a diff flav of php on it.
  5. This time… I was prompted for credentials when I visited http://mybox/admin But I could NEVER authenticate!
  6. If I modified /etc/amportal.conf and changed database to “none”… I could get in.

Below is how I fixed it:

  1. Modify your www/admin/header_auth.php to look like this:
    if (!empty($_SERVER[‘HTTPS’])) {
    $baselink = ($_SERVER[‘HTTPS’]!=’’?‘https://’:‘http://’).$_SERVER[‘HTTP_HOST’].$_SERVER[‘PHP_SELF’];
    }
    else{
    $baselink = (‘http://’).$_SERVER[‘HTTP_HOST’].$_SERVER[‘PHP_SELF’];
    }

The original like 16 or so was throwing an exception that https wasn’t defined.

  1. I also got errors inside php because something was depricted… So I changed this from OFF to ON in my /etc/php.ini

allow_call_time_pass_reference = On
;Off

Once I did the above… I didn’t have to restart anything… I simply authenticated right in. :slight_smile:

In closing…
I hope this saves some other poor sap the headache I got from this… And to the freePBX dev team… Please incorporate this fix.

Blessings to all! :slight_smile: JC Rocks!

please file a bug/feature request in trac if you think this needs to be updated. It will otherwise be lost in the forums within a day.

Thanks.