Example #1
0
function getmember($parent, $k, $detail, &$member, $c)
{
    $c++;
    foreach ($parent[$k] as $value) {
        if (array_key_exists($value, $parent)) {
            if ($c > 5) {
                return;
            }
            //只递归5层
            getmember($parent, $value, $detail, $member, $c);
        } else {
            $member[] =& $detail[$value];
        }
    }
    if (array_key_exists($k, $detail)) {
        $member[] =& $detail[$k];
    }
}
Example #2
0
/*
     gettheblog.php用于获得用户的具体信息
     Add by am@ihome.2012-10-08  16:58
	 modified by xuxing@ihome. 2012-12-5 22:46
*/
include_once '../data_oauth_check.php';
$userid = intval(oauth_check());
include_once '../../../common.php';
include_once S_ROOT . './uc_client/client.php';
//@include_once(S_ROOT.'./data/data_profield.php');
$blogid = intval(trim($_POST[blogid]));
/*$blogid=645;
	$userid = 18;
	$username = '******';
	*/
getmember();
//print_r($_SGLOBAL);exit();
$result = array();
//chdir(dirname(dirname(dirname(__FILE__))));
$query = $_SGLOBAL['db']->query("SELECT b.blogid,b.friend,bf.target_ids,b.subject,bf.message,b.username,b.uid,b.pic,b.noreply,b.viewnum,b.replynum,b.dateline FROM " . tname('blog') . " b \r\n\t\t\t\tleft join " . tname('blogfield') . " bf  on b.blogid=bf.blogid where b.blogid={$blogid} ");
$blog = $_SGLOBAL['db']->fetch_array($query);
/*
//将日志中的图片进行绝对路径化。 start
preg_match_all("#[<]img\s+src[=]\"(.*)\".*[>]#U",$blog['message'], $matche, PREG_SET_ORDER);
//print_r($matches);
//print_r($matches);

foreach($matche as $item){
	//print_r($item[1]);
	$TmpString = $item[1]; 
	$TmpFace = $item[0];
Example #3
0
function checkperm($permtype)
{
    global $_SGLOBAL, $space;
    if ($permtype == 'admin') {
        $permtype = 'manageconfig';
    }
    $var = 'checkperm_' . $permtype;
    if (!isset($_SGLOBAL[$var])) {
        if (empty($_SGLOBAL['supe_uid'])) {
            $_SGLOBAL[$var] = '';
        } else {
            if (empty($_SGLOBAL['member'])) {
                getmember();
            }
            $gid = getgroupid($_SGLOBAL['member']['experience'], $_SGLOBAL['member']['groupid']);
            if (!@(include_once S_ROOT . './data/data_usergroup_' . $gid . '.php')) {
                usergroup_cache();
                @(include_once S_ROOT . './data/data_usergroup_' . $gid . '.php');
            }
            if ($gid != $_SGLOBAL['member']['groupid']) {
                updatetable('space', array('groupid' => $gid), array('uid' => $_SGLOBAL['supe_uid']));
                //赠送道具
                if ($_SGLOBAL['usergroup'][$gid]['magicaward']) {
                    include_once S_ROOT . './source/inc_magicaward.php';
                }
            }
            $_SGLOBAL[$var] = empty($_SGLOBAL['usergroup'][$gid][$permtype]) ? '' : $_SGLOBAL['usergroup'][$gid][$permtype];
            if (substr($permtype, 0, 6) == 'manage' && empty($_SGLOBAL[$var])) {
                $_SGLOBAL[$var] = $_SGLOBAL['usergroup'][$gid]['manageconfig'];
                //权限覆盖
                if (empty($_SGLOBAL[$var])) {
                    $_SGLOBAL[$var] = ckfounder($_SGLOBAL['supe_uid']) ? 1 : 0;
                    //创始人
                }
            }
        }
    }
    return $_SGLOBAL[$var];
}
Example #4
0
 if ($_POST['list1']) {
     e_addemail($Email, $_POST['list1']);
 }
 if ($_POST['list1'] && $_POST['list2']) {
     e_addemail($Email, $_POST['list2']);
 }
 if ($_POST['list1'] && $_POST['list3']) {
     e_addemail($Email, $_POST['list3']);
 }
 if ($_POST['list1'] && $_POST['list4']) {
     e_addemail($Email, $_POST['list4']);
 }
 #################################################################
 #
 #insert into action history
 $memberid = getmember($Email);
 $actionid = $_POST['actionid'];
 $subject = $_POST['subject'];
 $text = $_POST['text'];
 $MM_editTable = "action_history";
 $MM_fieldsStr = "actionid|value|memberid|value|subjectText|value|Letter_Content|value|date|value";
 $MM_columnsStr = "actionid|',none,''|memberid|',none,''|subject|',none,''|text|',none,''|date|',none,now()";
 require "Connections/insetstuff.php";
 require "Connections/dataactions.php";
 ##### mail to target
 # get send info
 $actiondetails = $dbcon->Execute("select * from action_text where id = " . $dbcon->qstr($_POST['actionid']));
 if ($actiondetails) {
     # prepare email
     $finalemail = "Dear " . $actiondetails->Fields("prefix") . " " . $actiondetails->Fields("firstname") . " " . $actiondetails->Fields("lastname") . ",\n" . strip_tags($_REQUEST['Letter_Content'] . "\n" . $_REQUEST['Title'] . " " . $_REQUEST['First_Name'] . " " . $_REQUEST['Last_Name'] . " \n" . $_REQUEST['City'] . " " . $_REQUEST['State'] . ' ' . $_REQUEST['Country'] . " \n" . $_REQUEST['Email'] . " \n");
     #send emails
Example #5
0
function checkperm($permtype, $gid = 0)
{
    global $_SGLOBAL, $_SCONFIG, $channel, $channels;
    if (!@(include_once S_ROOT . './data/system/group.cache.php')) {
        include_once S_ROOT . './function/cache.func.php';
        updategroupcache();
    }
    $founderprem = array('managetpl', 'managecss', 'managestyletpl');
    if (ckfounder($_SGLOBAL['supe_uid'])) {
        return $permtype == 'allowdirectpost' ? false : true;
        //´´Ê¼È˲»×öȨÏÞ¼ì²é
    } elseif (in_array($permtype, $founderprem)) {
        return false;
        //·Ç´´Ê¼ÈËȨÏÞ
    }
    if (!$gid) {
        if (empty($_SGLOBAL['supe_uid'])) {
            getmember();
        }
        if (empty($_SGLOBAL['member']['groupid'])) {
            $gid = 2;
            //ÓοÍ×é
        } else {
            $gid = intval($_SGLOBAL['member']['groupid']);
            $gid = getgroupid($_SGLOBAL['member']['experience'], $gid);
            if ($gid != $_SGLOBAL['member']['groupid']) {
                updatetable('members', array('groupid' => $gid), array('uid' => $_SGLOBAL['supe_uid']));
                //¸üÐÂÓû§×é
            }
        }
        if (!empty($channel)) {
            if (!empty($channels['menus'][$channel][$permtype])) {
                $extgroupid = explode("\t", $channels['menus'][$channel][$permtype]);
                if (!in_array($gid, $extgroupid)) {
                    return false;
                }
                //ûÓÐƵµÀ·ÃÎÊȨ
            }
        }
    }
    if ($permtype == 'allowmanage') {
        return true;
    }
    return empty($_SGLOBAL['grouparr'][$gid][$permtype]) ? false : true;
}
Example #6
0
	if($user = uc_get_user($uid, 1)) {
		$space = array('uid' => $user[0], 'username' => $user[1], 'dateline'=>$_SGLOBAL['timestamp'], 'friends'=>array());
		$_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) {
		showmessage('space_has_been_locked');
	}
	
	//禁止访问
	if(checkperm('banvisit')) {
		ckspacelog();
		showmessage('you_do_not_have_permission_to_visit');
	}
	
	updatetable('session', array('lastactivity' => $_SGLOBAL['timestamp']), array('uid'=>$_SGLOBAL['supe_uid']));
}

//计划任务
Example #7
0
function checkperm($permtype)
{
    global $_SGLOBAL, $space;
    @(include_once S_ROOT . './data/data_usergroup.php');
    //升级身份
    if (empty($_SGLOBAL['supe_uid'])) {
        return '';
    } else {
        if (empty($_SGLOBAL['member'])) {
            //获取当前人
            getmember();
        }
        $gid = getgroupid($_SGLOBAL['member']['credit'], $_SGLOBAL['member']['groupid']);
        if ($gid != $_SGLOBAL['member']['groupid']) {
            //需要升级
            updatetable('space', array('groupid' => $gid), array('uid' => $_SGLOBAL['supe_uid']));
        }
    }
    if ($permtype == 'admin') {
        $permtype = 'manageconfig';
    }
    return empty($_SGLOBAL['usergroup'][$gid][$permtype]) ? '' : $_SGLOBAL['usergroup'][$gid][$permtype];
}