[-] BO : Customer Service options/sync mailbox not working - #PSFV-539

This commit is contained in:
vAugagneur
2012-02-20 16:24:51 +00:00
parent 12903001cc
commit 5d4ecb4072
4 changed files with 575 additions and 553 deletions
+1 -1
View File
@@ -646,7 +646,7 @@ if (Tools::isSubmit('syncImapMail'))
if (!function_exists('imap_open'))
die('{"hasError" : true, "errors" : ["imap is not installed on this server"]}');
$mbox = @imap_open('{'.$url.':'.$port.(Configuration::get('PS_SAV_IMAP_SSL') ? '/ssl' : '').'}', $user, $password);
$mbox = @imap_open('{'.$url.':'.$port.(Configuration::get('PS_SAV_IMAP_OPT') ? Configuration::get('PS_SAV_IMAP_OPT') : '').'}', $user, $password);
//checks if there is no error when connecting imap server
$errors = imap_errors();
@@ -86,7 +86,13 @@
{/block}
{if $field['type'] == 'select'}
{if $field['list']}
<select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}">
{if $field['select_multiple']}
{assign var="select_name" value="{$key}[]"}
{else}
{assign var="select_name" value="[$key]"}
{/if}
<select name="{$select_name}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if $field['select_multiple']} multiple="multiple"{/if} {if $field['size']} size="{$field['size']}"{/if}>
{foreach $field['list'] AS $k => $option}
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
{/foreach}
@@ -161,21 +161,26 @@ class AdminCustomerThreadsControllerCore extends AdminController
'size' => 40,
'visibility' => Shop::CONTEXT_ALL,
),
'PS_SAV_IMAP_SSL' => array(
'title' => $this->l('Imap use ssl'),
'type' => 'bool',
'PS_SAV_IMAP_OPT' => array(
'title' => $this->l('Imap option'),
'type' => 'select',
'select_multiple' => true,
'size' => 6,
'visibility' => Shop::CONTEXT_ALL,
'identifier' => 'value',
'list' => array(
'0' => array('value' => '/norsh', 'name' => $this->l('Do not use rsh or ssh to establish a preauthenticated IMAP session').' /norsh'),
'1' => array('value' => '/ssl', 'name' => $this->l('Use the Secure Socket Layer to encrypt the session').' /ssl '),
'2' => array('value' => '/validate-cert', 'name' => $this->l('Validate certificates from TLS/SSL server').' /validate-cert'),
'3' => array('value' => '/novalidate-cert', 'name' => $this->l('Do not validate certificates from TLS/SSL server, needed if server uses self-signed certificates').' /novalidate-cert'),
'4' => array('value' => '/tls', 'name' => $this->l('Force use of start-TLS to encrypt the session, and reject connection to servers that do not support it').' /tls'),
'5' => array('value' => '/notls', 'name' => $this->l('do not do start-TLS to encrypt the session, even with servers that support it').' /notls')
),
),
'PS_SAV_IMAP_DELETE_MSG' => array(
'title' => $this->l('Deletes messages'),
'desc' => $this->l('Deletes message after sync. If you do not active this option, the sync will be longer'),
'cast' => 'intval',
'type' => 'select',
'identifier' => 'value',
'list' => array(
'0' => array('value' => 0, 'name' => $this->l('No')),
'1' => array('value' => 1, 'name' => $this->l('Yes')),
),
'type' => 'bool',
'visibility' => Shop::CONTEXT_ALL,
)
),
@@ -380,6 +385,16 @@ class AdminCustomerThreadsControllerCore extends AdminController
$this->errors[] = Tools::displayError('An error occurred, your message was not sent. Please contact your system administrator.');
}
}
/*
if (Tools::isSubmit('submitGeneral'.$this->table))
{
p($_POST);
die('toto');
//PS_SAV_IMAP_OPT
}
*/
return parent::postProcess();
}
@@ -604,5 +619,11 @@ class AdminCustomerThreadsControllerCore extends AdminController
}
}
public function updateOptionPsSavImapOpt($value)
{
if (!$this->errors && $value)
Configuration::updateValue('PS_SAV_IMAP_OPT', implode('', $value));
}
}
+536 -541
View File
File diff suppressed because it is too large Load Diff