From 1a64deeb894dc95e2645a75771732c6cc53a79ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 4 Oct 2023 01:35:06 +0200 Subject: Squash changes containing private information There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository --- .../websites/tools/tools/landing/ldap_ssh_keys.php | 348 --------------------- 1 file changed, 348 deletions(-) delete mode 100644 modules/private/websites/tools/tools/landing/ldap_ssh_keys.php (limited to 'modules/private/websites/tools/tools/landing/ldap_ssh_keys.php') diff --git a/modules/private/websites/tools/tools/landing/ldap_ssh_keys.php b/modules/private/websites/tools/tools/landing/ldap_ssh_keys.php deleted file mode 100644 index 259e28d..0000000 --- a/modules/private/websites/tools/tools/landing/ldap_ssh_keys.php +++ /dev/null @@ -1,348 +0,0 @@ - - - - ImmaeEu Account - - - - - - -
-

Gestion des clés SSH

- $apps, - 'public_key' => $publicKey, - 'comment' => $comment, - ]; - } - - return $keys; -} - -function pushLdapInfos($keys) -{ - $con = doConnect(); - if (!isset($_SESSION["user_dn"])) - return false; - - return ldap_mod_replace($con, $_SESSION["user_dn"], array("immaeSshKey" => $keys)); -} - - -// Script -if (isset($_POST['deconnexion'])) { - $_SESSION = []; -} - -if (isset($_POST['sauvegarder'])) { - $editedKeys = []; - $errors = false; - $keysToSave = []; - foreach($_POST['keys'] as $id => $key) { - $editedKeys[$id] = $key; - if (!checkSshKey($key['public_key'])) { - $editedKeys[$id]['error'] = true; - $errors = true; - } - - if (!isset($key['apps'])) { - $editedKeys[$id]['apps'] = $key['apps'] = []; - - } - foreach ($key['apps'] as $app) { - if (!in_array($app, apps)) { - die("integrity"); - } - } - - if (!isset($editedKeys[$id]['error']) || $editedKeys[$id]['error'] !== true) { - $keysToSave[] = implode('|', $key['apps']) . ' ' . $key['public_key'] . ' ' . $key['comment']; - } - } - - if (!$errors) { - $successSave = pushLdapInfos($keysToSave); - } -} - -$loginErrors = ""; -if (isset($_POST['login'])) { - if (empty($_POST['username']) || empty($_POST['password'])) { - $loginErrors = "Le nom d'utilisateur et le mot de passe sont requis."; - } elseif (!checkLogin($_POST['username'], $_POST['password'])) { - $loginErrors = "Identifiants incorrects."; - } else { - $_SESSION['login'] = $_POST['username']; - } -} - -if (isUserLogged()) : - $keys = isset($editedKeys) ? $editedKeys : getLdapInfo(); -?> -

Connecté en tant que

- -
- -
- - -

Clés enregistrées avec succès.

- - -
- - - $sshKey) : - ?> - - - - - - - - - - - - - - - - - - - -
Description
>
- - - -
- - -
- - -
-

Login

- - -

- - - - - - - - - -
- -
- - - - -- cgit v1.2.3