Blame view

sources/core/templates/installation.php 7.4 KB
03e52840d   Kload   Init
1
2
3
4
5
6
7
8
  <input type='hidden' id='hasMySQL' value='<?php p($_['hasMySQL']) ?>'>
  <input type='hidden' id='hasSQLite' value='<?php p($_['hasSQLite']) ?>'>
  <input type='hidden' id='hasPostgreSQL' value='<?php p($_['hasPostgreSQL']) ?>'>
  <input type='hidden' id='hasOracle' value='<?php p($_['hasOracle']) ?>'>
  <input type='hidden' id='hasMSSQL' value='<?php p($_['hasMSSQL']) ?>'>
  <form action="index.php" method="post">
  <input type="hidden" name="install" value="true" />
  	<?php if(count($_['errors']) > 0): ?>
31b7f2792   Kload   Upgrade to ownclo...
9
10
  	<fieldset class="warning">
  		<legend><strong><?php p($l->t('Error'));?></strong></legend>
03e52840d   Kload   Init
11
  		<?php foreach($_['errors'] as $err): ?>
31b7f2792   Kload   Upgrade to ownclo...
12
  		<p>
03e52840d   Kload   Init
13
14
  			<?php if(is_array($err)):?>
  				<?php print_unescaped($err['error']); ?>
31b7f2792   Kload   Upgrade to ownclo...
15
  				<span class='hint'><?php print_unescaped($err['hint']); ?></span>
03e52840d   Kload   Init
16
17
18
  			<?php else: ?>
  				<?php print_unescaped($err); ?>
  			<?php endif; ?>
31b7f2792   Kload   Upgrade to ownclo...
19
  		</p>
03e52840d   Kload   Init
20
  		<?php endforeach; ?>
31b7f2792   Kload   Upgrade to ownclo...
21
  	</fieldset>
03e52840d   Kload   Init
22
23
24
25
26
  	<?php endif; ?>
  	<?php if($_['vulnerableToNullByte']): ?>
  	<fieldset class="warning">
  		<legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  		<p><?php p($l->t('Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)'));?><br/>
31b7f2792   Kload   Upgrade to ownclo...
27
  		<?php p($l->t('Please update your PHP installation to use %s securely.', $theme->getName() )); ?></p>
03e52840d   Kload   Init
28
29
30
31
32
33
34
35
36
37
38
39
40
  	</fieldset>
  	<?php endif; ?>
  	<?php if(!$_['secureRNG']): ?>
  	<fieldset class="warning">
  		<legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  		<p><?php p($l->t('No secure random number generator is available, please enable the PHP OpenSSL extension.'));?><br/>
  		<?php p($l->t('Without a secure random number generator an attacker may be able to predict password reset tokens and take over your account.'));?></p>
  	</fieldset>
  	<?php endif; ?>
  	<?php if(!$_['htaccessWorking']): ?>
  	<fieldset class="warning">
  		<legend><strong><?php p($l->t('Security Warning'));?></strong></legend>
  		<p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br>
31b7f2792   Kload   Upgrade to ownclo...
41
42
43
44
  		<?php print_unescaped($l->t(
  			'For information how to properly configure your server, please see the <a href="%s" target="_blank">documentation</a>.',
  			link_to_docs('admin-install')
  		)); ?></p>
03e52840d   Kload   Init
45
46
47
48
  	</fieldset>
  	<?php endif; ?>
  	<fieldset id="adminaccount">
  		<legend><?php print_unescaped($l->t( 'Create an <strong>admin account</strong>' )); ?></legend>
6d9380f96   Cédric Dupont   Update sources OC...
49
50
51
52
53
  		<p class="grouptop">
  			<input type="text" name="adminlogin" id="adminlogin"
  				placeholder="<?php p($l->t( 'Username' )); ?>"
  				value="<?php p($_['adminlogin']); ?>"
  				autocomplete="off" autocapitalize="off" autocorrect="off" autofocus required />
