Exemple #1
0
        require_once PrintEot('thread_set');
        footer();
    } else {
        S::gp(array('tocid'));
        S::gp(array('password'));
        if (!threadSetCheckOwnerPassword($winduid, $password)) {
            Showmsg('您输入的密码不正确!');
        }
        if (!($toColony = $colonyServer->getColonyById($tocid)) || $toColony['admin'] != $colony['admin']) {
            Showmsg('undefined_action');
        }
        require_once R_P . 'require/functions.php';
        if (PwColony::calculateCredit($colony) > PwColony::calculateCredit($toColony)) {
            Showmsg('只允许群积分低的群组并入群积分高的群组!');
        }
        $colonyServer->mergeColony($tocid, $cyid);
        refreshto("thread.php?cyid={$tocid}", 'operate_success');
    }
} elseif ($t == 'attorn') {
    if (!($windid == $colony['admin'] && $groupRight['allowattorn'] || $groupid == '3')) {
        Showmsg('您没有权限进行转让操作!');
    }
    if (empty($_POST['step'])) {
        $groupManager = array();
        $query = $db->query("SELECT c.uid,m.username,m.groupid,m.memberid,m.icon FROM pw_cmembers c LEFT JOIN pw_members m ON c.uid=m.uid WHERE c.ifadmin='1' AND c.colonyid=" . S::sqlEscape($cyid));
        while ($rt = $db->fetch_array($query)) {
            $rt['groupid'] == '-1' && ($rt['groupid'] = $rt['memberid']);
            if ($rt['username'] == $colony['admin'] || $o_groups && strpos($o_groups, ',' . $rt['groupid'] . ',') === false) {
                continue;
            }
            list($rt['faceurl']) = showfacedesign($rt['icon'], 1, 'm');
Exemple #2
0
    } else {
        $basename = $basename . '&action=mergecolony';
        S::gp(array('fromcname', 'tocname'), '');
        require_once A_P . 'lib/colony.class.php';
        require_once A_P . 'lib/colonys.class.php';
        $colonyServer = new PW_Colony();
        if (!($colony = $colonyServer->getColonyByName($fromcname))) {
            adminmsg('源群组不存在!');
        }
        if (!($toColony = $colonyServer->getColonyByName($tocname))) {
            adminmsg('目标群组不存在!');
        }
        if (PwColony::calculateCredit($colony) > PwColony::calculateCredit($toColony)) {
            Showmsg('只允许群积分低的群组并入群积分高的群组!');
        }
        $colonyServer->mergeColony($toColony['id'], $colony['id']);
        adminmsg('operate_success', "{$basename}&action=mergecolony");
    }
} elseif ($action == 'delcolony') {
    S::gp(array('cyid'), '', 2);
    $rt = $db->get_one("SELECT classid,cnimg FROM pw_colonys WHERE id=" . S::sqlEscape($cyid));
    if (!empty($rt)) {
        Delcnimg($rt['cnimg']);
        pwFtpClose($ftp);
        //updateUserAppNum($rt['uid'],'group','recount');
        $db->update("UPDATE pw_cmembers a LEFT JOIN pw_ouserdata o ON a.uid=o.uid SET o.groupnum=o.groupnum-1 WHERE a.colonyid=" . S::sqlEscape($cyid) . ' AND o.groupnum>0');
        $db->update("DELETE FROM pw_argument WHERE cyid=" . S::sqlEscape($cyid));
        $db->update("DELETE FROM pw_cmembers WHERE colonyid=" . S::sqlEscape($cyid));
        //* $db->update("DELETE FROM pw_colonys  WHERE id=" . S::sqlEscape($cyid));
        pwQuery::delete('pw_colonys', 'id=:id', array($cyid));
        $db->update("UPDATE pw_cnclass SET cnsum=cnsum-1 WHERE fid=" . S::sqlEscape($rt['classid']) . ' AND cnsum>0');