44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
include_once __DIR__.'/../../core.php';
|
||
|
|
||
|
switch (post('op')) {
|
||
|
case 'add':
|
||
|
$dbo->insert('zz_smtp', [
|
||
|
'name' => $post['name'],
|
||
|
'from_name' => $post['from_name'],
|
||
|
'from_address' => $post['from_address'],
|
||
|
]);
|
||
|
|
||
|
$id_record = $dbo->last_inserted_id();
|
||
|
|
||
|
$_SESSION['infos'][] = tr('Nuovo account email aggiunto!');
|
||
|
|
||
|
break;
|
||
|
|
||
|
case 'update':
|
||
|
$dbo->update('zz_smtp', [
|
||
|
'name' => $post['name'],
|
||
|
'note' => $post['note'],
|
||
|
'server' => $post['server'],
|
||
|
'port' => $post['port'],
|
||
|
'username' => $post['username'],
|
||
|
'password' => $post['password'],
|
||
|
'from_name' => $post['from_name'],
|
||
|
'from_address' => $post['from_address'],
|
||
|
'encryption' => $post['encryption'],
|
||
|
'pec' => $post['pec'],
|
||
|
], ['id' => $id_record]);
|
||
|
|
||
|
$_SESSION['infos'][] = tr('Informazioni salvate correttamente!');
|
||
|
|
||
|
break;
|
||
|
|
||
|
case 'delete':
|
||
|
$dbo->query('UPDATE zz_smtp SET deleted = 1 WHERE id='.prepare($id_record));
|
||
|
|
||
|
$_SESSION['infos'][] = tr('Account email eliminato!');
|
||
|
|
||
|
break;
|
||
|
}
|