Exemplo n.º 1
0
//判断用户是否设置了头像
$setarr = array();
$avatar_exists = ckavatar($space['uid']);
if ($avatar_exists) {
    if (!$space['avatar']) {
        //奖励积分
        $reward = getreward('setavatar', 0);
        if ($reward['credit']) {
            $setarr['credit'] = "credit=credit+{$reward['credit']}";
        }
        if ($reward['experience']) {
            $setarr['experience'] = "experience=experience+{$reward['experience']}";
        }
        $setarr['avatar'] = 'avatar=1';
        $setarr['updatetime'] = "updatetime={$_SGLOBAL['timestamp']}";
    }
} else {
    if ($space['avatar']) {
        $setarr['avatar'] = 'avatar=0';
    }
}
if ($setarr) {
    $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET " . implode(',', $setarr) . " WHERE uid='{$space['uid']}'");
    //变更记录
    if ($_SCONFIG['my_status']) {
        inserttable('userlog', array('uid' => $_SGLOBAL['supe_uid'], 'action' => 'update', 'dateline' => $_SGLOBAL['timestamp']), 0, true);
    }
}
//include template("cp_avatar");
capi_showmessage_by_data('do_success', 0, array('uc_avatar' => $uc_avatar));
Exemplo n.º 2
0
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                realname_set($value['uid'], $value['username']);
                if ($value['friend'] == 4) {
                    $value['message'] = $value['pic'] = '';
                } else {
                    $value['message'] = strip_tags($value['message']);
                    //剥去字符串中的 HTML 标签
                    $value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, 0, -1);
                }
                if ($value['pic']) {
                    $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                }
                $value['pics'] = json_decode($value['pics']);
                //json解密picurls
                //增加发布者头像地址
                $value['avatar_url'] = avatar($value['uid'], 'middle', TRUE);
                $list[] = $value;
            } else {
                $pricount++;
            }
        }
    }
    //分页
    $multi = multi($count, $perpage, $page, $theurl);
    //实名
    realname_get();
    $_TPL['css'] = 'bwzt';
    //include_once template("space_bwzt_list");
    capi_showmessage_by_data("do_success", 0, array('list' => $list, 'count' => count($list), 'totalcount' => intval($count)));
}
Exemplo n.º 3
0
            $value['name'] = empty($value['name']) ? $value['author'] : $value['name'];
            $value['isnew'] = $value['new'];
            unset($value['new']);
            $value['avatar_url'] = avatar($value['authorid'], 'middle', TRUE);
            $list[] = $value;
        }
        //分页
        $multi = multi($count, $perpage, $page, "space.php?do={$do}");
    }
    //更新状态为已看
    if ($newids) {
        $_SGLOBAL['db']->query("UPDATE " . tname('notification') . " SET new='0' WHERE id IN (" . simplode($newids) . ")");
        //更新未读的
        $newcount = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('notification') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND new='1'"), 0);
        $space['notenum'] = $newcount = intval($newcount);
        updatetable('space', array('notenum' => $newcount), array('uid' => $_SGLOBAL['supe_uid']));
    }
    $newnum = 0;
    $space['pmnum'] = $_SGLOBAL['member']['newpm'];
    foreach (array('notenum', 'pokenum', 'addfriendnum', 'mtaginvitenum', 'eventinvitenum', 'myinvitenum') as $value) {
        $newnum = $newnum + $space[$value];
    }
    $_SGLOBAL['member']['notenum'] = $space['notenum'];
    $_SGLOBAL['member']['allnotenum'] = $newnum;
    realname_get();
}
//include_once template("space_notice");
$realpages = @ceil($count / $perpage);
$notices = array('pages' => $realpages, 'count' => count($list), 'list' => $list);
capi_showmessage_by_data('do_success', 0, array('notices' => $notices));
Exemplo n.º 4
0
            include_once S_ROOT . './source/function_feed.php';
            feed_publish($_POST['opalbumid'], 'albumid');
        }
        //单个图片feed
        if ($_POST['topicid']) {
            topic_join($_POST['topicid'], $_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
            $url = "space.php?do=topic&topicid={$_POST['topicid']}&view=pic";
        } else {
            $url = "space.php?uid={$_SGLOBAL['supe_uid']}&do=album&id=" . (empty($_POST['opalbumid']) ? -1 : $_POST['opalbumid']);
        }
        capi_showmessage_by_data('upload_images_completed', $url, 0);
    }
} else {
    if (!checkperm('allowupload')) {
        ckspacelog();
        capi_showmessage_by_data('no_privilege');
    }
    //实名认证
    ckrealname('album');
    //视频认证
    ckvideophoto('album');
    //新用户见习
    cknewuser();
    $siteurl = getsiteurl();
    //获取相册
    $albums = getalbums($_SGLOBAL['supe_uid']);
    //激活
    $actives = $_GET['op'] == 'flash' || $_GET['op'] == 'cam' ? array($_GET['op'] => ' class="active"') : array('js' => ' class="active"');
    //空间大小
    $maxattachsize = checkperm('maxattachsize');
    if (!empty($maxattachsize)) {
Exemplo n.º 5
0
    } elseif ($ucresult == -3) {
        capi_showmessage_by_data('user_name_already_exists');
    } else {
        capi_showmessage_by_data('succeed');
    }
} elseif ($op == "checkseccode") {
    include_once S_ROOT . './source/function_cp.php';
    if (ckseccode(trim($_REQUEST['seccode']))) {
        capi_showmessage_by_data('succeed');
    } else {
        capi_showmessage_by_data('incorrect_code');
    }
} elseif ($op == "seccode") {
    //验证码
    $seccode = mkseccode();
    //设定cookie
    capi_showmessage_by_data("rest_success", 0, array("seccode_auth" => rawurlencode(authcode($seccode, 'ENCODE')), "seccode" => $seccode));
}
//生成随机
function mkseccode()
{
    $seccode = random(6, 1);
    $s = sprintf('%04s', base_convert($seccode, 10, 24));
    $seccode = '';
    $seccodeunits = 'BCEFGHJKMPQRTVWXY2346789';
    for ($i = 0; $i < 4; $i++) {
        $unit = ord($s[$i]);
        $seccode .= $unit >= 0x30 && $unit <= 0x39 ? $seccodeunits[$unit - 0x30] : $seccodeunits[$unit - 0x57];
    }
    return $seccode;
}
Exemplo n.º 6
0
    exit('Access Denied');
}
if (submitcheck('pwdsubmit')) {
    if ($_POST['newpasswd1'] != $_POST['newpasswd2']) {
        capi_showmessage_by_data('password_inconsistency');
    }
    if ($_POST['newpasswd1'] != addslashes($_POST['newpasswd1'])) {
        capi_showmessage_by_data('profile_passwd_illegal');
    }
    @(include_once S_ROOT . './uc_client/client.php');
    $ucresult = uc_user_edit($_SGLOBAL['supe_username'], $_POST['password'], $_POST['newpasswd1'], $space['email']);
    if ($ucresult == -1) {
        capi_showmessage_by_data('old_password_invalid');
    } elseif ($ucresult == -4) {
        capi_showmessage_by_data('email_format_is_wrong');
    } elseif ($ucresult == -5) {
        capi_showmessage_by_data('email_not_registered');
    } elseif ($ucresult == -6) {
        capi_showmessage_by_data('email_has_been_registered');
    } elseif ($ucresult == -7) {
        capi_showmessage_by_data('no_change');
    } elseif ($ucresult == -8) {
        capi_showmessage_by_data('protection_of_users');
    }
    clearcookie();
    capi_showmessage_by_data('getpasswd_succeed', 0);
}
//$actives = array('profile' => ' class="active"');
//include_once template("cp_password");
capi_showmessage_by_data('non_normal_operation');
Exemplo n.º 7
0
<?php

