Add license management functionality and privacy policy banner

Introduced forms, controller, and model for license management in v1 API, enabling users to interact with license-related resources. Updated ACL to include permissions for licenses and global configuration for IPs and site settings. Added a fixed banner for the privacy and cookie policy to improve compliance with user consent requirements.
This commit is contained in:
2025-04-17 10:45:32 +02:00
parent b37be9f3b9
commit 94507eb91c
6 changed files with 158 additions and 4 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
ip_master = ""
ip_alternativo = "185.31.65.102"
ip_master = "79.9.179.236"
ip_alternativo = "195.32.92.242,212.43.120.241,93.41.96.27"
email_mittente = "info@adriaticasistemi.it"
email_mittente_nome = "Adriatica Sistemi"
email_primo_contatto = "info@adriaticasistemi.it"
@@ -7,7 +7,7 @@ default_footer_email = "Inserisci qui il footer che comparirà sotto alle email
puoi utilizzare %default_NomeSito% per inserire il nome del sito"
email_contatto_template = "CONTATTO"
test_email = "sviluppoweb@winfatt.com"
interrutore_sito = "off"
interrutore_sito = "on"
interrutore_webservices_v1 = "on"
interrutore_services = "on"
interrutore_testdb = "off"
+56
View File
@@ -0,0 +1,56 @@
<?php
class Application_Form_V1_Licenze_Add extends Zend_Form
{
public function init()
{
$this->addElement('text', 'IdentificativoDB',
array(
'filters' => array('StringTrim'),
'required' => true
)
);
$this->addElement('text', 'RagioneSociale',
array(
'filters' => array('StringTrim'),
)
);
$this->addElement('text', 'PartitaIva',
array(
'filters' => array('StringTrim'),
)
);
$this->addElement('text', 'CodiceFiscale',
array(
'filters' => array('StringTrim'),
)
);
$this->addElement('text', 'Chiave',
array(
'filters' => array('StringTrim'),
'required' => true
)
);
$this->addElement('text', 'IdentificativoPC',
array(
'filters' => array('StringTrim'),
)
);
$this->addElement('text', 'Versione',
array(
'filters' => array('StringTrim'),
)
);
}
}
@@ -0,0 +1,60 @@
<style>
/** PRIVACY POLICY **/
.privacy_pol {
background-color: #F4C058;
color: #FFFFFF;
bottom: 0;
height: auto;
padding: 8px 25px;
position: fixed;
width: 100%;
z-index: 1000;
}
.privacy_pol a {
color: #FFFFFF;
text-decoration: underline;
}
.privacy_pol a#accept_cookie_policy {
max-width: 250px;
margin-left: 10px;
font-weight: 600;
}
.privacy_pol a.btn {
border: 1px solid #FFF;
border-radius: 0;
text-decoration: none;
}
.privacy_pol a.btn:hover {
background-color: #FFF;
color: #F4C058;
text-decoration: none;
}
</style>
<div class="privacy_pol">
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
Questo sito o gli strumenti terzi da questo utilizzati si avvalgono di cookie necessari al funzionamento
ed utili alle finalità illustrate nella <a href="<?= $this->url(array('action'=>'privacy'),'it',true); ?>"
target="_blank">privacy policy</a> e <a href="<?= $this->url(array('action'=>'cookiepolicy'),'it',true); ?>"
target="_blank">cookie policy</a>
<a id="accept_cookie_policy" class="btn btn-sm"><i class="fa fa-check fa-fw"></i> Ok,acconsento</a>
</div>
</div>
</div>
<script type="text/javascript">
$('#accept_cookie_policy').click(function (link) {
link.preventDefault();
var d = new Date();
d.setTime(d.getTime() + (5 * 24 * 60 * 60 * 1000));
var expires = "expires=" + d.toUTCString();
document.cookie = "displayCookiePolicy=false; " + expires + "; path=/";
$('.privacy_pol').slideUp();
});
</script>
+13
View File
@@ -0,0 +1,13 @@
<?php
class Application_Model_Resources_Licenze extends App_Model_Resource_Abstract {
protected $_name = 'licenze';
protected $_primary = 'id';
protected $_defaultOrder = 'id';
protected $_defaultTipoOrder = 'ASC';
/************** METODI SPECIALIZZATI *******************/
}
@@ -0,0 +1,24 @@
<?php
class V1_LicenzeController extends App_Controller_Rest_Controller
{
public function init()
{
$this->_resourceName = 'Licenze';
parent::init();
}
//-----------------------------------------------
public function switchMethodFunction($method)
{
switch ($method) {
default:
$this->defaultGetList();
break;
}
}
}//END CLASS
+2 -1
View File
@@ -19,7 +19,8 @@ class App_Model_Acl_AclRestV1 extends Zend_Acl
// ACL for user
$this->addRole(new Zend_Acl_Role('user'), 'unregistered')
->add(new Zend_Acl_Resource('emails'))
->allow('user', array('emails'));
->add(new Zend_Acl_Resource('licenze'))
->allow('user', array('emails','licenze'));
// ACL for administrator
$this->addRole(new Zend_Acl_Role('admin'), 'user')