* @author Craig Andrews <candrews@integralblue.com>
* @author Eric Helgeson <helfire@Erics-MBP.local>
* @author Evan Prodromou <evan@status.net>
+ * @author Mikael Nordfeldth <mmn@hethane.se>
* @author Robin Millette <millette@controlyourself.ca>
* @author Sarven Capadisli <csarven@status.net>
* @author Tom Adams <tom@holizz.com>
}
}
+ $ssl = array('always'=>null, 'never'=>null);
+ if (!empty($_SERVER['HTTPS'])) {
+ $ssl['always'] = 'checked="checked"';
+ } else {
+ $ssl['never'] = 'checked="checked"';
+ }
+
echo<<<E_O_T
<form method="post" action="install.php" class="form_settings" id="form_install">
<fieldset>
<input type="radio" name="fancy" id="fancy-disable" value="" /> disable<br />
<p class="form_guide" id='fancy-form_guide'>Enable fancy (pretty) URLs. Auto-detection failed, it depends on Javascript.</p>
</li>
+ <li>
+ <label for="ssl">Server SSL</label>
+ <input type="radio" name="ssl" id="ssl-always" value="always" {$ssl['always']} /> enable<br />
+ <input type="radio" name="ssl" id="ssl-never" value="never" {$ssl['never']} /> disable<br />
+ <p class="form_guide" id="ssl-form_guide">Enabling SSL (https://) requires extra webserver configuration and certificate generation not offered by this installation.</p>
+ </li>
</ul>
</fieldset>
$this->siteProfile = $post->string('site_profile');
+ $this->ssl = $post->string('ssl');
+
$this->server = $_SERVER['HTTP_HOST'];
$this->path = substr(dirname($_SERVER['PHP_SELF']), 1);
$fail = true;
}
+ if (!in_array($this->ssl, array('never', 'sometimes', 'always'))) {
+ $this->updateStatus("Bad value for server SSL enabling.");
+ $fail = true;
+ }
+
if (!$this->validateSiteProfile()) {
$fail = true;
}
* @author Craig Andrews <candrews@integralblue.com>
* @author Eric Helgeson <helfire@Erics-MBP.local>
* @author Evan Prodromou <evan@status.net>
+ * @author Mikael Nordfeldth <mmn@hethane.se>
* @author Robin Millette <millette@controlyourself.ca>
* @author Sarven Capadisli <csarven@status.net>
* @author Tom Adams <tom@holizz.com>
abstract class Installer
{
/** Web site info */
- public $sitename, $server, $path, $fancy, $siteProfile;
+ public $sitename, $server, $path, $fancy, $siteProfile, $ssl;
/** DB info */
public $host, $database, $dbtype, $username, $password, $db;
/** Administrator info */
'sitename' => $this->sitename,
'server' => $this->server,
'path' => $this->path,
+ 'ssl' => in_array($this->ssl, array('never', 'sometimes', 'always'))
+ ? $this->ssl
+ : 'never',
'db_database' => $this->db['database'],
'db_type' => $this->db['type']
));
// site location
"\$config['site']['server'] = {$vals['server']};\n".
"\$config['site']['path'] = {$vals['path']}; \n\n".
+ "\$config['site']['ssl'] = {$vals['ssl']}; \n\n".
// checks if fancy URLs are enabled
($this->fancy ? "\$config['site']['fancy'] = true;\n\n":'').
* @package Installation
*
* @author Brion Vibber <brion@status.net>
+ * @author Mikael Nordfeldth <mmn@hethane.se>
* @license GNU Affero General Public License http://www.gnu.org/licenses/
- * @version 0.9.x
+ * @version 1.1.x
* @link http://status.net
*/
'--path' => 'path',
'--sitename' => 'sitename',
'--fancy' => 'fancy',
+ '--ssl' => 'ssl',
'--dbtype' => 'dbtype',
'--host' => 'host',
$this->dbtype = 'mysql';
$this->adminUpdates = true;
$this->verbose = true;
+ // ssl is defaulted in lib/installer.php
foreach ($options as $option) {
$arg = $option[0];
-p --path=<path> Use <path> as path name
--sitename User-friendly site name (required)
--fancy Whether to use fancy URLs (default no)
+ --ssl Server SSL enabled (default never),
+ [never | sometimes | always]
--dbtype 'mysql' (default) or 'pgsql'
--host Database hostname (required)