1234567891011121314151617 |
- <?php
- class GetProjectsAction implements IAction {
- public function execute() {
- if(!Authorize::isLoggedIn()) {
- return array("error" => "Access not authorized");
- }
- $database = SqliteDatabase::getSingleton();
- $projects = $database->queryArray("SELECT rowid AS project_id, * FROM projects WHERE project_id IN (SELECT project_id FROM account_projects WHERE account_id = ".$_SESSION['client_id'].");");
- return array("projects" => $projects);
- }
- private function isLoggedIn() {
- return isset($_SESSION['authorized']) && $_SESSION['authorized'];
- }
- }
|