@@ 2612-2632 (lines=21) @@ | ||
2609 | * @access public |
|
2610 | * @author Thorsten Rinne <[email protected]> |
|
2611 | */ |
|
2612 | function deletePermission($mode, $record_id) |
|
2613 | { |
|
2614 | if (!($mode == "user" || $mode == "group")) { |
|
2615 | return false; |
|
2616 | } |
|
2617 | if (!is_int($record_id)) { |
|
2618 | return false; |
|
2619 | } |
|
2620 | ||
2621 | $query = sprintf(" |
|
2622 | DELETE FROM |
|
2623 | %sfaqdata_%s |
|
2624 | WHERE |
|
2625 | record_id = %d", |
|
2626 | PMF_Db::getTablePrefix(), |
|
2627 | $mode, |
|
2628 | $record_id); |
|
2629 | $this->_config->getDb()->query($query); |
|
2630 | ||
2631 | return true; |
|
2632 | } |
|
2633 | ||
2634 | /** |
|
2635 | * Returns the record permissions for users and groups |
@@ 1415-1437 (lines=23) @@ | ||
1412 | * @param array $categories ID of the current category |
|
1413 | * @return boolean |
|
1414 | */ |
|
1415 | public function deletePermission($mode, $categories) |
|
1416 | { |
|
1417 | if (!($mode == "user" || $mode == "group")) { |
|
1418 | return false; |
|
1419 | } |
|
1420 | if (!is_array($categories)) { |
|
1421 | return false; |
|
1422 | } |
|
1423 | ||
1424 | foreach ($categories as $category_id) { |
|
1425 | $query = sprintf(" |
|
1426 | DELETE FROM |
|
1427 | %sfaqcategory_%s |
|
1428 | WHERE |
|
1429 | category_id = %d", |
|
1430 | PMF_Db::getTablePrefix(), |
|
1431 | $mode, |
|
1432 | $category_id); |
|
1433 | $this->_config->getDb()->query($query); |
|
1434 | } |
|
1435 | ||
1436 | return true; |
|
1437 | } |
|
1438 | ||
1439 | /** |
|
1440 | * Returns the category permissions for users and groups |