Ejemplo n.º 1
0
 empty($winduid) && Showmsg('not_login');
 S::gp(array('id', 'type'));
 require_once R_P . 'require/functions.php';
 $customdes = getLangInfo('other', 'invite_custom_des');
 $tmpUrlAdd .= '&a=invite';
 if ($type == 'groupactive') {
     $invite_url = $db_bbsurl . '/u.php?a=invite&type=groupactive&id=' . $id . '&uid=' . $winduid . '&hash=' . appkey($winduid, $type);
     $activeArray = $db->get_one("SELECT * FROM pw_active WHERE id=" . S::sqlEscape($id));
     $objectName = $activeArray['title'];
     $objectDescrip = substrs($activeArray['content'], 30);
     $activeId = $activeArray['id'];
     $emailContent = getLangInfo('email', 'email_groupactive_invite_content');
 } else {
     $id = $cyid;
     $type = 'group';
     $invite_url = $db_bbsurl . '/u.php?a=invite&type=group&id=' . $cyid . '&uid=' . $winduid . '&hash=' . appkey($winduid, $type);
     $objectName = $colony['cname'];
     $objectDescrip = substrs($colony['descrip'], 30);
     $emailContent = getLangInfo('email', 'email_group_invite_content');
 }
 if (empty($_POST['step'])) {
     S::gp("id", null, 2);
     //* @include_once pwCache::getPath(D_P.'data/bbscache/o_config.php');
     pwCache::getData(D_P . 'data/bbscache/o_config.php');
     $friend = getFriends($winduid) ? getFriends($winduid) : array();
     foreach ($friend as $key => $value) {
         $frienddb[$value['ftid']][] = $value;
     }
     $query = $db->query("SELECT * FROM pw_friendtype WHERE uid=" . S::sqlEscape($winduid) . " ORDER BY ftid");
     $friendtype = array();
     while ($rt = $db->fetch_array($query)) {
Ejemplo n.º 2
0
<?php

!function_exists('readover') && exit('Forbidden');
require_once R_P . 'require/functions.php';
PwNewDB();
$friendServer = L::loadClass('Friend', 'friend');
if ($hash == appkey($o_u, $app) && $winduid && $o_u !== $winduid) {
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $ckuser = $userService->get($o_u);
    $iffriend = $friendServer->getFriendByUidAndFriendid($winduid, $o_u);
    if ($ckuser && empty($iffriend)) {
        $friendcheck = getstatus($ckuser['userstatus'], PW_USERSTATUS_CFGFRIEND, 3);
        if (!$friendcheck) {
            $db->query("DELETE FROM pw_attention WHERE uid=" . S::sqlEscape($winduid) . " AND friendid=" . S::sqlEscape($o_u));
            addSingleFriend(true, $winduid, $o_u, $timestamp, 0);
            addSingleFriend(true, $o_u, $winduid, $timestamp, 0);
            M::sendNotice(array($ckuser['username']), array('title' => getLangInfo('writemsg', 'friend_add_title_1', array('username' => $windid)), 'content' => getLangInfo('writemsg', 'friend_add_content_1', array('uid' => $winduid, 'username' => $windid))));
        } elseif ($friendcheck == 1) {
            $db->query("DELETE FROM pw_attention WHERE uid=" . S::sqlEscape($winduid) . " AND friendid=" . S::sqlEscape($touid));
            addSingleFriend(false, $winduid, $o_u, $timestamp, 1);
            M::sendRequest($winduid, array($ckuser['username']), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => getLangInfo('writemsg', 'friend_add_title_2', array('username' => $windid)), 'content' => getLangInfo('writemsg', 'friend_add_content_2', array('uid' => $winduid, 'username' => $windid, 'msg' => stripslashes($checkmsg)))), 'request_friend', 'request_friend');
        }
        Cookie('o_invite', '');
    }
}
function addSingleFriend($updatemem, $winduid, $frienduid, $timestamp, $status, $friendtype = 0, $checkmsg = '')
{
    global $db;
    $pwSQL = S::sqlSingle(array('uid' => $winduid, 'friendid' => $frienduid, 'joindate' => $timestamp, 'status' => $status, 'descrip' => $checkmsg, 'ftid' => $friendtype));
    $attentionService = L::loadClass('Attention', 'friend');
Ejemplo n.º 3
0
<?php

!defined('M_P') && exit('Forbidden');
empty($o_invite) && Showmsg('mode_o_invite_close');
InitGP(array('u', 'hash', 'app'));
$u = (int) $u;
!$u && Showmsg('undefined_action');
$thisbase = $basename . "q=invite&";
if ($winduid) {
    if (getOneFriend($u)) {
        Showmsg('mode_o_is_friend');
    }
}
$friend = $db->get_one("SELECT m.uid,m.username,m.icon as face,m.honor,md.f_num,md.postnum,od.diarynum,od.photonum,od.owritenum,od.sharenum,od.groupnum FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid LEFT JOIN pw_ouserdata od ON m.uid=od.uid WHERE m.uid=" . pwEscape($u));
!$friend && Showmsg('undefined_action');
if ($hash != appkey($u, $app)) {
    Showmsg('mode_o_invite_hash_error');
} elseif ($winduid) {
    $o_u = $u;
    if (is_numeric($o_u) && strlen($hash) == 18) {
        require_once R_P . 'require/o_invite.php';
    }
    refreshto("u.php?uid={$u}", 'add_friend_success');
} else {
    Cookie('o_invite', "{$u}\t{$hash}\t{$app}");
}
require_once R_P . 'require/showimg.php';
list($friend['face']) = showfacedesign($friend['face'], 1, 'm');
if ($friend['f_num']) {
    $friends = getFriends($u, 0, 6, '', 1);
}
Ejemplo n.º 4
0
    if (!is_array($value)) {
        $emails = explode(',', str_replace(array("\r", "\n"), array('', ','), $value));
    }
    count($emails) > 20 && ajaxExport('mail_limit');
    strlen($extranote) > 200 && ajaxExport('mode_o_extra_toolang');
    if ($emails) {
        foreach ($emails as $key => $email) {
            $emails[$key] = trim($email);
            !isEmail($email) && ajaxExport('请输入正确的邮箱地址');
            if (!$email || !isEmail($email)) {
                unset($emails[$key]);
            }
        }
    }
    !$emails && ajaxExport('mail_is_empty');
    $hash = appkey($winduid);
    $invite_url = $db_bbsurl . '/u.php?a=invite&uid=' . $winduid . '&hash=' . $hash;
    $invite->sendInviteEmail($emails);
    ajaxExport('success');
} elseif ($step == 'sendinvitecode') {
    S::gp(array('value', 'invcodes', 'extranote'), 'GP');
    if (!is_array($value)) {
        $emails = explode(',', str_replace(array("\r", "\n"), array('', ','), $value));
    }
    count($emails) > 20 && ajaxExport('mail_limit');
    strlen($extranote) > 200 && ajaxExport('mode_o_extra_toolang');
    if ($emails) {
        foreach ($emails as $key => $email) {
            $emails[$key] = trim($email);
            if (!$email || !isEmail($email)) {
                unset($emails[$key]);
Ejemplo n.º 5
0
<?php

!defined('R_P') && exit('Forbidden');
//empty($o_invite) && Showmsg('mode_o_invite_close');
if ($uid) {
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    if (!$userService->isExist($uid)) {
        Showmsg('invite_user_not_exist');
    }
}
S::gp(array('hash', 'type', 'id'));
//验证hash的合法性
$hash != appkey($uid, $type) && Showmsg('mode_o_invite_hash_error');
Cookie('o_invite', "{$uid}\t{$hash}\t{$type}");
if ($type == 'group') {
    ObHeader("apps.php?q=group&cyid=" . $id);
} elseif ($type == 'groupactive') {
    require_once R_P . 'apps/groups/lib/active.class.php';
    $newActive = new PW_Active();
    $cyid = $newActive->getCyidById($id);
    ObHeader("apps.php?q=group&a=active&job=view&cyid={$cyid}&id={$id}");
} else {
    ObHeader(USER_URL . $uid);
}