public function send_mail($email_a_id, $data)
 {
     global $_K, $_lang;
     $md5_code = md5($data['uid'] . $data['username'] . $data['email']);
     $title = $_K['html_title'] . '--' . $_lang['email_auth'];
     $body = '<font color="red">' . $_K['html_title'] . $_lang['__email_auth'] . '</font><br><br>&nbsp;&nbsp;&nbsp;' . $_lang['please_click_email_auth_url'] . '<a href="' . $_K[siteurl] . '/index.php?do=user&view=account&op=auth&code=email&email_a_id=' . $email_a_id . '&ac=check_email&step=step3&ver=1&active_code=' . $md5_code . '">' . $_K[siteurl] . '/index.php?do=user&view=account&op=auth&code=email&email_a_id=' . $email_a_id . '&ac=check_email&step=step3&ver=1&active_code=' . $md5_code . '</a>,如果链接无法点击,请复制以下链接到浏览器中执行' . $_K[siteurl] . '/index.php?do=user&view=account&op=auth&code=email&email_a_id=' . $email_a_id . '&ac=check_email&step=step3&ver=1&active_code=' . $md5_code;
     return kekezu::send_mail($data['email'], $title, $body);
 }
Esempio n. 2
0
 public function sendmail()
 {
     global $_K;
     if (!$this->_email || !$this->_username) {
         $userinfo = kekezu::get_user_info($this->_uid);
         $this->_username = $userinfo['username'];
         $this->_email = $userinfo['email'];
     }
     if (!$this->_email) {
         return false;
     }
     $this->_basicconfig and $basicconfig = $this->_basicconfig or $basicconfig = kekezu::get_config('basic');
     if ($basicconfig['mail_server_cat'] == 'mail') {
         if ($basicconfig['post_account'] && $basicconfig['mail_replay'] && $this->_email && $this->_title && $this->_normal_content) {
             $hearer = "From:{$basicconfig['post_account']}\nReply-To:{$basicconfig['mail_replay']}\nX-Mailer: PHP/" . phpversion() . "\nContent-Type:text/html";
             mail($this->_email, $this->_title, htmlspecialchars_decode($this->_normal_content), $hearer);
         }
     } else {
         if ($basicconfig['smtp_url'] && $basicconfig['mail_server_port'] && $basicconfig['post_account'] && $basicconfig['account_pwd'] && $basicconfig['website_name']) {
             kekezu::send_mail($this->_email, $this->_title, htmlspecialchars_decode($this->_normal_content));
         }
     }
 }
Esempio n. 3
0
    static function send_email_action_user($info = array())
    {
        global $kekezu;
        global $_lang;
        if (!empty($info) && function_exists('fsockopen')) {
            db_factory::execute(sprintf("update %switkey_space set status='3' where uid='%d'", TABLEPRE, $info['uid']));
            $user_info = implode(',', $info);
            $excite_code = md5($user_info);
            $title = $kekezu->_sys_config['website_name'] . '--' . $_lang['activate_the_account'];
            $body = <<<EOT
\t\t\t<font color="red">{$kekezu->_sys_config['website_name']}--{$kekezu->lang('activate_the_account')}</font><br><br>
\t\t\t&nbsp;&nbsp;&nbsp;{$kekezu->lang('welcome_you_register')}{$kekezu->_sys_config['website_name']},{$kekezu->lang('please_onclick_this_address_activate')}
\t\t\t<a href="{$kekezu->_sys_config[website_url]}/index.php?do=activating&excite_code={$excite_code}&excite_uid={$info['uid']}" traget="_blank">
\t\t\t{$kekezu->lang('onclick_activate_account')}
\t\t\t</a>
EOT;
            kekezu::send_mail($info[email], $title, $body);
        }
    }
Esempio n. 4
0
 function auto_mail()
 {
     $path = S_ROOT . "/data/data_cache/auto_mail.php";
     $arr_auto_mail = getfile($path);
     if ($arr_auto_mail['is_open'] == '1') {
         $authlist = trim($arr_auto_mail['authlist'], ",");
         $arrauth = explode(",", $authlist);
         if ($authlist) {
             if (count($arrauth) == 1 or count($arrauth) == 2 && strstr($authlist, "realname")) {
                 $sql = "select uid from " . TABLEPRE . "witkey_auth_record where 1=1";
                 if (strstr($authlist, "realname")) {
                     $sql .= "  and auth_code=('realname' or auth_code='enterprise') and auth_status=1 ";
                 } elseif (strstr($authlist, "bank")) {
                     $sql .= "  and auth_code='bank' and auth_status=1 ";
                 } elseif (strstr($authlist, "email")) {
                     $sql .= "  and auth_code='email' and auth_status=1 ";
                 } else {
                     $sql .= "  and auth_code='mobile' and auth_status=1 ";
                 }
             } else {
                 $sql = "select uid from " . TABLEPRE . "witkey_auth_record where 1=1";
                 if (strstr($authlist, "realname")) {
                     $sql .= " and (auth_code='realname' or auth_code='enterprise') and auth_status=1 ";
                 }
                 if (strstr($authlist, "bank")) {
                     if (strstr($authlist, "enterprise") || strstr($authlist, "realname")) {
                         $sql .= " and uid in (select uid from " . TABLEPRE . "witkey_auth_record where auth_code='bank' and auth_status=1 )";
                     } else {
                         $sql .= "  and auth_code='bank' and auth_status=1 ";
                     }
                 }
                 if (strstr($authlist, "email")) {
                     if (strstr($authlist, "enterprise") || strstr($authlist, "realname") || strstr($authlist, "bank")) {
                         $sql .= " and uid in (select uid from " . TABLEPRE . "witkey_auth_record where auth_code='email' and auth_status=1 )";
                     } else {
                         $sql .= "  and auth_code='email' and auth_status=1 ";
                     }
                 }
                 if (strstr($authlist, "mobile")) {
                     $sql .= " and uid in (select uid from " . TABLEPRE . "witkey_auth_record where auth_code='mobile' and auth_status=1 )";
                 }
             }
             $authArr = db_factory::query($sql);
         }
         $renwulist = trim($arr_auto_mail['renwulist'], ",");
         if ($renwulist) {
             if ($authArr) {
                 foreach ($authArr as $v) {
                     $authstr .= $v['uid'] . ",";
                 }
                 $authstr = trim($authstr, ",");
                 if (strstr($renwulist, "1") && strstr($renwulist, "2")) {
                     $taskstr = "";
                     $taskArr = db_factory::query("select distinct uid from " . TABLEPRE . "witkey_task where uid in ({$authstr})");
                     foreach ($taskArr as $v) {
                         $taskstr .= $v['uid'] . ",";
                     }
                     $taskstr = trim($taskstr, ",");
                     if ($taskstr) {
                         $allArr = db_factory::query("select uid from " . TABLEPRE . "witkey_task_work union select uid from " . TABLEPRE . "witkey_task_bid where uid in ({$taskstr})");
                     }
                 } elseif (strstr($renwulist, "1")) {
                     if ($authstr) {
                         $allArr = db_factory::query("select distinct uid from " . TABLEPRE . "witkey_task where uid in ({$authstr})");
                     }
                 } else {
                     if ($authstr) {
                         $allArr = db_factory::query("select uid from " . TABLEPRE . "witkey_task_work union select uid from " . TABLEPRE . "witkey_task_bid where uid in ({$authstr})");
                     }
                 }
             } else {
                 if (strstr($renwulist, "1") && strstr($renwulist, "2")) {
                     $workstr = "";
                     $workArr = db_factory::query("select uid from " . TABLEPRE . "witkey_task_work union select uid from " . TABLEPRE . "witkey_task_bid");
                     foreach ($workArr as $v) {
                         $workstr .= $v["uid"] . ",";
                     }
                     $workstr = trim($workstr, ",");
                     if ($workstr) {
                         $allArr = db_factory::query("select distinct uid from " . TABLEPRE . "witkey_task where uid in({$workstr})");
                     }
                 } elseif (strstr($renwulist, "1")) {
                     $allArr = db_factory::query("select distinct uid from " . TABLEPRE . "witkey_task");
                 } else {
                     $allArr = db_factory::query("select uid from " . TABLEPRE . "witkey_task_work union select uid from " . TABLEPRE . "witkey_task_bid");
                 }
             }
         }
         $time = time();
         $tiantime = $arr_auto_mail['tian'] * 60 * 60 * 24;
         if ($allArr) {
             $allstr = "";
             foreach ($allArr as $v) {
                 $allstr .= $v['uid'] . ",";
             }
             $allstr = trim($allstr, ",");
             $userInfoArr = db_factory::query("select * from " . TABLEPRE . "witkey_space where {$time}-last_login_time>{$tiantime} and uid in ({$allstr})");
             foreach ($userInfoArr as $v2) {
                 if (!$v2[is_mail]) {
                     if ($v2[email]) {
                         kekezu::send_mail($v2[email], $arr_auto_mail['title'], htmlspecialchars_decode(stripslashes($arr_auto_mail['content'])));
                         db_factory::execute("update " . TABLEPRE . "witkey_space set is_mail=1 where uid=" . intval($v2[uid]));
                     } elseif ($v2[qq]) {
                         kekezu::send_mail($v2[qq], $arr_auto_mail['title'], htmlspecialchars_decode(stripslashes($arr_auto_mail['content'])));
                         db_factory::execute("update " . TABLEPRE . "witkey_space set is_mail=1 where uid=" . intval($v2[uid]));
                     }
                 }
             }
         }
         if (!$allArr && $authlist) {
             foreach ($authArr as $v) {
                 $authstr .= $v['uid'] . ",";
             }
             $authstr = trim($authstr, ",");
             $userInfoArr = db_factory::query("select * from " . TABLEPRE . "witkey_space where {$time}-last_login_time>{$tiantime} and uid in ({$authstr})");
             foreach ($userInfoArr as $v2) {
                 if (!$v2[is_mail]) {
                     if ($v2[email]) {
                         kekezu::send_mail($v2[email], $arr_auto_mail['title'], htmlspecialchars_decode(stripslashes($arr_auto_mail['content'])));
                         db_factory::execute("update " . TABLEPRE . "witkey_space set is_mail=1 where uid=" . intval($v2[uid]));
                     } elseif ($v2[qq]) {
                         kekezu::send_mail($v2[qq], $arr_auto_mail['title'], htmlspecialchars_decode(stripslashes($arr_auto_mail['content'])));
                         db_factory::execute("update " . TABLEPRE . "witkey_space set is_mail=1 where uid=" . intval($v2[uid]));
                     }
                 }
             }
         }
         $arr_auto_mail['time'] = time() + 86400;
         file_put_contents($path, "<?php      return " . $arr_auto_mail . ";");
     }
 }