2010-04-14 04:21:26 +02:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
< html >
2009-06-18 01:14:40 +02:00
< head >
< title > SilverStripe CMS Installation< / title >
2010-04-14 04:21:26 +02:00
< meta http-equiv = "Content-type" content = "text/html; charset=utf-8" >
2010-04-14 04:22:54 +02:00
< script type = "text/javascript" >
2009-06-18 01:14:40 +02:00
function show(id) {
document.getElementById(id).style.display = '';
}
function hide(id) {
document.getElementById(id).style.display = 'none';
}
2010-04-14 04:22:54 +02:00
function getElementsByClassName(classname, node) {
if(!node) node = document.getElementsByTagName("body")[0];
var a = [];
var re = new RegExp('\\b' + classname + '\\b');
var els = node.getElementsByTagName("*");
for(var i=0,j=els.length; i< j ; i + + )
if(re.test(els[i].className))a.push(els[i]);
return a;
}
function toggleDisabledFields(el) {
if(!el.checked) {
// Go through each environment supported field and enable
document.getElementById('db_server').disabled = '';
document.getElementById('db_username').disabled = '';
document.getElementById('db_password').disabled = '';
document.getElementById('admin_username').disabled = '';
document.getElementById('admin_password').disabled = '';
var dbs = getElementsByClassName('databaseClass');
for(var i = 0; i < dbs.length ; i + + ) {
dbs[i].disabled = '';
}
} else {
// Go through each environment supported field and disable
document.getElementById('db_server').disabled = 'disabled';
document.getElementById('db_username').disabled = 'disabled';
document.getElementById('db_password').disabled = 'disabled';
document.getElementById('admin_username').disabled = 'disabled';
document.getElementById('admin_password').disabled = 'disabled';
var dbs = getElementsByClassName('databaseClass');
for(var i = 0; i < dbs.length ; i + + ) {
dbs[i].disabled = 'disabled';
}
}
}
2009-06-18 01:14:40 +02:00
< / script >
2010-04-14 04:21:26 +02:00
< link rel = "stylesheet" type = "text/css" href = "themes/blackcandy/css/layout.css" >
< link rel = "stylesheet" type = "text/css" href = "themes/blackcandy/css/typography.css" >
< link rel = "stylesheet" type = "text/css" href = "themes/blackcandy/css/form.css" >
< link rel = "stylesheet" type = "text/css" href = "sapphire/dev/install/install.css" >
< link rel = "shortcut icon" href = "favicon.ico" >
2009-06-18 01:14:40 +02:00
< / head >
< body >
< div id = "BgContainer" >
< div id = "Container" >
< div id = "Header" >
< h1 > SilverStripe CMS Installation< / h1 >
< p > Version <?php echo $silverstripe_version; ?> < / p >
< / div >
< div id = "Navigation" > < / div >
< div class = "clear" > <!-- --> < / div >
< div id = "Layout" >
< div class = "typography" >
< h1 > Welcome to SilverStripe< / h1 >
< p > Thanks for choosing to use SilverStripe! Please follow the instructions below to get SilverStripe installed.< / p >
< form action = "install.php" method = "post" >
<?php if(isset($hasErrorOtherThanDatabase)) { ?>
< p class = "error" >
2010-04-14 04:21:26 +02:00
You aren't currently able to install the software. Please < a href = "#requirements" > see below< / a > for details.< br >
2009-11-06 04:35:07 +01:00
If you are having problems meeting the requirements, see the < a href = "http://doc.silverstripe.org/doku.php?id=server-requirements" > server requirements wiki page< / a > .
2009-06-18 01:14:40 +02:00
< / p >
<?php } else { ?>
<?php if($req->hasWarnings()) { ?>
< p class = "warning" >
There are some issues that we recommend you look at before installing, however, you are still able to install the software.
2010-04-14 04:21:26 +02:00
Please see below for details.< br >
2009-11-06 04:35:07 +01:00
If you are having problems meeting the requirements, see the < a href = "http://doc.silverstripe.org/doku.php?id=server-requirements" > server requirements wiki page< / a > .
2009-06-18 01:14:40 +02:00
< / p >
2009-11-19 21:23:19 +01:00
<?php } else if(!$adminConfig['username'] || !$adminConfig['password']) { ?>
< p class = "warning" >
Please fill in a username and password for the admin account to install.
< / p >
2009-06-18 01:14:40 +02:00
<?php } else if(!$dbReq->hasErrors()) { ?>
2010-04-14 04:22:21 +02:00
< p class = "good" > You're ready to install!< / p >
<?php } ?>
< h3 > Template to install:< / h3 >
2009-06-18 01:14:40 +02:00
< ul id = "Themes" >
2010-04-14 04:21:26 +02:00
< li > < input type = "radio" name = "template" value = "blackcandy" id = "BlackCandy" < ? php if ( ! isset ( $ _POST [ ' template ' ] ) | | $ _POST [ ' template ' ] = = ' blackcandy ' ) { ? > checked="checked"<?php }?> >< label for = "BlackCandy" > BlackCandy, default template ready to use.< / label > < / li >
< li > < input type = "radio" name = "template" value = "tutorial" id = "EmptyTemplate" < ? php if ( isset ( $ _POST [ ' template ' ] ) & & $ _POST [ ' template ' ] = = ' tutorial ' ) { ? > checked="checked"<?php }?> >< label for = "EmptyTemplate" > Empty template, ready to begin the tutorial.< / label > < / li >
2009-06-18 01:14:40 +02:00
< / ul >
< p > You can change the template or download another from the SilverStripe website after installation.< / p >
2010-04-14 04:22:21 +02:00
< input type = "checkbox" id = "stats" name = "stats" checked = "checked" > < label for = "stats" > Send information on my webserver to SilverStripe (this is only version information, used for statistical purposes)< / label > < br >
2009-06-18 01:14:40 +02:00
<?php if($alreadyInstalled) { ?>
< p class = "warning" >
< strong > Note:< / strong > It seems as though SilverStripe is already installed here. If you ask me to install, I will overwrite
the < strong > .htaccess< / strong > and < strong > mysite/_config.php< / strong > files.
2010-04-14 04:21:26 +02:00
< br >
< input type = "checkbox" id = "ReIn" name = "force_reinstall" onclick = "document.getElementById('install_button').disabled = !this.checked" > < label for = "ReIn" > That's okay, please re-install SilverStripe and overwrite these files.< / label >
2009-06-18 01:14:40 +02:00
< / p >
<?php } ?>
2010-04-14 04:22:21 +02:00
2009-06-18 01:14:40 +02:00
< p >
<?php if($alreadyInstalled) { ?>
2010-04-14 04:21:26 +02:00
< input id = "install_button" type = "submit" disabled = "disabled" class = "action" name = "go" value = "Install SilverStripe" onclick = "document.getElementById('saving_top').style.display = ''; this.value = 'Installing SilverStripe...'" >
2009-06-18 01:14:40 +02:00
<?php } else { ?>
2010-04-14 04:21:26 +02:00
< input id = "install_button" type = "submit" class = "action" name = "go" value = "Install SilverStripe" onclick = "document.getElementById('saving_top').style.display = ''; this.value = 'Installing SilverStripe...'" >
2009-06-18 01:14:40 +02:00
<?php } ?>
< span id = "saving_top" style = "display: none" >
2010-04-14 04:21:26 +02:00
< img src = "cms/images/network-save.gif" >
2009-06-18 01:14:40 +02:00
(this will take a minute or so)
< / span >
< / p >
<?php } ?>
2010-04-14 04:21:11 +02:00
< h4 class = "sectionHeading" > Database< / h4 >
2009-06-18 01:14:40 +02:00
<?php if($dbReq->hasErrors()) { ?>
2010-04-14 04:22:54 +02:00
< p class = "error" >
2009-06-18 01:14:40 +02:00
These database details don't appear to be correct. Please enter the correct details before installing.
< / p >
<?php } else { ?>
< p class = "good" >
These database details look all good!
< / p >
<?php } ?>
2010-04-14 04:21:11 +02:00
< div id = "database_credentials" class = "section" >
2010-04-14 05:30:13 +02:00
<?php if($envFileExists) { ?>
2010-04-14 04:22:54 +02:00
< div id = "use_environment_field" class = "field" >
2010-04-14 05:29:59 +02:00
< input id = "use_environment" type = "checkbox" name = "useEnv" < ? php if ( $ usingEnv ) echo " checked = \"checked\"" ? > onclick="toggleDisabledFields(this);">
2010-04-14 04:22:54 +02:00
< label for = "use_environment" > Use _ss_environment file for configuration< / label >
< / div >
<?php } ?>
< div class = "field" >
< label > Database type:< / label >
< ul id = "database_selection" >
< ?php
foreach($foundDatabaseClasses as $class => $title) {
$checked = ($databaseConfig['type'] == $class) ? ' checked="checked"' : '';
$disabled = '';
2010-04-14 05:29:59 +02:00
if($usingEnv) {
2010-04-14 04:22:54 +02:00
// All are disabled by default when environment is used
$disabled = 'disabled="disabled"';
// If SS_DATABASE_CLASS is specified, check the database in the list
if(defined('SS_DATABASE_CLASS') & & SS_DATABASE_CLASS == $class) {
$checked = ' checked="checked"';
}
}
echo "< li > ";
echo "< input id = \"$class\" class = \"databaseClass\" type = \"radio\" name = \"db[type]\" value = \"$class\"$checked $ disabled > ";
echo "< label class = \"left\" for = \"$class\" > $title< / label > ";
echo "< / li > ";
2010-04-14 04:21:11 +02:00
}
2010-04-14 04:22:54 +02:00
?>
< / ul >
< / div >
2010-04-14 04:21:39 +02:00
< div class = "field" >
< label for = "db_server" > Database server:< / label >
< span class = "middleColumn" >
2010-04-14 05:29:59 +02:00
< input id = "db_server" class = "text" type = "text" name = "db[server]" value = "<?php echo $databaseConfig['server']; ?>" < ? php if ( $ usingEnv & & defined ( ' SS_DATABASE_SERVER ' ) ) echo ' disabled = "disabled" ' ; ? > >
2010-04-14 04:21:39 +02:00
< / span >
< / div >
< div class = "field" >
< label for = "db_username" > Database username:< / label >
< span class = "middleColumn" >
2010-04-14 05:29:59 +02:00
< input id = "db_username" class = "text" type = "text" name = "db[username]" value = "<?php echo $databaseConfig['username']; ?>" < ? php if ( $ usingEnv & & defined ( ' SS_DATABASE_USERNAME ' ) ) echo ' disabled = "disabled" ' ; ? > >
2010-04-14 04:21:39 +02:00
< / span >
< / div >
< div class = "field" >
< label for = "db_password" > Database password:< / label >
< span class = "middleColumn" >
2010-04-14 05:29:59 +02:00
< input id = "db_password" class = "text" type = "password" name = "db[password]" value = "<?php echo $databaseConfig['password']; ?>" < ? php if ( $ usingEnv & & defined ( ' SS_DATABASE_PASSWORD ' ) ) echo ' disabled = "disabled" ' ; ? > >
2010-04-14 04:21:39 +02:00
< / span >
< / div >
< div class = "field" >
< label for = "db_database" > Database name:< / label >
< span class = "middleColumn" >
< input id = "db_database" class = "text" type = "text" name = "db[database]" value = "<?php echo $databaseConfig['database']; ?>" onchange = "this.value = this.value.replace(/[\/\\:*?"<>|. \t]+/g,'');" >
< / span >
< / div >
< div class = "action" >
< input type = "submit" class = "action" value = "Re-check requirements" >
< / div >
2010-04-14 04:21:11 +02:00
< / div >
2010-04-14 04:21:39 +02:00
2010-04-14 04:21:52 +02:00
< p id = "dbHelp" class = "helpText" >
SilverStripe stores its content in a relational SQL database. Please provide the username and password to connect to the server here.
If this account has permission to create databases, then we will create the database for you; otherwise, you must give the name of a
database that already exists.
< / p >
2010-04-14 05:46:56 +02:00
< div class = "clear" > <!-- --> < / div >
2010-04-14 04:21:11 +02:00
<?php $dbReq->showTable("Database Configuration"); ?>
2010-04-14 04:21:39 +02:00
2010-04-14 04:21:11 +02:00
< h4 class = "sectionHeading" > SilverStripe Administration Account< / h4 >
< div id = "AdminAccount" class = "section" >
2010-04-14 04:21:39 +02:00
< div class = "field" >
< label for = "admin_username" > Administrator email:< / label >
< span class = "middleColumn" >
2010-04-14 05:29:59 +02:00
< input type = "text" class = "text" name = "admin[username]" id = "admin_username" value = "<?php echo $adminConfig['username']; ?>" < ? php if ( $ usingEnv & & defined ( ' SS_DEFAULT_ADMIN_USERNAME ' ) ) echo ' disabled = "disabled" ' ? > >
2010-04-14 04:21:39 +02:00
< / span >
< / div >
< div class = "field" >
< label for = "admin_password" > Administrator password:< / label >
< span class = "middleColumn" >
2010-04-14 05:29:59 +02:00
< input type = "password" class = "text" name = "admin[password]" id = "admin_password" value = "<?php echo $adminConfig['password']; ?>" < ? php if ( $ usingEnv & & defined ( ' SS_DEFAULT_ADMIN_PASSWORD ' ) ) echo ' disabled = "disabled" ' ? > >
2010-04-14 04:21:39 +02:00
< / span >
< / div >
< div class = "field" >
< label for = "admin_firstname" > Administrator first name:< / label >
< span class = "middleColumn" >
< input type = "text" class = "text" name = "admin[firstname]" id = "admin_firstname" value = "<?php echo $adminConfig['firstname']; ?>" >
< / span >
< / div >
< div class = "field" >
< label for = "admin_surname" > Administrator surname:< / label >
< span class = "middleColumn" >
< input type = "text" class = "text" name = "admin[surname]" id = "admin_surname" value = "<?php echo $adminConfig['surname']; ?>" >
< / span >
< / div >
2010-04-14 04:21:11 +02:00
< / div >
2010-04-14 04:21:52 +02:00
< p id = "adminAcc" class = "helpText" >
We will set up 1 administrator account for you automatically. Enter the email address and password. If you'd
2009-06-18 01:14:40 +02:00
rather log-in with a username instead of an email address, enter that instead.
< / p >
2010-04-14 04:21:11 +02:00
< h4 class = "sectionHeading" > Development Servers< / h4 >
2010-04-14 04:21:26 +02:00
< div class = "section" >
2009-06-18 01:14:40 +02:00
< label for = "devsites" > Development servers:< / label >
2010-04-14 04:21:39 +02:00
< span class = "middleColumn" >
2010-04-14 05:51:03 +02:00
< textarea name = "devsites" id = "devsites" rows = "5" cols = "10" >
< ?php if(@$_POST['devsites']) echo $_POST['devsites'];
else echo 'localhost
127.0.0.1'; ?>< / textarea >
2010-04-14 04:21:39 +02:00
< / span >
2010-04-14 04:21:11 +02:00
< / div >
2010-04-14 04:21:52 +02:00
< p id = "devHelp" class = "helpText" >
2009-11-06 04:35:07 +01:00
SilverStripe allows you to run a site in < a href = "http://doc.silverstripe.org/doku.php?id=configuration" > development mode< / a > .
2009-06-18 01:14:40 +02:00
This shows all error messages in the web browser instead of emailing them to the administrator, and allows
the database to be built without logging in as administrator. Please enter the host/domain names for servers
you will be using for development.
< / p >
< h4 id = "requirements" > Requirements< / h4 >
2010-04-14 04:21:11 +02:00
<?php $req->showTable(); ?>
2009-06-18 01:14:40 +02:00
< / form >
< / div >
< / div >
< div class = "clear" > <!-- --> < / div >
< / div >
< div id = "Footer" >
< div class = "footerTop" > <!-- --> < / div >
2009-11-06 04:35:07 +01:00
< p > < a href = "http://www.silverstripe.org" > SilverStripe Open Source CMS< / a > | Copyright © 2008 SilverStripe Limited< / p >
2009-06-18 01:14:40 +02:00
< / div >
< / div >
< / body >
2010-04-14 05:33:12 +02:00
< / html >