Permalink
Browse files

Update setup system

  • Loading branch information...
wakdev committed Apr 24, 2013
1 parent a69386a commit eefc43727c67931fc2eae47f16844fea10f150f1
@@ -22,10 +22,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
//Global level
define("SL_ERROR", 0);
define("SL_INFO", 1);
define("SL_DEBUG", 2);
//sl_config errors
define("SL_CONFIG_NOT_EXIST", 0);
define("SETUP_NOT_DELETED", 1);
define("SL_CONFIG_OK", 2);
?>
@@ -31,9 +31,11 @@
* @{
*/
//Global includes
include ("common/constants/sl_constants.php"); //Defines
include ("config/sl_config.php"); // configuration file.
include ("languages/sl_lang.php"); // System Language
class Slash {
@@ -160,6 +162,7 @@ private function disconnect () {
* Loading Slash properties in SLConfig class
*/
private function load_properties() {
include ("config/sl_config.php"); // configuration file.
$sl_config = new SLConfig();
$class_vars = get_class_vars(get_class($sl_config));
@@ -359,6 +362,19 @@ private function load_class(){
}
/**
* Check if sl_config exists and redirect to setup if necessary
* @return int constant
*/
private function check_configuration() {
if(!file_exists(dirname(__FILE__)."/config/sl_config.php")){
return SL_CONFIG_NOT_EXIST;
}elseif(file_exists(dirname(__FILE__)."/../setup")){
return SETUP_NOT_DELETED;
}
return SL_CONFIG_OK;
}
/*
* ------------------
@@ -371,6 +387,11 @@ private function load_class(){
*/
public function show() {
$this->mode = "site";
$ret_check = $this->check_configuration();
if($ret_check == SL_CONFIG_NOT_EXIST){header("Location:setup");exit();}
if($ret_check == SETUP_NOT_DELETED){die("Please delete the setup directory!");}
$this->initialize();
}
@@ -379,6 +400,11 @@ public function show() {
*/
public function show_admin () {
$this->mode = "admin";
$ret_check = $this->check_configuration();
if($ret_check == SL_CONFIG_NOT_EXIST){header("Location:../setup");exit();}
if($ret_check == SETUP_NOT_DELETED){die("Please delete the setup directory!");}
$this->initialize_admin ();
}
@@ -22,14 +22,7 @@
*/
//include core
// Check if sl_config exists and redirect to setup if necessary
if(!file_exists("core/config/sl_config.php")){
header("Location:setup");
exit();
}elseif(file_exists("setup"))die("Veuillez supprimer le r&eacute;pertoire setup!");
include ("core/slash.php");
$slash = new Slash ();
$slash = new Slash();
$slash->show(); //show front office
?>
@@ -107,7 +107,7 @@ private function init(){
$datas['bdd_port'] = "3386";
$datas['bdd_user'] = "root";
$datas['bdd_pwd'] = "";
$datas['bdd_name'] = "slash-cms";
$datas['bdd_name'] = "db_slashcms";
$datas['bdd_prefix'] = "sl_";
$datas['admin_name'] = "";
$datas['admin_user'] = "";

This file was deleted.

Oops, something went wrong.
@@ -1,3 +1,28 @@
/**
* @package SLASH-CMS
* @subpackage main.css
* @internal Slash core system
* @version main.css - Version 13.04.24
* @author Loic Bajard
* @copyright Copyright(C) 2013 - Today. All rights reserved.
* @license GNU/GPL
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

.head h3{
background-image: url(../img/slashcms.png);
background-repeat: no-repeat;
@@ -108,14 +108,8 @@ CREATE TABLE IF NOT EXISTS `attachments` (
KEY `state` (`state`),
KEY `id_element` (`id_element`),
KEY `id_module` (`id_module`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;

--
-- Contenu de la table `attachments`
--
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

INSERT INTO `attachments` (`id`, `id_user`, `id_module`, `id_element`, `id_field`, `filename`, `position`, `state`) VALUES
(13, 0, 0, 0, '', 'git.txt', 1, 0);

-- --------------------------------------------------------

@@ -301,9 +295,9 @@ CREATE TABLE IF NOT EXISTS `menu` (

INSERT INTO `menu` (`id`, `menu_id`, `pri_type`, `sec_type`, `parent`, `position`, `title`, `action`, `home`, `enabled`) VALUES
(1, 0, 1, 'horizontal', 0, 0, 'Principal', '#', 0, 1),
(2, 1, 2, 'url_self', 0, 0, 'Présentation', 'index.php?mod=sl_pages&id=1', 1, 1),
(3, 1, 2, 'url_self', 0, 1, 'Actualités', 'index.php?mod=sl_pages&id=2', 0, 1),
(5, 1, 2, 'url_self', 0, 2, 'Téléchargement', 'index.php?mod=sl_pages&id=3', 0, 1),
(2, 1, 2, 'url_self', 0, 0, 'Présentation', 'index.php?mod=sl_pages&id=1', 1, 1),
(3, 1, 2, 'url_self', 0, 1, 'Actualités', 'index.php?mod=sl_pages&id=2', 0, 1),
(5, 1, 2, 'url_self', 0, 2, 'Téléchargement', 'index.php?mod=sl_pages&id=3', 0, 1),
(6, 1, 2, 'url_self', 0, 4, 'Contact', 'index.php?mod=sl_pages&id=4', 0, 1),
(15, 1, 2, 'url_self', 0, 3, 'Documentation', 'index.php?mod=sl_pages&id=5', 0, 1);

@@ -398,9 +392,9 @@ CREATE TABLE IF NOT EXISTS `pages` (
--

INSERT INTO `pages` (`id`, `id_user`, `title`, `content`, `date`, `enabled`) VALUES
(1, 1, 'Présentation', '<p>\r\n Slash CMS, est une application web open source qui va vous permettre de cr&eacute;er<br />\r\n et g&eacute;rer votre site internet tr&egrave;s simplement.<br />\r\n <br />\r\n Avec ce syst&egrave;me de gestion de contenu sur internet, vous allez pouvoir mettre a disposition des visiteurs toutes les informations dont vous avez besoin de communiquer.<br />\r\n <br />\r\n Allant de la simple page &agrave; la galerie photo, en passant par des news flash et bien d&#39;autres modules,<br />\r\n vous pourrez afficher toutes vos donn&eacute;es sur votre site, sans avoir la moindre connaissance technique.</p>\r\n', '2013-01-29 13:08:34', 1),
(2, 1, 'Actualités', '<p>\r\n A venir</p>\r\n', '2013-01-29 13:08:52', 1),
(3, 1, 'Téléchargement', '<p>\r\n A venir.</p>\r\n', '2013-01-29 13:09:06', 1),
(1, 1, 'Présentation', '<p>\r\n Slash CMS, est une application web open source qui va vous permettre de cr&eacute;er<br />\r\n et g&eacute;rer votre site internet tr&egrave;s simplement.<br />\r\n <br />\r\n Avec ce syst&egrave;me de gestion de contenu sur internet, vous allez pouvoir mettre a disposition des visiteurs toutes les informations dont vous avez besoin de communiquer.<br />\r\n <br />\r\n Allant de la simple page &agrave; la galerie photo, en passant par des news flash et bien d&#39;autres modules,<br />\r\n vous pourrez afficher toutes vos donn&eacute;es sur votre site, sans avoir la moindre connaissance technique.</p>\r\n', '2013-01-29 13:08:34', 1),
(2, 1, 'Actualités', '<p>\r\n A venir</p>\r\n', '2013-01-29 13:08:52', 1),
(3, 1, 'Téléchargement', '<p>\r\n A venir.</p>\r\n', '2013-01-29 13:09:06', 1),
(4, 1, 'Contact', '<p>\r\n Vous pouvez me contacter a cette adresse : weneedyou [arobase] slash-cms.com</p>\r\n', '2013-01-29 13:09:23', 1),
(5, 1, 'Documentation', '<p>\r\n A venir.</p>\r\n', '2013-01-29 22:56:12', 1);

Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
* @subpackage SLSETUP
* @internal Slash core system
* @version index.php - Version 13.04.24
* @author Loïc Bajard
* @author Loic Bajard
* @copyright Copyright(C) 2013 - Today. All rights reserved.
* @license GNU/GPL

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -4,7 +4,7 @@
* @subpackage SLSETUP
* @internal Slash core system
* @version default.php - Version 13.04.24
* @author Loïc Bajard
* @author Loic Bajard
* @copyright Copyright(C) 2013 - Today. All rights reserved.
* @license GNU/GPL
@@ -37,7 +37,7 @@ private function loadHeader($state){
<title>Installation de SLASH-CMS - ".$state."</title>\n
<meta name='description' content=''>\n
<meta name='viewport' content='width=device-width'>\n
<link rel='stylesheet' href='css/bootstrap.min.css'>\n
<link rel='stylesheet' href='../core/plugins/bootstrap/css/bootstrap.min.css'>\n
<link rel='stylesheet' href='css/main.css'>\n
</head>\n
<body>\n
@@ -52,16 +52,15 @@ private function loadFooter(){
echo "</div>\n";
echo "</div>\n
</body>\n
<script src='js/jquery-1.9.1.min.js'></script>\n
<script src='js/bootstrap.min.js'></script>\n
<script src='../core/plugins/jquery/jquery.js'></script>\n
<script src='../core/plugins/bootstrap/js/bootstrap.min.js'></script>\n
</html>";
}
public function loadInit($datas,$errors = null,$fatals = null){
$this->loadHeader("Bienvenue");
echo "<h1>Bonjour et bienvenue dans SLASH-CMS</h1>\n";
echo "<p>Cet assistant va vous guider au cours des diff&eacute;rentes &eacute;tapes d'installation.</p>\n";
@@ -82,47 +81,47 @@ public function loadInit($datas,$errors = null,$fatals = null){
echo "<div class='control-group".(isset($errors['bdd_host']) ?" error":"")."'>\n";
echo "<label class='control-label' for='bdd_host'>Serveur</label>\n";
echo "<div class='controls'>\n";
echo "<input required type='text' name='bdd_host' placeholder='bdd_host' value='".$datas['bdd_host']."'>\n";
echo "<input required type='text' name='bdd_host' placeholder='database host' value='".$datas['bdd_host']."'>\n";
if(isset($errors['bdd_host'])) echo "<span class='help-inline'>".$errors['bdd_host']."</span>\n";
echo "</div>\n";
echo "</div>\n";
echo "<div class='control-group".(isset($errors['bdd_port']) ?" error":"")."'>\n";
echo "<label class='control-label' for='bdd_port'>Port</label>\n";
echo "<div class='controls'>\n";
echo "<input required type='text' name='bdd_port' placeholder='bdd_port' value='".$datas['bdd_port']."'>\n";
echo "<input required type='text' name='bdd_port' placeholder='database port' value='".$datas['bdd_port']."'>\n";
if(isset($errors['bdd_port'])) echo "<span class='help-inline'>".$errors['bdd_port']."</span>\n";
echo "</div>\n";
echo "</div>\n";
echo "<div class='control-group".(isset($errors['bdd_user']) ?" error":"")."'>\n";
echo "<label class='control-label' for='bdd_user'>Utilisateur</label>\n";
echo "<div class='controls'>\n";
echo "<input required type='text' name='bdd_user' placeholder='bdd_user' value='".$datas['bdd_user']."'>\n";
echo "<input required type='text' name='bdd_user' placeholder='database user' value='".$datas['bdd_user']."'>\n";
if(isset($errors['bdd_user'])) echo "<span class='help-inline'>".$errors['bdd_user']."</span>\n";
echo "</div>\n";
echo "</div>\n";
echo "<div class='control-group".(isset($errors['bdd_pwd']) ?" error":"")."'>\n";
echo "<label class='control-label' for='bdd_pwd'>Mot de passe</label>\n";
echo "<div class='controls'>\n";
echo "<input type='text' name='bdd_pwd' placeholder='bdd_pwd' value='".$datas['bdd_pwd']."'>\n";
echo "<input type='text' name='bdd_pwd' placeholder='database password' value='".$datas['bdd_pwd']."'>\n";
if(isset($errors['bdd_pwd'])) echo "<span class='help-inline'>".$errors['bdd_pwd']."</span>\n";
echo "</div>\n";
echo "</div>\n";
echo "<div class='control-group".(isset($errors['bdd_name']) ?" error":"")."'>\n";
echo "<label class='control-label' for='bdd_name'>Nom de la base</label>\n";
echo "<div class='controls'>\n";
echo "<input required type='text' name='bdd_name' placeholder='bdd_name' value='".$datas['bdd_name']."'>\n";
echo "<input required type='text' name='bdd_name' placeholder='database name' value='".$datas['bdd_name']."'>\n";
if(isset($errors['bdd_name'])) echo "<span class='help-inline'>".$errors['bdd_name']."</span>\n";
echo "</div>\n";
echo "</div>\n";
echo "<div class='control-group".(isset($errors['bdd_prefix']) ?" error":"")."'>\n";
echo "<label class='control-label' for='bdd_prefix'>Prefixe des tables</label>\n";
echo "<div class='controls'>\n";
echo "<input type='text' name='bdd_prefix' placeholder='bdd_prefix' value='".$datas['bdd_prefix']."'>\n";
echo "<input type='text' name='bdd_prefix' placeholder='database prefix' value='".$datas['bdd_prefix']."'>\n";
if(isset($errors['bdd_prefix'])) echo "<span class='help-inline'>".$errors['bdd_prefix']."</span>\n";
echo "</div>\n";
echo "</div>\n";
@@ -137,15 +136,15 @@ public function loadInit($datas,$errors = null,$fatals = null){
echo "<div class='control-group".(isset($errors['admin_name']) ?" error":"")."'>\n";
echo "<label class='control-label' for='admin_name'>Nom complet</label>\n";
echo "<div class='controls'>\n";
echo "<input required type='text' name='admin_name' placeholder='Jhon Doe' value='".$datas['admin_name']."'>\n";
echo "<input required type='text' name='admin_name' placeholder='John Doe' value='".$datas['admin_name']."'>\n";
if(isset($errors['admin_name'])) echo "<span class='help-inline'>".$errors['admin_name']."</span>\n";
echo "</div>\n";
echo "</div>\n";
echo "<div class='control-group".(isset($errors['admin_user']) ?" error":"")."'>\n";
echo "<label class='control-label' for='admin_user'>Identifiant</label>\n";
echo "<div class='controls'>\n";
echo "<input required type='text' name='admin_user' placeholder='superjhon' value='".$datas['admin_user']."'>\n";
echo "<input required type='text' name='admin_user' placeholder='superjohn' value='".$datas['admin_user']."'>\n";
if(isset($errors['admin_user'])) echo "<span class='help-inline'>".$errors['admin_user']."</span>\n";
echo "</div>\n";
echo "</div>\n";
@@ -169,7 +168,7 @@ public function loadInit($datas,$errors = null,$fatals = null){
echo "<div class='control-group".(isset($errors['admin_mail']) ?" error":"")."'>\n";
echo "<label class='control-label' for='admin_mail'>E-mail</label>\n";
echo "<div class='controls'>\n";
echo "<input required type='email' name='admin_mail' placeholder='jhondoe@example.com' value='".$datas['admin_mail']."'>\n";
echo "<input required type='email' name='admin_mail' placeholder='johndoe@example.com' value='".$datas['admin_mail']."'>\n";
if(isset($errors['admin_mail'])) echo "<span class='help-inline'>".$errors['admin_mail']."</span>\n";
echo "</div>\n";
echo "</div>\n";
@@ -200,7 +199,7 @@ public function loadCheckSettings($fatals=null,$warnings=null){
foreach ($warnings as $warning) {
echo "<div class='alert alert-warning'>".$warning."</div>\n";
}
echo "<div class='alert alert-success'>Tous les paramètres sont corrects, vous pouvez continuer</div>\n";
echo "<div class='alert alert-success'>Tous les param&egrave;tres sont corrects, vous pouvez continuer</div>\n";
echo "<a class='btn btn-primary btn-primary' href='index.php?state=install'>Continuer</a>\n";
}
}
@@ -218,7 +217,7 @@ public function loadInstall($fatals=null){
}else{
echo "<div class='alert alert-success'>Yipikaye! SLASH-CMS est install&eacute;.</div>\n";
echo "<div class='alert alert-info'>Votre compte administreur a &eacute;t&eacute; cr&eacute;e.<br>
N'oubliez pas de supprimer le répertoire setup.</div>\n";
N'oubliez pas de supprimer le r&eacute;pertoire setup.</div>\n";
echo "<a class='btn btn-primary btn-primary' href='../admin'>Aller au panneau d'administration</a>\n";
}
}

0 comments on commit eefc437

Please sign in to comment.