| Server IP : 103.161.17.216 / Your IP : 216.73.216.1 Web Server : nginx/1.18.0 System : Linux tipsysaigoncharming 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/app.houseland.info/application/controllers/ |
Upload File : |
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Consent extends ClientsController
{
public function index()
{
show_404();
}
public function contact($key = '')
{
if (!$key) {
show_404();
}
if (is_gdpr() && get_option('gdpr_enable_consent_for_contacts') == '0' || !is_gdpr()) {
show_error('This page is currently disabled, check back later.');
}
$this->db->where('meta_value', $key);
$this->db->where('meta_key', 'consent_key');
$meta = $this->db->get(db_prefix() . 'user_meta')->row();
if (!$meta) {
show_404();
}
$contact = $this->clients_model->get_contact($meta->contact_id);
if (!$contact) {
show_404();
}
$this->load->model('gdpr_model');
if ($this->input->post()) {
foreach ($this->input->post('action') as $purpose_id => $action) {
$purpose = $this->gdpr_model->get_consent_purpose($purpose_id);
if ($purpose) {
$this->gdpr_model->add_consent([
'action' => $action,
'purpose_id' => $purpose_id,
'contact_id' => $contact->id,
'description' => 'Consent Updated From Web Form',
'opt_in_purpose_description' => $purpose->description,
]);
}
}
redirect(site_url('consent/contact/' . $key));
}
$data['contact'] = $contact;
$data['purposes'] = $this->gdpr_model->get_consent_purposes($contact->id, 'contact');
$data['title'] = _l('gdpr') . ' - ' . $contact->firstname . ' ' . $contact->lastname;
$data['bodyclass'] = 'consent';
$this->data($data);
$this->view('consent');
no_index_customers_area();
$this->disableNavigation();
$this->disableSubMenu();
$this->layout();
}
public function l($hash = '')
{
if (!$hash) {
show_404();
}
if (is_gdpr() && get_option('gdpr_enable_consent_for_leads') == '0' || !is_gdpr()) {
show_error('This page is currently disabled, check back later.');
}
$this->db->where('hash', $hash);
$lead = $this->db->get(db_prefix() . 'leads')->row();
if (!$lead) {
show_404();
}
$this->load->model('gdpr_model');
if ($this->input->post()) {
foreach ($this->input->post('action') as $purpose_id => $action) {
$purpose = $this->gdpr_model->get_consent_purpose($purpose_id);
if ($purpose) {
$this->gdpr_model->add_consent([
'action' => $action,
'purpose_id' => $purpose_id,
'lead_id' => $lead->id,
'description' => 'Consent Updated From Web Form',
'opt_in_purpose_description' => $purpose->description,
]);
}
}
redirect(site_url('consent/l/' . $hash));
}
$data['lead'] = $lead;
$data['purposes'] = $this->gdpr_model->get_consent_purposes($lead->id, 'lead');
$data['title'] = _l('gdpr') . ' - ' . $lead->name;
$data['bodyclass'] = 'consent';
$this->data($data);
$this->view('consent');
no_index_customers_area();
$this->disableNavigation();
$this->disableSubMenu();
$this->layout();
}
}