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')