public function login($user, $password) { $md5 = md5($password); $user = UserModel::where('user', '=', $user)->where('password')->get(); if ($user) { $session = new \RKA\Session(); $session->set('auth-identity', array('id' => $user->id, 'user' => $user->user, 'password' => $user->password, 'profile' => $user->name, 'group' => $user->group)); } }
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->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()); $app->group('/ajax', function () {
private function setLoginSession() { $session = new \RKA\Session(); $session->set('loggedin', '1'); }