From 1957ddacf00313b667fb4315b1dd7867c67dcfd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 6 Oct 2023 22:14:32 +0200 Subject: [PATCH] fix --- conf/config.local.php | 60 ------------------------------------------- manifest.toml | 2 +- 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/conf/config.local.php b/conf/config.local.php index 18f58e0..70ca1a9 100644 --- a/conf/config.local.php +++ b/conf/config.local.php @@ -58,66 +58,6 @@ const SECRET_KEY = '__SECRET_KEY__'; //const LOCAL_LOGIN = null; -const LDAP_HOST = 'localhost'; -const LDAP_DN = 'cn=%s,ou=users,dc=yunohost,dc=org'; - -session_start(); - -if (empty($_SESSION['ldap_user']) && !empty($_POST['ldap_login']) && !empty($_POST['ldap_password'])) { - $l = ldap_connect(LDAP_HOST) || die('Connexion impossible'); - ldap_set_option($l, LDAP_OPT_PROTOCOL_VERSION, 3); - ldap_set_option($l, LDAP_OPT_REFERRALS, 0); - ldap_set_option($l, LDAP_OPT_NETWORK_TIMEOUT, 10); - - $login = trim($_POST['ldap_login']); - - if (ldap_bind($l, sprintf(LDAP_DN, $login), $_POST['ldap_password'])) { - $_SESSION['ldap_user'] = $login; - } - - ldap_close($l); -} - -if (empty($_SESSION['ldap_user'])) { - echo ' - - -
'; - - if (!empty($_POST['ldap_login'])) { - echo '

Identifiants invalides

'; - } - - echo ' -
- Connexion -
-
Login
-
-
Mot de passe
-
-
-

-
-
- - '; - exit; -} - -define('Garradin\LOCAL_LOGIN', [ - 'user' => [ - '_name' => $_SESSION['ldap_user'], - ], - 'permissions' => [ - 'users' => 9, - 'accounting' => 9, - 'web' => 9, - 'documents' => 9, - 'config' => 9, - ], -]); - /** * Autoriser (ou non) l'import de sauvegarde qui a été modifiée ? * diff --git a/manifest.toml b/manifest.toml index dd2fbb3..9aa5dec 100644 --- a/manifest.toml +++ b/manifest.toml @@ -53,4 +53,4 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "sqlite3, php8.2-sqlite3, php8.2-gd, php8.2-intl, php8.2-cli, php8.2-gnupg, php8.2-mbstring, php8.2-ldap" + packages = "sqlite3, php8.2-sqlite3, php8.2-gd, php8.2-intl, php8.2-cli, php8.2-gnupg, php8.2-mbstring"