private function getCurrentProjectData() { $session = new \RKA\Session(); $currentProjectID = intval($session->get('currentProject')); if ($currentProjectID > 0) { $this->db->where('projectID', $currentProjectID); $this->currentProjectArray = $this->db->getOne('projects', 'projectURL'); } else { $this->db->where('projectDefault', '1'); $this->currentProjectArray = $this->db->getOne('projects', 'projectID,projectURL'); if ($this->db->count == 0) { $this->db->orderBy('projectID', 'ASC'); $this->currentProjectArray = $this->db->getOne('projects', 'projectID,projectURL'); } else { } $session->set('currentProject', $this->currentProjectArray['projectID']); } }
$c = new App\Controller\Keywords($request, $response, $this->db, $this->renderer); $c->chart($args['id']); }); })->add(new App\CheckAuth()); $app->group('/projects', function () { $this->get('/{action:index|add}/', function ($request, $response, $args) { $c = new App\Controller\Projects($request, $response, $this->db, $this->renderer); $action = $args['action']; $c->{$action}(); }); $this->get('/edit/{id:\\d+}/', function ($request, $response, $args) { $c = new App\Controller\Projects($request, $response, $this->db, $this->renderer); $c->edit($args['id']); }); $this->get('/select/{id:\\d+}/', function ($request, $response, $args) { $session = new \RKA\Session(); $session->set('currentProject', $args['id']); return $response->withStatus(301)->withHeader('Location', '/Dashboard/index/'); }); })->add(new App\CheckAuth()); $app->group('/backlinks', function () { $this->get('/{action:index|add}/', function ($request, $response, $args) { $c = new App\Controller\Backlinks($request, $response, $this->db, $this->renderer); $action = $args['action']; $c->{$action}(); }); $this->get('/edit/{id:\\d+}/', function ($request, $response, $args) { $c = new App\Controller\Backlinks($request, $response, $this->db, $this->renderer); $c->edit($args['id']); }); })->add(new App\CheckAuth());
public function userProfile() { $session = new \RKA\Session(); return $session->get('auth-identity'); }
private function setLoginSession() { $session = new \RKA\Session(); $session->set('loggedin', '1'); }