/**
 * 
 * @param type $errors
 * @param type $entered_name
 */
function indexAction($errors = NULL, $entered_name = '')
{
    $user = getUserFromSession();
    if (!$user) {
        header('Location: /');
    }
    $projects = getProjectsByUserId($user['id']);
    $project = getProjectFromSession();
    if (!$project) {
        $project['name'] = 'new_project';
    }
    include TPL_PATH . 'main.php';
    include TPL_RSB_PATH . 'userRsb.php';
    include TPL_PATH . 'end.php';
}
Example #2
0
        $_RESPONSE['message'] = "Base Layer with given Id not found!";
    }
}
if (!$error) {
    $map['groupId'] = (int) $map['groupId'];
    if ($map['groupId'] != 0 && !getGroupById($user['id'], $map['groupId'])) {
        $error = true;
        $_RESPONSE['success'] = false;
        $_RESPONSE['message'] = "Base Layer Group with given Id not found!";
    }
}
if (!$error) {
    $map['projectId'] = (int) $map['projectId'];
    if ($map['projectId'] != 0) {
        if (isAdmin($user)) {
            $projects = getProjectsByUserId($user['id']);
        } else {
            $projects = getMyProjects($user['id']);
        }
        $found = false;
        foreach ($projects as $p) {
            if ($p['id'] == $map['projectId']) {
                $found = true;
            }
        }
        if (!$found) {
            $error = true;
            $_RESPONSE['success'] = false;
            $_RESPONSE['message'] = "Project with given Id not found!";
        }
    }