owls

diff Config/Setup.php @ 14:cebc198276eb

more file moving
author meillo@marmaro.de
date Sun, 27 May 2007 03:01:16 +0200
parents Setup.php@144bc36a6c27
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Config/Setup.php	Sun May 27 03:01:16 2007 +0200
     1.3 @@ -0,0 +1,52 @@
     1.4 +<?php
     1.5 +
     1.6 +// you can customize the config here
     1.7 +
     1.8 +$dbPrefix = 'rem__2_';    // the names of the db-tables will be prefixed with this string
     1.9 +
    1.10 +//$modifyProtected = true;    // are guests allowed to modify data? (true or false)
    1.11 +
    1.12 +$defaultUser = 'admin';    // useraccount if "modifyProtected = true" above
    1.13 +$defaultUserPassword = 'admin';    // password for useraccount if "modifyProtected = true" above
    1.14 +
    1.15 +
    1.16 +
    1.17 +// dont change anything form here on (except you know what you do)
    1.18 +//##################################################################
    1.19 +
    1.20 +  // write db-login-data to textfile
    1.21 +
    1.22 +
    1.23 +  // connect to db and create tables
    1.24 +  require('../Db.inc.php');
    1.25 +
    1.26 +
    1.27 +  // table 'Owls' for the content data
    1.28 +  mysql_query("
    1.29 +    CREATE TABLE IF NOT EXISTS `". $dbPrefix ."Owls` (
    1.30 +      `id` int(11) NOT NULL auto_increment,
    1.31 +      `idParent` int(11) default '0',
    1.32 +      `name` text NOT NULL,
    1.33 +      `text` longtext NOT NULL,
    1.34 +      `permission` tinyint(4) NOT NULL default '1',
    1.35 +      `date` int(11) NOT NULL default '0',
    1.36 +      PRIMARY KEY  (`id`)
    1.37 +    )
    1.38 +  ") or die(mysql_error());
    1.39 +
    1.40 +  // insert startup nodes
    1.41 +  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());
    1.42 +
    1.43 +
    1.44 +
    1.45 +  // login should be managed via text file in future
    1.46 +  mysql_query("CREATE TABLE IF NOT EXISTS `". $dbPrefix ."User` (
    1.47 +    `id` int(11) NOT NULL auto_increment,
    1.48 +    `loginname` tinytext NOT NULL,
    1.49 +    `password` tinytext NOT NULL,
    1.50 +    PRIMARY KEY  (`id`)
    1.51 +  )") or die(mysql_error());
    1.52 +
    1.53 +  mysql_query("INSERT INTO `". $dbPrefix ."User` VALUES (1, '". $defaultUser ."', '". md5($defaultUserPassword) ."')") or die(mysql_error());
    1.54 +
    1.55 +?>