Quellcode durchsuchen

WIP, finishing for the weekend to pick up later

Andy Baugh vor 9 Jahren
Ursprung
Commit
6b0daa93fc
2 geänderte Dateien mit 24 neuen und 1 gelöschten Zeilen
  1. 10 1
      bin/install
  2. 14 0
      templates/default/nav.inc

+ 10 - 1
bin/install

@@ -28,12 +28,21 @@ if( $private_base != $user_info['dir'] . "/.tCMS" ) {
     echo "        wish to prevent this information disclosure. Please press [enter] to continue.";
     get_string_from_stdin(); # Mostly just to make the user confirm they read this.
 }
-#TODO Add question here asking for administrator user setup. DO NOT ALLOW DEFAULT VALUES
+while( empty($username) ) {
+    echo "Please enter in the name you'd like to login to tCMS as (you can add more users later):";
+    $username = get_string_from_stdin();
+}
+while( empty($password) ) { # PHP has no standardized way to do this, so do it with shell, "pray it goes ok".
+    $password = shell_exec('read -s PW; echo $PW');
+}
 $wd = realpath( dirname( __FILE__ ) . "/../" );
 echo "[INFO] Installing private data to $private_base now...\n";
 $files = [ 'lib', 'templates' ];
 install( $private_base, $wd, $files );
 ensure_directories_exist( [ "$private_base/blog", "$private_base/microblog", "$private_base/conf" ] );
+echo "[INFO] Writing user configuration and generating 4096-bit RSA public/private keypair...\n";
+#HEREHERE pick up here
+#file_put_contents('');
 #TODO Generate private/public keypair with passphrase of user entered credentials.
 echo "[INFO] Installing public data to $public_base now...\n";
 $files = [ 'css', 'fileshare', 'img', 'index.php', 'sys' ];

+ 14 - 0
templates/default/nav.inc

@@ -0,0 +1,14 @@
+<div id="lefttitle" class="toplel">
+ <?php
+  echo $config['htmltitle'];
+ ?>
+</div>
+<div id="midtitle" class="toplel">
+</div>
+<button title="Menu" id="clickme">&#9776;</button>
+<div id="righttitle" class="toplel">
+ <a href="index.php?nav=2" title="Micro Blog" class="topbar">LinkLog</a>
+ <a href="index.php?nav=3" title="Blog" class="topbar">Blog</a>
+ <a href="index.php?nav=1&amp;dir=fileshare" title="File Share" class="topbar">Fileshare</a>
+ <a href="index.php?nav=4" title="About" class="topbar">About</a>
+</div>