예제 #1
0
function xmlrpc_smtp2pne($message)
{
    // パラメータを取得
    $param = $message->getParam(0);
    if (!XML_RPC_Value::isValue($param)) {
        return $param;
    }
    $params = XML_RPC_decode($param);
    // 入力チェック とりあえず空かどうかのみ
    if (empty($params['prefix']) and empty($params['domain'])) {
        return xmlrpc_get_response_faultDefault('incorrect_params');
    }
    if (empty($params['to'])) {
        return xmlrpc_get_response_faultDefault('incorrect_params');
    }
    if (empty($params['from'])) {
        return xmlrpc_get_response_faultDefault('incorrect_params');
    }
    // デコーダオブジェクトを作成
    $options['from_encoding'] = 'UTF-8';
    $options['to_encoding'] = 'UTF-8';
    $options['img_tmp_dir'] = OPENPNE_VAR_DIR . '/tmp';
    $options['img_max_filesize'] = IMAGE_MAX_FILESIZE * 1024;
    $options['trim_doublebyte_space'] = OPENPNE_TRIM_DOUBLEBYTE_SPACE;
    $decoder =& new OpenPNE_KtaiMail_RPC($options);
    $decoder->assign($params);
    // メール受信処理オブジェクトを起動
    $mail_sns =& new mail_sns($decoder);
    if (!$mail_sns->main()) {
        //エラーの場合はfaultCodeを返す
        return xmlrpc_get_fault_response(56, 'Can\'t Receive Mail');
    }
    return xmlrpc_get_response(0);
}
예제 #2
0
/**
 * 認証API
 */
function xmlrpc_000_auth($message)
{
    $param = $message->getParam(0);
    if (!XML_RPC_Value::isValue($param)) {
        return false;
    }
    $params = XML_RPC_decode($param);
    if (empty($params['sid'])) {
        return false;
    }
    if (empty($params['mid'])) {
        return false;
    }
    if (empty($params['dt'])) {
        return false;
    }
    $c_member_id = $params['mid'];
    $datetime = $params['dt'];
    if (!db_member_c_member4c_member_id_LIGHT($c_member_id)) {
        return xmlrpc_get_fault_response(56);
    }
    if (!($member_token = db_api_get_member_token($c_member_id))) {
        return xmlrpc_get_fault_response(52);
    }
    $session_id = api_get_sid($c_member_id, $member_token, $datetime);
    if ($params['sid'] != $session_id) {
        return xmlrpc_get_fault_response(52);
    }
    return xmlrpc_get_response($c_member_id);
}
예제 #3
0
/**
 * @copyright 2005-2008 OpenPNE Project
 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
 */
function xmlrpc_001_get_c_member($message)
{
    $param = $message->getParam(0);
    if (!XML_RPC_Value::isValue($param)) {
        return false;
    }
    $params = XML_RPC_decode($param);
    if (empty($params['target_c_member_id'])) {
        return false;
    }
    if (empty($params['my_c_member_id'])) {
        return false;
    }
    $t_id = intval($params['target_c_member_id']);
    $m_id = intval($params['my_c_member_id']);
    // my_c_member_id が不正
    if (!db_member_c_member4c_member_id_LIGHT($m_id)) {
        return xmlrpc_get_fault_response(56);
    }
    if ($t_id == $m_id) {
        // 自分
        $public_flag = 'private';
    } elseif (db_friend_is_friend($t_id, $m_id)) {
        $public_flag = 'friend';
    } else {
        $public_flag = 'public';
    }
    // target_c_member_id が不正
    if (!($c_member = db_member_c_member4c_member_id($t_id, false, true, $public_flag))) {
        return xmlrpc_get_fault_response(56);
    }
    // アクセスブロック判定
    if (db_member_is_access_block($m_id, $t_id)) {
        $result = array('c_member_id' => $t_id, 'nickname' => $c_member['nickname'], 'image_url' => xmlrpc_get_image_url());
    } else {
        $result = array('c_member_id' => $t_id, 'nickname' => $c_member['nickname'], 'image_url' => xmlrpc_get_image_url($c_member['image_filename']), 'image_url_1' => xmlrpc_get_image_url($c_member['image_filename_1'], false), 'image_url_2' => xmlrpc_get_image_url($c_member['image_filename_2'], false), 'image_url_3' => xmlrpc_get_image_url($c_member['image_filename_3'], false), 'birth_year' => intval($c_member['birth_year']), 'birth_month' => intval($c_member['birth_month']), 'birth_day' => intval($c_member['birth_day']), 'access_date' => xmlrpc_get_date($c_member['access_date']), 'r_date' => xmlrpc_get_date($c_member['r_date']), 'profile' => array());
        foreach ($c_member['profile'] as $key => $profile) {
            $result['profile'][$key] = $profile['value'];
        }
    }
    return xmlrpc_get_response($result);
}
예제 #4
0
/**
 * @copyright 2005-2008 OpenPNE Project
 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
 */
function xmlrpc_101_add_point($message)
{
    $param = $message->getParam(0);
    if (!XML_RPC_Value::isValue($param)) {
        return false;
    }
    $params = XML_RPC_decode($param);
    if (empty($params['c_member_id'])) {
        return false;
    }
    if (!isset($params['point'])) {
        return false;
    }
    $c_member_id = intval($params['c_member_id']);
    $point = intval($params['point']);
    if (!db_member_c_member4c_member_id_LIGHT($c_member_id)) {
        return xmlrpc_get_fault_response(56);
    }
    $c_point_log_id = db_point_insert_log($c_member_id, $point, $params['memo']);
    db_point_insert_tags($c_point_log_id, $params['tags']);
    $point = db_point_add_point($c_member_id, $point);
    return xmlrpc_get_response($point);
}