diff Setup.php @ 0:3021ce32ee14 owls-0.5

begin of using hg for owls
author "Meillo r e t u r n s <meillo@marmaro.de>"
date Sun, 03 Dec 2006 22:32:13 +0100
parents
children 144bc36a6c27
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Setup.php	Sun Dec 03 22:32:13 2006 +0100
@@ -0,0 +1,52 @@
+<?php
+
+// you can customize the config here
+
+$dbPrefix = 'rem__2_';    // the names of the db-tables will be prefixed with this string
+
+//$modifyProtected = true;    // are guests allowed to modify data? (true or false)
+
+$defaultUser = 'admin';    // useraccount if "modifyProtected = true" above
+$defaultUserPassword = 'admin';    // password for useraccount if "modifyProtected = true" above
+
+
+
+// dont change anything form here on (except you know what you do)
+//##################################################################
+
+  // write db-login-data to textfile
+
+
+  // connect to db and create tables
+  require('../Db.inc.php');
+
+
+  // table 'Owls' for the content data
+  mysql_query("
+    CREATE TABLE IF NOT EXISTS `". $dbPrefix ."Owls` (
+      `id` int(11) NOT NULL auto_increment,
+      `idParent` int(11) default '0',
+      `name` text NOT NULL,
+      `text` longtext NOT NULL,
+      `permission` tinyint(4) NOT NULL default '1',
+      `date` int(11) NOT NULL default '0',
+      PRIMARY KEY  (`id`)
+    )
+  ") or die(mysql_error());
+
+  // insert startup nodes
+  mysql_query("INSERT INTO `". $dbPrefix ."Owls` VALUES (1, 0, 'Index', 'Thanks for using [url=http://prog.marmaro.de/owls/]Owls[/url]!', 0, now())") or die(mysql_error());
+
+
+
+  // login should be managed via text file in future
+  mysql_query("CREATE TABLE IF NOT EXISTS `". $dbPrefix ."User` (
+    `id` int(11) NOT NULL auto_increment,
+    `loginname` tinytext NOT NULL,
+    `password` tinytext NOT NULL,
+    PRIMARY KEY  (`id`)
+  )") or die(mysql_error());
+
+  mysql_query("INSERT INTO `". $dbPrefix ."User` VALUES (1, '". $defaultUser ."', '". md5($defaultUserPassword) ."')") or die(mysql_error());
+
+?>