Merge branch 'zentaopms_9.8' of https://github.com/easysoft/zentaopms into zentaopms_9.8

This commit is contained in:
wumo
2018-03-14 15:24:29 +08:00
2 changed files with 6 additions and 14 deletions
+6 -11
View File
@@ -56,26 +56,21 @@ class mail extends control
* @access public
* @return void
*/
public function detect($type = 'smtp')
public function detect()
{
if($_POST or $type == 'gmail')
if($_POST)
{
set_time_limit(30);
if($type != 'gmail')
{
$error = '';
if($this->post->fromAddress == false) $error = sprintf($this->lang->error->notempty, $this->lang->mail->fromAddress);
if(!validater::checkEmail($this->post->fromAddress)) $error .= '\n' . sprintf($this->lang->error->email, $this->lang->mail->fromAddress);
$error = '';
if($this->post->fromAddress == false) $error = sprintf($this->lang->error->notempty, $this->lang->mail->fromAddress);
if(!validater::checkEmail($this->post->fromAddress)) $error .= '\n' . sprintf($this->lang->error->email, $this->lang->mail->fromAddress);
if($error) die(js::alert($error));
}
if($type == 'gmail' and empty($_POST['fromAddress'])) $_POST['fromAddress'] = '@gmail.com';
if($error) die(js::alert($error));
echo "<script>setTimeout(function(){parent.location.href='" . inlink('edit') . "'}, 10000)</script>";
$mailConfig = $this->mail->autoDetect($this->post->fromAddress);
$mailConfig->fromAddress = $this->post->fromAddress;
$mailConfig->domain = common::getSysURL();
if($type == 'gmail') $mailConfig->fromAddress = '';
$this->session->set('mailConfig', $mailConfig);
die(js::locate(inlink('edit'), 'parent'));
-3
View File
@@ -24,9 +24,6 @@
<?php if($this->app->getClientLang() != 'en' and common::hasPriv('mail', 'ztCloud')):?>
<?php echo html::a(inlink('ztCloud'), $lang->mail->ztCloud, '', "class='btn btn-sm w-120px'")?>
<?php endif;?>
<?php if($this->app->getClientLang() == 'en'):?>
<?php echo html::a(inlink('detect', 'type=gmail'), $lang->mail->gmail, '', "class='btn btn-sm w-120px'")?>
<?php endif;?>
<?php if(common::hasPriv('mail', 'detect')):?>
<?php echo html::a(inlink('detect'), $lang->mail->smtp, '', "class='btn btn-sm w-120px'")?>
<?php endif;?>