| @@ 429-448 (lines=20) @@ | ||
| 426 | * @param string $name Name |
|
| 427 | * @return int |
|
| 428 | */ |
|
| 429 | public function getRightId($name) |
|
| 430 | { |
|
| 431 | // get right id |
|
| 432 | $select = sprintf(" |
|
| 433 | SELECT |
|
| 434 | right_id |
|
| 435 | FROM |
|
| 436 | %sfaqright |
|
| 437 | WHERE |
|
| 438 | name = '%s'", |
|
| 439 | PMF_Db::getTablePrefix(), |
|
| 440 | $this->config->getDb()->escape($name)); |
|
| 441 | ||
| 442 | $res = $this->config->getDb()->query($select); |
|
| 443 | if ($this->config->getDb()->numRows($res) != 1) { |
|
| 444 | return 0; |
|
| 445 | } |
|
| 446 | $row = $this->config->getDb()->fetchArray($res); |
|
| 447 | return $row['right_id']; |
|
| 448 | } |
|
| 449 | ||
| 450 | /** |
|
| 451 | * Returns an array that contains the IDs of all rights stored |
|
| @@ 537-556 (lines=20) @@ | ||
| 534 | * |
|
| 535 | * @return int |
|
| 536 | */ |
|
| 537 | public function getGroupId($name) |
|
| 538 | { |
|
| 539 | $select = sprintf(" |
|
| 540 | SELECT |
|
| 541 | group_id |
|
| 542 | FROM |
|
| 543 | %sfaqgroup |
|
| 544 | WHERE |
|
| 545 | name = '%s'", |
|
| 546 | PMF_Db::getTablePrefix(), |
|
| 547 | $this->config->getDb()->escape($name) |
|
| 548 | ); |
|
| 549 | ||
| 550 | $res = $this->config->getDb()->query($select); |
|
| 551 | if ($this->config->getDb()->numRows($res) != 1) { |
|
| 552 | return 0; |
|
| 553 | } |
|
| 554 | $row = $this->config->getDb()->fetchArray($res); |
|
| 555 | return $row['group_id']; |
|
| 556 | } |
|
| 557 | ||
| 558 | /** |
|
| 559 | * Returns an associative array with the group-data of the group |
|