root/dev/install/install_step6.php

Revision 473, 3.3 KB (checked in by kovell, 13 years ago)

Add transactions to installation to speed up InnoDB. Transaction log is written after each transaction instead of each insert. Warnings are reduced to help installation with overly strict error reporting.

Line 
1<?php
2if(!$installrunning)
3{
4        header('Location: index.php');
5        die();
6}
7$stoppage = true;
8
9if (isset($_REQUEST['submit']))
10{
11        foreach ($_POST['set'] as $name => $value)
12        {
13                $_SESSION['sett'][$name] = $value;
14        }
15}
16$uri = 'http://'.$_SERVER['HTTP_HOST'].str_replace('/install/index.php','', $_SERVER['SCRIPT_NAME']);
17if (empty($_SESSION['sett']['title']))
18{
19        $_SESSION['sett']['title'] = '';
20}
21if (empty($_SESSION['sett']['site']))
22{
23        $_SESSION['sett']['site'] = chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90)).chr(rand(65,90));
24}
25if (empty($_SESSION['sett']['host']))
26{
27        $_SESSION['sett']['host'] = $uri;
28}
29if (empty($_SESSION['sett']['style']))
30{
31        $_SESSION['sett']['style'] = $uri.'/style';
32}
33if (empty($_SESSION['sett']['img']))
34{
35        $_SESSION['sett']['img'] = $uri.'/img';
36}
37if (empty($_SESSION['sett']['common']))
38{
39        $_SESSION['sett']['common'] = $uri.'/common';
40}
41
42if (isset($_SESSION['sett']['adminpw']) && isset($_SESSION['sett']['site']))
43{
44        $stoppage = false;
45}
46if (!empty($_SESSION['sett']['aid']) && !empty($_SESSION['sett']['cid']))
47{
48        echo '<b>Error:</b> You have entered an alliance AND corp id, please fix this conflict.<br/>';
49        $stoppage = true;
50}
51if (isset($_SESSION['sett']['site']) && strlen($_SESSION['sett']['site']) > 12)
52{
53        echo '<b>Error:</b> Your site identification string is way too long.<br/>';
54        $stoppage = true;
55}
56?>
57<p>You have to enter/edit some settings now. I will generate a config file based on this data for you.<br/>
58        To be able to continue you have to enter at least an admin password and a site identification key.<br/>
59        <br/>
60        <b>Tips:</b><br/>
61        Title is used as title attribute for every page so your corp/alliance name could be a good idea.<br/>
62        Site identification should be 1-8 chars, they will be used to reference your settings inside the database, something like 'GKB' will be sufficient.<br/>
63        The URLs are guessed on the location of this installscript, you might need to correct them for some installations.<br/>
64</p>
65<form id="options" name="options" method="post" action="?step=6">
66        <input type="hidden" name="step" value="6">
67        <div class="block-header2">Settings</div>
68        <table class="kb-subtable">
69                <?php
70                $settings = array();
71                $settings[] = array('descr' => 'Adminpassword', 'name' => 'adminpw');
72                $settings[] = array('descr' => 'Title', 'name' => 'title');
73                $settings[] = array('descr' => 'Site', 'name' => 'site');
74
75                $settings[] = array('descr' => 'Host', 'name' => 'host');
76                $settings[] = array('descr' => 'Style URL', 'name' => 'style');
77                $settings[] = array('descr' => 'IMG URL', 'name' => 'img');
78                $settings[] = array('descr' => 'Common URL', 'name' => 'common');
79
80                //$settings[] = array('descr' => 'CorpID', 'name' => 'cid');
81                //$settings[] = array('descr' => 'AllianceID', 'name' => 'aid');
82
83                foreach ($settings as $set)
84                {
85                        ?>
86                <tr><td width="120"><b><?php echo $set['descr']; ?></b></td><td><input type=<?php
87                        if($set['name'] == 'adminpw') echo "password"; else echo "text"
88                        ?> name=set[<?php echo $set['name']; ?>] size=60 maxlength=80 value="<?php echo $_SESSION['sett'][$set['name']]; ?>"></td></tr>
89                        <?php
90                        }
91                        ?>
92                <tr><td width="120"></td><td><input type=submit name=submit value="Save"></td></tr>
93        </table>
94        <?php if ($stoppage)
95        {
96                return;
97        }?>
98        <p><a href="?step=<?php echo ($_SESSION['state']+1); ?>">Next Step</a></p>
Note: See TracBrowser for help on using the browser.