commit | author | age
|
3e083b
|
1 |
<?php |
B |
2 |
|
|
3 |
/** |
|
4 |
* ajax |
|
5 |
*/ |
|
6 |
|
|
7 |
define('IN_ECS', true); |
|
8 |
|
|
9 |
require(dirname(__FILE__) . '/includes/init.php'); |
|
10 |
|
|
11 |
if ($_REQUEST['act'] == 'tipemail') |
|
12 |
{ |
|
13 |
require(ROOT_PATH . 'includes/cls_json.php'); |
|
14 |
$word_com = json_str_iconv($_REQUEST['word']); |
|
15 |
$json_com = new JSON; |
|
16 |
$result_com = array('error' => 0, 'message' => '', 'content' => ''); |
|
17 |
|
|
18 |
if(!$word_com || strlen($word_com) > 30) |
|
19 |
{ |
|
20 |
$result_com['error'] = 1; |
|
21 |
die($json_com->encode($result_com)); |
|
22 |
} |
|
23 |
$word_com = str_replace(array(' ','*', "\'"), array('', '', ''), $word_com); |
|
24 |
|
|
25 |
$email_name_arr = explode("@", $word_com); |
|
26 |
$email_name = $email_name_arr[0]; |
|
27 |
|
|
28 |
$_CFG['email_domain'] =str_replace(" ", "",$_CFG['email_domain']); |
|
29 |
$email_domain_arr = explode(",", str_replace(",",",",$_CFG['email_domain'])); |
|
30 |
|
|
31 |
$logdb=array(); |
|
32 |
foreach($email_domain_arr AS $key=>$edomain) |
|
33 |
{ |
|
34 |
$email_domain_arr[$key] = $email_name.'@'.$edomain; |
|
35 |
} |
|
36 |
|
|
37 |
foreach($email_domain_arr AS $email_domain) |
|
38 |
{ |
|
39 |
if (stristr($email_domain, $word_com)) |
|
40 |
{ |
|
41 |
$logdb[] = $email_domain; |
|
42 |
} |
|
43 |
} |
|
44 |
$smarty->assign('logdb', $logdb); |
|
45 |
|
|
46 |
if(count($logdb)==0) |
|
47 |
{ |
|
48 |
$result_com['content'] = ''; |
|
49 |
} |
|
50 |
else |
|
51 |
{ |
|
52 |
$result_com['content'] = $smarty->fetch('library/email_tip.lbi'); |
|
53 |
} |
|
54 |
|
|
55 |
|
|
56 |
die($json_com->encode($result_com)); |
|
57 |
} |
|
58 |
?> |