Skip to content

Commit

Permalink
Lobby 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
subins2000 committed Feb 19, 2016
1 parent 809e918 commit c3ffce5
Show file tree
Hide file tree
Showing 298 changed files with 106 additions and 68 deletions.
5 changes: 0 additions & 5 deletions NOTICE.md

This file was deleted.

Empty file modified admin/apps.php
100755 → 100644
Empty file.
Empty file modified admin/backup-db.php
100755 → 100644
Empty file.
Empty file modified admin/check-updates.php
100755 → 100644
Empty file.
Empty file modified admin/css/install.css
100755 → 100644
Empty file.
Empty file modified admin/css/lobby-store.css
100755 → 100644
Empty file.
Empty file modified admin/download.php
100755 → 100644
Empty file.
Empty file modified admin/inc/sidebar.php
100755 → 100644
Empty file.
Empty file modified admin/index.php
100755 → 100644
Empty file.
Empty file modified admin/install-app.php
100755 → 100644
Empty file.
107 changes: 61 additions & 46 deletions admin/install.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,27 @@
}
?></td>
</tr>
<tr>
<td>Apache mod_rewrite Module</td>
<td><?php if (preg_match("/mod_rewrite/", $info)){
sss("Ok", "Apache mod_rewrite module is enabled");
}else{
$error = 1;
ser("Not Ok", "Apache mod_rewrite module is not enabled");
}
?></td>
</tr>
<?php
ob_start();
phpinfo(INFO_GENERAL);
$g_info = ob_get_contents();
ob_end_clean();
$server_software = stristr($g_info, 'Server API');
if(preg_match("/\>Apache/", $server_software)){
?>
<tr>
<td>Apache mod_rewrite Module</td>
<td><?php if (preg_match("/mod_rewrite/", $info)){
sss("Ok", "Apache mod_rewrite module is enabled");
}else{
$error = 1;
ser("Not Ok", "Apache mod_rewrite module is not enabled");
}
?></td>
</tr>
<?php
}
?>
<tr>
<td>Permissions</td>
<td><?php if (is_writable(L_DIR)){
Expand Down Expand Up @@ -151,7 +162,7 @@
}else if($install_step === "4"){
echo "<h2>Safety</h2>";
$safe = \Lobby\Install::safe();
if($safe == "configFile"){
if($safe === "configFile"){
ser("Permission Error", "The <b>config.php</b> file still has write permission. Change the permission to Read Only.");
}
if($safe !== true){
Expand All @@ -170,7 +181,7 @@
<tbody>
<tr>
<td width="50%"><?php
$mysql_version = stristr($info, 'Client API version');
$mysql_version = stristr($info, 'Client API version');
preg_match('/[1-9].[0-9].[1-9][0-9]/', $mysql_version, $match);
$mysql_version = $match[0];
if(version_compare($mysql_version, '5.0') >= 0){
Expand Down Expand Up @@ -222,47 +233,51 @@
$username = \H::input('dbusername', "POST");
$password = \H::input('dbpassword', "POST");
$prefix = \H::input('prefix', "POST");

/**
* We give the database config to the Install Class
*/
\Lobby\Install::dbConfig(array(
"host" => $dbhost,
"port" => $dbport,
"dbname" => $dbname,
"username" => $username,
"password" => $password,
"prefix" => $prefix
));

/**
* First, check if prefix is valid
* Check if connection to database can be established using the credentials given by the user
*/
if($prefix == "" || preg_match("/[^0-9,a-z,A-Z,\$,_]+/i", $prefix) != 0 || strlen($prefix) > 50){
ser("Error", "A Prefix should only contain basic Latin letters, digits 0-9, dollar, underscore and shouldn't exceed 50 characters.<cl/>" . \Lobby::l("/admin/install.php?step=2" . H::csrf("g"), "Try Again", "class='button'"));
}else if(\Lobby\Install::checkDatabaseConnection() !== false){
if($dbhost === "" || $dbport === "" || $dbname === "" || $username === ""){
ser("Empty Fields", "Buddy, you left out some details.<cl/>" . \Lobby::l("/admin/install.php?step=3&db_type=mysql" . H::csrf("g"), "Try Again", "class='button orange'"));
}else{
/**
* Create Tables
* We give the database config to the Install Class
*/
if(\Lobby\Install::makeDatabase($prefix)){
/**
* Make the Config File
*/
\Lobby\Install::makeConfigFile();
\Lobby\Install::dbConfig(array(
"host" => $dbhost,
"port" => $dbport,
"dbname" => $dbname,
"username" => $username,
"password" => $password,
"prefix" => $prefix
));

/**
* First, check if prefix is valid
* Check if connection to database can be established using the credentials given by the user
*/
if($prefix == "" || preg_match("/[^0-9,a-z,A-Z,\$,_]+/i", $prefix) != 0 || strlen($prefix) > 50){
ser("Error", "A Prefix should only contain basic Latin letters, digits 0-9, dollar, underscore and shouldn't exceed 50 characters.<cl/>" . \Lobby::l("/admin/install.php?step=3&db_type=mysql" . H::csrf("g"), "Try Again", "class='button orange'"));
}else if(\Lobby\Install::checkDatabaseConnection() !== false){
/**
* Enable app lEdit
* Create Tables
*/
\Lobby::$installed = true;
\Lobby\DB::init();
$App = new \Lobby\Apps("ledit");
$App->enableApp();
if(\Lobby\Install::makeDatabase($prefix)){
/**
* Make the Config File
*/
\Lobby\Install::makeConfigFile();

sss("Success", "Database Tables and <b>config.php</b> file was successfully created.");
echo '<cl/><a href="?step=4'. H::csrf("g") .'" class="button">Proceed</a>';
}else{
ser("Unable To Create Database Tables", "Are there any tables with the same name ? Or Does the user have the permissions to create tables ? Error :<blockquote>". \Lobby\Install::$error ."</blockquote>" . \Lobby::l("/admin/install.php?step=2" . H::csrf("g"), "Try Again", "class='button'"));
/**
* Enable app lEdit
*/
\Lobby::$installed = true;
\Lobby\DB::init();
$App = new \Lobby\Apps("ledit");
$App->enableApp();

sss("Success", "Database Tables and <b>config.php</b> file was successfully created.");
echo '<cl/><a href="?step=4'. H::csrf("g") .'" class="button">Proceed</a>';
}else{
ser("Unable To Create Database Tables", "Are there any tables with the same name ? Or Does the user have the permissions to create tables ? Error :<blockquote>". \Lobby\Install::$error ."</blockquote>" . \Lobby::l("/admin/install.php?step=2" . H::csrf("g"), "Try Again", "class='button'"));
}
}
}
}else{
Expand Down
Empty file modified admin/js/apps.js
100755 → 100644
Empty file.
Empty file modified admin/js/install.js
100755 → 100644
Empty file.
Empty file modified admin/lobby-store.php
100755 → 100644
Empty file.
Empty file modified admin/modules.php
100755 → 100644
Empty file.
Empty file modified admin/settings.php
100755 → 100644
Empty file.
Empty file modified admin/themes.php
100755 → 100644
Empty file.
Empty file modified admin/update.php
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions contents/apps/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Silence
Empty file modified contents/apps/ledit/App.php
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/manifest.json
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/ajax/saves.php
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/css/main.css
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/image/logo.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified contents/apps/ledit/src/js/date.js
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/js/main.js
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/langs/readme.md
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/license.txt
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/code/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/example/dialog.html
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/hr/plugin.min.js
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/image/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/layer/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/link/plugin.min.js
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/lists/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/media/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/paste/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/print/plugin.min.js
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/save/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/plugins/table/plugin.min.js
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/themes/modern/theme.min.js
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/lib/tinymce/tinymce.min.js
100755 → 100644
Empty file.
Empty file modified contents/apps/ledit/src/page/index.php
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions contents/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Silence
Empty file modified contents/modules/admin/Module.php
100755 → 100644
Empty file.
Empty file modified contents/modules/admin/disabled.txt
100755 → 100644
Empty file.
Empty file modified contents/modules/admin/image/admin.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified contents/modules/admin/inc/Francium.log
100755 → 100644
Empty file.
Empty file modified contents/modules/admin/inc/class.logsys.php
100755 → 100644
Empty file.
Empty file modified contents/modules/admin/page/change_password.php
100755 → 100644
Empty file.
Empty file modified contents/modules/admin/page/login.php
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions contents/modules/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Silence
Empty file modified contents/themes/hine/Theme.php
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/manifest.json
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/css/admin.style.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/css/font.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/css/style.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/css/dashboard.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/css/jquery.contextmenu.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/css/scrollbar.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/js/Packery.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/js/dashboard.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/js/jquery.contextmenu.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/js/scrollbar.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/dashboard/load.php
100755 → 100644
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified contents/themes/hine/src/lib/material-design/LICENSE
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/lib/material-design/materialize.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/lib/material-design/materialize.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/panel/css/panel.css
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/panel/image/home.svg
100755 → 100644
Empty file modified contents/themes/hine/src/panel/js/panel.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/panel/js/superfish.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/panel/lib/connection/connection.js
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/panel/lib/connection/connection.png
100755 → 100644
Empty file modified contents/themes/hine/src/panel/load.admin.php
100755 → 100644
Empty file.
Empty file modified contents/themes/hine/src/panel/load.php
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions contents/themes/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// Silence
Empty file modified includes/extra.php
100755 → 100644
Empty file.
Empty file modified includes/functions.php
100755 → 100644
Empty file.
Empty file modified includes/init.php
100755 → 100644
Empty file.
Empty file modified includes/lib/jquery/jquery-ui.css
100755 → 100644
Empty file.
Empty file modified includes/lib/jquery/jquery-ui.js
100755 → 100644
Empty file.
Empty file modified includes/lib/jquery/jquery.js
100755 → 100644
Empty file.
Empty file modified includes/lib/jquery/ui/animated-overlay.gif
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-bg_flat_10_000000_40x100.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-bg_glass_100_f6f6f6_1x400.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-bg_glass_100_fdf5ce_1x400.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-bg_glass_65_ffffff_1x400.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-bg_gloss-wave_35_f6a828_500x100.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-bg_highlight-soft_75_ffe45c_1x100.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-icons_222222_256x240.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-icons_228ef1_256x240.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-icons_ef8c08_256x240.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-icons_ffd27a_256x240.png
100755 → 100644
Empty file modified includes/lib/jquery/ui/ui-icons_ffffff_256x240.png
100755 → 100644
Empty file modified includes/lib/lobby/ajax/app.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/ajax/net.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/ajax/removeData.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/ajax/saveData.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/ajax/saveOption.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/css/admin.css
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/css/main.css
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/image/bg.gif
100755 → 100644
Empty file modified includes/lib/lobby/image/blank.png
100755 → 100644
Empty file modified includes/lib/lobby/image/close.svg
100755 → 100644
Empty file modified includes/lib/lobby/image/menu.png
100755 → 100644
Empty file modified includes/lib/lobby/image/open.svg
100755 → 100644
Empty file modified includes/lib/lobby/image/pixel.gif
100755 → 100644
Empty file modified includes/lib/lobby/image/trash.svg
100755 → 100644
Empty file modified includes/lib/lobby/image/update.png
100755 → 100644
Empty file modified includes/lib/lobby/inc/config-sample.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/inc/dashboard.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/inc/error.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/inc/page.php
100755 → 100644
Empty file.
Empty file modified includes/lib/lobby/js/app.js
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion includes/lib/lobby/js/main.js
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified includes/lib/modules/filepicker/Module.php
100755 → 100644
Empty file.
Empty file modified includes/lib/modules/filepicker/ajax/filepicker.php
100755 → 100644
Empty file.
Empty file modified includes/lib/modules/filepicker/css/filepicker.css
100755 → 100644
Empty file.
Empty file modified includes/lib/modules/filepicker/image/list/document.svg
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/excel.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/folder.svg
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/image.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/movie.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/music.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/pdf.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/swf.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/unknown.svg
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/web.svg
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/word.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/xml.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/list/zip.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/loading.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/new_folder.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/refresh.svg
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/rename.gif
100755 → 100644
Empty file modified includes/lib/modules/filepicker/image/up.svg
100755 → 100644
Empty file modified includes/lib/modules/filepicker/inc/FilePicker.php
100755 → 100644
Empty file.
Empty file modified includes/lib/modules/filepicker/js/filepicker.js
100755 → 100644
Empty file.
Empty file modified includes/load.php
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion includes/serve.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once "../load.php";

$f = $_GET['file'];
$f = rtrim($_GET['file'], ",");
$content = "";
$extraContent = "";

Expand Down
Empty file modified includes/src/App.php
100755 → 100644
Empty file.
Empty file modified includes/src/Apps.php
100755 → 100644
Empty file.
Empty file modified includes/src/Database.php
100755 → 100644
Empty file.
Empty file modified includes/src/FileSystem.php
100755 → 100644
Empty file.
Empty file modified includes/src/Helpers.php
100755 → 100644
Empty file.
9 changes: 6 additions & 3 deletions includes/src/Install.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ public static function checkDatabaseConnection(){
}
}

if(!$notable){ /* There are database tables */
ser("Error", "Lobby Tables with prefix <b>". self::$database['prefix'] ."</b> exists. Delete (DROP) those tables and <a href='install.php?step=2". \H::csrf("g") ."'>try again.</a>");
if(!$notable){
/**
* Database tables exist
*/
ser("Error", "Lobby Tables with prefix <b>". self::$database['prefix'] ."</b> exists. Delete (DROP) those tables and <cl/><a class='button orange' href='install.php?step=3&db_type=mysql". \H::csrf("g") ."'>Try Again</a>");
return false;
}
}catch(\PDOException $Exception) {
ser("Error", "Unable to connect. Make sure that the settings you entered are correct. <cl/><a href='install.php?step=2'>Try Again</a>");
ser("Error", "Unable to connect. Make sure that the settings you entered are correct. <cl/><a class='button orange' href='install.php?step=3&db_type=mysql". \H::csrf("g") ."'>Try Again</a>");
return false;
}
}
Expand Down
17 changes: 7 additions & 10 deletions includes/src/Lobby.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ public static function init(){
self::$host_name = $url_parts['host'];
self::$url = self::$config['lobby_url'];
}else{
$base_dir = L_DIR;
$doc_root = str_replace("\\", "/", preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']));
$base_url = preg_replace("!^${doc_root}!", '', $base_dir); # ex: '' or '/mywebsite'
$protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$port = $_SERVER['SERVER_PORT'];
$disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
$domain = $_SERVER['SERVER_NAME'];
$docDir = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$subdir = str_replace($docDir, '', L_DIR);
$urladdr = $_SERVER['HTTP_HOST'] . $subdir;
$urladdr = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://" . $urladdr;
self::$url = rtrim($urladdr, "/");

self::$url = "${protocol}://${domain}${disp_port}${base_url}";
self::$host_name = $domain;
unset($tempPath1, $tempPath2, $tempPath3, $urladdr);
self::$host_name = $_SERVER['HTTP_HOST'];
}
}

Expand Down Expand Up @@ -423,4 +421,3 @@ public static function curPage($page = false, $full = false){
}
}
\Lobby::init();
?>
Empty file modified includes/src/Module.php
100755 → 100644
Empty file.
Empty file modified includes/src/Modules.php
100755 → 100644
Empty file.
21 changes: 19 additions & 2 deletions includes/src/Router.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,27 @@ public static function statusRoutes(){
* The default 404 page
*/
self::$router->onHttpError(function ($code, $router) {
if($code == 404){
ser();
if($code === 404){
if(self::pathExists()){
$router->response()->code(200);
}else{
ser();
}
}
});
}

/**
* This is useful when Lobby is run using PHP Built In Server
* When no routes are matched, by default a 404 is inited,
* even when the file exists in Lobby as .php file. To prevent
* this, we check if the file exist and return false to the PHP
* Built in Server to make it serve the file normally
* http://php.net/manual/en/features.commandline.webserver.php#example-430
*/
public static function pathExists(){
return file_exists(L_DIR . $_SERVER['PHP_SELF']);
}

}
\Lobby\Router::init();
Empty file modified includes/src/Server.php
100755 → 100644
Empty file.
Empty file modified includes/src/Time.php
100755 → 100644
Empty file.
3 changes: 3 additions & 0 deletions includes/src/Update.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php
namespace Lobby;

/**
* The Update class.
* For updating Lobby Core & Apps
* The script execution time is set to unlimited
*/
set_time_limit(0);

class Update extends \Lobby {

Expand Down
Empty file modified includes/src/ca_bundle.crt
100755 → 100644
Empty file.
Empty file modified includes/src/composer/composer.json
100755 → 100644
Empty file.
Empty file modified includes/src/composer/composer.lock
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/autoload.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/composer/ClassLoader.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/composer/LICENSE
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/composer/autoload_classmap.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/composer/autoload_namespaces.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/composer/autoload_psr4.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/composer/autoload_real.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/composer/installed.json
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/CHANGELOG.md
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/CONTRIBUTING.md
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/LICENSE
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/README.md
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/UPGRADING.md
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/composer.json
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/phpdoc.dist.xml
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/phpunit.xml.dist
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/src/Klein/App.php
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/src/Klein/Klein.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/src/Klein/Request.php
100755 → 100644
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/src/Klein/Response.php
100755 → 100644
Empty file.
Empty file.
Empty file modified includes/src/composer/vendor/klein/klein/src/Klein/Route.php
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified includes/src/l10n.php
100755 → 100644
Empty file.
Empty file modified includes/src/ui/Panel.php
100755 → 100644
Empty file.
Empty file modified includes/src/ui/Theme.php
100755 → 100644
Empty file.
Empty file modified includes/src/ui/Themes.php
100755 → 100644
Empty file.
Empty file modified lobby.json
100755 → 100644
Empty file.

0 comments on commit c3ffce5

Please sign in to comment.