barryserver-git
Barry Splitting into more pages + commit pages a6603d5 (2 years, 3 months ago)diff --git a/index.php b/index.php new file mode 100644 index 0000000..d0bb776 --- /dev/null +++ b/index.php @@ -0,0 +1,14 @@ +<?php session_start(); ?> +<?php require_once $_SERVER["DOCUMENT_ROOT"]."/config.php"; ?> +<?php require_once $_SERVER["DOCUMENT_ROOT"]."/head.php"; ?> +<main> + <h1>Repositories</h1> +<?php + $repos = preg_grep("/(.git)$/", scandir(GIT_DIR)); + foreach ($repos as $repo) { + $desc = file_get_contents(GIT_DIR."/".$repo."/description"); + if (substr($desc,0,7) !== "PRIVATE" || isset($_SESSION["username"])) { ?> + <a href="/<?= substr($repo,0,-4) ?>" class="repo"><b><?= substr($repo,0,-4) ?></b> :: <?= $desc ?></a> +<?php }} ?> +</main> +<?php require_once $_SERVER["DOCUMENT_ROOT"]."/foot.php"; ?>