コード例 #1
0
ファイル: groups.php プロジェクト: adrianbroher/thwboard
    $a_groupboard = array();
    $r_groupboard = query("SELECT groupid, accessmask FROM {$pref}" . "groupboard WHERE boardid='{$boardid}'");
    while ($groupboard = mysql_fetch_array($r_groupboard)) {
        $a_groupboard[$groupboard['groupid']] = $groupboard;
    }
    print '<table width="100%" border="0" cellspacing="0" cellpadding="4">';
    /* header */
    print '<tr><td></td>';
    while (list($k, $v) = each($p_desc)) {
        print '<td width="20" align="center"><img src="./images/pbar_' . $k . '.png"></td>';
    }
    print '</tr>';
    /* group rows */
    while (list(, $group) = each($a_group)) {
        print '<tr><td>' . htmlspecialchars($group['name']) . '<br><font size="1"><a href="groups.php?session=' . $session . '&action=editgroupboard&boardid=' . $boardid . '&groupid=' . $group['groupid'] . '">Modify permissions ...</a></font></td>';
        if (isset($a_groupboard[$group['groupid']])) {
            // custom perms
            print_perms($a_groupboard[$group['groupid']]['accessmask'], '#800000');
        } else {
            // global
            print_perms($group['accessmask'], '#000080');
        }
        print '</tr>';
    }
    print '</table>';
} elseif ($action == 'set_default_groups') {
    query("UPDATE {$pref}" . "registry SET keyvalue='{$default_groupid}' WHERE keyname='default_groupid'");
    query("UPDATE {$pref}" . "registry SET keyvalue='{$guest_groupid}' WHERE keyname='guest_groupid'");
    print 'Default groups have been set.';
}
tb_footer();
コード例 #2
0
ファイル: groups.php プロジェクト: BackupTheBerlios/thwc
    while ($groupboard = db_result($r_groupboard)) {
        $a_groupboard[$groupboard['groupid']] = $groupboard;
    }
    $data['work'] .= '<table width="100%" border="0" cellspacing="0" cellpadding="4">';
    /* header */
    $data['work'] .= '<tr><td id="blank"></td>';
    while (list($k, $v) = each($p_desc)) {
        $data['work'] .= '<td id="blank" style="width:20px; text-align:center"><img src="./images/pbar_' . $k . '.png"></td>';
    }
    $data['work'] .= '</tr>';
    /* group rows */
    while (list(, $group) = each($a_group)) {
        $data['work'] .= '<tr><td id="blank">' . htmlspecialchars($group['name']) . '<br><font size="1"><a href="groups.php?action=editgroupboard&boardid=' . $_GET['boardid'] . '&groupid=' . $group['groupid'] . '">Modify permissions ...</a></font></td>';
        if (isset($a_groupboard[$group['groupid']])) {
            // custom perms
            $data['work'] .= print_perms($a_groupboard[$group['groupid']]['accessmask'], '#800000');
        } else {
            // global
            $data['work'] .= print_perms($group['accessmask'], '#000080');
        }
        $data['work'] .= '</tr>';
    }
    $data['work'] .= '</table>';
} elseif ($action == 'set_default_groups') {
    db_query("UPDATE " . $pref . "registry SET\n         keyvalue='{$_POST['default_groupid']}'\n     WHERE keyname='default_groupid'");
    db_query("UPDATE " . $pref . "registry SET\n         keyvalue='{$_POST['guest_groupid']}'\n     WHERE keyname='guest_groupid'");
    $data['work'] = 'Default groups have been set.';
}
$data['javascript'] = '';
echo Template(Get_Template('templates/admin.html'));
tb_footer();