03e52840d   Kload   Init
54
55
56
  			<label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label>
  			<img class="svg" src="<?php p(image_path('', 'actions/user.svg')); ?>" alt="" />
  		</p>
6d9380f96   Cédric Dupont   Update sources OC...
57
58
59
60
61
  		<p class="groupbottom">
  			<input type="password" name="adminpass" data-typetoggle="#show" id="adminpass"
  				placeholder="<?php p($l->t( 'Password' )); ?>"
  				value="<?php p($_['adminpass']); ?>"
  				autocomplete="off" autocapitalize="off" autocorrect="off" required />
03e52840d   Kload   Init
62
63
64
65
  			<label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label>
  			<img class="svg" id="adminpass-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt="" />
  			<input type="checkbox" id="show" name="show" />
  			<label for="show"></label>
6d9380f96   Cédric Dupont   Update sources OC...
66
  			<div class="strengthify-wrapper"></div>
03e52840d   Kload   Init
67
68
  		</p>
  	</fieldset>
31b7f2792   Kload   Upgrade to ownclo...
69
70
  	<?php if(!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?>
  	<fieldset id="advancedHeader">
6d9380f96   Cédric Dupont   Update sources OC...
71
  		<legend><a id="showAdvanced"><?php p($l->t( 'Storage & database' )); ?> <img class="svg" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend>
31b7f2792   Kload   Upgrade to ownclo...
72
73
74
75
  	</fieldset>
  	<?php endif; ?>
  
  	<?php if(!$_['directoryIsSet'] OR count($_['errors']) > 0): ?>
03e52840d   Kload   Init
76
  	<fieldset id="datadirField">
03e52840d   Kload   Init
77
78
79
  		<div id="datadirContent">
  			<label for="directory"><?php p($l->t( 'Data folder' )); ?></label>
  			<input type="text" name="directory" id="directory"
6d9380f96   Cédric Dupont   Update sources OC...
80
81
82
  				placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>"
  				value="<?php p($_['directory']); ?>"
  				autocomplete="off" autocapitalize="off" autocorrect="off" />
03e52840d   Kload   Init
83
84
  		</div>
  	</fieldset>
31b7f2792   Kload   Upgrade to ownclo...
85
  	<?php endif; ?>
03e52840d   Kload   Init
86

31b7f2792   Kload   Upgrade to ownclo...
87
  	<?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?>
6d9380f96   Cédric Dupont   Update sources OC...
88
  	<fieldset id='databaseBackend'>
03e52840d   Kload   Init
89
90
91
92
  		<?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle'] or $_['hasMSSQL'])
  			$hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?>
  		<legend><?php p($l->t( 'Configure the database' )); ?></legend>
  		<div id="selectDbType">
6d9380f96   Cédric Dupont   Update sources OC...
93
94
95
96
  		<?php foreach($_['databases'] as $type => $label): ?>
  		<?php if(count($_['databases']) === 1): ?>
  		<p class="info"><?php p($l->t( 'Only %s is available.', array($label) )); ?>.</p>
  		<input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>" />
03e52840d   Kload   Init
97
  		<?php else: ?>
6d9380f96   Cédric Dupont   Update sources OC...
98
99
100
  		<input type="radio" name="dbtype" value="<?php p($type) ?>" id="<?php p($type) ?>"
  			<?php print_unescaped($_['dbtype'] === $type ? 'checked="checked" ' : '') ?>/>
  		<label class="<?php p($type) ?>" for="<?php p($type) ?>"><?php p($label) ?></label>
31b7f2792   Kload   Upgrade to ownclo...
101
  		<?php endif; ?>
6d9380f96   Cédric Dupont   Update sources OC...
102
  		<?php endforeach; ?>
03e52840d   Kload   Init
103
  		</div>
6d9380f96   Cédric Dupont   Update sources OC...
104
  	</fieldset>
03e52840d   Kload   Init
105
106
  
  		<?php if($hasOtherDB): ?>
6d9380f96   Cédric Dupont   Update sources OC...
107
  		<fieldset id='databaseField'>
03e52840d   Kload   Init
108
  		<div id="use_other_db">
6d9380f96   Cédric Dupont   Update sources OC...
109
  			<p class="grouptop">
03e52840d   Kload   Init
110
  				<label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
6d9380f96   Cédric Dupont   Update sources OC...
111
112
113
114
  				<input type="text" name="dbuser" id="dbuser"
  					placeholder="<?php p($l->t( 'Database user' )); ?>"
  					value="<?php p($_['dbuser']); ?>"
  					autocomplete="off" autocapitalize="off" autocorrect="off" />
03e52840d   Kload   Init
115
  			</p>
6d9380f96   Cédric Dupont   Update sources OC...
116
117
118
119
120
  			<p class="groupmiddle">
  				<input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword"
  					placeholder="<?php p($l->t( 'Database password' )); ?>"
  					value="<?php p($_['dbpass']); ?>"
  					autocomplete="off" autocapitalize="off" autocorrect="off" />
31b7f2792   Kload   Upgrade to ownclo...
121
122
123
  				<label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
  				<input type="checkbox" id="dbpassword" name="dbpassword" />
  				<label for="dbpassword"></label>
03e52840d   Kload   Init
124
  			</p>
6d9380f96   Cédric Dupont   Update sources OC...
125
  			<p class="groupmiddle">
03e52840d   Kload   Init
126
  				<label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
6d9380f96   Cédric Dupont   Update sources OC...
127
128
129
130
131
  				<input type="text" name="dbname" id="dbname"
  					placeholder="<?php p($l->t( 'Database name' )); ?>"
  					value="<?php p($_['dbname']); ?>"
  					autocomplete="off" autocapitalize="off" autocorrect="off"
  					pattern="[0-9a-zA-Z$_-]+" />
03e52840d   Kload   Init
132
  			</p>
31b7f2792   Kload   Upgrade to ownclo...
133
134
  			<?php if($_['hasOracle']): ?>
  			<div id="use_oracle_db">
6d9380f96   Cédric Dupont   Update sources OC...
135
  				<p class="groupmiddle">
31b7f2792   Kload   Upgrade to ownclo...
136
  					<label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
6d9380f96   Cédric Dupont   Update sources OC...
137
138
139
140
  					<input type="text" name="dbtablespace" id="dbtablespace"
  						placeholder="<?php p($l->t( 'Database tablespace' )); ?>"
  						value="<?php p($_['dbtablespace']); ?>"
  						autocomplete="off" autocapitalize="off" autocorrect="off" />
31b7f2792   Kload   Upgrade to ownclo...
141
142
143
  				</p>
  			</div>
  			<?php endif; ?>
6d9380f96   Cédric Dupont   Update sources OC...
144
  			<p class="groupbottom">
31b7f2792   Kload   Upgrade to ownclo...
145
  				<label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
6d9380f96   Cédric Dupont   Update sources OC...
146
147
148
149
  				<input type="text" name="dbhost" id="dbhost"
  					placeholder="<?php p($l->t( 'Database host' )); ?>"
  					value="<?php p($_['dbhost']); ?>"
  					autocomplete="off" autocapitalize="off" autocorrect="off" />
03e52840d   Kload   Init
150
151
  			</p>
  		</div>
6d9380f96   Cédric Dupont   Update sources OC...
152
  		</fieldset>
03e52840d   Kload   Init
153
  		<?php endif; ?>
31b7f2792   Kload   Upgrade to ownclo...
154
  	<?php endif; ?>
03e52840d   Kload   Init
155

6d9380f96   Cédric Dupont   Update sources OC...
156
  	<p id="sqliteInformation" class="info"><?php p($l->t('SQLite will be used as database. For larger installations we recommend to change this.'));?></p>
31b7f2792   Kload   Upgrade to ownclo...
157
  	<div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>" /></div>
03e52840d   Kload   Init
158
  </form>