Skip to content

Instantly share code, notes, and snippets.

@julienmru
Created April 13, 2019 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienmru/48d23e9c9d70cf0d4b7d521598ae1c24 to your computer and use it in GitHub Desktop.
Save julienmru/48d23e9c9d70cf0d4b7d521598ae1c24 to your computer and use it in GitHub Desktop.
Masque les champs non attribués au profil des formulaires Auteur de SPIP
<?php
function autoriser_auteur_voirextra($faire, $type, $id, $qui, $opt) {
if ($auteur = sql_fetsel('id_profil', 'spip_auteurs', 'id_auteur = '.$id)) {
include_spip('inc/profils');
if ($profil = profils_recuperer_profil($auteur['id_profil'])) {
if (isset($profil['config']['auteur'][$opt['champ']])) return in_array('edition', $profil['config']['auteur'][$opt['champ']]);
else return FALSE;
} else {
return TRUE;
}
} else {
return TRUE;
}
}
function autoriser_auteur_modifierextra($faire, $type, $id, $qui, $opt) {
return autoriser_auteur_voirextra($faire, $type, $id, $qui, $opt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment