Beispiel #1
0
function message_post(&$a)
{
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $replyto = x($_POST, 'replyto') ? notags(trim($_POST['replyto'])) : '';
    $subject = x($_POST, 'subject') ? notags(trim($_POST['subject'])) : '';
    $body = x($_POST, 'body') ? escape_tags(trim($_POST['body'])) : '';
    $recipient = x($_POST, 'messageto') ? intval($_POST['messageto']) : 0;
    $ret = send_message($recipient, $body, $subject, $replyto);
    switch ($ret) {
        case -1:
            notice(t('No recipient selected.') . EOL);
            break;
        case -2:
            notice(t('Unable to locate contact information.') . EOL);
            break;
        case -3:
            notice(t('Message could not be sent.') . EOL);
            break;
        case -4:
            notice(t('Message collection failure.') . EOL);
            break;
        default:
            info(t('Message sent.') . EOL);
    }
}
 function dosendMessage()
 {
     $myenid = session('user_en_id');
     $itenid = I('post.en_id');
     $this->itenid = $itenid;
     send_message($myenid, $itenid, I('post.content'), 0);
     //发送消息
 }
 public function addPost()
 {
     if (!isset($_SESSION['user_id'])) {
         redirect(U('Login/index'));
         die;
     }
     if (!$this->isPost()) {
         $category = M('category')->select();
         $this->category = $category;
         $this->display();
         die;
     }
     $category_id = $this->_post('category_id');
     $parent_id = $this->_post('parent_id');
     //p($_POST);die;
     $post = array('category_id' => $category_id, 'parent_id' => $parent_id, 'title' => $this->_post('title'), 'body' => $this->_post('body'), 'time' => time(), 'update_time' => time(), 'user_id' => session('user_id'));
     //检测category_id是否存在
     if (!M('category')->where(array('category_id' => $category_id))->find()) {
         $this->error('请选择分类失败');
     }
     //p($post);die;
     $db = M('post');
     $post_id = $db->add($post);
     if ($post_id) {
         //消息发送处理
         if ($parent_id != 0) {
             //不等于0说明是跟帖,发送消息
             $user_id = M('post')->where(array('post_id' => $parent_id))->getField('user_id');
             //获取楼主的ID
             if ($user_id != session('user_id')) {
                 //不是自己跟帖
                 $text = $this->_post('body');
                 send_message($user_id, $post_id, $text);
             }
             //更新楼主帖子的更新时间
             $update_time = array('post_id' => $parent_id, 'update_time' => time());
             M('post')->save($update_time);
         }
         //保存图片路径
         if (isset($_POST['picture'])) {
             $db = M('picture');
             $picture = array();
             foreach ($_POST['picture'] as $key => $value) {
                 $picture = array('post_id' => $post_id, 'picture' => $value);
                 $db->add($picture);
             }
         }
         if ($parent_id == 0) {
             $this->success('发表成功', U('Post/index', array('post_id' => $post_id)));
         } else {
             $this->success('发表成功', U('Post/index', array('post_id' => $parent_id)));
         }
     } else {
         $this->error('发表失败' . $db->getDbError());
     }
 }
Beispiel #4
0
 function edit($post)
 {
     global $DT_PRE, $_username, $DT_TIME, $GROUP, $L;
     $item = $this->get_one();
     $user = $item['username'] ? userinfo($item['username']) : array();
     $gsql = $msql = $csql = '';
     $gsql = "edittime={$DT_TIME},editor='{$_username}',status={$post['status']},note='{$post['note']}'";
     if ($post['status'] == 1) {
         //reject
         if ($user) {
             if ($post['message'] && $post['content']) {
                 send_message($user['username'], lang($L['grade_fail'], array($GROUP[$item['groupid']]['groupname'])), nl2br($post['content']));
                 $gsql .= ",message=1";
             }
             if ($item['amount']) {
                 money_add($item['username'], $item['amount']);
                 money_record($item['username'], $item['amount'], $L['in_site'], 'system', $L['grade_title'], $L['grade_return']);
             }
         }
     } else {
         if ($post['status'] == 2) {
             //
         } else {
             if ($post['status'] == 3) {
                 if ($user) {
                     if (isset($post['pay']) && $post['pay']) {
                         if ($user['money'] < $post['pay']) {
                             return $this->_($L['grade_pass_balance']);
                         } else {
                             money_add($item['username'], -$post['pay']);
                             money_record($item['username'], -$post['pay'], $L['in_site'], 'system', $L['grade_title'], $L['grade_upto'] . $GROUP[$item['groupid']]['groupname']);
                         }
                     }
                     $msql = $csql = "groupid={$item['groupid']},company='{$item['company']}'";
                     $vip = $GROUP[$item['groupid']]['vip'];
                     $csql .= ",vip={$vip},vipt={$vip}";
                     if (isset($post['pay'])) {
                         $csql .= ",fromtime=" . strtotime($post['fromtime']) . ",totime=" . strtotime($post['totime']) . ",validtime=" . strtotime($post['validtime']) . ",validator='{$post['validator']}',validated={$post['validated']}";
                     }
                     if ($post['message'] && $post['content']) {
                         send_message($user['username'], lang($L['grade_success'], array($GROUP[$item['groupid']]['groupname'])), nl2br($post['content']));
                         $gsql .= ",message=1";
                     }
                 }
             }
         }
     }
     $this->db->query("UPDATE {$this->table} SET {$gsql} WHERE itemid={$this->itemid}");
     if ($msql) {
         $this->db->query("UPDATE {$DT_PRE}member SET {$msql} WHERE userid={$item['userid']}");
     }
     if ($csql) {
         $this->db->query("UPDATE {$DT_PRE}company SET {$csql} WHERE userid={$item['userid']}");
     }
     return true;
 }
Beispiel #5
0
function message_to_clan($p_message)
{
    $error = null;
    $user_id = self_char_id();
    $clan_id = get_clan_by_player_id($user_id)->getID();
    $clan_members = query_resultset("SELECT player_id, uname\n\t    FROM clan JOIN clan_player ON _clan_id = clan_id JOIN players ON player_id = _player_id\n\t    WHERE clan_id = :clan", array(':clan' => $clan_id));
    $messaged_to = array();
    foreach ($clan_members as $loop_member) {
        send_message($user_id, $loop_member['player_id'], $p_message, $type = 1);
        $messaged_to[] = $loop_member['uname'];
    }
    return implode(', ', $messaged_to);
}
function broadcast()
{
    $num_sent = 0;
    for ($n = 0; $n < 20;) {
        $regIDs = '';
        foreach (get_regIDs() as $k => $v) {
            $regIDs .= ',"' . $k . '"';
        }
        $regIDs = substr($regIDs, 1);
        if (send_message(API_KEY, $regIDs)) {
            $n++;
        }
        sleep(15);
    }
}
Beispiel #7
0
function message_post(&$a)
{
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $replyto = x($_REQUEST, 'replyto') ? notags(trim($_REQUEST['replyto'])) : '';
    $subject = x($_REQUEST, 'subject') ? notags(trim($_REQUEST['subject'])) : '';
    $body = x($_REQUEST, 'body') ? escape_tags(trim($_REQUEST['body'])) : '';
    $recipient = x($_REQUEST, 'messageto') ? intval($_REQUEST['messageto']) : 0;
    // Work around doubled linefeeds in Tinymce 3.5b2
    /*	$plaintext = intval(get_pconfig(local_user(),'system','plaintext') && !feature_enabled(local_user(),'richtext'));
    	if(! $plaintext) {
    		$body = fix_mce_lf($body);
    	}*/
    $plaintext = intval(!feature_enabled(local_user(), 'richtext'));
    if (!$plaintext) {
        $body = fix_mce_lf($body);
    }
    $ret = send_message($recipient, $body, $subject, $replyto);
    $norecip = false;
    switch ($ret) {
        case -1:
            notice(t('No recipient selected.') . EOL);
            $norecip = true;
            break;
        case -2:
            notice(t('Unable to locate contact information.') . EOL);
            break;
        case -3:
            notice(t('Message could not be sent.') . EOL);
            break;
        case -4:
            notice(t('Message collection failure.') . EOL);
            break;
        default:
            info(t('Message sent.') . EOL);
    }
    // fake it to go back to the input form if no recipient listed
    if ($norecip) {
        $a->argc = 2;
        $a->argv[1] = 'new';
    } else {
        goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
    }
}
 public function addComment()
 {
     if (!$this->isPost()) {
         $this->error('不给你看');
     }
     $body = $this->_post('body');
     $post_id = $this->_post('post_id');
     $comment = array('post_id' => $post_id, 'body' => $body, 'time' => time(), 'user_id' => session('user_id'));
     //p($comment);die;
     if (M('comment')->add($comment)) {
         //消息发送处理
         $user_id = M('post')->where(array('post_id' => $post_id))->getField('user_id');
         //获帖子主人的ID
         if (isset($_POST['get_message_user_id']) && $_POST['get_message_user_id'] != $user_id && $_POST['get_message_user_id'] && $_POST['get_message_user_id'] != session('user_id')) {
             //点击了回复某人,并且不是层主
             if ($user_id != $_SESSION['user_id'] && $_POST['get_message_user_id'] != session('user_id')) {
                 send_message($user_id, $post_id, $body);
             }
             send_message($_POST['get_message_user_id'], $post_id, $body);
         } else {
             if ($user_id != $_SESSION['user_id'] && $_POST['get_message_user_id'] != session('user_id')) {
                 send_message($user_id, $post_id, $body);
             }
         }
         //更新楼主帖子的更新时间
         $post = M('post')->where(array('post_id' => $post_id))->find();
         $parent_post_id = M('post')->where(array('post_id' => $post['parent_id']))->getField('post_id');
         $update_time = array('post_id' => $parent_post_id, 'update_time' => time());
         M('post')->save($update_time);
         $user = M('user')->where(array('user_id' => session('user_id')))->find();
         $html = '';
         $html .= "<div class='row'>\n                            <br><div class='col-xs-1'></div>\n                            <div class='col-xs-1 qianhui'>";
         if ($user['face']) {
             $html .= "<a target='_blank' href='" . U('User/index', array('user_id' => $user['user_id'])) . "'>\n                                        <img src='" . __ROOT__ . "/Uploads/face/" . $user['face'] . "' width='50px' height='50px' alt=''></a>";
         } else {
             $html .= "<a target='_blank' href='" . U('User/index', array('user_id' => $user['user_id'])) . "'>\n                \t<img src='" . __ROOT__ . "/Public/Index/images/no_face.jpg' width='50px' height='50px' alt=''>\n                \t</a>";
         }
         $time = time_format(time());
         $html .= " </div>\n                            <div class='col-xs-10 qianhui'>\n                                <p>\n                                <a target='_blank' href='" . U('User/index', array('user_id' => $user['user_id'])) . "'>" . $user['username'] . "</a>:" . $body . "</p>\n                                <p class='text-muted text-right'>\n                                    " . $time . " \n                                    <span class='glyphicon glyphicon glyphicon-comment'></span>\n                                </p>\n                            </div>\n                            <hr>\n                        </div>";
         echo $html;
         die;
     } else {
         echo 0;
     }
 }
Beispiel #9
0
function message_to_clan($message)
{
    global $sql;
    $error = null;
    $user_id = get_user_id();
    $username = get_username();
    $clan = getClan($username);
    $sql->Query("SELECT player_id, uname from players where clan = '" . sql($clan) . "'");
    $clan_members = $sql->fetchAll();
    $messaged_to = '';
    $comma = '';
    foreach ($clan_members as $loop_member) {
        send_message($user_id, $loop_member['player_id'], "CLAN: " . $message);
        $messaged_to .= $comma . $loop_member['uname'];
        $comma = ', ';
    }
    return $messaged_to;
}
Beispiel #10
0
function render_clan_join($process = null, $username, $clan_name)
{
    $sql = new DBAccess();
    if ($process == 1) {
        $confirm = $sql->QueryItem("SELECT confirm FROM players WHERE uname = '{$username}'");
        $url = message_url("clan_confirm.php?clan_joiner=" . rawurlencode($username) . "&confirm={$confirm}&clan_name=" . rawurlencode($clan_name), 'Confirm Request');
        $join_request_message = "CLAN JOIN REQUEST: {$username} has sent you a clan request.\n            If you wish to allow this ninja into your clan click the following link:\n            {$url}";
        send_message(get_user_id($username), get_user_id($clan_name), $join_request_message);
        echo "<div>***Your request to join this clan has been sent to {$clan_name}***</div>\n";
    } else {
        //Clan Join list of available Clans
        $clan_leaders = $sql->FetchAll("SELECT uname,level,clan,clan_long_name FROM players\n            WHERE lower(uname) = lower(clan) AND clan_long_name != '' AND confirmed = 1");
        echo "<p>Clans Available to Join</p>\n        <p>To send a clan request click on that clan leader's name.</p>\n        <ul>";
        foreach ($clan_leaders as $leader) {
            echo "<li><a href=\"clan.php?command=join&clan_name={$leader['clan']}&process=1\">\n                    Join {$leader['clan_long_name']}</a>.\n                    Its leader is <a href=\"player.php?player=" . rawurlencode($leader['uname']) . "\">\n                    {$leader['uname']}</a>, level {$leader['level']}.\n                    <a href=\"clan.php?command=view&clan_name={$leader['clan']}\">View This Clan</a>\n                </li>\n";
        }
        echo "</ul>";
    }
}
 public function send_message()
 {
     $recipient = 1;
     if (isset($_POST['recipient'])) {
         $recipient = $_POST['recipient'];
     }
     if (isset($_POST['author'])) {
         $author = $_POST['author'];
     } else {
         //if sent username instead
         if (isset($_POST['username'])) {
             $author_data = get_user_by('login', $_POST['username']);
             $author = $author_data->ID;
         } else {
             return array("result" => "NOK", "message" => "Missing parameters");
         }
     }
     send_message($author, $_POST['message_string'], $recipient);
     return array("result" => "OK", "message" => "Message sent!");
 }
Beispiel #12
0
function send_to_recipients($recipients, $message, $sch_id)
{
    global $scheduler_id;
    global $complete;
    $results = array();
    $scheduler_id = $sch_id;
    //die( json_encode($recipients) );
    if (isset($recipients->values)) {
        foreach ($recipients->values as $recipient) {
            $result = send_message($recipient, $message);
            array_push($results, $result);
        }
        if ($complete) {
            complete_schedule($sch_id, "CMP");
        } else {
            complete_schedule($sch_id, "FLD");
        }
        //If all number(s) fail, scheduler status is failed
        return $results;
    }
}
Beispiel #13
0
function send_notice($username, $subject, $body)
{
    global $DT, $msg, $eml, $sms, $wec;
    if (!$username || !$subject || !$body) {
        return;
    }
    if (isset($msg)) {
        send_message($username, $subject, $body);
    }
    if (isset($wec)) {
        send_weixin($username, $subject);
    }
    if (isset($eml) || isset($sms)) {
        $user = userinfo($username);
        if (isset($eml)) {
            send_mail($user['email'], $subject, $body);
        }
        if (isset($sms)) {
            send_sms($user['mobile'], $subject . $DT['sms_sign']);
        }
    }
}
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     User::unguard();
     $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'phone' => $data['phone'], 'password' => bcrypt($data['password'])]);
     User::reguard();
     $role = new UserRole();
     $role->user_id = $user->id;
     $role->role_id = 2;
     $role->save();
     /**
      * Send a welcome message
      */
     $message = "Hi " . $data['name'] . ". Your account has been activated. Have a good day";
     send_message($data['phone'], $message);
     /**
      * Send email for account creation
      */
     Mail::send('emails.register', compact('user'), function ($message) use($user) {
         $message->from(get_option('sent_from'), get_option('app'));
         $message->to($user->email, $user->name)->subject(get_option('app') . ' Registration Successful');
     });
     return $user;
 }
Beispiel #15
0
                //ensure don't go over the limit
                if ($this_ship['is_warship'] == 1) {
                    $target_ship_count['warships']++;
                } else {
                    $target_ship_count['other_ships']++;
                }
                $transfer_counter++;
            }
        }
        $text .= sprintf($st[747], $transfer_counter, $num_ships) . "<p />" . $loop_txt;
        if ($transfer_counter > 0) {
            $total_cost = $cost_per_transfer * $transfer_counter;
            $text .= "<p />{$st['7480']} {$total_cost} " . $cw['credits'];
            take_cash($total_cost);
            post_news("<b class='b1'>" . sprintf($st[748], $user[login_name], $transfer_counter, $target[login_name]), "ship");
            send_message($target['login_id'], sprintf($st[749], $transfer_counter, $user[login_name]));
            insert_history($user['login_id'], sprintf($st[750], $transfer_counter, $target[login_name]));
        }
    }
    print_page($cw['transfer_ship'], $text);
}
$text .= sprintf($st[751], $target[login_name]) . "<br /><br />";
$text .= "<b class='b1'>" . $st[752] . "<br />";
$text .= "<form action=send_ship.php method=POST name=transfer_ships><table>";
db("select ship_name, class_name, location, fighters, max_fighters, shields, max_shields, armour, max_armour, config, ship_id from {$db_name}_ships where login_id = '{$user['login_id']}' && ship_id != '{$user['ship_id']}' order by class_name");
$ships = dbr(1);
if (!isset($ships)) {
    #ensure there are some ships to display
    $text .= $st[753];
} else {
    $text .= make_table(array("Nom du vaisseau", "Type de vaisseau", "Emplacement", "Chasseurs", "Boucliers", "Coques", "Configuration"));
Beispiel #16
0
             //判断该笔订单是否在商户网站中已经做过处理(可参考“集成教程”中“3.4返回数据处理”)
             //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
             //如果有做过处理,不执行商户的业务程序
             if ($td['status'] == 3) {
                 $db->query("UPDATE {$DT_PRE}mall_order SET status=4,updatetime={$DT_TIME} WHERE itemid={$itemid}");
                 //更新商品数据
                 $db->query("UPDATE {$DT_PRE}mall SET orders=orders+1,sales=sales+{$td['number']},amount=amount-{$td['number']} WHERE itemid={$mallid}");
                 $myurl = userurl($td['buyer']);
                 $_username = $td['seller'];
                 //send message
                 $touser = $td['seller'];
                 $title = lang($L['trade_message_t4'], array($itemid));
                 $url = $memberurl . 'trade.php?itemid=' . $itemid;
                 $content = lang($L['trade_message_c4'], array($myurl, $_username, $timenow, $url));
                 $content = ob_template('messager', 'mail');
                 send_message($touser, $title, $content);
                 message('交易成功', $MODULE[2]['linkurl'] . 'trade.php?action=order&itemid=' . $itemid);
             }
         } else {
             if ($_GET['trade_status'] == 'WAIT_BUYER_PAY') {
                 message('订单创建成功,请尽快通过支付宝付款', $MODULE[2]['linkurl'] . 'trade.php?action=order&itemid=' . $itemid);
             } else {
                 //echo "trade_status=".$_GET['trade_status'];
             }
         }
     }
 }
 message('验证成功(Code:000)', $MODULE[2]['linkurl'] . 'trade.php?error=0');
 //echo "验证成功<br />";
 //echo "trade_no=".$trade_no;
 //――请根据您的业务逻辑来编写程序(以上代码仅作参考)――
Beispiel #17
0
        $newSocket = socket_accept($socket);
        $clients[] = $newSocket;
        $header = socket_read($newSocket, 1024);
        perform_handshaking($header, $newSocket, $host, $port);
        socket_getpeername($newSocket, $ip);
        $found_socket = array_search($socket, $changed);
        unset($changed[$found_socket]);
    }
    foreach ($changed as $changed_socket) {
        while (socket_recv($changed_socket, $buf, 1024, 0) >= 1) {
            $received_text = unmask($buf);
            $tst_msg = json_decode($received_text);
            $posx = $tst_msg->posx;
            $posy = $tst_msg->posy;
            $response_text = mask(json_encode(array('posx' => $posx, 'posy' => $posy)));
            send_message($response_text);
            break 2;
        }
        $buf = @socket_read($changed_socket, 1024, PHP_NORMAL_READ);
        if ($buf === false) {
            $found_socket = array_search($changed_socket, $clients);
            socket_getpeername($changed_socket, $ip);
            unset($clients[$found_socket]);
        }
    }
}
socket_close($sock);
function send_message($msg)
{
    global $clients;
    foreach ($clients as $changed_socket) {
    if (!$mail->SendFromFile($filePath)) {
        printf("error: %s\n", $mail->ErrorInfo);
    } else {
        printf("success: sent\n");
    }
}
/*
 Pseudo main()
*/
if ($cargc < 1) {
    print_version();
    exit;
}
switch ($cargv[1]) {
    case "-h":
    case "--help":
        print_help();
        break;
    case "-V":
    case "--version":
        print_version();
        break;
    case "-s":
    case "--send":
        send_message($cargv[2]);
        break;
    default:
        print_help();
}
return 0;
// return success
Beispiel #19
0
function api_direct_messages_new(&$a, $type)
{
    if (api_user() === false) {
        return false;
    }
    if (!x($_POST, "text") or !x($_POST, "screen_name") and !x($_POST, "user_id")) {
        return;
    }
    $sender = api_get_user($a);
    if ($_POST['screen_name']) {
        $r = q("SELECT `id`, `nurl`, `network` FROM `contact` WHERE `uid`=%d AND `nick`='%s'", intval(api_user()), dbesc($_POST['screen_name']));
        // Selecting the id by priority, friendica first
        api_best_nickname($r);
        $recipient = api_get_user($a, $r[0]['nurl']);
    } else {
        $recipient = api_get_user($a, $_POST['user_id']);
    }
    $replyto = '';
    $sub = '';
    if (x($_REQUEST, 'replyto')) {
        $r = q('SELECT `parent-uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', intval(api_user()), intval($_REQUEST['replyto']));
        $replyto = $r[0]['parent-uri'];
        $sub = $r[0]['title'];
    } else {
        if (x($_REQUEST, 'title')) {
            $sub = $_REQUEST['title'];
        } else {
            $sub = strlen($_POST['text']) > 10 ? substr($_POST['text'], 0, 10) . "..." : $_POST['text'];
        }
    }
    $id = send_message($recipient['cid'], $_POST['text'], $sub, $replyto);
    if ($id > -1) {
        $r = q("SELECT * FROM `mail` WHERE id=%d", intval($id));
        $ret = api_format_messages($r[0], $recipient, $sender);
    } else {
        $ret = array("error" => $id);
    }
    $data = array('$messages' => $ret);
    switch ($type) {
        case "atom":
        case "rss":
            $data = api_rss_extra($a, $data, $user_info);
    }
    return api_apply_template("direct_messages", $type, $data);
}
<?php

include "config/config.php";
include "admin/include/function.php";
$from = $_POST["from"];
$to = $_POST["to"];
$title = mysql_real_escape_string(stripslashes($_POST["title"]));
$message = mysql_real_escape_string(stripslashes($_POST["message"]));
send_message($from, $to, $title, $message, "");
Beispiel #21
0
$target_id = $to ? get_user_id($to) : null;
$user_id = get_user_id();
$username = get_username();
$clan = getClan($username);
$has_clan = $clan ? true : false;
$page = in('page', 1, 'toInt');
$limit = 25;
$offset = ($page - 1) * $limit;
$delete = in('delete');
$message_sent_to = null;
// Sending mail section.
if ($message && $messenger) {
    if ($to_clan && $has_clan) {
        $message_sent_to = message_to_clan($message);
    } elseif (!!$target_id) {
        send_message($user_id, $target_id, $message);
        $message_sent_to = $to;
        // (
    }
}
if ($delete) {
    delete_messages();
}
$messages = get_messages($user_id, $limit, $offset);
$message_count = message_count();
$pages = ceil($message_count / $limit);
// Total pages.
//$current_page = floor(($message_count/$limit) - $limit); //
$nav = render_message_nav($page, $pages, $limit);
read_messages($user_id);
// mark messages as read for next viewing.
Beispiel #22
0
     $sql3 .= ",content='" . addslashes($E['content']) . "'";
 }
 $ECK = array('thumb' => '形象图片', 'areaid' => '所在地区', 'type' => '公司类型', 'business' => '经营范围', 'regyear' => '成立年份', 'capital' => '注册资本', 'address' => '公司地址', 'telephone' => '联系电话', 'content' => '公司介绍');
 $title = '会员资料修改审核结果';
 $content = '尊敬的会员:<br/>您的会员资料修改已经审核,现将结果通知如下:<br/>';
 foreach ($E as $k => $v) {
     if (!isset($ECK[$k])) {
         continue;
     }
     $content .= $ECK[$k] . ' ---------- ' . (in_array($k, $pass) ? '<span style="color:green;">已通过</span>' : '<span style="color:red;">未通过</span>') . '<br/>';
 }
 if ($reason) {
     $content .= '操作原因:' . nl2br($reason) . '<br/>';
 }
 if ($msg) {
     send_message($username, $title, $content);
 }
 if ($eml) {
     send_mail($U['email'], $title, $content);
 }
 if ($sms) {
     send_sms($U['mobile'], '您的会员资料修改审核结果已通过站内信发送,请注意查阅');
 }
 if ($wec) {
     send_weixin($username, '您的会员资料修改审核结果已通过站内信发送,请注意查阅');
 }
 if ($sql1) {
     $db->query("UPDATE {$DT_PRE}member SET " . substr($sql1, 1) . " WHERE userid={$userid}");
 }
 if ($sql2) {
     $db->query("UPDATE {$DT_PRE}company SET " . substr($sql2, 1) . " WHERE userid={$userid}");
Beispiel #23
0
function send_clan_join_request($user_id, $clan_id)
{
    DatabaseConnection::getInstance();
    $clan_obj = new Clan($clan_id);
    $leader = $clan_obj->getLeaderInfo();
    $leader_id = $leader['player_id'];
    $username = get_username($user_id);
    $confirmStatement = DatabaseConnection::$pdo->prepare('SELECT verification_number FROM players WHERE player_id = :user');
    $confirmStatement->bindValue(':user', $user_id);
    $confirmStatement->execute();
    $confirm = $confirmStatement->fetchColumn();
    // These ampersands get encoded later.
    $url = message_url("clan.php?joiner={$user_id}&command=review&confirmation={$confirm}", 'Confirm Request');
    $join_request_message = 'CLAN JOIN REQUEST: ' . htmlentities($username) . " has sent a request to join your clan.\n\t\tIf you wish to allow this ninja into your clan click the following link:\n\t\t{$url}";
    send_message($user_id, $leader_id, $join_request_message);
}
Beispiel #24
0
		<div id = "wrapper">
			<div id = "header">
				<h1><a href = "../">feel it</a></h1>
				<p>let it all out.</p>
				<ul class = "nav">
					<?php 
require_once '../scripts/functions.php';
if (isset($_SESSION['logged_in'])) {
    $msg_count = get_message_count($_SESSION['username']);
    echo "<a onclick = \"pop_window('../changepass')\"\n\t\t\t\t\t\t\t\t  href = 'javascript:void(0)'><li>" . $_SESSION['username'] . " -</li></a>\n\t\t\t\t\t\t\t<li><a href = '../messages'> messages (" . $msg_count . ") </a> - </li>\n\t\t\t\t\t\t\t<li><a href = '#' onclick = 'logout()'>sign out</a></li>";
} else {
    echo "<li><a href = '../'><div class = 'log_in'>log in</div></a></li>\n\t\t\t\t\t\t          <li><a href = '../signup'><div class = 'sign_up'>sign up</div></a></li>";
}
?>
				</ul> <!-- ul class nav -->
			</div> <!-- header -->
			<?php 
require_once "../scripts/functions.php";
$to = $_POST['r_user'];
$from = $_SESSION['username'];
$subj = $_POST['subj'];
$body = $_POST['body'];
if (send_message($from, $to, $subj, $body)) {
    echo "<div style = 'font-size: 1.2em; color: #00CC00; margin: 0 auto; margin-top: 64px; text-align: center;'>Message sent successfully!</div>";
} else {
    echo "<div style = 'font-size: 1.2em; color: #FF0000; margin: 0 auto; margin-top: 64px; text-align: center;'> There was an error processing your request.</div>";
}
?>
		</div> <!-- wrapper -->						
	</body>
</html>
Beispiel #25
0
<div class="container">
    <div class="row">
        <div class="col-lg-12 text-center">
            <h2 class="section-heading">コンタクト</h2>
            <h3 class="section-subheading">
                <?php 
display_message();
?>
            </h3> 
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <form name="sentMessage" id="contactForm" method="post">
            	<?php 
send_message();
?>
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <input type="text" name="name" class="form-control" placeholder="お名前" id="name" required data-validation-required-message="お名前を入力してください。">                            
                        </div>
                        <div class="form-group">
                            <input type="email" name="email" class="form-control" placeholder="メールアドレス" id="email" required data-validation-required-message="メールアドレスを入力してください。">                            
                        </div>
                        <div class="form-group">
                            <input type="text" name="subject" class="form-control" placeholder="件名" id="subject" required data-validation-required-message="件名を入力してください。">                            
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
Beispiel #26
0
             if ($sary->uid == $USER->uid) {
                 // ny tompony no mamafa
                 $message = "Miarahaba an'i {$USER->user},\n\nAraka ny fangatahanao dia nesorina ny sarinao iray.\n\nRaha mbola te hampiditra sary dia ao amin'ny\n\nhttp://namana.serasera.org/?rub=namana/sary\nMisaotra betsaka.";
                 $subject = "Sary nesorina";
                 send_mail($USER->user . "<" . $USER->email . ">", $subject, $message);
                 $message = "Nesorin'i {$USER->user} ny sariny";
                 $subject = "[Admin sary] Sary nesorina";
                 send_mail("<*****@*****.**>", $subject, $message);
                 $x_body .= "Voafafa ny sary.";
             } else {
                 // admin no mamafa
                 if ($tompony = $DB->get_row("SELECT * FROM #__namana_user_profile WHERE uid='" . $sary->uid . "' LIMIT 1")) {
                     $x_body .= "Voafafa ny sary. Nandefasana  hafatra ny tompon'ny sary.";
                     $message = "Miarahaba an'i {$tompony->user},\n\nIalana tsiny fa voatery nofafain'i {$USER->user} ny sarinao.\nIty ambany ity ny antony nanesorany azy :\n\n[b]" . $antony . "[/b]\n\nRaha mbola te hampiditra sary dia ao amin'ny\n\nhttp://namana.serasera.org/?rub=namana/sary\nMisaotra betsaka.";
                     $subject = "Sary nesorina";
                     send_message($tompony->user, $subject, $message, $USER->username);
                     $tatitra .= "<b>{$subject}</b>\n\n";
                     $tatitra .= "- Nesorin'i <b>{$USER->user}</b> ny sarin'i <b>{$tompony->user}</b>. Ny antony dia\n\n" . $antony;
                     $message = "Nesorin'i {$USER->user} ny sarin'i {$tompony->user} satria {$antony}";
                     $subject = "Sary nesorina";
                     send_mail("<*****@*****.**>", $subject, $message);
                 }
             }
         } else {
             $x_body .= "Tsy ao intsony ny sary tianao hofafaina";
         }
     } else {
         $x_body .= "Tsy voafafa ny sary.";
     }
 } else {
     $x_body .= "Tsy afaka mamafa sary fa niveau " . $admin[sary][level];
Beispiel #27
0
 function _send($message)
 {
     global $DT_TIME;
     if (!$this->_is_message($message)) {
         return false;
     }
     clear_upload($message['content']);
     $message['title'] = htmlspecialchars(trim($message['title']));
     $message['content'] = dsafe(addslashes(save_remote(save_local(stripslashes($message['content'])))));
     if ($message['type']) {
         $message['groupids'] = implode(',', $message['groupids']);
         $this->db->query("INSERT INTO {$this->pre}message(title,content,fromuser,touser,addtime,status,groupids) values('{$message['title']}','{$message['content']}','{$this->username}','','{$DT_TIME}','0','{$message['groupids']}')");
     } else {
         foreach (explode(' ', $message['touser']) as $touser) {
             send_message($touser, $message['title'], stripslashes($message['content']));
         }
     }
     return true;
 }
Beispiel #28
0
/**
 * 发送子进程
 * @param unknown_type $id
 */
function proc_worker($id)
{
    global $queue;
    $msg_type = 0;
    $msg_pkt = '';
    $errCode = 0;
    while (1) {
        $ret = msg_receive($queue, 0, $msg_type, 8192, $msg_pkt, false, $errCode);
        if ($ret) {
            error_log("[WORKER {$id}] msg_receive:[" . $msg_pkt . "]\n", 3, RUNTIME_LOG_PATH);
            send_message(SERVER_URL, $msg_pkt);
        } else {
            error_log("[ERROR]: msg_receive:[{$errCode}]\n", 3, RUNTIME_LOG_PATH);
        }
        usleep(SLEEP_MICRO_SECONDS);
    }
}
Beispiel #29
0
function api_direct_messages_new(&$a, $type)
{
    if (api_user() === false) {
        return false;
    }
    if (!x($_POST, "text") || !x($_POST, "screen_name")) {
        return;
    }
    $sender = api_get_user($a);
    require_once "include/message.php";
    // in a decentralised world the screen name is ambiguous
    $r = q("SELECT `abook_id` FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE `abook_channel`=%d and xchan_addr like '%s'", intval(api_user()), dbesc($_POST['screen_name'] . '@%'));
    $recipient = api_get_user($a, $r[0]['abook_id']);
    $replyto = '';
    $sub = '';
    if (x($_REQUEST, 'replyto')) {
        $r = q('SELECT `parent_mid`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', intval(api_user()), intval($_REQUEST['replyto']));
        $replyto = $r[0]['parent_mid'];
        $sub = $r[0]['title'];
    } else {
        if (x($_REQUEST, 'title')) {
            $sub = $_REQUEST['title'];
        } else {
            $sub = strlen($_POST['text']) > 10 ? substr($_POST['text'], 0, 10) . "..." : $_POST['text'];
        }
    }
    $id = send_message(api_user(), $recipient['guid'], $_POST['text'], $sub, $replyto);
    if ($id > -1) {
        $r = q("SELECT * FROM `mail` WHERE id=%d", intval($id));
        $ret = api_format_message($r[0], $recipient, $sender);
    } else {
        $ret = array("error" => $id);
    }
    $data = array('$messages' => $ret);
    switch ($type) {
        case "atom":
        case "rss":
            $data = api_rss_extra($a, $data, $user_info);
    }
    return api_apply_template("direct_messages", $type, $data);
}
Beispiel #30
0
            $row['doc_number'] = docnumber($row['number'], $row['template'] ? $row['template'] : '%N/LMS/%Y', $row['cdate']);
            $recipient_mail = $debug_email ? $debug_email : $row['email'];
            if (!$quiet) {
                printf("[deadline] %s (%04d) %s: %s\n", $row['name'], $row['id'], $row['doc_number'], $recipient_mail);
            }
            if (!$debug) {
                send_message($msgid, $row['id'], $recipient_mail, $row['name'], $deadline_subject, parse_data($deadline_message, $row), $host, $port, $user, $pass, $auth);
            }
        }
    }
}
// Debit notes created up to 24 hours ago
if ($notes_message && (empty($types) || in_array('notes', $types))) {
    $documents = $DB->GetAll("SELECT d.id AS docid, c.id, c.pin, d.name,\n\t\td.number, n.template, d.cdate, c.email,\n\t\tCOALESCE(ca.balance, 0) AS balance, v.value\n\t\tFROM documents d\n\t\tJOIN customers c ON (c.id = d.customerid)\n\t\tJOIN (SELECT SUM(value) * -1 AS value, docid\n\t\t\tFROM cash\n\t\t\tGROUP BY docid\n\t\t) v ON (v.docid = d.id)\n\t\tLEFT JOIN numberplans n ON (d.numberplanid = n.id)\n\t\tLEFT JOIN (SELECT SUM(value) AS balance, customerid\n\t\t\tFROM cash\n\t\t\tGROUP BY customerid\n\t\t) ca ON (ca.customerid = d.customerid)\n\t\tWHERE c.email <> '' AND d.type = 5\n\t\t\tAND d.cdate > ?NOW? - 86400");
    if (!empty($documents)) {
        if (!$debug) {
            $msgid = create_message($notes_subject, $notes_message);
        }
        foreach ($documents as $row) {
            $row['doc_number'] = docnumber($row['number'], $row['template'] ? $row['template'] : '%N/LMS/%Y', $row['cdate']);
            $recipient_mail = $debug_email ? $debug_email : $row['email'];
            if (!$quiet) {
                printf("[new debit note] %s (%04d) %s: %s\n", $row['name'], $row['id'], $row['doc_number'], $recipient_mail);
            }
            if (!$debug) {
                send_message($msgid, $row['id'], $recipient_mail, $row['name'], $notes_subject, parse_data($notes_message, $row), $host, $port, $user, $pass, $auth);
            }
        }
    }
}
$DB->Destroy();