commit 8217182dbc87833dd62f4af61643339b55590c9a
parent b2f9cdae0afe253abbf2cd5b877f35d42a3a3bab
Author: MTRNord <mtrnord1@gmail.com>
Date: Sat, 18 Apr 2015 23:00:37 +0200
update installer
Diffstat:
| M | install/index.php | | | 138 | +++++++++++++++++++++++++------------------------------------------------------ |
| A | install/set_variables.php | | | 95 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 138 insertions(+), 95 deletions(-)
diff --git a/install/index.php b/install/index.php
@@ -6,102 +6,50 @@
* @author Marcel Radzio <info@nordgedanken.de>
* @version 0.2 18/08/2014 18:45
*/-->
-<!Doctype html>
-<html>
-<head>
-<title>Installieren</title>
-</head>
-<body>
<?php
- if (!extension_loaded('mysql')) {
- if (!dl('mysql.so')) {
- echo "MySQL is not installed! Please install this module!";
- exit;
- }else{
- echo "MySQL has been successfully loaded";
- }
+###############################
+# include files from root dir #
+###############################
+$root_1 = realpath($_SERVER["DOCUMENT_ROOT"]);
+$currentdir = getcwd();
+$root_2 = str_replace($root_1, '', $currentdir);
+$root_3 = explode("/", $root_2);
+if ($root_3[1] == 'core') {
+ echo $root_3[1];
+ $root = realpath($_SERVER["DOCUMENT_ROOT"]);
+}else{
+ $root = $root_1 . '/' . $root_3[1];
+}
+
+################################
+# Check if mysqli is installed #
+################################
+if (!extension_loaded('mysqli')) {
+ if (!dl('mysqli.so')) {
+ echo "MySQLi is not installed! Please install this module!";
+ exit;
}else{
- echo "MySQL has been successfully loaded";
+ echo "MySQLi has been successfully loaded";
}
-?>
-<h1>Installer</h1>
-<!-- Reset Configs -->
-<?php
-#################
-#Database Config#
-#################
-//unlink('../core/config/connect.db.inc.php');
-######################
-#Blog Basics Config #
-######################
-//unlink('../core/config/variables.config.php');
-######################
-#temp pass #
-######################
-//unlink('../core/config/pass.tmp.php')
-?>
-<!-- Form to give data to config-generator -->
-<form action="generate_configs.php" method="post">
- <table cellpadding="1" cellspacing="4">
- <h3>MySQL</h3>
- <tr>
- <td><p>Datenbank Adresse: </p></td>
- <td><input type="name" name="db_address" required="required" placeholder="Datenbank Adresse" maxlength="255" /></td>
- </tr>
- <tr>
- <td><p>Nutzername: </p></td>
- <td><input type="name" name="db_username" required="required" placeholder="Nutzername" maxlength="255" /></td>
- </tr>
- <tr>
- <td><p>Passwort: </p></td>
- <td><input type="password" name="db_password" required="required" placeholder="Passwort" maxlength="50" /></td>
- </tr>
- <tr>
- <td><p>Datenbank Name: </p></td>
- <td><input type="name" name="db_name" required="required" placeholder="Datenbank Name" maxlength="255" /></td>
- </tr>
- </table>
-<h3>Basics</h3>
- <table cellpadding="1" cellspacing="4">
- <tr>
- <td><p>Website Name: </p></td>
- <td style="text-indent:40px;"><input type="name" name="blog_name" required="required" placeholder="Website Name" maxlength="255" /></td>
- </tr>
- <tr>
- <td><p>Untertitel: </p></td>
- <td style="text-indent:40px;"><input type="text" name="undertitle" required="required" placeholder="Untertitel" maxlength="255" /></td>
- </tr>
- <tr>
- <td><p>Schlagwörter: </p></td>
- <td style="text-indent:40px;"><input type="text" name="keywords" placeholder="Schlagwörter" maxlength="50" /></td>
- </tr>
- <tr>
- <td><p>Admin Username: </p></td>
- <td style="text-indent:40px;"><input type="text" name="admin_username" required="required" placeholder="Admin Username" maxlength="255" /></td>
- </tr>
- <tr>
- <td><p>Admin Password: </p></td>
- <td style="text-indent:40px;"><input type="text" name="admin_password" required="required" placeholder="Admin Password" maxlength="50" /></td>
- </tr>
- </table>
-<h3>Design</h3>
- <table cellpadding="1" cellspacing="4">
- <tr>
- <td><p>Theme</p></td>
- <td style="text-indent:40px;">
- <select name="theme" size="3">
- <option>accentbox</option>
- <option>jumbotron</option>
- <option>parkzone</option>
- <option>zResponsive</option>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="2"><input type="submit" name="send" value="Weiter" /></td>
- </tr>
- </table>
+}else{
+ echo "MySQLi has been successfully loaded";
+}
+
+###################################
+# Check if Directory is writeable #
+###################################
+if ( ! is_writable($root)) {
+ echo $root . ' must writable!!!';
+} else {
+ echo $root . "Is writeable!";
+}
-</form>
-</body>
-</html>
+if ($mysql == 1 && $dir == 1){
+ echo "
+ <form action=\"set_variables.php\" method=\"post\">
+ <input type=\"submit\" name=\"send\" value=\"Go on!\" />
+ </form>";
+}else{
+ echo "Can't proceed!"
+}
+?>
diff --git a/install/set_variables.php b/install/set_variables.php
@@ -0,0 +1,95 @@
+<!--/**
+* Set Variable
+*
+* This script sets the requierd Variables.
+*
+* @author Marcel Radzio <info@nordgedanken.de>
+* @version 0.2 18/08/2014 18:45
+*/-->
+<!Doctype html>
+<html>
+<head>
+<title>Installieren</title>
+</head>
+<body>
+<h1>Set Variables</h1>
+<!-- Reset Configs -->
+<?php
+#################
+#Database Config#
+#################
+//unlink('../core/config/connect.db.inc.php');
+######################
+#Blog Basics Config #
+######################
+//unlink('../core/config/variables.config.php');
+######################
+#temp pass #
+######################
+//unlink('../core/config/pass.tmp.php')
+?>
+<!-- Form to give data to config-generator -->
+<form action="generate_configs.php" method="post">
+ <table cellpadding="1" cellspacing="4">
+ <h3>MySQL</h3>
+ <tr>
+ <td><p>Datenbank Adresse: </p></td>
+ <td><input type="name" name="db_address" required="required" placeholder="Datenbank Adresse" maxlength="255" /></td>
+ </tr>
+ <tr>
+ <td><p>Nutzername: </p></td>
+ <td><input type="name" name="db_username" required="required" placeholder="Nutzername" maxlength="255" /></td>
+ </tr>
+ <tr>
+ <td><p>Passwort: </p></td>
+ <td><input type="password" name="db_password" required="required" placeholder="Passwort" maxlength="50" /></td>
+ </tr>
+ <tr>
+ <td><p>Datenbank Name: </p></td>
+ <td><input type="name" name="db_name" required="required" placeholder="Datenbank Name" maxlength="255" /></td>
+ </tr>
+ </table>
+<h3>Basics</h3>
+ <table cellpadding="1" cellspacing="4">
+ <tr>
+ <td><p>Website Name: </p></td>
+ <td style="text-indent:40px;"><input type="name" name="blog_name" required="required" placeholder="Website Name" maxlength="255" /></td>
+ </tr>
+ <tr>
+ <td><p>Untertitel: </p></td>
+ <td style="text-indent:40px;"><input type="text" name="undertitle" required="required" placeholder="Untertitel" maxlength="255" /></td>
+ </tr>
+ <tr>
+ <td><p>Schlagwörter: </p></td>
+ <td style="text-indent:40px;"><input type="text" name="keywords" placeholder="Schlagwörter" maxlength="50" /></td>
+ </tr>
+ <tr>
+ <td><p>Admin Username: </p></td>
+ <td style="text-indent:40px;"><input type="text" name="admin_username" required="required" placeholder="Admin Username" maxlength="255" /></td>
+ </tr>
+ <tr>
+ <td><p>Admin Password: </p></td>
+ <td style="text-indent:40px;"><input type="text" name="admin_password" required="required" placeholder="Admin Password" maxlength="50" /></td>
+ </tr>
+ </table>
+<h3>Design</h3>
+ <table cellpadding="1" cellspacing="4">
+ <tr>
+ <td><p>Theme</p></td>
+ <td style="text-indent:40px;">
+ <select name="theme" size="3">
+ <option>accentbox</option>
+ <option>jumbotron</option>
+ <option>parkzone</option>
+ <option>zResponsive</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"><input type="submit" name="send" value="Weiter" /></td>
+ </tr>
+ </table>
+
+</form>
+</body>
+</html>