コード例 #1
0
ファイル: index.php プロジェクト: hyrmedia/directus
    if (!$isHttpsFn()) {
        $host = 'https://' . $_SERVER['SERVER_NAME'];
        if ('80' != $_SERVER['SERVER_PORT']) {
            $host .= ":" . $_SERVER['SERVER_PORT'];
        }
        $httpsUrl = $host . $_SERVER['REQUEST_URI'];
        header('Location: ' . $httpsUrl);
        exit;
    }
}
$users = getUsers();
$currentUserInfo = getCurrentUserInfo($users);
// Cache buster
$git = __DIR__ . '/.git';
$cacheBuster = Directus\Util\Git::getCloneHash($git);
$tableSchema = TableSchema::getAllSchemas($currentUserInfo['group']['id'], $cacheBuster);
// $tabPrivileges = getTabPrivileges(($currentUserInfo['group']['id']));
$groupId = $currentUserInfo['group']['id'];
$groups = getGroups();
$currentUserGroup = array();
if (isset($groups['rows']) && count($groups['rows'] > 0)) {
    foreach ($groups['rows'] as $group) {
        if ($group['id'] === $groupId) {
            $currentUserGroup = $group;
            break;
        }
    }
}
$statusMapping = array('active_num' => STATUS_ACTIVE_NUM, 'deleted_num' => STATUS_DELETED_NUM, 'status_name' => STATUS_COLUMN_NAME);
$statusMapping['mapping'] = $config['statusMapping'];
$data = array('cacheBuster' => $cacheBuster, 'nonces' => getNonces(), 'storage_adapters' => getStorageAdapters(), 'path' => DIRECTUS_PATH, 'page' => '#tables', 'tables' => parseTables($tableSchema), 'preferences' => parsePreferences($tableSchema), 'users' => $users, 'groups' => $groups, 'settings' => getSettings(), 'active_files' => getActiveFiles(), 'authenticatedUser' => $authenticatedUser, 'extensions' => getExtensions($currentUserGroup), 'privileges' => getPrivileges($groupId), 'ui' => getUI(), 'listViews' => getListViews(), 'messages' => getInbox(), 'bookmarks' => getBookmarks(), 'extendedUserColumns' => getExtendedUserColumns($tableSchema), 'statusMapping' => $statusMapping);