| @@ 1434-1456 (lines=23) @@ | ||
| 1431 | * @param array $categories ID of the current category | |
| 1432 | * @return boolean | |
| 1433 | */ | |
| 1434 | public function deletePermission($mode, $categories) | |
| 1435 |     { | |
| 1436 |         if (!($mode == "user" || $mode == "group")) { | |
| 1437 | return false; | |
| 1438 | } | |
| 1439 |         if (!is_array($categories)) { | |
| 1440 | return false; | |
| 1441 | } | |
| 1442 | ||
| 1443 |         foreach ($categories as $category_id) { | |
| 1444 |             $query = sprintf(" | |
| 1445 | DELETE FROM | |
| 1446 | %sfaqcategory_%s | |
| 1447 | WHERE | |
| 1448 | category_id = %d", | |
| 1449 | PMF_Db::getTablePrefix(), | |
| 1450 | $mode, | |
| 1451 | $category_id); | |
| 1452 | $this->_config->getDb()->query($query); | |
| 1453 | } | |
| 1454 | ||
| 1455 | return true; | |
| 1456 | } | |
| 1457 | ||
| 1458 | /** | |
| 1459 | * Returns the category permissions for users and groups | |
| @@ 2609-2629 (lines=21) @@ | ||
| 2606 | * @access public | |
| 2607 | * @author Thorsten Rinne <[email protected]> | |
| 2608 | */ | |
| 2609 | function deletePermission($mode, $record_id) | |
| 2610 |     { | |
| 2611 |         if (!($mode == "user" || $mode == "group")) { | |
| 2612 | return false; | |
| 2613 | } | |
| 2614 |         if (!is_int($record_id)) { | |
| 2615 | return false; | |
| 2616 | } | |
| 2617 | ||
| 2618 |         $query = sprintf(" | |
| 2619 | DELETE FROM | |
| 2620 | %sfaqdata_%s | |
| 2621 | WHERE | |
| 2622 | record_id = %d", | |
| 2623 | PMF_Db::getTablePrefix(), | |
| 2624 | $mode, | |
| 2625 | $record_id); | |
| 2626 | $this->_config->getDb()->query($query); | |
| 2627 | ||
| 2628 | return true; | |
| 2629 | } | |
| 2630 | ||
| 2631 | /** | |
| 2632 | * Returns the record permissions for users and groups | |