/var/www/vhosts/ihelp.ro/httpdocs/src/Controller
Edit: /var/www/vhosts/ihelp.ro/httpdocs/src/Controller/PagesController.php (2317B)
Authentication->addUnauthenticatedActions([
'home',
'contact',
'gdpr',
'utils',
'cineSuntem'
]);
}
/**
* home
*/
public function home()
{
$this->loadModel('Sponsors');
$this->loadModel('Banners');
$sponsors = $this->Sponsors->find()
->contain('SponsorsActivities')
->all();
$banners = $this->Banners->find()
->order(['position' => 'ASC'])
->all();
$orderedItems = [];
foreach ($banners as $banner) {
$orderedItems[$banner->position][] = $banner;
}
$this->set(compact('sponsors', 'orderedItems'));
}
/**
* contact
*/
public function contact()
{
$contact = new ContactForm();
if ($this->request->is('post')) {
if ($contact->execute($this->request->getData())) {
$this->Flash->success(__('Mesajul a fost trimis'));
$this->redirect($this->referer());
} else {
$this->Flash->error('Mesajul nu a fost trimis');
}
}
$this->set(compact('contact'));
}
/**
* utils
*/
public function utils($slug)
{
$this->render($slug);
}
/**
* gdpr
*/
public function gdpr()
{
if (!empty($this->userAuth->id)) {
$showFormGdpr = null;
$uuidUser = $this->userAuth->uuid;
$this->loadModel('Users');
$statusGdpr = $this->Users->find()
->where(['Users.id' => $this->userAuth->id, 'Users.gdpr_active' => false])
->first();
if (!empty($statusGdpr)) {
$showFormGdpr = true;
}
$this->set(compact('showFormGdpr', 'uuidUser'));
}
}
public function cineSuntem()
{
}
}