コード例 #1
0
ファイル: group-fns.php プロジェクト: rkania/GS3
function gs_group_permission_del($group_id, $permission_id, $type)
{
    $type = preg_replace('/[^a-z0-9\\-_]/', '', strToLower($type));
    if (!in_array($type, gs_group_permission_types_get())) {
        return new GsError('Invalid permission type.');
    }
    $db_master = gs_db_master_connect();
    if (!$db_master) {
        return new GsError('Could not connect to database.');
    }
    $ret = $db_master->execute('DELETE FROM `group_permissions` WHERE `group` = ' . $group_id . ' AND `permit` = ' . $permission_id . ' AND  `type` = \'' . $db_master->escape($type) . '\'');
    return $ret;
}
コード例 #2
0
    ?>
</th>
	<th style="min-width:1em;"></th>
</tr>
</thead>
<tbody>
<?php 
    $group_permissions = gs_group_permissions_get_names($group['id']);
    echo '<tr class="', $i % 2 === 0 ? 'odd' : 'even', '">', "\n";
    echo '<form method="post" action="' . GS_URL_PATH . '">';
    echo gs_form_hidden($SECTION, $MODULE);
    echo '<input type="hidden" name="page" value="' . $page . '" />', "\n";
    echo '<input type="hidden" name="id" value="' . $group_id . '" />', "\n";
    echo '<td>';
    echo '<select name="permission">', "\n";
    foreach (gs_group_permission_types_get() as $perm_type) {
        echo '<option value="', $perm_type, '">', $perm_type, '</option>', "\n";
    }
    echo '</select>', "\n";
    echo '</td>', "\n";
    echo '<td>';
    echo '<select name="group">', "\n";
    foreach (gs_group_info_get() as $group_info) {
        echo '<option value="', $group_info['id'], '">', $group_info['name'], ' -- ', $group_info['title'], '</option>', "\n";
    }
    echo '</select>', "\n";
    echo '</td>', "\n";
    echo '<td class="r" colspan="2">', "\n";
    echo '<button type="submit" name="action" value="insert-perm" title="', __('Berechtigung Einf&uuml;gen'), '" class="plain"><img alt="', __('Einf&uuml;gen'), '" src="', GS_URL_PATH, 'img/plus.gif" /></button>';
    echo '</td>', "\n";
    echo '</tr>', "\n";