qury / ion_auth-adldap2-codeigniter

Active Directory authentication for Codeigniter on Ion Auth basis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax Error

miikee-us opened this issue · comments

commented

I'm getting this error after installing and trying to access the Adauth controller.

`Parse error: syntax error, unexpected '?' in C:\inetpub\wwwapex\application\controllers\Adauth.php on line 841
A PHP Error was encountered
Severity: Parsing Error

Message: syntax error, unexpected '?'

Filename: controllers/Adauth.php
Line Number: 841
Backtrace:`

commented

Are you using PHP 5.x by any chance?

Line 841: $defaultCompany = $_POST['company'] ?? $this->config->item('default_company', 'adauth');

I'm using the null coalescing operator that was introduced in PHP7.

You can replace it in your code with the below:

if (isset($_POST['company']))
{
    $defaultCompany = $_POST['company'];
}
else
{
    $defaultCompany = $this->config->item('default_company', 'adauth');
}
commented

Yes, I was using PHP 5.7. Closing issue.