/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: do.php 12354 2009-06-11 08:14:06Z liguode $
*/
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . './common.php';
//获取方法
$ac = empty($_GET['ac']) ? '' : $_GET['ac'];
//自定义登录
// if($ac == $_SCONFIG['login_action']) {
// $ac = 'login';
// } elseif($ac == 'login') {
// $ac = '';
// }
// if($ac == $_SCONFIG['register_action']) {
// $ac = 'register';
// } elseif($ac == 'register') {
// $ac = '';
// }
//允许的方法
$acs = array('login', 'register', 'lostpasswd', 'swfupload', 'inputpwd', 'ajax', 'seccode', 'sendmail', 'stat', 'emailcheck');
if (empty($ac) || !in_array($ac, $acs)) {
    capi_showmessage_by_data('enter_the_space');
}
//链接
$theurl = 'do.php?ac=' . $ac;
include_once S_ROOT . './capi/source/do_' . $ac . '.php';
Exemplo n.º 8
0
    $bwztclass = $_SGLOBAL['db']->fetch_array($query);
}
if (empty($bwztclass)) {
    //showmessage('did_not_specify_the_type_of_operation');
    capi_showmessage_by_data('did_not_specify_the_type_of_operation');
}
if ($op == 'edit') {
    if (capi_submitcheck('editsubmit')) {
        $_GET['bwztclassname'] = getstr($_GET['bwztclassname'], 40, 1, 1, 1);
        if (strlen($_GET['bwztclassname']) < 1) {
            capi_showmessage_by_data('enter_the_correct_bwztclass_name');
        }
        updatetable('bwztclass', array('bwztclassname' => $_GET['bwztclassname']), array('bwztclassid' => $bwztclassid));
        //showmessage('do_success', $_POST['refer'], 0);
        capi_showmessage_by_data('do_success', 0);
    }
} elseif ($op == 'delete') {
    //删除分类
    if (capi_submitcheck('deletesubmit')) {
        //更新日志分类
        updatetable('bwzt', array('bwztclassid' => 0), array('bwztclassid' => $bwztclassid));
        $_SGLOBAL['db']->query("DELETE FROM " . tname('bwztclass') . " WHERE bwztclassid='{$bwztclassid}'");
        //showmessage('do_success', $_POST['refer'], 0);
        capi_showmessage_by_data('do_success', 0);
    }
}
//模版
//include_once template("cp_bwztclass");
//查看当前分类信息
capi_showmessage_by_data('do_success', 0, array("bwztclass" => $bwztclass));
Exemplo n.º 9
0
            }
            if ($experience) {
                $setarr['experience'] = "experience=experience+{$experience}";
            }
            $setarr['avatar'] = 'avatar=1';
            $setarr['updatetime'] = "updatetime={$_SGLOBAL['timestamp']}";
        }
    } else {
        if ($space['avatar']) {
            $setarr['avatar'] = 'avatar=0';
        }
    }
    if ($setarr) {
        $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET " . implode(',', $setarr) . " WHERE uid='{$space['uid']}'");
    }
    if (empty($_REQUEST['refer'])) {
        $_REQUEST['refer'] = 'space.php?do=home';
    }
    realname_get();
    //增加用户头像地址
    $space['avatar_url'] = $space['avatar'] ? avatar($space['uid'], 'middle', TRUE) : avatar_default();
    //通知数
    $space['allnotenum'] = 0;
    foreach (array('notenum', 'pokenum', 'addfriendnum', 'mtaginvitenum', 'eventinvitenum', 'myinvitenum') as $value) {
        $space['allnotenum'] = $space['allnotenum'] + $space[$value];
    }
    capi_showmessage_by_data('login_success', 0, array("m_auth" => rawurlencode($auth), 'uhash' => $_SGLOBAL['uhash'], "formhash" => formhash(), "space" => $space));
}
$membername = empty($_SCOOKIE['loginuser']) ? '' : sstripslashes($_SCOOKIE['loginuser']);
$cookiecheck = ' checked';
//include template('do_login');
Exemplo n.º 10
0
 function onuploadavatar4m()
 {
     $this->init_input(getgpc('agent', 'G'));
     $uid = $this->input('uid');
     if (empty($uid)) {
         //return -1;
         capi_showmessage_by_data('ucenter_error', -1, array('error' => 'uid is empty'));
     }
     if (empty($_FILES['Filedata'])) {
         //return -3;
         capi_showmessage_by_data('ucenter_error', -3, array('error' => 'Filedata is empty'));
     }
     list($width, $height, $type, $attr) = getimagesize($_FILES['Filedata']['tmp_name']);
     $imgtype = array(1 => '.gif', 2 => '.jpg', 3 => '.png');
     $filetype = $imgtype[$type];
     if (!$filetype) {
         $filetype = '.jpg';
     }
     $tmpavatar = UC_DATADIR . './tmp/upload' . $uid . $filetype;
     file_exists($tmpavatar) && @unlink($tmpavatar);
     if (@copy($_FILES['Filedata']['tmp_name'], $tmpavatar) || @move_uploaded_file($_FILES['Filedata']['tmp_name'], $tmpavatar)) {
         @unlink($_FILES['Filedata']['tmp_name']);
         list($width, $height, $type, $attr) = getimagesize($tmpavatar);
         if ($width < 10 || $height < 10 || $type == 4) {
             @unlink($tmpavatar);
             //return -2;
             capi_showmessage_by_data('ucenter_error', -2);
         }
     } else {
         @unlink($_FILES['Filedata']['tmp_name']);
         //return -4;
         capi_showmessage_by_data('ucenter_error', -4);
     }
     $avatarurl = UC_DATADIR . './tmp/upload' . $uid . $filetype;
     $home = $this->get_home($uid);
     if (!is_dir(UC_DATADIR . './avatar/' . $home)) {
         $this->set_home($uid, UC_DATADIR . './avatar/');
     }
     $avatartype = getgpc('avatartype', 'G') == 'real' ? 'real' : 'virtual';
     $bigavatarfile = UC_DATADIR . './avatar/' . $this->get_avatar($uid, 'big', $avatartype);
     $middleavatarfile = UC_DATADIR . './avatar/' . $this->get_avatar($uid, 'middle', $avatartype);
     $smallavatarfile = UC_DATADIR . './avatar/' . $this->get_avatar($uid, 'small', $avatartype);
     file_exists($bigavatarfile) && unlink($bigavatarfile);
     file_exists($middleavatarfile) && unlink($middleavatarfile);
     file_exists($smallavatarfile) && unlink($smallavatarfile);
     resizeImage($avatarurl, 200, 200, $bigavatarfile);
     resizeImage($avatarurl, 120, 120, $middleavatarfile);
     resizeImage($avatarurl, 48, 48, $smallavatarfile);
     $success = 1;
     $biginfo = @getimagesize($bigavatarfile);
     $middleinfo = @getimagesize($middleavatarfile);
     $smallinfo = @getimagesize($smallavatarfile);
     if (!$biginfo || !$middleinfo || !$smallinfo || $biginfo[2] == 4 || $middleinfo[2] == 4 || $smallinfo[2] == 4) {
         file_exists($bigavatarfile) && unlink($bigavatarfile);
         file_exists($middleavatarfile) && unlink($middleavatarfile);
         file_exists($smallavatarfile) && unlink($smallavatarfile);
         $success = 0;
     }
     $filetype = '.jpg';
     @unlink(UC_DATADIR . './tmp/upload' . $uid . $filetype);
     if ($success) {
         capi_showmessage_by_data('do_success', 0);
         // return '<?xml version="1.0" ? ><root><face success="1"/></root>';
     } else {
         capi_showmessage_by_data('ucenter_error');
         //return '<?xml version="1.0" ? ><root><face success="0"/></root>';
     }
 }
