diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-11 16:55:50 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-11 17:06:20 +0200 |
commit | 7667c367033b15582cf383da62446f78e66a59ef (patch) | |
tree | 5349427aa43070dd603802f68963b30c1c544232 /nixops/modules/websites/commons | |
parent | c890321db12036be69ebbece202984874b1e5a57 (diff) | |
download | Nix-7667c367033b15582cf383da62446f78e66a59ef.tar.gz Nix-7667c367033b15582cf383da62446f78e66a59ef.tar.zst Nix-7667c367033b15582cf383da62446f78e66a59ef.zip |
Move spip and chloe website to pkgs
Diffstat (limited to 'nixops/modules/websites/commons')
-rw-r--r-- | nixops/modules/websites/commons/spip/spip_ldap_patch.patch | 60 | ||||
-rw-r--r-- | nixops/modules/websites/commons/spip/spip_mes_options.php | 18 |
2 files changed, 0 insertions, 78 deletions
diff --git a/nixops/modules/websites/commons/spip/spip_ldap_patch.patch b/nixops/modules/websites/commons/spip/spip_ldap_patch.patch deleted file mode 100644 index 653c909..0000000 --- a/nixops/modules/websites/commons/spip/spip_ldap_patch.patch +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | --- old/ecrire/auth/ldap.php 2017-06-08 21:58:17.000000000 +0200 | ||
2 | +++ new/ecrire/auth/ldap.php 2017-06-10 02:54:02.687954143 +0200 | ||
3 | @@ -171,24 +171,41 @@ | ||
4 | $desc = isset($ldap['attributes']) && $ldap['attributes'] ? $ldap['attributes'] : $GLOBALS['ldap_attributes'] ; | ||
5 | |||
6 | $logins = is_array($desc['login']) ? $desc['login'] : array($desc['login']); | ||
7 | + if (isset($GLOBALS['ldap_search'])) { | ||
8 | + $search_query = str_replace("%user%", $login_search, $GLOBALS['ldap_search']); | ||
9 | + $result = @ldap_search($ldap_link, $ldap_base, $search_query, array("dn")); | ||
10 | + $info = @ldap_get_entries($ldap_link, $result); | ||
11 | + // Ne pas accepter les resultats si plus d'une entree | ||
12 | + // (on veut un attribut unique) | ||
13 | |||
14 | - // Tenter une recherche pour essayer de retrouver le DN | ||
15 | - foreach ($logins as $att) { | ||
16 | - $result = @ldap_search($ldap_link, $ldap_base, "$att=$login_search", array("dn")); | ||
17 | - $info = @ldap_get_entries($ldap_link, $result); | ||
18 | - // Ne pas accepter les resultats si plus d'une entree | ||
19 | - // (on veut un attribut unique) | ||
20 | + if (is_array($info) and $info['count'] == 1) { | ||
21 | + $dn = $info[0]['dn']; | ||
22 | + if (!$checkpass) { | ||
23 | + return $dn; | ||
24 | + } | ||
25 | + if (@ldap_bind($ldap_link, $dn, $pass)) { | ||
26 | + return $dn; | ||
27 | + } | ||
28 | + } | ||
29 | + } else { | ||
30 | + // Tenter une recherche pour essayer de retrouver le DN | ||
31 | + foreach ($logins as $att) { | ||
32 | + $result = @ldap_search($ldap_link, $ldap_base, "$att=$login_search", array("dn")); | ||
33 | + $info = @ldap_get_entries($ldap_link, $result); | ||
34 | + // Ne pas accepter les resultats si plus d'une entree | ||
35 | + // (on veut un attribut unique) | ||
36 | |||
37 | - if (is_array($info) and $info['count'] == 1) { | ||
38 | - $dn = $info[0]['dn']; | ||
39 | - if (!$checkpass) { | ||
40 | - return $dn; | ||
41 | - } | ||
42 | - if (@ldap_bind($ldap_link, $dn, $pass)) { | ||
43 | - return $dn; | ||
44 | - } | ||
45 | - } | ||
46 | - } | ||
47 | + if (is_array($info) and $info['count'] == 1) { | ||
48 | + $dn = $info[0]['dn']; | ||
49 | + if (!$checkpass) { | ||
50 | + return $dn; | ||
51 | + } | ||
52 | + if (@ldap_bind($ldap_link, $dn, $pass)) { | ||
53 | + return $dn; | ||
54 | + } | ||
55 | + } | ||
56 | + } | ||
57 | + } | ||
58 | |||
59 | if ($checkpass and !isset($dn)) { | ||
60 | // Si echec, essayer de deviner le DN | ||
diff --git a/nixops/modules/websites/commons/spip/spip_mes_options.php b/nixops/modules/websites/commons/spip/spip_mes_options.php deleted file mode 100644 index 8db8389..0000000 --- a/nixops/modules/websites/commons/spip/spip_mes_options.php +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | <?php // /!\ Important: There must be no blank space before <?php or after ?> | ||
2 | // This file was inspired from the spip contrib website | ||
3 | // http://www.spip.net/fr_article3811.html | ||
4 | |||
5 | $config_dir = getenv('SPIP_CONFIG_DIR') . '/'; | ||
6 | $var_dir = getenv('SPIP_VAR_DIR') . '/'; | ||
7 | |||
8 | $cookie_prefix = str_replace('.', '_', getenv("SPIP_SITE")); | ||
9 | $table_prefix = 'spip'; | ||
10 | |||
11 | spip_initialisation( | ||
12 | $config_dir, | ||
13 | _DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES, | ||
14 | $var_dir . _NOM_TEMPORAIRES_INACCESSIBLES, | ||
15 | _DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES | ||
16 | ); | ||
17 | |||
18 | ?> | ||