From 5744a32e0f7458eca1a6ac1a2e337240d8f2fc16 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 14 Mar 2018 15:21:41 +0800 Subject: [PATCH] * finish task #3713. --- module/mail/control.php | 17 ++++++----------- module/mail/view/index.html.php | 3 --- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/module/mail/control.php b/module/mail/control.php index a43cb603a1..805d007390 100755 --- a/module/mail/control.php +++ b/module/mail/control.php @@ -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 ""; $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')); diff --git a/module/mail/view/index.html.php b/module/mail/view/index.html.php index dc68624ab7..00c8055199 100755 --- a/module/mail/view/index.html.php +++ b/module/mail/view/index.html.php @@ -24,9 +24,6 @@ app->getClientLang() != 'en' and common::hasPriv('mail', 'ztCloud')):?> mail->ztCloud, '', "class='btn btn-sm w-120px'")?> - app->getClientLang() == 'en'):?> - mail->gmail, '', "class='btn btn-sm w-120px'")?> - mail->smtp, '', "class='btn btn-sm w-120px'")?>