Merge branch 'bludit:main' into preview
This commit is contained in:
commit
5285ab78af
6 changed files with 214 additions and 44 deletions
|
@ -224,6 +224,77 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('#btnDeleteUserAndKeepContent').on('click', function() {
|
||||
var username = $('#username').val();
|
||||
logs('Deleting user. Username: ' + username);
|
||||
bootbox.confirm({
|
||||
message: '<?php $L->p('Are you sure you want to delete this user') ?>',
|
||||
buttons: {
|
||||
cancel: {
|
||||
label: '<i class="fa fa-times"></i><?php $L->p('Cancel') ?>',
|
||||
className: 'btn-sm btn-secondary'
|
||||
},
|
||||
confirm: {
|
||||
label: '<i class="fa fa-check"></i><?php $L->p('Confirm') ?>',
|
||||
className: 'btn-sm btn-primary'
|
||||
}
|
||||
},
|
||||
closeButton: false,
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
var args = {
|
||||
username: $('#username').val()
|
||||
};
|
||||
api.deleteUser(args).then(function(response) {
|
||||
if (response.status == 0) {
|
||||
logs('User deleted. Username: ' + response.data.key);
|
||||
window.location.replace(HTML_PATH_ADMIN_ROOT + 'users');
|
||||
} else {
|
||||
logs("An error occurred while trying to disable the user.");
|
||||
showAlertError(response.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#btnDeleteUserAndContent').on('click', function() {
|
||||
var username = $('#username').val();
|
||||
logs('Deleting user and content. Username: ' + username);
|
||||
bootbox.confirm({
|
||||
message: '<?php $L->p('Are you sure you want to delete this user') ?>',
|
||||
buttons: {
|
||||
cancel: {
|
||||
label: '<i class="fa fa-times"></i><?php $L->p('Cancel') ?>',
|
||||
className: 'btn-sm btn-secondary'
|
||||
},
|
||||
confirm: {
|
||||
label: '<i class="fa fa-check"></i><?php $L->p('Confirm') ?>',
|
||||
className: 'btn-sm btn-primary'
|
||||
}
|
||||
},
|
||||
closeButton: false,
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
var args = {
|
||||
username: $('#username').val(),
|
||||
deleteContent: true
|
||||
};
|
||||
api.deleteUser(args).then(function(response) {
|
||||
if (response.status == 0) {
|
||||
logs('User and content deleted. Username: ' + response.data.key);
|
||||
window.location.replace(HTML_PATH_ADMIN_ROOT + 'users');
|
||||
} else {
|
||||
logs("An error occurred while trying to disable the user.");
|
||||
showAlertError(response.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
@ -967,7 +967,7 @@ function deleteUser($args) {
|
|||
$deleteContent = isset($args['deleteContent']) ? $args['deleteContent'] : false;
|
||||
|
||||
// Only administrators can delete users
|
||||
if ($login->role()!=='admin') {
|
||||
if (Session::get('role')!=='admin') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -377,6 +377,32 @@ class API {
|
|||
}
|
||||
}
|
||||
|
||||
/* Delete user
|
||||
@args array Arguments can be any of the fields from an user
|
||||
@return string The username
|
||||
*/
|
||||
async deleteUser(args) {
|
||||
var url = this.apiURL + "users/" + args['username'];
|
||||
var body = Object.assign({}, this.body, args);
|
||||
try {
|
||||
var response = await fetch(url, {
|
||||
credentials: "same-origin",
|
||||
method: "DELETE",
|
||||
body: JSON.stringify(body),
|
||||
headers: new Headers({
|
||||
"Content-Type": "application/json"
|
||||
})
|
||||
});
|
||||
var json = await response.json();
|
||||
return json;
|
||||
} catch (err) {
|
||||
console.log(response);
|
||||
console.log(err);
|
||||
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Install and activate a plugin === Bludit v4
|
||||
|
||||
@args array
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
"language-data": {
|
||||
"native": "Italiano (Italia)",
|
||||
"english-name": "Italian",
|
||||
"last-update": "2019-03-21",
|
||||
"last-update": "2022-04-07",
|
||||
"locale": "it, it_IT"
|
||||
"authors": [
|
||||
"Daniele La Pira https:\/\/github.com\/danielelapira",
|
||||
"Giuseppe Pignataro https:\/\/github.com\/fastbyte01",
|
||||
"",
|
||||
"Giacomo Margarito https:\/\/github.com\/eagleman",
|
||||
""
|
||||
]
|
||||
},
|
||||
|
@ -57,10 +58,12 @@
|
|||
"thanks-for-supporting-bludit": "Grazie di supportare Bludit",
|
||||
"upgrade-to-bludit-pro": "Aggiorna a Bludit PRO",
|
||||
"language": "Lingua",
|
||||
"unlisted": "Non in elenco",
|
||||
"plugin": "Plugin",
|
||||
"plugins": "Plugin",
|
||||
"developers": "Sviluppatori",
|
||||
"themes": "Temi",
|
||||
"theme": "Tema",
|
||||
"about": "Informazioni",
|
||||
"url": "URL",
|
||||
"welcome": "Benvenuto",
|
||||
|
@ -79,7 +82,7 @@
|
|||
"manage-content": "Gestisci contenuto",
|
||||
"add-new-content": "Aggiungi nuovo contenuto",
|
||||
"new-category": "Nuova categoria",
|
||||
"you-do-not-have-sufficient-permissions": "Non hai sufficienti permessi per accedere a questa pagina. Contatta l'amministratore.",
|
||||
"you-do-not-have-sufficient-permissions": "Non hai permessi sufficienti per accedere a questa pagina. Contatta l'amministratore.",
|
||||
"add-a-new-user": "Aggiungi un nuovo utente",
|
||||
"url-associated-with-the-content": "URL associato con il contenuto.",
|
||||
"language-and-timezone": "Lingua e fuso orario",
|
||||
|
@ -98,7 +101,7 @@
|
|||
"save-as-draft": "Salva come bozza",
|
||||
"cancel": "Annulla",
|
||||
"description": "Descrizione",
|
||||
"this-field-can-help-describe-the-content": "Quì puoi descrivere il contenuto in poche parole. Non più di 150 caratteri.",
|
||||
"this-field-can-help-describe-the-content": "Quì puoi descrivere il contenuto in poche parole.",
|
||||
"images": "Immagini",
|
||||
"error": "Errore",
|
||||
"supported-image-file-types": "Formati file immagine supportati",
|
||||
|
@ -120,7 +123,7 @@
|
|||
"empty": "vuoto",
|
||||
"date": "Data",
|
||||
"external-cover-image": "Immagine di copertina esterna",
|
||||
"parent": "Genitore",
|
||||
"parent": "Principale",
|
||||
"full-image-url": "URL immagine completo.",
|
||||
"this-field-is-used-when-you-order-the-content-by-position": "Questo campo è utilizzato quando ordini il contenuto per posizione.",
|
||||
"position": "Posizione",
|
||||
|
@ -141,8 +144,8 @@
|
|||
"site-slogan": "Slogan del sito",
|
||||
"use-this-field-to-add-a-catchy-phrase": "Usa questo campo per aggiungere uno slogan al tuo sito.",
|
||||
"site-description": "Descrizione del sito",
|
||||
"you-can-add-a-site-description-to-provide": "Puoi aggiungere una descrizione del tuo sito e una tua breve biografia.",
|
||||
"footer-text": "Testo pie' di pagina",
|
||||
"you-can-add-a-site-description-to-provide": "Puoi aggiungere una descrizione del tuo sito.",
|
||||
"footer-text": "Testo a pie' di pagina",
|
||||
"you-can-add-a-small-text-on-the-bottom": "Puoi aggiungere un breve testo in fondo ad ogni pagina. Ad es. copyright, autore, date, ecc.",
|
||||
"social-networks-links": "Social Network",
|
||||
"site-url": "URL del sito",
|
||||
|
@ -165,7 +168,7 @@
|
|||
"delete": "Elimina",
|
||||
"password": "Password",
|
||||
"confirm-password": "Conferma Password",
|
||||
"editor": "Editor",
|
||||
"editor": "Editore",
|
||||
"administrator": "Amministratore",
|
||||
"edit-user": "Modifica utente",
|
||||
"edit-content": "Modifica contenuto",
|
||||
|
@ -187,7 +190,7 @@
|
|||
"order-content-by": "Ordina contenuto per",
|
||||
"edit-or-delete-content-from-your-site": "Modifica o elimina il contenuto dal tuo sito",
|
||||
"order-the-content-by-date-to-build-a-blog": "Ordina il contenuto per data per creare un blog o ordina il contenuto per posizione per creare un sito web.",
|
||||
"page-not-found-content": "Hey! sembra che la pagina non esista.",
|
||||
"page-not-found-content": "Ehi! sembra che la pagina non esista.",
|
||||
"page-not-found": "Pagina non trovata",
|
||||
"predefined-pages": "Pagine predefinite",
|
||||
"returning-page-when-the-page-doesnt-exist": "Pagina di ritorno quando la pagina non esiste, lascia vuoto se vuoi che venga visualizzato un messagio predefinito.",
|
||||
|
@ -202,7 +205,7 @@
|
|||
"install": "Installa",
|
||||
"login": "Inizia sessione",
|
||||
"back-to-login-form": "Torna indietro alla pagina di accesso",
|
||||
"get-login-access-code": "Richiedi un codice accesso",
|
||||
"get-login-access-code": "Richiedi un codice di accesso",
|
||||
"email-access-code": "Codice di accesso email",
|
||||
"whats-next": "Passi successivi",
|
||||
"username-or-password-incorrect": "Nome utente o password non corretti",
|
||||
|
@ -256,7 +259,7 @@
|
|||
"default": "Predefinito",
|
||||
"latest-content": "Ultimi contenuti",
|
||||
"default-message": "Messaggio predefinito",
|
||||
"no-parent": "Nessun genitore",
|
||||
"no-parent": "Nessun principale",
|
||||
"have-you-seen-my-ball": "Hai visto la mia palla?",
|
||||
"pagebreak": "Interruzione di pagina",
|
||||
"pages": "Pagine",
|
||||
|
@ -278,22 +281,22 @@
|
|||
"reading-time": "Tempo di lettura",
|
||||
"minutes": "minuti",
|
||||
"minute": "minuto",
|
||||
"example-page-1-slug": "crea-il-tuo-contenuto",
|
||||
"example-page-1-title": "Crea il tuo contentuo",
|
||||
"example-page-1-content": "Inzia a scrivere il tuo contenuto o modifica il contentuo corrente secondo le tue esigenze. Per creare, modificare o rimuovere il contenutodevi effettuare il login al [pannelo di amministrazione](.\/admin) con il nome utente `admin` e la password che hai impostato durante il processo di installazione.",
|
||||
"example-page-2-slug": "imposta-il-tuo-nuovo-sito",
|
||||
"example-page-2-title": "Imposta il tuo nuovo sito",
|
||||
"example-page-2-content": "Aggiorna le impostazioni del tuo sito dal [pannello di amministazione](.\/admin),puoi cambiare il titolo, la descrizione e i social network da [Impostazioni > Generale](.\/admin\/settings).",
|
||||
"example-page-3-slug": "segui-bludit",
|
||||
"example-page-3-title": "Segui Bludit",
|
||||
"example-page-3-content": "Rimani informato sulle notizie, nuovi rilasci, nuovi temi o nuovi plugin sui nostri social network <a href=\"https:\/\/www.facebook.com\/bluditcms\/\" target=\"_blank\">Facebook<\/a>, <a href=\"https:\/\/www.twitter.com\/bludit\/\" target=\"_blank\">Twitter<\/a> e <a href=\"https:\/\/www.youtube.com\/c\/Bluditcms\" target=\"_blank\">YouTube<\/a> o visita il nostro <a href=\"https:\/\/blog.bludit.com\" target=\"_blank\">Blog<\/a>.",
|
||||
"example-page-4-slug": "informazioni su",
|
||||
"example-page-4-title": "Informazioni su",
|
||||
"example-page-4-content": "La tua pagina sulle informazione è tipicamente una delle pagine più visitate sul tuo sito, deve essere semplice con un paio di cose chiave,come il tuo nome, chi sei, come possono contattarti, una piccola storia, ecc.",
|
||||
"the-extension-zip-is-not-installed": "L'estensione zip non è installata, per utilizzare questo plugin hai bisogno di installare l'estensione.",
|
||||
"there-are-no-sticky-pages-at-this-moment": "Non c'è nessuna pagina sticky in questo momento.",
|
||||
"there-are-no-scheduled-pages-at-this-moment": "Non c'è nessuna pagina programmata in questo momento.",
|
||||
"update": "Aggiorna",
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"template": "Template",
|
||||
"nickname": "Nickname",
|
||||
"disable-user": "Disabilita utente",
|
||||
|
@ -305,7 +308,7 @@
|
|||
"extreme-friendly-url": "URL estremamente friendly",
|
||||
"title-formats": "Formati titolo",
|
||||
"delete-content": "Elimina contenuto",
|
||||
"are-you-sure-you-want-to-delete-this-page": "Sei sicuro di voler eliminare questa pagina?",
|
||||
|
||||
"sticky": "Sticky",
|
||||
"actions": "Azioni",
|
||||
"edit": "Modifica",
|
||||
|
@ -328,12 +331,12 @@
|
|||
"uncategorized": "Non categorizzato",
|
||||
"done": "Fatto",
|
||||
"delete-category": "Elimina categoria",
|
||||
"are-you-sure-you-want-to-delete-this-category?": "Sei sicuro di voler eliminare questa categoria?",
|
||||
"confirm-new-password": "Conferma nuova password",
|
||||
"the-nickname-is-almost-used-in-the-themes-to-display-the-author-of-the-content": "Il nickname viene usato nei temi per visualizzare l'autore del contenuto",
|
||||
"allow-unicode": "Permetti Unicode",
|
||||
"allow-unicode-characters-in-the-url-and-some-part-of-the-system": "Permette i caratteri Unicode nell'URL e in alcune parti del sistema.",
|
||||
"variables-allowed": "Variabili permesse",
|
||||
|
||||
|
||||
"tag": "Tag",
|
||||
"drag-and-drop-to-sort-the-plugins": "Sposta e trascina per ordinare i plugin.",
|
||||
"seo": "SEO",
|
||||
|
@ -342,7 +345,7 @@
|
|||
"chat-support": "Chat di supporto",
|
||||
"quick-links": "Link veloci",
|
||||
"leave-empty-for-autocomplete-by-bludit": "Lascia vuoto per autocommpletamento di Bludit.",
|
||||
"choose-a-password-for-the-user-admin": "Scegli una password per l'utente <b>admin<\/b>",
|
||||
"choose-a-password-for-the-user-admin": "Scegli una password per l'utente <code>admin<\/code>",
|
||||
"access-denied": "Accesso negato",
|
||||
"choose-images-to-upload": "Seleziona le immagini da caricare",
|
||||
"insert": "Inserisci",
|
||||
|
@ -377,18 +380,44 @@
|
|||
"thumbnail-quality-in-percentage": "Qualità anteprima in percentuale (%).",
|
||||
"maximum-load-file-size-allowed:": "Grandezza massima da caricare permessa:",
|
||||
"file-type-is-not-supported": "TIpo di file non supportato. Tipi permessi:",
|
||||
"page-content": "Page content",
|
||||
"markdown-parser": "Markdown parser",
|
||||
"site-logo": "Site logo",
|
||||
"search": "Search",
|
||||
"search-plugins": "Search plugins",
|
||||
"enabled-plugins": "Enabled plugins",
|
||||
"disabled-plugins": "Disabled plugins",
|
||||
"remove-logo": "Remove logo",
|
||||
"preview": "Preview",
|
||||
"author-can-write-and-edit-their-own-content": "Author: Can write and edit their own content.</br>Editor: Can write and edit the content of others.",
|
||||
"custom-fields": "Custom fields",
|
||||
"define-custom-fields-for-the-content": "Define custom fields for the content. Learn more about custom fields in the <a href='https:\/\/docs.bludit.com\/en\/content\/custom-fields'>documentation<\/a>.",
|
||||
"start-typing-to-see-a-list-of-suggestions": "Start typing to see a list of suggestions.",
|
||||
"view": "View"
|
||||
"page-content": "Contenuto della pagina",
|
||||
"markdown-parser": "Parser Markdown",
|
||||
"site-logo": "Logo del sito",
|
||||
"search": "Cerca",
|
||||
"search-plugins": "Cerca plugins",
|
||||
"enabled-plugins": "Plugins abilitati",
|
||||
"disabled-plugins": "Plugins disabilitati",
|
||||
"remove-logo": "Rimuovi logo",
|
||||
"preview": "Anteprima",
|
||||
"author-can-write-and-edit-their-own-content": "Autore: può scrivere e modificareil proprio contenuto. Editore: Può scrivere e modificare il contenuto degli altri.",
|
||||
"custom-fields": "Campi personalizzati",
|
||||
"define-custom-fields-for-the-content": "Definisci campi personalizzati per il contenuto. Scopri di più sui campi personalizzati nella <a href='https:\/\/docs.bludit.com\/en\/content\/custom-fields'>documentazione<\/a>.",
|
||||
"start-typing-to-see-a-list-of-suggestions": "Inizia a scrivere per vedere un elenco di suggerimenti.",
|
||||
"view": "Visualizza"
|
||||
"confirm": "Conferma",
|
||||
"current-password": "Password attuale",
|
||||
"are-you-sure-you-want-to-disable-this-user": "Sei sicuro di voler disabilitare questo utente?",
|
||||
"are-you-sure-you-want-to-delete-the-profile-picture": "Sei sicuro di voler eliminare quest'immagine del profilo?",
|
||||
"are-you-sure-you-want-to-delete-the-site-logo": "Sei sicuro di voler eliminare il logo del sito?",
|
||||
"are-you-sure-you-want-to-delete-this-user": "Sei sicuro di voler eliminare questo utente?",
|
||||
"are-you-sure-you-want-to-delete-this-page": "Sei sicuro di voler eliminare questa pagina?",
|
||||
"are-you-sure-you-want-to-delete-this-category?": "Sei sicuro di voler eliminare questa categoria?",
|
||||
"are-you-sure-you-want-to-change-the-password?": "Sei sicuro di voler cambiare la password?",
|
||||
"website-plugins": "Plugin del sito",
|
||||
"dashboard-plugins": "Plugin del Pannello",
|
||||
"powered-by-bludit": "Realizzato con <a href='https:\/\/www.bludit.com'>Bludit</a>",
|
||||
"build-number": "Numero della Build",
|
||||
"disk-usage": "Uso del disco",
|
||||
"standard": "Standard",
|
||||
"insert-file": "Inserisci file",
|
||||
"insert-original-size": "Inserisci dimensione originale",
|
||||
"insert-small-size": "Inserisci dimensione minima",
|
||||
"insert-medium-size": "Inserisci dimensione media",
|
||||
"year": "anno",
|
||||
"month": "mese",
|
||||
"week": "settimana",
|
||||
"day": "giorno",
|
||||
"hour": "ora",
|
||||
"second": "secondo",
|
||||
"parent-page": "Pagina principale"
|
||||
}
|
14
bl-plugins/alternative/languages/it_it.json
Normal file
14
bl-plugins/alternative/languages/it_it.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "Tema Alternative",
|
||||
"description": "Questo plugin fornisce la configurazione per il tema Alternative."
|
||||
},
|
||||
"enable-or-disable-dark-mode": "Abilita o disabilita la modalità scura.",
|
||||
"enable-or-disable-google-fonts": "Abilita o disabilita i caratteri di Google.",
|
||||
"relative": "Relativo",
|
||||
"absolute": "Assoluto",
|
||||
"change-the-date-format-for-the-main-page": "Modifica il formato della data per la pagina principale.",
|
||||
"show-tags": "Visualizza i tag",
|
||||
"show-tags-in-the-main-page-for-each-article": "Visualizza i tag nella pagina principale per ogni articolo."
|
||||
}
|
|
@ -149,8 +149,12 @@ class pluginAPI extends Plugin {
|
|||
// /api/pages/:key
|
||||
// /api/pages/:parent/:key
|
||||
|
||||
// (GET) /api/pages
|
||||
if ( ($method==='GET') && ($parmA==='pages') && empty($parmB) ) {
|
||||
$data = $this->getPages($inputs);
|
||||
}
|
||||
// (GET) /api/pages/files/:key
|
||||
if ( ($method==='GET') && ($parmA==='pages') && ($parmB==='files') && !empty($parmC) ) {
|
||||
elseif ( ($method==='GET') && ($parmA==='pages') && ($parmB==='files') && !empty($parmC) ) {
|
||||
$key = $parmC;
|
||||
if (!empty($parmD)) {
|
||||
$key = $parmC.'/'.$parmD;
|
||||
|
@ -259,6 +263,11 @@ class pluginAPI extends Plugin {
|
|||
elseif ( ($method==='POST') && ($parmA==='users') && empty($parmB) && $writePermissions ) {
|
||||
$data = $this->createUser($inputs);
|
||||
}
|
||||
// (DELETE) /api/users/:key
|
||||
elseif ( ($method==='DELETE') && ($parmA==='users') && !empty($parmB) && $writePermissions ) {
|
||||
$inputs['key'] = $parmB;
|
||||
$data = $this->deleteUser($inputs);
|
||||
}
|
||||
// (POST) /api/users/picture/:username
|
||||
elseif ( ($method==='POST') && ($parmA==='users') && ($parmB==='picture') && !empty($parmC) && $writePermissions ) {
|
||||
$username = $parmC;
|
||||
|
@ -816,6 +825,27 @@ class pluginAPI extends Plugin {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/* Delete user === Bludit v4
|
||||
Referer to the function deleteUser() from functions.php
|
||||
*/
|
||||
private function deleteUser($args)
|
||||
{
|
||||
$key = deleteUser($args);
|
||||
if ($key===false) {
|
||||
return array(
|
||||
'status'=>'1',
|
||||
'message'=>'An error occurred while trying to delete the user.'
|
||||
);
|
||||
}
|
||||
|
||||
return array(
|
||||
'status'=>'0',
|
||||
'message'=>'User deleted.',
|
||||
'data'=>array('key'=>$key)
|
||||
);
|
||||
}
|
||||
|
||||
/* Upload a profile picture === Bludit v4
|
||||
Referer to the function uploadProfilePicture() from functions.php
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue