@@ 1555-1577 (lines=23) @@ | ||
1552 | * |
|
1553 | * @return bool |
|
1554 | */ |
|
1555 | public function deletePermission($mode, $categories) |
|
1556 | { |
|
1557 | if (!($mode == 'user' || $mode == 'group')) { |
|
1558 | return false; |
|
1559 | } |
|
1560 | if (!is_array($categories)) { |
|
1561 | return false; |
|
1562 | } |
|
1563 | ||
1564 | foreach ($categories as $category_id) { |
|
1565 | $query = sprintf(' |
|
1566 | DELETE FROM |
|
1567 | %sfaqcategory_%s |
|
1568 | WHERE |
|
1569 | category_id = %d', |
|
1570 | PMF_Db::getTablePrefix(), |
|
1571 | $mode, |
|
1572 | $category_id); |
|
1573 | $this->_config->getDb()->query($query); |
|
1574 | } |
|
1575 | ||
1576 | return true; |
|
1577 | } |
|
1578 | ||
1579 | /** |
|
1580 | * Returns the category permissions for users and groups. |
@@ 2823-2843 (lines=21) @@ | ||
2820 | * |
|
2821 | * @author Thorsten Rinne <[email protected]> |
|
2822 | */ |
|
2823 | public function deletePermission($mode, $record_id) |
|
2824 | { |
|
2825 | if (!($mode == 'user' || $mode == 'group')) { |
|
2826 | return false; |
|
2827 | } |
|
2828 | if (!is_int($record_id)) { |
|
2829 | return false; |
|
2830 | } |
|
2831 | ||
2832 | $query = sprintf(' |
|
2833 | DELETE FROM |
|
2834 | %sfaqdata_%s |
|
2835 | WHERE |
|
2836 | record_id = %d', |
|
2837 | PMF_Db::getTablePrefix(), |
|
2838 | $mode, |
|
2839 | $record_id); |
|
2840 | $this->_config->getDb()->query($query); |
|
2841 | ||
2842 | return true; |
|
2843 | } |
|
2844 | ||
2845 | /** |
|
2846 | * Returns the record permissions for users and groups. |