From 408f5588ab472e4f0dcf9b22ee7abc4d8d3ddab2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 4 Aug 2014 01:38:14 +0000 Subject: [PATCH] * adjust code for task #1967. --- module/mail/control.php | 18 ++++++++++++++++++ module/mail/model.php | 3 --- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/module/mail/control.php b/module/mail/control.php index 64eab60237..8f9955127c 100755 --- a/module/mail/control.php +++ b/module/mail/control.php @@ -11,6 +11,24 @@ */ class mail extends control { + /** + * Construct. + * + * @access public + * @return void + */ + public function __construct() + { + parent::__construct(); + + /* Task #1967. check the function of fsocket. */ + if(!function_exists('fsockopen')) + { + echo js::alert($this->lang->mail->nofsocket); + die(js::locate('back')); + } + } + /** * The index page, goto edit page or detect page. * diff --git a/module/mail/model.php b/module/mail/model.php index 7d0f7e3cea..77d6ce94ed 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -243,9 +243,6 @@ class mailModel extends model { if(!$this->config->mail->turnon) return; - /* Task #1967. check the function of fsocket. */ - if(function_exists('fsockopen')) die(js::alert($this->lang->mail->nofsocket)); - ob_start(); $toList = $toList ? explode(',', str_replace(' ', '', $toList)) : array(); $ccList = $ccList ? explode(',', str_replace(' ', '', $ccList)) : array();