Skip to content

Commit

Permalink
CS Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi committed Aug 5, 2024
1 parent 4b7a5b2 commit a024169
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 2 additions & 4 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

if (getenv('ENV_DIR') !== false && getenv('ENV_DIR') !== '' ) {
if (false !== getenv('ENV_DIR') && '' !== getenv('ENV_DIR')) {
$_SERVER['APP_RUNTIME_OPTIONS']['dotenv_path'] = getenv('ENV_DIR').'/.env';
}

Expand All @@ -11,11 +11,9 @@

require dirname(__DIR__).'/vendor/autoload.php';


$env_dir = getenv('ENV_DIR') != false ? getenv('ENV_DIR') : dirname(__DIR__);
$env_dir = false != getenv('ENV_DIR') ? getenv('ENV_DIR') : dirname(__DIR__);
(new Dotenv())->bootEnv($env_dir.'/.env');


if ($_SERVER['APP_DEBUG']) {
umask(0000);

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/DAVController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DAVController extends AbstractController
/**
* WebDAV User Homes directory.
*
* @var string | null
* @var string|null
*/
protected $webdavHomesDir;

Expand Down
5 changes: 4 additions & 1 deletion src/Services/LDAPAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,19 @@ protected function ldapOpen($username, $password)
$ldap = ldap_connect($this->LDAPAuthUrl);
} catch (\Exception $e) {
error_log('LDAP Error (ldap_connect with '.$this->LDAPAuthUrl.'): '.$e->getMessage());

return false;
}

if ($ldap === false) {
if (false === $ldap) {
error_log('LDAP Error (ldap_connect with '.$this->LDAPAuthUrl.'): provided LDAP URI does not seems plausible');

return false;
}

if (!ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3)) {
error_log('LDAP Error (ldap_set_option): could not set LDAP_OPT_PROTOCOL_VERSION to 3');

return false;
}

Expand Down

0 comments on commit a024169

Please sign in to comment.