Skip to content
Permalink
Browse files

Prepare for different user roles in project

  • Loading branch information...
uprel committed Mar 13, 2019
1 parent fe78b56 commit 28e5a1f278d348966bb3da3df152cbf75cdc88ff
Showing with 7 additions and 6 deletions.
  1. +4 −3 admin/class.DbLoader.php
  2. +3 −3 admin/class.Login.php
@@ -35,13 +35,14 @@ public function checkUserProject()
if($exec) {
$result_row = $query->fetchObject();
if ($result_row) {
return $result_row->check_user_project;
$role = isset($result_row->role) ? $result_row->role : null;
return ['check' => $result_row->check_user_project, 'role' => $role];
} else
return 'TR.loginFailMessage';
return ['check' => 'TR.loginFailMessage'];
}
else {
//SQL execute error, get error message
return $query->errorInfo()[2];
return ['check' => $query->errorInfo()[2]];
}
}
@@ -327,11 +327,10 @@ private function loadProjectData($user, $project)
return false;
}
//aditional check if project and user exists and user has permission to use project
$check = $gisApp->checkUserProject();
if ($check == 'OK') {
if ($check['check'] == 'OK') {
$role = $check['role'];
//get additional project info
$project_data = $gisApp->getProjectDataFromDB();
if ($project_data == false) {
@@ -383,6 +382,7 @@ private function loadProjectData($user, $project)
$_SESSION['project'] = $project;
$_SESSION['project_path'] = $projectPath['message'];
$_SESSION['role'] = $role;
$_SESSION['data'] = $project_data;
$_SESSION['settings'] = $project_settings['message'];
$_SESSION['description'] = $project_description['message'];

0 comments on commit 28e5a1f

Please sign in to comment.
You can’t perform that action at this time.