Permalink
Browse files

Split conf.php in two files conf.php/constants.php

* Move conf.php to conf.template.php, checked in index.php
  • Loading branch information...
olivierperez committed Feb 28, 2015
1 parent e92f749 commit ba70db55d75d7329465210028a2b0f6bd4be853f
Showing with 37 additions and 16 deletions.
  1. +1 −1 about.php
  2. +9 −8 chatroom.php
  3. +1 −0 getMessages.php
  4. +0 −5 inc/{conf.php → conf.template.php}
  5. +6 −0 inc/constants.php
  6. +16 −2 index.php
  7. +1 −0 newroom.php
  8. +1 −0 removeChatroom.php
  9. +1 −0 sendMessage.php
  10. +1 −0 stats.php
View
@@ -49,7 +49,7 @@
<footer>
<div class="content-wrapper">
<div class="float-left">
<p>&copy; 2013 - MyCryptoChat <?php require 'inc/conf.php'; echo MYCRYPTOCHAT_VERSION; ?> by HowTommy.net</p>
<p>&copy; 2013 - MyCryptoChat <?php require 'inc/constants.php'; echo MYCRYPTOCHAT_VERSION; ?> by HowTommy.net</p>
</div>
</div>
</footer>
View
@@ -1,13 +1,14 @@
<?php
require 'inc/conf.php';
require 'inc/init.php';
require 'inc/functions.php';
require 'inc/classes.php';
require 'inc/dbmanager.php';
$dbManager = new DbManager();
require 'inc/constants.php';
require 'inc/conf.php';
require 'inc/init.php';
require 'inc/functions.php';
require 'inc/classes.php';
require 'inc/dbmanager.php';
$chatRoom = $dbManager->GetChatroom($_GET['id']);
$dbManager = new DbManager();
$chatRoom = $dbManager->GetChatroom($_GET['id']);
?>
<!DOCTYPE html>
<html lang="en">
View
@@ -1,5 +1,6 @@
<?php
require 'inc/conf.php';
require 'inc/constants.php';
require 'inc/init.php';
require 'inc/functions.php';
require 'inc/classes.php';
@@ -10,11 +10,6 @@
define('NB_SECONDS_USER_TO_BE_DISCONNECTED', 35);
define('DB_FILE_NAME', 'db/chatrooms.sqlite');
define('LOGS_FILE_NAME', 'db/logs.txt');
define('MYCRYPTOCHAT_VERSION', 'v1.0.4');
$allowedTimes = array(
5 => '5 minutes',
30 => '30 minutes',
View
@@ -0,0 +1,6 @@
<?php
define('DB_FILE_NAME', 'db/chatrooms.sqlite');
define('LOGS_FILE_NAME', 'db/logs.txt');
const CONFIG_FILE_NAME = 'inc/conf.php';
define('MYCRYPTOCHAT_VERSION', 'v1.0.4');
View
@@ -1,5 +1,5 @@
<?php
require 'inc/conf.php';
require 'inc/constants.php';
require 'inc/functions.php';
?><!DOCTYPE html>
<html lang="en">
@@ -14,6 +14,20 @@
<body>
<?php
$showContent = true;
$configIncluded = false;
if(is_readable(CONFIG_FILE_NAME)) {
include CONFIG_FILE_NAME;
$configIncluded = true;
} else {
$showContent = false;
?>
<h2>Error: missing inc/conf.php</h2>
<p>
MyCryptoChat can't read the configuration file.<br />
Copy <strong>inc/config.template.php</strong> into <strong>inc/config.php</strong>, and don't forget to <strong>customize it</strong>.
</p>
<?php
}
if(!is_writable(DB_FILE_NAME)) {
$showContent = false;
?>
@@ -64,7 +78,7 @@
</p>
<?php
}
if(SEED == 'f-rjng24!1r5TRHHgnjrt') {
if($configIncluded === true && SEED == 'f-rjng24!1r5TRHHgnjrt') {
$showContent = false;
?>
<h2>Error: the seed was not modified</h2>
View
@@ -1,5 +1,6 @@
<?php
require 'inc/conf.php';
require 'inc/constants.php';
require 'inc/init.php';
require 'inc/functions.php';
require 'inc/classes.php';
View
@@ -1,5 +1,6 @@
<?php
require 'inc/conf.php';
require 'inc/constants.php';
require 'inc/init.php';
require 'inc/functions.php';
require 'inc/classes.php';
View
@@ -1,5 +1,6 @@
<?php
require 'inc/conf.php';
require 'inc/constants.php';
require 'inc/init.php';
require 'inc/functions.php';
require 'inc/classes.php';
View
@@ -1,5 +1,6 @@
<?php
require 'inc/conf.php';
require 'inc/constants.php';
require 'inc/init.php';
require 'inc/functions.php';
require 'inc/classes.php';

0 comments on commit ba70db5

Please sign in to comment.