Exemplo n.º 11
0
            }
            $space['privacy']['filter_note'][$type_uid] = $type_uid;
            privacy_update();
        }
        capi_showmessage_by_data('do_success', $_POST['refer']);
    }
    $formid = random(8);
} elseif ($op == 'getuserapp') {
    //处理
    if (empty($_GET['subop'])) {
        //展开
        $my_userapp = array();
        foreach ($_SGLOBAL['my_userapp'] as $value) {
            if ($value['allowsidenav'] && !isset($_SGLOBAL['userapp'][$value['appid']])) {
                $my_userapp[] = $value;
            }
        }
    } else {
        $my_userapp = $_SGLOBAL['my_menu'];
    }
} elseif ($op == 'closefeedbox') {
    ssetcookie('closefeedbox', 1);
} elseif ($op == 'changetpl') {
    $dir = empty($_GET['name']) ? '' : str_replace('.', '', trim($_GET['name']));
    if ($dir && file_exists(S_ROOT . './template/' . $dir . '/style.css')) {
        ssetcookie('mytemplate', $dir, 3600 * 24 * 365);
        //长期有效
    }
    capi_showmessage_by_data('do_success', 0, 'space.php?do=feed');
}
//include template('cp_common');
Exemplo n.º 12
0
        $message = getstr($_POST['message'], 0, 1, 1, 1, 2);
        if (strlen($message) < 2) {
            capi_showmessage_by_data('content_is_too_short');
        }
        updatetable('comment', array('message' => $message), array('cid' => $comment['cid']));
        capi_showmessage_by_data('do_success', 0, array("refer" => $_POST['refer']));
    }
    //bbcode转换
    $comment['message'] = html2bbcode($comment['message']);
    //显示用
    capi_showmessage_by_data('do_success', 0, array("comment" => $comment));
} elseif ($_GET['op'] == 'delete') {
    if (capi_submitcheck('deletesubmit')) {
        include_once S_ROOT . './source/function_delete.php';
        if (deletecomments(array($cid))) {
            capi_showmessage_by_data('do_success', 0, array("refer" => $_POST['refer']));
        } else {
            capi_showmessage_by_data('no_privilege', 1, array('reason' => 'error delete'));
        }
    }
} elseif ($_GET['op'] == 'reply') {
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('comment') . " WHERE cid='{$cid}'");
    if (!($comment = $_SGLOBAL['db']->fetch_array($query))) {
        capi_showmessage_by_data('comments_do_not_exist');
    }
} else {
    capi_showmessage_by_data('no_privilege', 1, array('reason' => 'error op'));
}
//include template('cp_comment');
capi_showmessage_by_data("do_success", 0, array("comment" => $comment));
//
Exemplo n.º 13
0
        //产生feed
        if (ckprivacy('profile', 1)) {
            feed_add('profile', cplang('feed_profile_update_info'));
        }
        $url = 'cp.php?ac=profile&op=info';
        capi_showmessage_by_data('update_on_successful_individuals', 0);
    }
    //隐私
    $list = $friends = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spaceinfo') . " WHERE uid='{$space['uid']}' AND type='info'");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $list[$value['subtype']] = $value;
        $friends[$value['subtype']][$value['friend']] = ' selected';
    }
}
$cat_actives = array($_GET['op'] => ' class="active"');
if ($_GET['op'] == 'edu' || $_GET['op'] == 'work') {
    $yearhtml = '';
    $nowy = sgmdate('Y');
    for ($i = 0; $i < 50; $i++) {
        $they = $nowy - $i;
        $yearhtml .= "<option value=\"{$they}\">{$they}</option>";
    }
    $monthhtml = '';
    for ($i = 1; $i < 13; $i++) {
        $monthhtml .= "<option value=\"{$i}\">{$i}</option>";
    }
}
//include template("cp_profile");
capi_showmessage_by_data('do_success', 0, array('space' => $space));
Exemplo n.º 14
0
        $_SN[$space['uid']] = $space['username'];
    }
}
//游客
if (empty($space)) {
    $space = array('uid' => 0, 'username' => 'guest', 'self' => 1);
    if ($do == 'index') {
        $do = 'feed';
    }
}
//更新活动session
if ($_SGLOBAL['supe_uid']) {
    getmember();
    //获取当前用户信息
    if ($_SGLOBAL['member']['flag'] == -1) {
        capi_showmessage_by_data('space_has_been_locked');
    }
    //禁止访问
    if (checkperm('banvisit')) {
        ckspacelog();
        capi_showmessage_by_data('you_do_not_have_permission_to_visit');
    }
    updatetable('session', array('lastactivity' => $_SGLOBAL['timestamp']), array('uid' => $_SGLOBAL['supe_uid']));
}
//计划任务
if (!empty($_SCONFIG['cronnextrun']) && $_SCONFIG['cronnextrun'] <= $_SGLOBAL['timestamp']) {
    include_once S_ROOT . './source/function_cron.php';
    runcron();
}
//处理
include_once S_ROOT . "./capi/source/space_{$do}.php";
Exemplo n.º 15
0
function capi_cksearch($theurl)
{
    global $_SGLOBAL, $_SCONFIG, $space;
    $theurl = stripslashes($theurl) . "&page=" . $_GET['page'];
    if (!checkperm('searchignore')) {
        $reward = getreward('search', 0);
        if ($reward['credit'] || $reward['experience']) {
            if ($space['credit'] < $reward['credit'] || $space['experience'] < $reward['experience']) {
                capi_showmessage_by_data('points_search_error');
            } else {
                //扣分
                $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET lastsearch='{$_SGLOBAL['timestamp']}', credit=credit-{$reward['credit']}, experience=experience-{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
            }
        }
        return $reward;
    }
}
Exemplo n.º 16
0
    $bwztdivision = $_SGLOBAL['db']->fetch_array($query);
}
if (empty($bwztdivision)) {
    //showmessage('did_not_specify_the_type_of_operation');
    capi_showmessage_by_data('did_not_specify_the_type_of_operation');
}
if ($op == 'edit') {
    if (capi_submitcheck('editsubmit')) {
        $_GET['bwztdivisionname'] = getstr($_GET['bwztdivisionname'], 40, 1, 1, 1);
        if (strlen($_GET['bwztdivisionname']) < 1) {
            capi_showmessage_by_data('enter_the_correct_bwztdivision_name');
        }
        updatetable('bwztdivision', array('bwztdivisionname' => $_GET['bwztdivisionname']), array('bwztdivisionid' => $bwztdivisionid));
        //showmessage('do_success', $_POST['refer'], 0);
        capi_showmessage_by_data('do_success', 0);
    }
} elseif ($op == 'delete') {
    //删除分类
    if (capi_submitcheck('deletesubmit')) {
        //更新日志分类
        updatetable('bwzt', array('bwztdivisionid' => 0), array('bwztdivisionid' => $bwztdivisionid));
        $_SGLOBAL['db']->query("DELETE FROM " . tname('bwztdivision') . " WHERE bwztdivisionid='{$bwztdivisionid}'");
        //showmessage('do_success', $_POST['refer'], 0);
        capi_showmessage_by_data('do_success', 0);
    }
}
//模版
//include_once template("cp_bwztdivision");
//查看当前分类信息
capi_showmessage_by_data('do_success', 0, array("bwztdivision" => $bwztdivision));