Skip to content
Browse files

Working on styling and key listing support.

  • Loading branch information...
1 parent 7eb59bd commit 0d8459eb4b68eb1b8424b101ad64934e698a1fda Stephen Fluin committed
Showing with 18 additions and 3 deletions.
  1. +3 −1 functions.inc.php
  2. +15 −2 index.php
View
4 functions.inc.php
@@ -11,6 +11,8 @@ function displayPage($page) {
<title>Gitosis Web</title>
<style type="text/css">
* { padding:0;margin:0;}
+.rightPanel {width:600px;float:right;border:1px solid black;}
+.leftPanel {width:500px;float:left;}
</style>
</head><body>' . $page . "<div style=\"color:red;text-align:center;\">Caution: All changes made using this tool are immediately pushed to the server, and can irrecoverably break your gitosis installation.</body></html>";
-}
+}
View
17 index.php
@@ -55,8 +55,9 @@ function showGitosisAdmin($dir) {
$config = getConfig();
checkKeyChanges($config);
+ $body .= '<form method="post" class="leftPanel"><textarea name="config" style="width:500px;height:400px;">' . $config . '</textarea><br/><button type="submit">Save and Push</button></form>';
$body .= getUserList($config);
- $body .= '<form method="post"><textarea name="config" style="width:500px;height:400px;">' . $config . '</textarea><br/><button type="submit">Save and Push</button></form>';
+ $body .= getKeyList();
return $body;
}
@@ -111,9 +112,21 @@ function getUserList($data) {
}
- $body = '<div style="width:600px;float:right;border:1px solid black;">' . $body . '</div>';
+ $body = '<div class="rightPanel">' . $body . '</div>';
return $body;
}
+function getKeyList() {
+ $body .= "<h2>Key List</h2>";
+ $files = scandir($_SESSION["dir"] . "keydir/");
+ foreach($files as $file) {
+ if(preg_match("/^(.*)\.pub$/",$file)) {
+ $body .= $file . "<br/>";
+ }
+ }
+
+ return '<div class="rightPanel">' . $body . '</div>';
+}
+
function checkKeyChanges($config) {
$k = $_POST["keyname"];

0 comments on commit 0d8459e

Please sign in to comment.
Something went wrong with that request. Please try again.