Skip to content

Commit

Permalink
Add option to test and set friendly URLs in installer
Browse files Browse the repository at this point in the history
  • Loading branch information
samerton committed May 10, 2018
1 parent 5e3ae58 commit 0b51533
Show file tree
Hide file tree
Showing 17 changed files with 124 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/installation/views/installer.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
' ),' . PHP_EOL .
' "core" => array(' . PHP_EOL .
' "path" => "' . $install_path . '",' . PHP_EOL .
' "friendly" => false' . PHP_EOL .
' "friendly" => ' . ((isset($_POST['friendly']) && $_POST['friendly'] == 'true') ? 'true' : 'false') . PHP_EOL .
' ),' . PHP_EOL .
' "allowedProxies" => ""' . PHP_EOL .
');' . PHP_EOL;
Expand Down Expand Up @@ -292,6 +292,14 @@
<label for="inputPath"><?php echo $language['nameless_path']; ?></label> <span class="badge badge-info" data-toggle="popover" data-placement="top" data-content="<?php echo $language['nameless_path_info']; ?>"><i class="fa fa-question"></i></span>
<input type="text" class="form-control" name="install_path" id="inputPath" value="<?php echo Output::getClean($install_path); ?>" placeholder="<?php echo $language['nameless_path']; ?>">
</div>

<div class="form-group">
<label for="inputFriendly"><?php echo $language['friendly_urls']; ?></label> <span class="badge badge-info" data-toggle="popover" data-placement="top" data-content="<?php echo $language['friendly_urls_info']; ?>"><i class="fa fa-question"></i></span>
<select class="form-control" name="friendly" id="inputFriendly">
<option value="true"><?php echo $language['enabled']; ?></option>
<option value="false" selected><?php echo $language['disabled']; ?></option>
</select>
</div>

<div class="form-group">
<label for="inputCharset"><?php echo $language['character_set']; ?></label>
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Chinese/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
'database_name' => '資料庫名稱',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => '字符集',
'database_engine' => 'Database Storage Engine',
'database_error' => '請確認所有資料都已填寫.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Czech/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
'database_name' => 'Název databáze',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Sada znaků',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Zajistěte, aby byla vyplněna všechna pole.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Dutch/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
'database_name' => 'Database Naam',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Karakterset',
'database_engine' => 'Gegevens opslag progamma',
'database_error' => 'Zorg ervoor dat alle velden zijn ingevuld.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/EnglishUK/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
'database_name' => 'Database Name',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Character Set',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Please ensure all fields have been filled out.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/EnglishUS/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
'database_name' => 'Database Name',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Character Set',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Please ensure all fields have been filled out.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/German/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
'database_name' => 'Datenbank Name',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Zeichensatz',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Bitte stellen Sie sicher, dass alle Felder ausgefüllt sind.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Greek/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
'database_name' => 'Database Name',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Character Set',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Βεβαιωθείτε οτι όλα τα πεδία έχουν συμπληρωθεί.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Japanese/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
'database_name' => 'データベース名',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'キャラクターセット',
'database_engine' => 'データベースストレージエンジン',
'database_error' => 'すべてのフィールドに記入してください。',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Norwegian/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
'database_name' => 'Database Navn',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Tegnsetting',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Pass på at alle rutene har blitt fylt.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Portuguese/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
'database_name' => 'Nome do banbo de dados',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Conjunto de caracteres',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Certifique-se de que todos os campos foram preenchidos.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Romanian/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
'database_name' => 'Numele bazei de date',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Set de caractere',
'database_engine' => 'Motor de stocare pentru baza de date',
'database_error' => 'Asigurați-vă că toate câmpurile au fost completate.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Slovak/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
'database_name' => 'Database Name',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Character Set',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Please ensure all fields have been filled out.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/Spanish/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
'database_name' => 'Database Nombre',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Conjunto de caracteres',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Asegúrese de completar todos los campos.',
Expand Down
4 changes: 4 additions & 0 deletions custom/languages/SwedishSE/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
'database_name' => 'Databas Namn',
'nameless_path' => 'Installation Path',
'nameless_path_info' => 'This is the path Nameless is installed in, relative to your domain. For example, if Nameless is installed at example.com/forum, this needs to be <strong>forum</strong>. Leave empty if Nameless is not in a subfolder.',
'friendly_urls' => 'Friendly URLs',
'friendly_urls_info' => 'Friendly URLs will improve the readability of URLs in your browser.<br />For example: <br />example.com/index.php?route=/forum<br />would become<br />example.com/forum.<br /><strong>Important!</strong><br />Your server must be configured correctly for this to work. You can see whether you can enable this option by clicking <a href=\'./rewrite_test\' target=\'_blank\'>here</a>.',
'enabled' => 'Enabled',
'disabled' => 'Disabled',
'character_set' => 'Teckenuppsättning',
'database_engine' => 'Database Storage Engine',
'database_error' => 'Se till att alla fält har fyllts i.',
Expand Down
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
die($e->getMessage());
}

if(isset($_GET['route']) && $_GET['route'] == '/rewrite_test'){
require_once('rewrite_test.php');
die();
}

if(!isset($GLOBALS['config']['core']) && is_file(ROOT_PATH . '/install.php')) {
Redirect::to('install.php');
}
Expand Down
54 changes: 54 additions & 0 deletions rewrite_test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr3
*
* License: MIT
*
* Rewrite test
*/
?>
<html lang="en">
<head>
<!-- Page Title -->
<title>Rewrite Test &bull; NamelessMC</title>

<!-- Global CSS -->
<link rel="stylesheet" href="core/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="core/assets/css/custom.css">
<link rel="stylesheet" href="core/assets/css/font-awesome.min.css">

<style>
html {
overflow-y: scroll;
}
body {
background-color: #eceeef;
}
</style>
</head>

<body>
<div style="text-align:center">
<br /><br /><br />

<h1>NamelessMC v2 <sup><span style="font-size: small;">pre-release</span></sup></h1>

<hr />

<div class="row">
<div class="col-md-6 offset-md-3">
<?php
if(isset($_GET['route']) && $_GET['route'] = '/rewrite_test'){
echo '<div class="alert alert-success">Rewrite enabled!</div>';

} else {
echo '<div class="alert alert-danger">Rewrite disabled!</div>';
}
?>
</div>
</div>
</div>
</body>
</html>

0 comments on commit 0b51533

Please sign in to comment.