Пример #1
0
<?php

/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: cp_avatar.php 13149 2009-08-13 03:11:26Z liguode $
*/
if (!defined('IN_UCHOME')) {
    exit('Access Denied');
}
//返回头像地址
$avatar_size = $_GET['avatar_size'];
$get_avatar = $_GET['get_avatar'];
if (!empty($get_avatar) && !empty($avatar_size)) {
    capi_showmessage_by_data('do_success', 0, array('avatar_url' => avatar($space['uid'], $avatar_size, TRUE)));
}
if (capi_submitcheck('avatarsubmit')) {
    if (empty($_FILES['Filedata'])) {
        capi_showmessage_by_data('upload_error');
    }
    $filepath = realpath($_FILES['Filedata']['tmp_name']);
    if ($filepath) {
        include_once S_ROOT . './uc_client/client.php';
        $uc_avatar_url = capi_uc_avatar($_SGLOBAL['supe_uid'], empty($_SCONFIG['avatarreal']) ? 'virtual' : 'real', 1);
        $data = array('Filedata' => '@' . $filepath . ";type=" . $_FILES['Filedata']['type'] . ";filename=" . $_FILES['Filedata']['name']);
        $curl = my_curl($uc_avatar_url, $data);
        //capi_runlog('curl',$curl);
        $result = @json_decode($curl);
        if ($result->code == 0) {
            /*
            $curl_cookie=$separate='';
            foreach($_COOKIE as $key => $val) {
Пример #2
0
    } else {
        $uploadStat = $uploadfiles;
    }
    if ($_SGLOBAL['mobile']) {
        if ($picid) {
            $uploadfiles['pic'] = pic_get($uploadfiles['filepath'], $uploadfiles['thumb'], $uploadfiles['remote']);
            capi_showmessage_by_data('do_success', 0, array("pic" => $uploadfiles));
        } else {
            capi_showmessage_by_data('rest_error', 1, array("stat" => $uploadStat));
        }
    } else {
        $uploadfiles['pic'] = pic_get($uploadfiles['filepath'], $uploadfiles['thumb'], $uploadfiles['remote']);
        capi_showmessage_by_data('do_success', 0, array("pic" => $uploadfiles));
    }
    exit;
} elseif (capi_submitcheck('viewAlbumid')) {
    //上传完成发送feed
    if ($eventid) {
        //跳到活动页面
        $imgs = array();
        $imglinks = array();
        $dateline = $_SGLOBAL['timestamp'] - 600;
        $query = $_SGLOBAL['db']->query("SELECT pic.* FROM " . tname("eventpic") . " ep LEFT JOIN " . tname("pic") . " pic ON ep.picid=pic.picid WHERE ep.uid='{$_SGLOBAL['supe_uid']}' AND ep.eventid='{$eventid}' AND ep.dateline > {$dateline} ORDER BY ep.dateline DESC LIMIT 4");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $imgs[] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
            $imglinks[] = "space.php?do=event&id={$eventid}&view=pic&picid=" . $value['picid'];
        }
        $picnum = 0;
        if ($imgs) {
            $picnum = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname("eventpic") . " WHERE eventid='{$eventid}'"), 0);
            feed_add('event', cplang('event_feed_share_pic_title'), '', cplang('event_feed_share_pic_info'), array("eventid" => $eventid, "title" => $event['title'], "picnum" => $picnum), '', $imgs, $imglinks);
Пример #3
0
    include_once S_ROOT . './source/function_cp.php';
    $invitearr = invite_get($uid, $invite);
    $url_plus = "uid={$uid}&invite={$invite}";
}
$jumpurl = $app ? "userapp.php?id={$app}&my_extra=invitedby_bi_{$uid}_{$code}&my_suffix=Lw%3D%3D" : 'space.php?do=home';
if (empty($op)) {
    if ($_SCONFIG['closeregister']) {
        if ($_SCONFIG['closeinvite']) {
            capi_showmessage_by_data('not_open_registration');
        } elseif (empty($invitearr)) {
            capi_showmessage_by_data('not_open_registration_invite');
        }
    }
    //是否关闭站点
    checkclose();
    if (capi_submitcheck('registersubmit')) {
        //已经注册用户
        if ($_SGLOBAL['supe_uid']) {
            capi_showmessage_by_data('registered');
        }
        if ($_SCONFIG['seccode_register']) {
            include_once S_ROOT . './source/function_cp.php';
            if (!capi_ckseccode($_REQUEST['seccode'], $_REQUEST['m_auth'])) {
                capi_showmessage_by_data('incorrect_code');
            }
        }
        if (!@(include_once S_ROOT . './uc_client/client.php')) {
            capi_showmessage_by_data('system_error');
        }
        if ($_REQUEST['password'] != $_REQUEST['password2']) {
            capi_showmessage_by_data('password_inconsistency');
Пример #4
0
if ($uid && $code && !$reward['credit']) {
    $m_space = getspace($uid);
    if ($code == space_key($m_space, $app)) {
        //验证通过
        $invitearr['uid'] = $uid;
        $invitearr['username'] = $m_space['username'];
    }
    $url_plus = "uid={$uid}&app={$app}&code={$code}";
} elseif ($uid && $invite) {
    include_once S_ROOT . './source/function_cp.php';
    $invitearr = invite_get($uid, $invite);
    $url_plus = "uid={$uid}&invite={$invite}";
}
//没有登录表单
$_SGLOBAL['nologinform'] = 1;
if (capi_submitcheck('loginsubmit')) {
    $password = $_REQUEST['password'];
    $username = trim($_REQUEST['username']);
    $cookietime = intval($_REQUEST['cookietime']);
    $cookiecheck = $cookietime ? ' checked' : '';
    $membername = $username;
    if (empty($_REQUEST['username'])) {
        capi_showmessage_by_data('users_were_not_empty_please_re_login');
    }
    if ($_SCONFIG['seccode_login']) {
        include_once S_ROOT . './source/function_cp.php';
        if (!ckseccode($_REQUEST['seccode'])) {
            $_SGLOBAL['input_seccode'] = 1;
            include template('do_login');
            exit;
        }
Пример #5
0
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('bwztclass') . " WHERE bwztclassid='{$bwztclassid}' AND uid='{$_SGLOBAL['supe_uid']}'");
    $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));
Пример #6
0
} elseif ($op == 'report') {
    $_GET['idtype'] = trim($_GET['idtype']);
    $_GET['id'] = intval($_GET['id']);
    $uidarr = $report = array();
    if (!in_array($_GET['idtype'], array('picid', 'blogid', 'bwztid', 'albumid', 'tagid', 'tid', 'sid', 'uid', 'pid', 'eventid', 'comment', 'post')) || empty($_GET['id'])) {
        capi_showmessage_by_data('report_error');
    }
    //获取举报记录
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('report') . " WHERE id='{$_GET['id']}' AND idtype='{$_GET['idtype']}'");
    if ($report = $_SGLOBAL['db']->fetch_array($query)) {
        $uidarr = unserialize($report['uids']);
        if ($uidarr[$space['uid']]) {
            capi_showmessage_by_data('repeat_report');
        }
    }
    if (capi_submitcheck('reportsubmit')) {
        $reason = getstr($_POST['reason'], 150, 1, 1);
        $reason = "<li><strong><a href=\"space.php?uid={$space['uid']}\" target=\"_blank\">{$_SGLOBAL['supe_username']}</a>:</strong> " . $reason . ' (' . sgmdate('m-d H:i') . ')</li>';
        if ($report) {
            $uidarr[$space['uid']] = $space['username'];
            $uids = addslashes(serialize($uidarr));
            $reason = addslashes($report['reason']) . $reason;
            $_SGLOBAL['db']->query("UPDATE " . tname('report') . " SET num=num+1, reason='{$reason}', dateline='{$_SGLOBAL['timestamp']}', uids='{$uids}' WHERE rid='{$report['rid']}'");
        } else {
            $uidarr[$space['uid']] = $space['username'];
            $setarr = array('id' => $_GET['id'], 'idtype' => $_GET['idtype'], 'num' => 1, 'new' => 1, 'reason' => $reason, 'uids' => addslashes(serialize($uidarr)), 'dateline' => $_SGLOBAL['timestamp']);
            inserttable('report', $setarr);
        }
        capi_showmessage_by_data('report_success', 0);
    }
    //判断是否是被忽略的举报
Пример #7
0
        }
        //产生feed
        if (ckprivacy('profile', 1)) {
            feed_add('profile', cplang('feed_profile_update_work'));
        }
        capi_showmessage_by_data('update_on_successful_individuals', 0);
    }
    //当前已经设置
    $list = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spaceinfo') . " WHERE uid='{$space['uid']}' AND type='work'");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $value['title_s'] = urlencode($value['title']);
        $list[] = $value;
    }
} elseif ($_GET['op'] == 'info') {
    if (capi_submitcheck('profilesubmit')) {
        $inserts = array();
        foreach ($_POST['info'] as $key => $value) {
            $value = getstr($value, 500, 1, 1);
            $friend = intval($_POST['info_friend'][$key]);
            $inserts[] = "('{$space['uid']}','info','{$key}','{$value}','{$friend}')";
        }
        if ($inserts) {
            $_SGLOBAL['db']->query("DELETE FROM " . tname('spaceinfo') . " WHERE uid='{$space['uid']}' AND type='info'");
            $_SGLOBAL['db']->query("INSERT INTO " . tname('spaceinfo') . "\n\t\t\t\t(uid,type,subtype,title,friend)\n\t\t\t\tVALUES " . implode(',', $inserts));
        }
        //变更记录
        if ($_SCONFIG['my_status']) {
            inserttable('userlog', array('uid' => $_SGLOBAL['supe_uid'], 'action' => 'update', 'dateline' => $_SGLOBAL['timestamp'], 'type' => 2), 0, true);
        }
        //产生feed
Пример #8
0
        if (deletebwzts(array($bwztid))) {
            capi_showmessage_by_data('do_success', 0, array("url" => "space.php?uid={$bwzt['uid']}&do=bwzt&view=me"));
        } else {
            capi_showmessage_by_data('failed_to_delete_operation');
        }
    }
} elseif ($_GET['op'] == 'goto') {
    $id = intval($_GET['id']);
    $uid = $id ? getcount('bwzt', array('bwztid' => $id), 'uid') : 0;
    capi_showmessage_by_data('do_success', 0, array("url" => "space.php?uid={$uid}&do=bwzt&id={$id}"));
} elseif ($_GET['op'] == 'edithot') {
    //权限
    if (!checkperm('managebwzt')) {
        capi_showmessage_by_data('no_privilege');
    }
    if (capi_submitcheck('hotsubmit')) {
        $_POST['hot'] = intval($_POST['hot']);
        updatetable('bwzt', array('hot' => $_POST['hot']), array('bwztid' => $bwzt['bwztid']));
        if ($_POST['hot'] > 0) {
            include_once S_ROOT . './source/function_feed.php';
            feed_publish($bwzt['bwztid'], 'bwztid');
        } else {
            updatetable('feed', array('hot' => $_POST['hot']), array('id' => $bwzt['bwztid'], 'idtype' => 'bwztid'));
        }
        capi_showmessage_by_data('do_success', 0, array("url" => "space.php?uid={$bwzt['uid']}&do=bwzt&id={$bwzt['bwztid']}"));
    }
} else {
    //添加编辑
    //获取个人分类
    $bwztclassarr = $bwzt['uid'] ? getbwztclassarr($bwzt['uid']) : getbwztclassarr($_SGLOBAL['supe_uid']);
    //获取科室分类