P.O.C d'un plugin permettant d'étendre les autorisations de SPIP, la doc est dans le README.md
@ -0,0 +1,99 @@
|
||||
# Autorisations étendues
|
||||
|
||||
Plugins pour développeur qui permet d'étendre les autorisations de SPIP.
|
||||
Il est compatible avec le plugin chosen
|
||||
|
||||
|
||||
## Configuration
|
||||
1. Le plugin a besoin d'une constante listant les autorisations à ajouter (dans xxx_options.php)
|
||||
```php
|
||||
define('_AUTH_MODELE', [
|
||||
'produit' => [
|
||||
'label' => 'Produit / Stage',
|
||||
'type' => 'produit',
|
||||
'faire' => ['voir','creer', 'modifier', 'supprimer']
|
||||
],
|
||||
'guide' => [
|
||||
'label' => 'Guide',
|
||||
'type' => 'guide',
|
||||
'faire' => ['voir', 'modifier']
|
||||
],
|
||||
'client' => [
|
||||
'label' => 'Client',
|
||||
'type' => 'client',
|
||||
'faire' => ['voir', 'modifier']
|
||||
]
|
||||
]);
|
||||
```
|
||||
|
||||
2. On peut ajouter des criteres de sélection des auteurs qui s'afficheront dans ce formulaire via le pipeline formulaire_charger. ex :
|
||||
```php
|
||||
function prefix_formulaire_charger($flux){
|
||||
if ($flux['args']['form'] === 'editer_autorisations'){
|
||||
$flux['data']['pgp'] = ["guide","client"];
|
||||
$flux['data']['webmestre'] = "non";
|
||||
}
|
||||
return $flux;
|
||||
}
|
||||
```
|
||||
|
||||
## Formulaire de gestion des autorisations
|
||||
1. Appeler le formulaire d'édition des autorisations, dans une page de votre choix. ex :
|
||||
```html
|
||||
[(#AUTORISER{modifier,autmodele}|sinon_interdire_acces)]
|
||||
<div class="inner">
|
||||
<header>
|
||||
<h1 class="txtcenter">Gestion des autorisations</h1>
|
||||
</header>
|
||||
<div class="">
|
||||
[(#FORMULAIRE_EDITER_AUTORISATIONS{#ENV{id_auteur}})]
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||

|
||||
|
||||
2. Si un auteur un dans son champ **boss = oui** => il aura tous les droits (un logo s'affiche devant son nom) : ex Emilie
|
||||
3. Devant le nom d'un auteur, une petite icone verte (modèle) permet de sélectionner un modèle d'autorisation.
|
||||
4. Quand un modèle d'autorisation est sélectionné, ex: pour Frédéric -> modèle Secrétaire, il récupère les autorisations définies dans le modèle **Secrétaire** et on ne peut donc plus modifier ses autorisations. Dans ce cas, on peut soit changer de modèle (icone modèle noire) soit dissocier le modèle (cadenas ouvert rouge).
|
||||
5. Ces autorisations sont stockées en json dans le champ **autorisations** de la table spip_auteurs, on stocke aussi le nom du modèle le cas échant dans le champ **aut_nom**
|
||||
|
||||
## Gestion des modèles d'autorisations
|
||||
> On peut créer des modèles d'autorisations
|
||||
|
||||

|
||||
|
||||
|
||||
## Utilisation des autorisations
|
||||
1. Dans le fichier prefix_autorisations.php ajouter en haut du fichier :
|
||||
```php
|
||||
include_spip('inc/tester_autorisation');
|
||||
```
|
||||
2. Puis ajouter les fonctions d'autorisation, par exemple, pour le type guide, nous avons : voir et modifier
|
||||
```php
|
||||
function autoriser_guide_voir_dist($faire, $type, $id, $qui, $opt) {
|
||||
return tester_autorisation($faire, $type, $qui);
|
||||
}
|
||||
function autoriser_guide_modifier_dist($faire, $type, $id, $qui, $opt) {
|
||||
return tester_autorisation($faire, $type, $qui);
|
||||
}
|
||||
// comme nos guides sont des auteurs, pour utiliser les crayons, nous surchargeons la fonction de SPIP
|
||||
function autoriser_auteur_modifier($faire, $type, $id, $qui, $opt) {
|
||||
return tester_autorisation($faire, "guide", $qui);
|
||||
}
|
||||
```
|
||||
|
||||
3. Cette fonction : `tester_autorisation()` renvoie toujours **true** pour les **webmestres** et pour les auteurs avec le champ **boss=oui**.
|
||||
Elle ajoute un pipeline : `super_autorisation` qui permet de modifier le retour.
|
||||
Exemple, renvoyer toujours true pour les boss définis dans le champ pgp=boss, de l'auteur qui demande l'autorisation
|
||||
```php
|
||||
function prefex_super_autorisation($qui){
|
||||
if ($qui['pgp'] === 'boss') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
```
|
||||
> On peut exeptionnellement interdire le passage dans ce pipeline ou le test $qui['boss'] === 'oui' en appelant notre fonction `tester_autorisation()` avec false en 4e arg
|
||||
```php
|
||||
tester_autorisation($faire, $type, $qui, false);
|
||||
```
|
@ -0,0 +1,8 @@
|
||||
[(#AUTORISER{associer,autmodele}|sinon_interdire_acces)]
|
||||
|
||||
<div id="charger_aut_modele">
|
||||
<h1><:auted:charger_un_modele_pour:> : [ (#ENV{nom})]</h1>
|
||||
<div class="">
|
||||
[(#FORMULAIRE_ASSOCIER_AUT_MODELE{#ENV{id_auteur}, #ENV{aut_nom}, #ENV{redirect}})]
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Fichier gérant l'installation et désinstallation du plugin Autorisations étendues
|
||||
*
|
||||
* @plugin Autorisations étendues
|
||||
* @copyright 2020
|
||||
* @author tofulm
|
||||
* @licence GNU/GPL
|
||||
* @package SPIP\Auted\Installation
|
||||
*/
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction d'installation et de mise à jour du plugin Autorisations étendues.
|
||||
*
|
||||
* @param string $nom_meta_base_version
|
||||
* Nom de la meta informant de la version du schéma de données du plugin installé dans SPIP
|
||||
* @param string $version_cible
|
||||
* Version du schéma de données dans ce plugin (déclaré dans paquet.xml)
|
||||
* @return void
|
||||
**/
|
||||
function auted_upgrade($nom_meta_base_version, $version_cible) {
|
||||
$maj = array();
|
||||
|
||||
$maj['create'] = array(array('maj_tables', array('spip_aut_modeles','spip_auteurs')));
|
||||
$maj['1.0.5'] = array(array('maj_tables', array('spip_aut_modeles','spip_auteurs')));
|
||||
|
||||
include_spip('base/upgrade');
|
||||
maj_plugin($nom_meta_base_version, $version_cible, $maj);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction de désinstallation du plugin Autorisations étendues.
|
||||
*
|
||||
* @param string $nom_meta_base_version
|
||||
* Nom de la meta informant de la version du schéma de données du plugin installé dans SPIP
|
||||
* @return void
|
||||
**/
|
||||
function auted_vider_tables($nom_meta_base_version) {
|
||||
|
||||
sql_drop_table('spip_aut_mods');
|
||||
|
||||
# Nettoyer les liens courants (le génie optimiser_base_disparus se chargera de nettoyer toutes les tables de liens)
|
||||
sql_delete('spip_documents_liens', sql_in('objet', array('aut_mod')));
|
||||
sql_delete('spip_mots_liens', sql_in('objet', array('aut_mod')));
|
||||
sql_delete('spip_auteurs_liens', sql_in('objet', array('aut_mod')));
|
||||
# Nettoyer les versionnages et forums
|
||||
sql_delete('spip_versions', sql_in('objet', array('aut_mod')));
|
||||
sql_delete('spip_versions_fragments', sql_in('objet', array('aut_mod')));
|
||||
sql_delete('spip_forum', sql_in('objet', array('aut_mod')));
|
||||
|
||||
effacer_meta($nom_meta_base_version);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Définit les autorisations du plugin Autorisations étendues
|
||||
*
|
||||
* @plugin Autorisations étendues
|
||||
* @copyright 2020
|
||||
* @author tofulm
|
||||
* @licence GNU/GPL
|
||||
* @package SPIP\Auted\Autorisations
|
||||
*/
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction d'appel pour le pipeline
|
||||
* @pipeline autoriser */
|
||||
function auted_autoriser() {
|
||||
}
|
||||
|
||||
|
||||
// -----------------
|
||||
// BOSS
|
||||
function autoriser_boss_dist($faire, $type, $id, $qui, $opt) {
|
||||
if (autoriser('webmestre', null, null, $qui, null)) {
|
||||
return true;
|
||||
}
|
||||
if ($qui['boss'] === 'oui') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// -----------------
|
||||
// Objet aut_modeles
|
||||
|
||||
/**
|
||||
* Autorisation de créer (autmodele)
|
||||
*
|
||||
**/
|
||||
function autoriser_autmodele_associer_dist($faire, $type, $id, $qui, $opt) {
|
||||
return (autoriser('webmestre', '', '', $qui) or $qui['boss'] === "oui");
|
||||
}
|
||||
|
||||
/**
|
||||
* Autorisation de modifier (autmodele)
|
||||
*
|
||||
**/
|
||||
function autoriser_autmodele_modifier_dist($faire, $type, $id, $qui, $opt) {
|
||||
return (autoriser('webmestre', '', '', $qui) or $qui['boss'] === "oui");
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Utilisations de pipelines par Autorisations étendues
|
||||
*
|
||||
* @plugin Autorisations étendues
|
||||
* @copyright 2020
|
||||
* @author tofulm
|
||||
* @licence GNU/GPL
|
||||
* @package SPIP\Auted\Pipelines
|
||||
*/
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Charger des styles CSS
|
||||
*
|
||||
* @pipeline insert_head_css
|
||||
* @param string $flux Code html des styles CSS à charger
|
||||
* @return string Code html complété
|
||||
**/
|
||||
function auted_insert_head_css($flux){
|
||||
$flux .= '<link rel="stylesheet" href="' . timestamp(find_in_path('css/auted.css')) . '" type="text/css" />' . "\n";
|
||||
return $flux;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optimiser la base de données
|
||||
*
|
||||
* Supprime les objets à la poubelle.
|
||||
*
|
||||
* @pipeline optimiser_base_disparus
|
||||
* @param array $flux Données du pipeline
|
||||
* @return array Données du pipeline
|
||||
*/
|
||||
function auted_optimiser_base_disparus($flux) {
|
||||
|
||||
sql_delete('spip_aut_modeles', "statut='poubelle' AND maj < " . $flux['args']['date']);
|
||||
|
||||
return $flux;
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* Déclarations relatives à la base de données
|
||||
*
|
||||
* @plugin Autorisations étendues
|
||||
* @copyright 2020
|
||||
* @author tofulm
|
||||
* @licence GNU/GPL
|
||||
* @package SPIP\Auted\Pipelines
|
||||
*/
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Déclaration des alias de tables et filtres automatiques de champs
|
||||
*
|
||||
* @pipeline declarer_tables_interfaces
|
||||
* @param array $interfaces
|
||||
* Déclarations d'interface pour le compilateur
|
||||
* @return array
|
||||
* Déclarations d'interface pour le compilateur
|
||||
*/
|
||||
function auted_declarer_tables_interfaces($interfaces) {
|
||||
|
||||
$interfaces['table_des_tables']['aut_modeles'] = 'aut_modeles';
|
||||
|
||||
return $interfaces;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Déclaration des objets éditoriaux
|
||||
*
|
||||
* @pipeline declarer_tables_objets_sql
|
||||
* @param array $tables
|
||||
* Description des tables
|
||||
* @return array
|
||||
* Description complétée des tables
|
||||
*/
|
||||
function auted_declarer_tables_objets_sql($tables) {
|
||||
|
||||
$tables['spip_aut_modeles'] = array(
|
||||
'type' => 'aut_modele',
|
||||
'principale' => 'oui',
|
||||
'table_objet_surnoms' => array('autmodele'),
|
||||
'field'=> array(
|
||||
'id_aut_modele' => 'bigint(21) NOT NULL',
|
||||
'nom' => 'varchar(55) NOT NULL DEFAULT ""',
|
||||
'aut_modele' => 'text NOT NULL DEFAULT ""',
|
||||
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
|
||||
'maj' => 'TIMESTAMP'
|
||||
),
|
||||
'key' => array(
|
||||
'PRIMARY KEY' => 'id_aut_modele',
|
||||
'KEY statut' => 'statut',
|
||||
),
|
||||
'titre' => 'nom AS titre, "" AS lang',
|
||||
'champs_editables' => array('nom', 'aut_modele', 'modifie'),
|
||||
'statut_textes_instituer' => array(
|
||||
'prepa' => 'texte_statut_en_cours_redaction',
|
||||
'publie' => 'texte_statut_publie',
|
||||
'refuse' => 'texte_statut_refuse',
|
||||
'poubelle' => 'texte_statut_poubelle',
|
||||
),
|
||||
'statut'=> array(
|
||||
array(
|
||||
'champ' => 'statut',
|
||||
'publie' => 'publie',
|
||||
'previsu' => 'publie,prepa',
|
||||
'post_date' => 'date',
|
||||
'exception' => array('statut','tout')
|
||||
)
|
||||
),
|
||||
'texte_changer_statut' => 'aut_mod:texte_changer_statut_aut_mod',
|
||||
|
||||
|
||||
);
|
||||
|
||||
return $tables;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ajouter des champs aux tables auteurs et articles et rubrique
|
||||
* @param array $tables_principales
|
||||
* @return array
|
||||
*/
|
||||
|
||||
function auted_declarer_tables_principales($tables_principales){
|
||||
|
||||
$tables_principales['spip_auteurs']['field']['autorisations'] = "text NOT NULL";
|
||||
$tables_principales['spip_auteurs']['field']['aut_nom'] = "varchar(55) NOT NULL";
|
||||
$tables_principales['spip_auteurs']['field']['boss'] = "varchar(20) NOT NULL";
|
||||
|
||||
return $tables_principales;
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<INCLURE{fond=inclure/editer_modeles_autorisations,env}>
|
||||
|
@ -0,0 +1,50 @@
|
||||
.formulaire_editer_autorisations .boss {
|
||||
max-width: 24px;
|
||||
}
|
||||
|
||||
.formulaire_editer_autorisations .chosen-container {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.formulaire_editer_autorisations table tr:nth-child(even) {
|
||||
background-color: rgb(231, 233, 237);
|
||||
}
|
||||
|
||||
a.associer_modele {
|
||||
color: rgb(51, 164, 51);
|
||||
}
|
||||
|
||||
.nom_modele span {
|
||||
background-color: #cecece;
|
||||
padding: 2px 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.nom_modele a.associer_modele {
|
||||
color: #000;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.icone_svg {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
button[type='submit'].dissocier {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
box-shadow: none;
|
||||
min-width: 20px;
|
||||
padding: 0;
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
.pas_modele.enregistrer_modele input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.formulaire_editer_modeles_autorisation .chosen-container {
|
||||
max-width: 100%;
|
||||
}
|
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 24 KiB |
@ -0,0 +1,30 @@
|
||||
#CACHE{0}
|
||||
|
||||
<div class="formulaire_spip formulaire_#FORM">
|
||||
|
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||
|
||||
<form name="formulaire_#FORM" action="#ENV{action}" method="post"><div>
|
||||
#ACTION_FORMULAIRE{#ENV{action}}
|
||||
|
||||
<div class="editer_groupe">
|
||||
#SET{name,id_aut_modele}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<BOUCLE_autmod(AUT_MODELES)>
|
||||
<div class="choix">
|
||||
<label>
|
||||
<input type="radio" class="radio" name="#GET{name}" value="#ID_AUT_MODELE" id="#GET{name}_#ID_AUT_MODELE}" [(#ENV{id_aut_modele}|=={#ID_AUT_MODELE}|oui) checked] >
|
||||
#NOM
|
||||
</label>
|
||||
</div>
|
||||
</BOUCLE_autmod>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="boutons"><button type="submit" class="submit"><:auted:valider:></button></p>
|
||||
</div></form>
|
||||
|
||||
</div>
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||
|
||||
function formulaires_associer_aut_modele_charger_dist($id_auteur, $aut_nom = 0, $redirect = ''){
|
||||
$id_aut_modele = 0;
|
||||
if ($aut_nom) {
|
||||
$id_aut_modele = sql_getfetsel('id_aut_modele', 'spip_aut_modeles', 'nom='.sql_quote($aut_nom));
|
||||
}
|
||||
|
||||
$valeurs = array(
|
||||
"id_auteur" => $id_auteur,
|
||||
"id_aut_modele" => intval($id_aut_modele)
|
||||
);
|
||||
|
||||
return $valeurs;
|
||||
}
|
||||
|
||||
function formulaires_associer_aut_modele_verifier_dist($id_auteur, $aut_nom = 0, $redirect = ''){
|
||||
$erreurs = array();
|
||||
return $erreurs;
|
||||
}
|
||||
|
||||
function formulaires_associer_aut_modele_traiter_dist($id_auteur, $aut_nom = 0, $redirect = ''){
|
||||
include_spip('inc/session');
|
||||
|
||||
$retour = array();
|
||||
|
||||
$id_aut_modele = _request('id_aut_modele');
|
||||
if (intval($id_aut_modele) and intval($id_auteur)) {
|
||||
$auts = sql_fetsel('nom, aut_modele','spip_aut_modeles', 'id_aut_modele='.intval($id_aut_modele));
|
||||
if (!empty($auts)) {
|
||||
$set = [
|
||||
'autorisations' => $auts['aut_modele'],
|
||||
'aut_nom' => $auts['nom']
|
||||
];
|
||||
sql_updateq('spip_auteurs', $set, 'id_auteur='.intval($id_auteur));
|
||||
$retour['message_ok'] = "bravo";
|
||||
|
||||
$auteur = sql_fetsel('*', 'spip_auteurs','id_auteur='.intval($id_auteur));
|
||||
actualiser_sessions($auteur);
|
||||
|
||||
include_spip('inc/invalideur');
|
||||
suivre_invalideur("id='id_auteur/$id_auteur'");
|
||||
}
|
||||
} else {
|
||||
$retour['message_erreur'] = _T('auted:enregistrement_impossible');
|
||||
}
|
||||
|
||||
if ($redirect) {
|
||||
$retour['redirect'] = $redirect;
|
||||
}
|
||||
|
||||
return $retour;
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
#CACHE{0}
|
||||
<div class="formulaire_spip formulaire_#FORM">
|
||||
|
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||
|
||||
|
||||
<form name="formulaire_#FORM" action="#ENV{action}" method="post"><div>
|
||||
#ACTION_FORMULAIRE{#ENV{action}}
|
||||
|
||||
<table id="gestion_autorisations" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><:auted:auteurs:></th>
|
||||
<BOUCLE_nomAuth(DATA){source tableau, #ENV{auth_modele}}>
|
||||
<td>#VALEUR{label}</td>
|
||||
</BOUCLE_nomAuth>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<BOUCLE_auteurs(AUTEURS)
|
||||
{id_auteur ?IN #ENV{id_auteur}}
|
||||
{statut ?IN #ENV{statut}}
|
||||
{pgp ?IN #ENV{pgp}}
|
||||
{boss?}
|
||||
{webmestre?}
|
||||
{tout}>
|
||||
<tr id="auteur-#ID_AUTEUR">
|
||||
[(#AUT_NOM|?{#SET{disabled,oui}, #SET{disabled,''}})]
|
||||
|
||||
<td>
|
||||
<div>
|
||||
[(#BOSS|oui)
|
||||
<svg class="icone_svg" alt="boss">
|
||||
<title>boss</title>
|
||||
<use xlink:href="[(#CHEMIN{img/boss.svg})#boss]" />
|
||||
</svg>
|
||||
#NOM
|
||||
]
|
||||
[(#BOSS|non)
|
||||
[(#GET{disabled}|non)
|
||||
<a class="mediabox associer_modele"
|
||||
title="<:auted:associer_modele:>"
|
||||
href="[(#URL_PAGE{associer_aut_modele}
|
||||
|parametre_url{id_auteur,#ID_AUTEUR}
|
||||
|parametre_url{nom,#NOM}
|
||||
|parametre_url{redirect,#SELF}
|
||||
)]"
|
||||
>
|
||||
<svg class="icone_svg" alt="modele">
|
||||
<use xlink:href="[(#CHEMIN{img/modele.svg})#modele]" />
|
||||
</svg>
|
||||
</a>
|
||||
]
|
||||
#NOM
|
||||
[ <div class="nom_modele">
|
||||
<span>
|
||||
[(#GET{disabled}|oui)
|
||||
<a class="mediabox associer_modele"
|
||||
title="<:auted:associer_modele:>"
|
||||
href="[(#URL_PAGE{associer_aut_modele}
|
||||
|parametre_url{id_auteur,#ID_AUTEUR}
|
||||
|parametre_url{aut_nom,#AUT_NOM}
|
||||
|parametre_url{nom,#NOM}
|
||||
|parametre_url{redirect,#SELF}
|
||||
)]"
|
||||
>
|
||||
<svg class="icone_svg" alt="modele">
|
||||
<use xlink:href="[(#CHEMIN{img/modele.svg})#modele]" />
|
||||
</svg>
|
||||
</a>
|
||||
]
|
||||
(#AUT_NOM)
|
||||
<button class="dissocier" type="submit" value="#ID_AUTEUR" name="dissocier_modele"
|
||||
title="<:auted:dissocier_modele:>"
|
||||
onClick="return confirm('<:auted:confirmer_dissocier_modele:>');"
|
||||
>
|
||||
<svg class="icone_svg" alt="unlock">
|
||||
<use xlink:href="[(#CHEMIN{img/unlock.svg})#unlock]" />
|
||||
</svg>
|
||||
</button>
|
||||
</span>
|
||||
</div> ]
|
||||
]
|
||||
</div>
|
||||
|
||||
[(#GET{disabled}|oui) <input type="hidden" value="#ID_AUTEUR" name="Tdisabled\[\]"/> ]
|
||||
[(#BOSS|non) <input type="hidden" name="Tid_auteur\[\]" value="#ID_AUTEUR" placeholder="Nom modèle"> ]
|
||||
</td>
|
||||
<BOUCLE_valeurAuth(DATA){source tableau, #ENV{auth_modele}}>
|
||||
[(#SET{autorisations,#AUTORISATIONS|json_decode{true}|table_valeur{#VALEUR{type}}})]
|
||||
<td>
|
||||
[(#BOSS|non)
|
||||
<INCLURE{fond=inclure/auth_choix,id_auteur,type=#VALEUR{type},faire=#VALEUR{faire},autorisations=#GET{autorisations},disabled=#GET{disabled}}>
|
||||
]
|
||||
</td>
|
||||
</BOUCLE_valeurAuth>
|
||||
</tr>
|
||||
</BOUCLE_auteurs>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p class="boutons"><button type="submit" class="submit"><:auted:valider:></button></p>
|
||||
</div></form>
|
||||
</div>
|
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||
|
||||
function formulaires_editer_autorisations_charger_dist($id_auteur=0, $redirect=''){
|
||||
$valeurs = ['auth_modele' => _AUTH_MODELE];
|
||||
|
||||
if (intval($id_auteur)) {
|
||||
$valeurs["id_auteur"] = intval($id_auteur);
|
||||
}
|
||||
|
||||
return $valeurs;
|
||||
}
|
||||
|
||||
function formulaires_editer_autorisations_verifier_dist($id_auteur=0, $redirect=''){
|
||||
$erreurs = array();
|
||||
return $erreurs;
|
||||
}
|
||||
|
||||
function formulaires_editer_autorisations_traiter_dist($id_auteur=0, $redirect=''){
|
||||
include_spip('inc/session');
|
||||
|
||||
$retour = array();
|
||||
|
||||
$Tdisabled = _request('Tdisabled');
|
||||
$Tid_auteur = _request('Tid_auteur');
|
||||
|
||||
$id_auteur_dissocier = _request('dissocier_modele');
|
||||
if (intval($id_auteur_dissocier)) {
|
||||
sql_updateq('spip_auteurs',['aut_nom' => ''], 'id_auteur='.intval($id_auteur_dissocier));
|
||||
|
||||
$auteur = sql_fetsel('*', 'spip_auteurs','id_auteur='.intval($id_auteur_dissocier));
|
||||
actualiser_sessions($auteur);
|
||||
}
|
||||
|
||||
foreach ($Tid_auteur as $id) {
|
||||
$Tautorisations = [];
|
||||
|
||||
if (in_array($id, $Tdisabled)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$Tauths = _request('id-' . $id);
|
||||
if (!empty($Tauths)) {
|
||||
foreach ($Tauths as $valeur) {
|
||||
$Tautorisations[key($valeur)][]= $valeur[key($valeur)];
|
||||
}
|
||||
}
|
||||
$set = ['autorisations' => json_encode($Tautorisations)];
|
||||
sql_updateq('spip_auteurs', $set, 'id_auteur='.intval($id));
|
||||
|
||||
// on recalcul la session
|
||||
$auteur = sql_fetsel('*', 'spip_auteurs','id_auteur='.intval($id));
|
||||
actualiser_sessions($auteur);
|
||||
|
||||
$retour['message_ok'] = _T("auted:enregistrement_valide");
|
||||
}
|
||||
|
||||
include_spip('inc/invalideur');
|
||||
suivre_invalideur("id='id_auteur/$id'");
|
||||
|
||||
|
||||
if ($redirect) {
|
||||
$retour['redirect'] = $redirect;
|
||||
}
|
||||
|
||||
return $retour;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
#CACHE{0}
|
||||
|
||||
<div class="formulaire_spip formulaire_#FORM">
|
||||
|
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||
|
||||
|
||||
<form name="formulaire_#FORM" action="#ENV{action}" method="post"><div>
|
||||
#ACTION_FORMULAIRE{#ENV{action}}
|
||||
|
||||
<table id="gestion_autorisations" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><:auted:modeles:></th>
|
||||
<BOUCLE_nomAuth(DATA){source tableau, #ENV{auth_modele}}>
|
||||
<td>#VALEUR{label}</td>
|
||||
</BOUCLE_nomAuth>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<BOUCLE_modele(AUT_MODELES){tout}>
|
||||
<tr id="modele-#ID_AUT_MODELE" data-id_modele="#ID_AUT_MODELE">
|
||||
<td>
|
||||
<input type="text" value="#NOM" name="Tnom[#ID_AUT_MODELE][]">
|
||||
<input type="hidden" name="Tid_aut_modele[]" value="#ID_AUT_MODELE">
|
||||
<input type="hidden" name="Tnom_modele[#ID_AUT_MODELE][]" value="#NOM">
|
||||
</td>
|
||||
<BOUCLE_valeurAuth(DATA){source tableau, #ENV{auth_modele}}>
|
||||
[(#SET{autorisations,#AUT_MODELE|json_decode{true}|table_valeur{#VALEUR{type}}})]
|
||||
<td>
|
||||
<INCLURE{fond=inclure/auth_choix,id_auteur=#ID_AUT_MODELE,type=#VALEUR{type},faire=#VALEUR{faire},autorisations=#GET{autorisations}}>
|
||||
</td>
|
||||
</BOUCLE_valeurAuth>
|
||||
</tr>
|
||||
</BOUCLE_modele>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="boutons">
|
||||
<button type="submit" class="submit" name="ajouter_modele" value="add"><:auted:ajouter_un_modele:></button>
|
||||
<button type="submit" class="submit"><:auted:valider:></button>
|
||||
</div>
|
||||
</div></form>
|
||||
</div>
|
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||
|
||||
function formulaires_editer_modeles_autorisation_charger_dist($redirect){
|
||||
$valeurs = [];
|
||||
|
||||
$valeurs = ['auth_modele' => _AUTH_MODELE];
|
||||
|
||||
return $valeurs;
|
||||
}
|
||||
|
||||
function formulaires_editer_modeles_autorisation_verifier_dist($redirect){
|
||||
$erreurs = array();
|
||||
return $erreurs;
|
||||
}
|
||||
|
||||
function formulaires_editer_modeles_autorisation_traiter_dist($redirect){
|
||||
include_spip('inc/session');
|
||||
|
||||
$retour = array();
|
||||
|
||||
if (_request('ajouter_modele') === "add") {
|
||||
sql_insertq('spip_aut_modeles', ['statut' => 'publie']);
|
||||
if ($redirect) {
|
||||
$retour['redirect'] = $redirect;
|
||||
}
|
||||
return $retour;
|
||||
}
|
||||
|
||||
$Tid_aut_modele = _request('Tid_aut_modele');
|
||||
|
||||
foreach ($Tid_aut_modele as $id) {
|
||||
$Tauths = _request('id-' . $id);
|
||||
$Tautorisations = [];
|
||||
|
||||
if (!empty($Tauths)) {
|
||||
foreach ($Tauths as $valeur) {
|
||||
$Tautorisations[key($valeur)][]= $valeur[key($valeur)];
|
||||
}
|
||||
}
|
||||
|
||||
$set = [
|
||||
'aut_modele' => json_encode($Tautorisations),
|
||||
'nom' => _request('Tnom')[$id][0]
|
||||
];
|
||||
|
||||
sql_updateq('spip_aut_modeles', $set, 'id_aut_modele='.intval($id));
|
||||
|
||||
if ($set['nom'] === _request('Tnom_modele')[$id][0]) {
|
||||
$set_auteur = [
|
||||
'autorisations' => json_encode($Tautorisations),
|
||||
];
|
||||
sql_updateq('spip_auteurs', $set_auteur, 'aut_nom='.sql_quote($set['nom']));
|
||||
// on recalcul la session
|
||||
$Tauteurs = sql_allfetsel('*', 'spip_auteurs', 'aut_nom='.sql_quote($set['nom']));
|
||||
foreach ($Tauteurs as $auteur) {
|
||||
actualiser_sessions($auteur);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$retour['message_ok'] = _T("auted:enregistrement_valide");
|
||||
}
|
||||
include_spip('inc/invalideur');
|
||||
suivre_invalideur("id='id_aut_modele/$id'");
|
||||
|
||||
|
||||
if ($redirect) {
|
||||
$retour['redirect'] = $redirect;
|
||||
}
|
||||
|
||||
return $retour;
|
||||
}
|
After Width: | Height: | Size: 744 B |
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
viewBox="0 0 223.55353 226.505"
|
||||
overflow="visible"
|
||||
enable-background="new 0 0 248.625 243.527"
|
||||
xml:space="preserve"
|
||||
x="0px"
|
||||
y="0px"
|
||||
id="boss"
|
||||
>
|
||||
|
||||
<metadata
|
||||
id="metadata28"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs26" /><g
|
||||
id="g847"><g
|
||||
id="g861"><g
|
||||
id="g4"
|
||||
style="fill:#c91869;fill-opacity:1"
|
||||
transform="translate(-11.571245,-5.608)"><path
|
||||
d="M 77.193,22.826 C 73.463,16.431 62.715,5.608 46.088,5.608 25.341,5.608 11.576,28.225 11.576,43.185 l -0.003,0.816 c -0.288,50.836 34.925,76.727 64.515,89.495 v 0 c 5.071,2.188 10.956,-0.148 13.144,-5.22 2.188,-5.072 -0.149,-10.956 -5.22,-13.144 v 0 C 49.034,100.039 31.391,76.145 31.573,44.113 l 0.003,-0.93 c 0,-5.097 6.281,-17.577 14.512,-17.577 9.314,0 13.785,7.22 13.828,7.293 v 0 c 2.782,4.771 8.905,6.383 13.676,3.601 4.771,-2.782 6.383,-8.903 3.601,-13.674 z"
|
||||
id="path2"
|
||||
style="fill:#c91869;fill-opacity:1" /></g><g
|
||||
id="g8"
|
||||
style="fill:#c91869;fill-opacity:1"
|
||||
transform="translate(-11.571245,-5.608)"><path
|
||||
d="m 186.777,34.901 c -0.049,0.083 -0.073,0.124 -0.074,0.124 0.189,-0.303 4.742,-7.417 13.902,-7.417 8.232,0 14.514,12.48 14.514,17.577 l 0.004,0.93 c 0.182,32.032 -17.463,55.926 -52.442,71.019 v 0 c -5.07,2.188 -7.408,8.072 -5.22,13.144 2.188,5.07 8.072,7.408 13.144,5.22 v 0 c 29.592,-12.769 64.807,-38.659 64.518,-89.495 l -0.003,-0.816 c 0,-14.96 -13.766,-37.577 -34.514,-37.577 -16.629,0 -27.376,10.823 -31.105,17.219 v 0 c -2.782,4.771 -1.17,10.894 3.602,13.676 4.769,2.78 10.892,1.167 13.674,-3.604 z"
|
||||
id="path6"
|
||||
style="fill:#c91869;fill-opacity:1" /></g><path
|
||||
d="m 169.38076,124.951 c 0,0 -42.522,31.19431 -42.522,65.79038 H 97.050755 c 0,-29.26087 -38.417,-65.46336 -38.417,-65.46336"
|
||||
id="path10"
|
||||
style="fill:#c91869;fill-opacity:1;stroke-width:1.14143" /><path
|
||||
d="M 48.028755,4.892 V 79.45 c 0,0 -4.083,69.963 69.962005,69.963 0,0 59.75,-4.991 59.75,-69.963 V 4.892 Z"
|
||||
id="path12"
|
||||
style="fill:#c91869;fill-opacity:1" /><g
|
||||
id="g16"
|
||||
style="fill:#c91869;fill-opacity:1"
|
||||
transform="translate(-11.571245,-5.608)"><path
|
||||
d="m 82.042,203.364 c 3.003,-4.407 9.825,-8.014 15.158,-8.014 h 53.674 c 5.334,0 12.153,3.604 15.159,8.014 l 3.693,5.414 c 3.004,4.41 5.461,11.462 5.461,15.675 0,4.216 -4.365,7.66 -9.699,7.66 H 82.585 c -5.333,0 -9.697,-3.446 -9.697,-7.66 0,-4.212 2.457,-11.265 5.461,-15.675 z"
|
||||
id="path14"
|
||||
style="fill:#c91869;fill-opacity:1" /></g></g></g></svg>
|
After Width: | Height: | Size: 3.0 KiB |
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="modele"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 100 100"
|
||||
viewBox="0 0 90 74"
|
||||
y="0px"
|
||||
x="0px"
|
||||
version="1.1"><metadata
|
||||
id="metadata917"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs915" /><path
|
||||
id="path905"
|
||||
d="m 71.5,44 v -8.5 h -24 V 30.999 H 62 c 3.3,0 6,-2.7 6,-6 V 0 H 22 v 24.999 c 0,3.3 2.699,6 6,6 H 42.5 V 35.5 h -24 V 44 H 0 v 24 c 0,3.3 2.699,6 6,6 h 30 c 3.3,0 6,-2.7 6,-6 V 44 H 23.5 v -3.5 h 43 V 44 H 48 v 24 c 0,3.3 2.699,6 6,6 h 30 c 3.3,0 6,-2.7 6,-6 V 44 Z M 29,10 H 61 V 23.999 H 29 Z m 6,57 H 7 V 54 h 28 z m 48,0 H 55 V 54 h 28 z" /></svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
inkscape:version="1.1-dev (6c977cb37d, 2020-02-03)"
|
||||
sodipodi:docname="save.svg"
|
||||
id="save"
|
||||
clip-rule="evenodd"
|
||||
fill-rule="evenodd"
|
||||
y="0px"
|
||||
x="0px"
|
||||
viewBox="0 0 290 316"
|
||||
style="image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision"
|
||||
version="1.1"
|
||||
xml:space="preserve"><metadata
|
||||
id="metadata933"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview
|
||||
inkscape:current-layer="svg929"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-y="20"
|
||||
inkscape:window-x="0"
|
||||
inkscape:cy="205.65035"
|
||||
inkscape:cx="146.2519"
|
||||
inkscape:zoom="1.5607595"
|
||||
showgrid="false"
|
||||
id="namedview931"
|
||||
inkscape:window-height="1416"
|
||||
inkscape:window-width="2556"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0"
|
||||
guidetolerance="10"
|
||||
gridtolerance="10"
|
||||
objecttolerance="10"
|
||||
borderopacity="1"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff" /><defs
|
||||
id="defs915"><style
|
||||
id="style913"
|
||||
type="text/css">
|
||||
|
||||
.fil0 {fill:black;fill-rule:nonzero}
|
||||
|
||||
</style></defs><path
|
||||
class="fil0"
|
||||
d="M 60,296 V 181 c 0,-6 5,-10 10,-10 h 150 c 5,0 10,5 10,10 v 115 h 27 c 8,0 13,-8 13,-15 V 96 L 201,20 h -7 v 64 c 0,5 -5,10 -10,10 H 71 C 65,94 60,89 60,84 V 20 H 33 c -8,0 -13,8 -13,15 v 246 c 0,7 5,15 13,15 z m 150,0 V 191 H 80 V 296 Z M 33,0 c 57,0 115,0 172,0 3,0 6,1 8,4 l 74,81 c 2,2 3,5 3,7 v 189 c 0,18 -14,35 -33,35 H 33 C 14,316 0,299 0,281 V 35 C 0,17 14,0 33,0 Z M 174,20 H 80 v 54 h 94 z"
|
||||
id="path917"
|
||||
inkscape:connector-curvature="0" /></svg>
|
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="toggle"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 100 100"
|
||||
viewBox="0 0 87.833 50.546001"
|
||||
y="0px"
|
||||
x="0px"
|
||||
version="1.1"><metadata
|
||||
id="metadata1082"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs1080" /><g
|
||||
transform="translate(-6.083,-24.727)"
|
||||
id="g1070"><path
|
||||
id="path1066"
|
||||
d="M 69.802,24.727 H 30.197 C 16.901,24.727 6.083,36.064 6.083,50 c 0,13.936 10.818,25.273 24.114,25.273 H 69.801 C 83.097,75.273 93.916,63.935 93.916,50 93.917,36.064 83.098,24.727 69.802,24.727 Z m 0,46.868 H 30.197 C 18.929,71.595 9.762,61.908 9.762,50 c 0,-11.907 9.167,-21.595 20.436,-21.595 h 39.604 c 11.269,0 20.437,9.688 20.437,21.595 -0.001,11.908 -9.169,21.595 -20.437,21.595 z" /><circle
|
||||
id="circle1068"
|
||||
r="18.622"
|
||||
cy="50"
|
||||
cx="32.073002" /></g></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="trash"
|
||||
y="0px"
|
||||
x="0px"
|
||||
xml:space="preserve"
|
||||
viewBox="0 0 90.833803 104.65872"
|
||||
version="1.1"><metadata
|
||||
id="metadata16"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs14" /><path
|
||||
id="path2"
|
||||
stroke="none"
|
||||
d="M 0,8.2802661 H 31.823467 V 0 h 27.186857 v 8.2802661 c 11.01016,0 20.813316,0 31.823476,0 V 20.810692 H 0 Z" /><path
|
||||
id="path4"
|
||||
fill-opacity="1"
|
||||
d="m 8.308722,26.122633 h 75.75356 L 75.057706,104.65871 H 17.313298 M 30.504624,38.259644 19.655415,49.108853 34.289899,63.743347 19.512566,78.520671 30.361785,89.369891 45.139119,74.592557 59.746341,89.199779 70.609813,78.364822 56.761318,64.304397 71.197342,49.868383 60.348123,39.019163 45.912108,53.455178" /></svg>
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="unlock"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 100 100"
|
||||
viewBox="0 0 90 83.930435"
|
||||
y="0px"
|
||||
x="0px"
|
||||
version="1.1"><metadata
|
||||
id="metadata14"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs12" /><path
|
||||
id="path2"
|
||||
d="m 83.174698,6.8448817 -0.01023,-0.0096 -0.0096,-0.01001 C 78.928108,2.6054127 73.112442,0 66.704613,0 60.296784,0 54.48156,2.6054127 50.25433,6.8252997 l -0.0091,0.01001 -0.01046,0.0096 C 46.015972,11.071668 43.409447,16.887336 43.409447,23.295165 V 41.578458 H 4.2345743 C 1.9062147,41.578458 0,43.484228 0,45.812585 V 79.69608 c 0,2.330361 1.9062147,4.234352 4.2345743,4.234352 H 57.175988 c 2.328133,0 4.233902,-1.903991 4.233902,-4.234352 V 45.812585 c 0,-2.328358 -1.905769,-4.234127 -4.233902,-4.234127 H 53.998887 V 23.295165 c 0,-3.526476 1.415978,-6.703575 3.698715,-8.986315 l 0.02092,-0.01958 c 2.282959,-2.284298 5.459839,-3.700051 8.986092,-3.700051 3.526474,0 6.703575,1.415753 8.986313,3.700051 l 0.0207,0.01958 c 2.28318,2.28274 3.698937,5.459839 3.698937,8.986315 h 0.02292 l -0.0033,7.080317 c 0,6.960376 10.54493,6.962601 10.54493,0 l 0.0022,-7.080317 H 90 C 90,16.887336 87.393478,11.071668 83.174698,6.8448817 Z M 34.149418,67.676419 c 0,4.739724 -6.889389,4.739724 -6.889389,0 v -9.843063 c 0,-4.739723 6.889389,-4.739723 6.889389,0 z"
|
||||
clip-rule="evenodd"
|
||||
fill-rule="evenodd" /></svg>
|
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function tester_autorisation($faire, $type, $qui, $secret = true) {
|
||||
include_spip('inc/autoriser');
|
||||
if (autoriser('webmestre', null, null, $qui, null)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($secret) {
|
||||
if ($qui['boss'] === "oui") {
|
||||
return true;
|
||||
}
|
||||
if (pipeline('super_autorisation',$qui)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$Tauts = [];
|
||||
if (!empty($qui['autorisations'])) {
|
||||
$Tauts = json_decode($qui['autorisations'],true);
|
||||
}
|
||||
|
||||
if (array_key_exists($type, $Tauts)) {
|
||||
if (in_array($faire, $Tauts[$type])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
#SET{name,aut_#ENV{type}}
|
||||
<select id="#GET{name}"
|
||||
[(#ENV{disabled}|oui) disabled]
|
||||
name="id-#ID_AUTEUR[][#ENV{type}]"
|
||||
class="select select_autorisation chosen"
|
||||
multiple>
|
||||
<option value=""></option>
|
||||
<BOUCLE_choix(DATA){source tableau,#ENV{faire}}>
|
||||
<option value="#VALEUR" [(#VALEUR|in_array{#ENV{autorisations,#ARRAY}}|oui) selected]
|
||||
>[(#VALEUR|majuscules)]</option>
|
||||
</BOUCLE_choix>
|
||||
</select>
|
@ -0,0 +1,9 @@
|
||||
[(#AUTORISER{modifier,autmodele}|sinon_interdire_acces)]
|
||||
<div class="inner edition_modeles_autorisation">
|
||||
<h1><:auted:editer_modeles_autorisations:></h1>
|
||||
|
||||
<div class="">
|
||||
[(#FORMULAIRE_EDITER_MODELES_AUTORISATION{#SELF})]
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// This is a SPIP language file -- Ceci est un fichier langue de SPIP
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$GLOBALS[$GLOBALS['idx_lang']] = array(
|
||||
|
||||
// A
|
||||
'auted_titre' => 'Autorisations étendues',
|
||||
'associer_modele' => 'Associer un modèle',
|
||||
'ajouter_un_modele' => "Ajouter un modèle",
|
||||
'auteurs' => 'Auteurs',
|
||||
|
||||
// C
|
||||
'confirmer_dissocier_modele' => 'Confirmez-vous la dissociation de ce modèle ?',
|
||||
'charger_un_modele_pour' => 'Charger un modèle pour',
|
||||
|
||||
// D
|
||||
'dissocier_modele' => 'Dissocier ce modèle',
|
||||
|
||||
// E
|
||||
'editer_modeles_autorisations' => 'Editer les modèles d\'autorisations',
|
||||
'enregistrement_impossible' => 'Enregistrement impossible',
|
||||
'enregistrement_valide' => 'Enregistrement validé',
|
||||
|
||||
//M
|
||||
'modele' => 'Modèle',
|
||||
'modeles' => 'Modèles',
|
||||
|
||||
// T
|
||||
'titre_page_configurer_auted' => 'Autorisations étendues',
|
||||
|
||||
//V
|
||||
'valider' => 'Valider',
|
||||
);
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// This is a SPIP language file -- Ceci est un fichier langue de SPIP
|
||||
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$GLOBALS[$GLOBALS['idx_lang']] = array(
|
||||
|
||||
// A
|
||||
'auted_description' => '',
|
||||
'auted_nom' => 'Autorisations étendues',
|
||||
'auted_slogan' => '',
|
||||
);
|
@ -0,0 +1,28 @@
|
||||
<paquet
|
||||
prefix="auted"
|
||||
categorie="outil"
|
||||
version="1.1.0"
|
||||
etat="dev"
|
||||
compatibilite="[3.2.0-dev;3.3.*]"
|
||||
logo="prive/themes/spip/images/auted-64.png"
|
||||
documentation=""
|
||||
schema="1.0.5"
|
||||
>
|
||||
|
||||
<nom>Autorisations étendues</nom>
|
||||
|
||||
<auteur lien='https://gamuza.fr'>tofulm</auteur>
|
||||
|
||||
<licence>GNU/GPL</licence>
|
||||
|
||||
<utilise nom="chosen" compatibilite="[1.8.0;]" />
|
||||
|
||||
<pipeline nom="autoriser" inclure="auted_autorisations.php" />
|
||||
|
||||
<pipeline nom="declarer_tables_objets_sql" inclure="base/auted.php" />
|
||||
<pipeline nom="declarer_tables_interfaces" inclure="base/auted.php" />
|
||||
<pipeline nom="declarer_tables_principales" inclure="base/auted.php" />
|
||||
<pipeline nom="insert_head_css" inclure="auted_pipelines.php" />
|
||||
<pipeline nom="optimiser_base_disparus" inclure="auted_pipelines.php" />
|
||||
|
||||
</paquet>
|
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 599 B |
After Width: | Height: | Size: 833 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 833 B |
After Width: | Height: | Size: 1.4 KiB |