From 44bc7bdc5baec93e6100983990288cc6f76a2292 Mon Sep 17 00:00:00 2001 From: cy_altern Date: Sat, 24 Apr 2021 01:46:05 +0200 Subject: [PATCH] =?UTF-8?q?ajustements=20pour=20la=20cr=C3=A9ation=20auto?= =?UTF-8?q?=20d'un=20slug=20=C3=A0=20l'installation=20d'un=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action/creer_slug.php | 15 ++++++++------- gamumail_autorisations.php | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/action/creer_slug.php b/action/creer_slug.php index 55ad95c..cec55a7 100644 --- a/action/creer_slug.php +++ b/action/creer_slug.php @@ -22,24 +22,25 @@ function action_creer_slug_dist($slug = null, $opt = []){ return false; } $set = [ - 'slug' => '', - 'titre' => 'Le titre du modèle', - 'sujet' => 'Le sujet du mail', - 'texte' => 'Le texte du mail', - 'statut' => 'publie', + 'slug' => '', + 'titre' => 'Le titre du modèle', + 'sujet' => 'Le sujet du mail', + 'texte' => 'Le texte du mail', + 'statut' => 'publie', + 'editable' => '', ]; if ($id_slug = objet_inserer('gamumail', null, $set)) { $set = ['slug' => 'slug_'.$id_slug]; if ( $slug !== null - and !sql_countsel('slug', 'spip_gamumails', 'slug!='.sql_quote($slug)) + and !sql_countsel('slug', 'spip_gamumails', 'slug='.sql_quote($slug)) ) { $set['slug'] = $slug; } if (is_array($opt) and count($opt)) { $set = array_merge($set, $opt); - $set['editable'] = ''; + //$set['editable'] = ''; } sql_updateq('spip_gamumails', $set, 'id_gamumail = '.$id_slug); } diff --git a/gamumail_autorisations.php b/gamumail_autorisations.php index e6e1edf..d39559a 100644 --- a/gamumail_autorisations.php +++ b/gamumail_autorisations.php @@ -51,7 +51,7 @@ function autoriser_gamumail_modifier_nom_slug_dist($faire, $type, $id, $qui, $op if ( intval($id) and $editable = sql_getfetsel('editable', 'spip_gamumails', 'id_gamumail='.intval($id)) - and $editable === 'oui' + and $editable !== 'non' ) { return autoriser('webmestre')