commit
273d897ec3
|
@ -32,7 +32,7 @@ if($_Plugin===false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the plugin has the method form()
|
// Check if the plugin has the method form()
|
||||||
if($_Plugin->form()===false) {
|
if(!method_exists($_Plugin, 'form')) {
|
||||||
Redirect::page('admin', 'plugins');
|
Redirect::page('admin', 'plugins');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,8 @@
|
||||||
|
|
||||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
$username = Sanitize::html($_POST['username']);
|
// Verify User sanitize the input
|
||||||
$password = Sanitize::html($_POST['password']);
|
if( $Login->verifyUser($_POST['username'], $_POST['password']) )
|
||||||
|
|
||||||
if( $Login->verifyUser($username, $password) )
|
|
||||||
{
|
{
|
||||||
Redirect::page('admin', 'dashboard');
|
Redirect::page('admin', 'dashboard');
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
<script src="./js/kube.min.js"></script>
|
<script src="./js/kube.min.js"></script>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php Theme::plugins('onAdminHead') ?>
|
<?php Theme::plugins('adminHead') ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php Theme::plugins('onAdminBodyBegin') ?>
|
<?php Theme::plugins('adminBodyBegin') ?>
|
||||||
|
|
||||||
<!-- ALERT -->
|
<!-- ALERT -->
|
||||||
<script>
|
<script>
|
||||||
|
@ -92,7 +92,7 @@ $(document).ready(function() {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php Theme::plugins('onAdminBodyEnd') ?>
|
<?php Theme::plugins('adminBodyEnd') ?>
|
||||||
|
|
||||||
<div id="footer">Bludit <?php echo BLUDIT_VERSION ?> | Load time <?php echo (microtime(true) - $loadTime) ?></div>
|
<div id="footer">Bludit <?php echo BLUDIT_VERSION ?> | Load time <?php echo (microtime(true) - $loadTime) ?></div>
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,15 @@
|
||||||
<link rel="stylesheet" href="./css/kube.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
<link rel="stylesheet" href="./css/kube.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||||
<link rel="stylesheet" href="./css/default.css?version=<?php echo BLUDIT_VERSION ?>">
|
<link rel="stylesheet" href="./css/default.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||||
<link rel="stylesheet" href="./css/css/font-awesome.css?version=<?php echo BLUDIT_VERSION ?>">
|
<link rel="stylesheet" href="./css/css/font-awesome.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||||
|
|
||||||
|
<!-- Plugins Login Head -->
|
||||||
|
<?php Theme::plugins('loginHead') ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<!-- Plugins Login Body Begin -->
|
||||||
|
<?php Theme::plugins('loginBodyBegin') ?>
|
||||||
|
|
||||||
<div id="head">
|
<div id="head">
|
||||||
<nav class="navbar nav-fullwidth">
|
<nav class="navbar nav-fullwidth">
|
||||||
<h1>Bludit</h1>
|
<h1>Bludit</h1>
|
||||||
|
@ -45,7 +51,10 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="footer">Bludit <?php echo BLUDIT_VERSION ?> | Load time <?php echo (microtime(true) - $loadTime) ?></div>
|
<div id="footer">Bludit</div>
|
||||||
|
|
||||||
|
<!-- Plugins Login Body Begin -->
|
||||||
|
<?php Theme::plugins('loginBodyEnd') ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -5,7 +5,7 @@
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms">
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Username') ?>
|
<?php $Language->p('Username') ?>
|
||||||
<input type="text" name="username" class="width-50">
|
<input type="text" name="username" class="width-50" value="<?php echo (isset($_POST['username'])?$_POST['username']:'') ?>">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
Email
|
Email
|
||||||
<input type="text" name="email" class="width-50">
|
<input type="text" name="email" class="width-50" value="<?php echo (isset($_POST['email'])?$_POST['email']:'') ?>">
|
||||||
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
|
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
foreach($posts as $Post)
|
foreach($posts as $Post)
|
||||||
{
|
{
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($Post->published()?'':'['.$Language->g('Draft').'] ').($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').'</a></td>';
|
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($Post->published()?'':'<span class="label label-outline label-red smaller">'.$Language->g('Draft').'</span> ').($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').'</a></td>';
|
||||||
echo '<td>'.$Post->dateCreated().'</td>';
|
echo '<td>'.$Post->dateCreated().'</td>';
|
||||||
echo '<td>'.$Post->timeago().'</td>';
|
echo '<td>'.$Post->timeago().'</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
echo '<span class="version">'.$Language->g('Version').': '.$Plugin->version().'</span><span class="author">'.$Language->g('author').': <a targe="_blank" href="'.$Plugin->website().'">'.$Plugin->author().'</a></span>';
|
echo '<span class="version">'.$Language->g('Version').': '.$Plugin->version().'</span><span class="author">'.$Language->g('author').': <a targe="_blank" href="'.$Plugin->website().'">'.$Plugin->author().'</a></span>';
|
||||||
|
|
||||||
if($Plugin->installed()) {
|
if($Plugin->installed()) {
|
||||||
if($Plugin->form()) {
|
if(method_exists($Plugin, 'form')) {
|
||||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$Plugin->className().'" class="btn btn-smaller">'.$Language->g('Configure plugin').'</a>';
|
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$Plugin->className().'" class="btn btn-smaller">'.$Language->g('Configure plugin').'</a>';
|
||||||
}
|
}
|
||||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'" class="btn btn-red btn-smaller">'.$Language->g('Uninstall plugin').'</a>';
|
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'" class="btn btn-red btn-smaller">'.$Language->g('Uninstall plugin').'</a>';
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Set the correct permissions on this directory.
|
||||||
|
Check the documentation: http://docs.bludit.com/en/troubleshooting/writing-test-failure-err205
|
63
install.php
63
install.php
|
@ -36,10 +36,29 @@ if(!defined('JSON_PRETTY_PRINT')) {
|
||||||
define('JSON_PRETTY_PRINT', 128);
|
define('JSON_PRETTY_PRINT', 128);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helpers class
|
// Check if JSON encode and decode are enabled.
|
||||||
|
define('JSON', function_exists('json_encode'));
|
||||||
|
|
||||||
|
// Multibyte string / UTF-8
|
||||||
|
define('MB_STRING', extension_loaded('mbstring'));
|
||||||
|
|
||||||
|
define('CHARSET', 'UTF-8');
|
||||||
|
|
||||||
|
if(MB_STRING)
|
||||||
|
{
|
||||||
|
// Tell PHP that we're using UTF-8 strings until the end of the script.
|
||||||
|
mb_internal_encoding(CHARSET);
|
||||||
|
|
||||||
|
// Tell PHP that we'll be outputting UTF-8 to the browser.
|
||||||
|
mb_http_output(CHARSET);
|
||||||
|
}
|
||||||
|
|
||||||
|
// PHP Classes
|
||||||
include(PATH_HELPERS.'sanitize.class.php');
|
include(PATH_HELPERS.'sanitize.class.php');
|
||||||
include(PATH_HELPERS.'valid.class.php');
|
include(PATH_HELPERS.'valid.class.php');
|
||||||
|
include(PATH_HELPERS.'text.class.php');
|
||||||
include(PATH_ABSTRACT.'dbjson.class.php');
|
include(PATH_ABSTRACT.'dbjson.class.php');
|
||||||
|
include(PATH_KERNEL.'dblanguage.class.php');
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// FUNCTIONS
|
// FUNCTIONS
|
||||||
|
@ -125,8 +144,10 @@ function checkSystem()
|
||||||
return $stdOut;
|
return $stdOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
function install($adminPassword, $email, $language)
|
function install($adminPassword, $email, $locale)
|
||||||
{
|
{
|
||||||
|
$Language = new dbLanguage($locale);
|
||||||
|
|
||||||
$stdOut = array();
|
$stdOut = array();
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -201,9 +222,9 @@ function install($adminPassword, $email, $language)
|
||||||
'title'=>'Bludit',
|
'title'=>'Bludit',
|
||||||
'slogan'=>'cms',
|
'slogan'=>'cms',
|
||||||
'description'=>'',
|
'description'=>'',
|
||||||
'footer'=>'Footer text - ©2015',
|
'footer'=>'©2015',
|
||||||
'language'=>$language,
|
'language'=>$locale,
|
||||||
'locale'=>$language,
|
'locale'=>$locale,
|
||||||
'timezone'=>'UTC',
|
'timezone'=>'UTC',
|
||||||
'theme'=>'pure',
|
'theme'=>'pure',
|
||||||
'adminTheme'=>'default',
|
'adminTheme'=>'default',
|
||||||
|
@ -241,56 +262,56 @@ function install($adminPassword, $email, $language)
|
||||||
// File plugins/pages/db.php
|
// File plugins/pages/db.php
|
||||||
$data = array(
|
$data = array(
|
||||||
'homeLink'=>true,
|
'homeLink'=>true,
|
||||||
'label'=>'Pages'
|
'label'=>$Language->get('Pages')
|
||||||
);
|
);
|
||||||
|
|
||||||
file_put_contents(PATH_PLUGINS_DATABASES.'pages'.DS.'db.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents(PATH_PLUGINS_DATABASES.'pages'.DS.'db.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
|
||||||
// File index.txt for error page
|
// File index.txt for error page
|
||||||
$data = 'Title: Error
|
$data = 'Title: '.$Language->get('Error').'
|
||||||
Content: The page has not been found.';
|
Content: '.$Language->get('The page has not been found');
|
||||||
|
|
||||||
file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX);
|
file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX);
|
||||||
|
|
||||||
// File index.txt for welcome post
|
// File index.txt for welcome post
|
||||||
$data = 'Title: First post
|
$data = 'Title: '.$Language->get('First post').'
|
||||||
Content:
|
Content:
|
||||||
|
|
||||||
Congratulations, you have installed **Bludit** successfully!
|
'.$Language->get('Congratulations you have successfully installed your Bludit').'
|
||||||
---
|
---
|
||||||
|
|
||||||
What\'s next:
|
'.$Language->get('Whats next').'
|
||||||
---
|
---
|
||||||
- Administrate your Bludit from the [admin area](./admin/)
|
- '.$Language->get('Manage your Bludit from the admin panel').'
|
||||||
- Follow Bludit on [Twitter](https://twitter.com/bludit) / [Facebook](https://www.facebook.com/pages/Bludit/239255789455913) / [Google+](https://plus.google.com/+Bluditcms)
|
- '.$Language->get('Follow Bludit on').' [Twitter](https://twitter.com/bludit) / [Facebook](https://www.facebook.com/pages/Bludit/239255789455913) / [Google+](https://plus.google.com/+Bluditcms)
|
||||||
- Visit the [forum](http://forum.bludit.com) for support
|
- '.$Language->get('Visit the support forum').'
|
||||||
- Read the [documentation](http://docs.bludit.com) for more information
|
- '.$Language->get('Read the documentation for more information').'
|
||||||
- Share with your friend :D';
|
- '.$Language->get('Share with your friends and enjoy');
|
||||||
|
|
||||||
file_put_contents(PATH_POSTS.$firstPostSlug.DS.'index.txt', $data, LOCK_EX);
|
file_put_contents(PATH_POSTS.$firstPostSlug.DS.'index.txt', $data, LOCK_EX);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkPOST($_POST)
|
function checkPOST($args)
|
||||||
{
|
{
|
||||||
// Check empty password
|
// Check empty password
|
||||||
if(empty($_POST['password']))
|
if(empty($args['password']))
|
||||||
{
|
{
|
||||||
return '<div>The password field is empty</div>';
|
return '<div>The password field is empty</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check invalid email
|
// Check invalid email
|
||||||
if( !Valid::email($_POST['email']) && ($_POST['noCheckEmail']=='0') )
|
if( !Valid::email($args['email']) && ($args['noCheckEmail']=='0') )
|
||||||
{
|
{
|
||||||
return '<div>Your email address is invalid.</div><div id="jscompleteEmail">Proceed anyway!</div>';
|
return '<div>Your email address is invalid.</div><div id="jscompleteEmail">Proceed anyway!</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sanitize email
|
// Sanitize email
|
||||||
$email = sanitize::email($_POST['email']);
|
$email = sanitize::email($args['email']);
|
||||||
|
|
||||||
// Install Bludit
|
// Install Bludit
|
||||||
install($_POST['password'], $email, $_POST['language']);
|
install($args['password'], $email, $args['language']);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,85 +191,4 @@ class Plugin {
|
||||||
// The user can define your own dbFields.
|
// The user can define your own dbFields.
|
||||||
}
|
}
|
||||||
|
|
||||||
// EVENTS
|
|
||||||
|
|
||||||
public function form()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Before the posts load.
|
|
||||||
public function beforePostsLoad()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// After the posts load.
|
|
||||||
public function afterPostsLoad()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Before the pages load.
|
|
||||||
public function beforePagesLoad()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// After the pages load.
|
|
||||||
public function afterPagesLoad()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onSiteHead()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onSiteBodyBegin()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onSiteBodyEnd()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onAdminHead()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onAdminBodyBegin()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onAdminBodyEnd()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onSiteSidebar()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onAdminSidebar()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function beforeSiteLoad()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function afterSiteLoad()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -52,6 +52,9 @@ else
|
||||||
$layout['template'] = 'login.php';
|
$layout['template'] = 'login.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Plugins before admin area loaded
|
||||||
|
Theme::plugins('beforeAdminLoad');
|
||||||
|
|
||||||
// Admin theme init.php
|
// Admin theme init.php
|
||||||
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.'init.php') )
|
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.'init.php') )
|
||||||
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.'init.php');
|
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.'init.php');
|
||||||
|
@ -63,4 +66,7 @@ else
|
||||||
// Load view and theme
|
// Load view and theme
|
||||||
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.$layout['template']) )
|
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.$layout['template']) )
|
||||||
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.$layout['template']);
|
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.$layout['template']);
|
||||||
|
|
||||||
|
// Plugins after admin area loaded
|
||||||
|
Theme::plugins('afterAdminLoad');
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,20 +5,29 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
$plugins = array(
|
$plugins = array(
|
||||||
'onSiteHead'=>array(), // <html><head>HERE</head><body>...</body></html>
|
'siteHead'=>array(),
|
||||||
'onSiteBodyBegin'=>array(), // <html><head>...</head><body>HERE...</body></html>
|
'siteBodyBegin'=>array(),
|
||||||
'onSiteBodyEnd'=>array(), // <html><head>...</head><body>...HERE</body></html>
|
'siteBodyEnd'=>array(),
|
||||||
'onSiteSidebar'=>array(), // <html><head>...</head><body>...<sidebar>HERE</sidebar>...</body></html>
|
'siteSidebar'=>array(),
|
||||||
'onAdminHead'=>array(),
|
|
||||||
'onAdminBodyBegin'=>array(),
|
|
||||||
'onAdminBodyEnd'=>array(),
|
|
||||||
'onAdminSidebar'=>array(),
|
|
||||||
'beforeSiteLoad'=>array(),
|
'beforeSiteLoad'=>array(),
|
||||||
'afterSiteLoad'=>array(),
|
'afterSiteLoad'=>array(),
|
||||||
'beforePostsLoad'=>array(),
|
|
||||||
'afterPostsLoad'=>array(),
|
'pageBegin'=>array(),
|
||||||
'beforePagesLoad'=>array(),
|
'pageEnd'=>array(),
|
||||||
'afterPagesLoad'=>array(),
|
'postBegin'=>array(),
|
||||||
|
'postEnd'=>array(),
|
||||||
|
|
||||||
|
'adminHead'=>array(),
|
||||||
|
'adminBodyBegin'=>array(),
|
||||||
|
'adminBodyEnd'=>array(),
|
||||||
|
'adminSidebar'=>array(),
|
||||||
|
'beforeAdminLoad'=>array(),
|
||||||
|
'afterAdminLoad'=>array(),
|
||||||
|
|
||||||
|
'loginHead'=>array(),
|
||||||
|
'loginBodyBegin'=>array(),
|
||||||
|
'loginBodyEnd'=>array(),
|
||||||
|
|
||||||
'all'=>array()
|
'all'=>array()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -81,11 +90,7 @@ function build_plugins()
|
||||||
{
|
{
|
||||||
foreach($pluginsEvents as $event=>$value)
|
foreach($pluginsEvents as $event=>$value)
|
||||||
{
|
{
|
||||||
/*
|
if(method_exists($Plugin, $event)) {
|
||||||
if($Plugin->onSiteHead()!==false)
|
|
||||||
array_push($plugins['onSiteHead'], $Plugin);
|
|
||||||
*/
|
|
||||||
if($Plugin->{$event}()!==false) {
|
|
||||||
array_push($plugins[$event], $Plugin);
|
array_push($plugins[$event], $Plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ class Text {
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public static function cleanUrl($string, $separator='-')
|
public static function cleanUrl($string, $separator='-')
|
||||||
{
|
{
|
||||||
// Delete characters
|
// Delete characters
|
||||||
|
@ -72,6 +73,21 @@ class Text {
|
||||||
|
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static function cleanUrl($string, $separator='-')
|
||||||
|
{
|
||||||
|
if(function_exists('iconv')) {
|
||||||
|
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
|
||||||
|
}
|
||||||
|
|
||||||
|
$string = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $string);
|
||||||
|
$string = trim($string, '-');
|
||||||
|
$string = self::lowercase($string);
|
||||||
|
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
// Replace all occurrences of the search string with the replacement string.
|
// Replace all occurrences of the search string with the replacement string.
|
||||||
public static function replace($search, $replace, $string)
|
public static function replace($search, $replace, $string)
|
||||||
|
|
|
@ -52,6 +52,9 @@ class Login {
|
||||||
|
|
||||||
public function verifyUser($username, $password)
|
public function verifyUser($username, $password)
|
||||||
{
|
{
|
||||||
|
$username = Sanitize::html($username);
|
||||||
|
$password = Sanitize::html($password);
|
||||||
|
|
||||||
$username = trim($username);
|
$username = trim($username);
|
||||||
$password = trim($password);
|
$password = trim($password);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
|
class Security extends dbJSON
|
||||||
|
{
|
||||||
|
private $dbFields = array(
|
||||||
|
'minutesBlocked'=>5,
|
||||||
|
'numberFailures'=>10
|
||||||
|
);
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct(PATH_DATABASES.'security.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function addLoginFail()
|
||||||
|
{
|
||||||
|
$ip = $this->getUserIp();
|
||||||
|
|
||||||
|
// Save the database
|
||||||
|
$this->db[$ip] = (int)$this->db[$ip] + 1;
|
||||||
|
if( $this->save() === false ) {
|
||||||
|
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUserIp()
|
||||||
|
{
|
||||||
|
// User IP
|
||||||
|
if(getenv('HTTP_X_FORWARDED_FOR'))
|
||||||
|
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
||||||
|
elseif(getenv('HTTP_CLIENT_IP'))
|
||||||
|
$ip = getenv('HTTP_CLIENT_IP');
|
||||||
|
else
|
||||||
|
$ip = getenv('REMOTE_ADDR');
|
||||||
|
|
||||||
|
return $ip;
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,7 +69,6 @@
|
||||||
"website": "Website",
|
"website": "Website",
|
||||||
"timezone": "Timezone",
|
"timezone": "Timezone",
|
||||||
"locale": "Locale",
|
"locale": "Locale",
|
||||||
"notifications": "Notifications",
|
|
||||||
"new-post": "New post",
|
"new-post": "New post",
|
||||||
"html-and-markdown-code-supported": "HTML and Markdown code supported",
|
"html-and-markdown-code-supported": "HTML and Markdown code supported",
|
||||||
"new-page": "New page",
|
"new-page": "New page",
|
||||||
|
@ -98,7 +97,6 @@
|
||||||
"username-or-password-incorrect": "Username or password incorrect",
|
"username-or-password-incorrect": "Username or password incorrect",
|
||||||
"database-regenerated": "Database regenerated",
|
"database-regenerated": "Database regenerated",
|
||||||
"the-changes-have-been-saved": "The changes have been saved",
|
"the-changes-have-been-saved": "The changes have been saved",
|
||||||
"html-markdown-code-supported": "HTML and Markdown code supported.",
|
|
||||||
"enable-more-features-at": "Enable more features at",
|
"enable-more-features-at": "Enable more features at",
|
||||||
"username-already-exists": "Username already exists",
|
"username-already-exists": "Username already exists",
|
||||||
"username-field-is-empty": "Username field is empty",
|
"username-field-is-empty": "Username field is empty",
|
||||||
|
@ -122,7 +120,6 @@
|
||||||
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
|
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
|
||||||
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
|
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
|
||||||
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
|
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
|
||||||
"delete": "Delete",
|
|
||||||
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
|
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
|
||||||
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
|
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
|
||||||
"read-more": "Read more",
|
"read-more": "Read more",
|
||||||
|
@ -137,5 +134,16 @@
|
||||||
"language-and-timezone":"Language and timezone",
|
"language-and-timezone":"Language and timezone",
|
||||||
"author": "Author",
|
"author": "Author",
|
||||||
"start-here": "Start here",
|
"start-here": "Start here",
|
||||||
"install-theme": "Install theme"
|
"install-theme": "Install theme",
|
||||||
|
"first-post": "First post",
|
||||||
|
"congratulations-you-have-successfully-installed-your-bludit": "Congratulations you have successfully installed your **Bludit**",
|
||||||
|
"whats-next": "What's Next",
|
||||||
|
"manage-your-bludit-from-the-admin-panel": "Manage your Bludit from the [admin area](./admin/)",
|
||||||
|
"follow-bludit-on": "Follow Bludit on",
|
||||||
|
"visit-the-support-forum": "Visit the [forum](http://forum.bludit.com) for support",
|
||||||
|
"read-the-documentation-for-more-information": "Read the [documentation](http://docs.bludit.com) for more information",
|
||||||
|
"share-with-your-friends-and-enjoy": "Share with your friends and enjoy",
|
||||||
|
"the-page-has-not-been-found": "The page has not been found.",
|
||||||
|
"error": "Error"
|
||||||
|
|
||||||
}
|
}
|
|
@ -27,86 +27,84 @@
|
||||||
"edit-page": "Editar pagina",
|
"edit-page": "Editar pagina",
|
||||||
"edit-post": "Editar post",
|
"edit-post": "Editar post",
|
||||||
"add-a-new-user": "Agregar nuevo usuario",
|
"add-a-new-user": "Agregar nuevo usuario",
|
||||||
"parent": "Parent",
|
"parent": "Padre",
|
||||||
"friendly-url": "Friendly URL",
|
"friendly-url": "URL Amistosa",
|
||||||
"description": "Description",
|
"description": "Descripcion",
|
||||||
"posted-by": "Posted by",
|
"posted-by": "Publicado por",
|
||||||
"tags": "Tags",
|
"tags": "Etiquetas",
|
||||||
"position": "Position",
|
"position": "Posicion",
|
||||||
"save": "Save",
|
"save": "Guardar",
|
||||||
"draft": "Draft",
|
"draft": "Borrador",
|
||||||
"delete": "Delete",
|
"delete": "Eliminar",
|
||||||
"registered": "Registered",
|
"registered": "Registrado",
|
||||||
"Notifications": "Notifications",
|
"Notifications": "Notificaciones",
|
||||||
"profile": "Profile",
|
"profile": "Perfil",
|
||||||
"email": "Email",
|
"email": "Correo electronico",
|
||||||
"settings": "Settings",
|
"settings": "Ajustes",
|
||||||
"general": "General",
|
"general": "General",
|
||||||
"advanced": "Advanced",
|
"advanced": "Avanzado",
|
||||||
"regional": "Regional",
|
"regional": "Regional",
|
||||||
"about": "About",
|
"about": "Acerca de",
|
||||||
"login": "Log in",
|
"login": "Iniciar sesión",
|
||||||
"logout": "Log out",
|
"logout": "Cerrar sesión",
|
||||||
"manage": "Manage",
|
"manage": "Administrar",
|
||||||
"themes": "Themes",
|
"themes": "Temas",
|
||||||
"prev-page": "Prev page",
|
"prev-page": "Pag. anterior",
|
||||||
"next-page": "Next page",
|
"next-page": "Pag. siguiente",
|
||||||
"configure-plugin": "Configure plugin",
|
"configure-plugin": "Configurar plugin",
|
||||||
"confirm-delete-this-action-cannot-be-undone": "Confirm delete, this action cannot be undone.",
|
"confirm-delete-this-action-cannot-be-undone": "Confirmar eliminacion, esta operacion no se puede deshacer.",
|
||||||
"site-title": "Site title",
|
"site-title": "Titulo del sitio",
|
||||||
"site-slogan": "Site slogan",
|
"site-slogan": "Slogan del sitio",
|
||||||
"site-description": "Site description",
|
"site-description": "Descripcion del sitio",
|
||||||
"footer-text": "Footer text",
|
"footer-text": "Texto de pie de pagina",
|
||||||
"posts-per-page": "Posts per page",
|
"posts-per-page": "Posts por pagina",
|
||||||
"site-url": "Site url",
|
"site-url": "URL del sitio",
|
||||||
"writting-settings": "Writting settings",
|
"writting-settings": "Ajustes de redaccion",
|
||||||
"url-filters": "URL filters",
|
"url-filters": "Filtros URL",
|
||||||
"page": "Page",
|
"page": "Pagina",
|
||||||
"pages": "Pages",
|
"pages": "Paginas",
|
||||||
"home": "Home",
|
"home": "Inicio",
|
||||||
"welcome-back": "Welcome back",
|
"welcome-back": "Bienvenido",
|
||||||
"language": "Language",
|
"language": "Lenguage",
|
||||||
"website": "Website",
|
"website": "Sitio web",
|
||||||
"timezone": "Timezone",
|
"timezone": "Zona horaria",
|
||||||
"locale": "Locale",
|
"locale": "Locale",
|
||||||
"notifications": "Notifications",
|
"new-post": "Nuevo post",
|
||||||
"new-post": "New post",
|
"new-page": "Nueva pagina",
|
||||||
"html-and-markdown-code-supported": "HTML and Markdown code supported",
|
"html-and-markdown-code-supported": "Codigo HTML y Markdown soportado",
|
||||||
"new-page": "New page",
|
"manage-posts": "Administrar posts",
|
||||||
"manage-posts": "Manage posts",
|
"published-date": "Fecha de publicacion",
|
||||||
"published-date": "Published date",
|
"modified-date": "Fecha de modificacion",
|
||||||
"modified-date": "Modified date",
|
"empty-title": "Titulo vacio",
|
||||||
"empty-title": "Empty title",
|
|
||||||
"plugins": "Plugins",
|
"plugins": "Plugins",
|
||||||
"install-plugin": "Install plugin",
|
"install-plugin": "Instalar plugin",
|
||||||
"uninstall-plugin": "Uninstall plugin",
|
"uninstall-plugin": "Desinstalar plugin",
|
||||||
"new-password": "New password",
|
"new-password": "Nueva contraseña",
|
||||||
"edit-user": "Edit user",
|
"edit-user": "Editar usuario",
|
||||||
"publish-now": "Publish now",
|
"publish-now": "Publicar",
|
||||||
"first-name": "First name",
|
"first-name": "Nombre",
|
||||||
"last-name": "Last name",
|
"last-name": "Apellido",
|
||||||
"bludit-version": "Bludit version",
|
"bludit-version": "Bludit version",
|
||||||
"powered-by": "Powered by",
|
"powered-by": "Corriendo con",
|
||||||
"recent-posts": "Recent Posts",
|
"recent-posts": "Posts recientes",
|
||||||
"manage-pages": "Manage pages",
|
"manage-pages": "Administrar paginas",
|
||||||
"advanced-options": "Advanced options",
|
"advanced-options": "Opciones avanzadas",
|
||||||
"user-deleted": "User deleted",
|
"user-deleted": "Usuario eliminado",
|
||||||
"page-added-successfully": "Page added successfully",
|
"page-added-successfully": "Página agregada con éxito",
|
||||||
"post-added-successfully": "Post added successfully",
|
"post-added-successfully": "Post agregado con éxito ",
|
||||||
"the-post-has-been-deleted-successfully": "The post has been deleted successfully",
|
"the-post-has-been-deleted-successfully": "El post fue eliminado con exito",
|
||||||
"the-page-has-been-deleted-successfully": "The page has been deleted successfully",
|
"the-page-has-been-deleted-successfully": "La pagina fue eliminada con exito",
|
||||||
"username-or-password-incorrect": "Username or password incorrect",
|
"username-or-password-incorrect": "Usuario o contraseña icorrectos",
|
||||||
"database-regenerated": "Database regenerated",
|
"database-regenerated": "Base de datos regenerada",
|
||||||
"the-changes-have-been-saved": "The changes have been saved",
|
"the-changes-have-been-saved": "Los cambios fueron guardados",
|
||||||
"html-markdown-code-supported": "HTML and Markdown code supported.",
|
"enable-more-features-at": "Habilitar más funciones en",
|
||||||
"enable-more-features-at": "Enable more features at",
|
"username-already-exists": "El usuario ya existe",
|
||||||
"username-already-exists": "Username already exists",
|
"username-field-is-empty": "El campo usuario esta vacio",
|
||||||
"username-field-is-empty": "Username field is empty",
|
"the-password-and-confirmation-password-do-not-match":"Las contraseña no coiniciden",
|
||||||
"the-password-and-confirmation-password-do-not-match":"The password and confirmation password do not match",
|
"user-has-been-added-successfully": "El usuario fue creado con exito",
|
||||||
"user-has-been-added-successfully": "User has been added successfully",
|
"you-do-not-have-sufficient-permissions": "No tiene suficientes permisos para acceder a esta pagina, contacte al administrador.",
|
||||||
"you-do-not-have-sufficient-permissions": "You do not have sufficient permissions to access this page, contact the administrator.",
|
"settings-advanced-writting-settings": "Ajustes->Avanzado->Ajustes de redaccion",
|
||||||
"settings-advanced-writting-settings": "Settings->Advanced->Writting Settings",
|
"new-posts-and-pages-synchronized": "Nuevos posts y paginas sincronizados.",
|
||||||
"new-posts-and-pages-synchronized": "New posts and pages synchronized.",
|
|
||||||
"you-can-choose-the-users-privilege": "You can choose the user's privilege. The editor role only can write pages and posts.",
|
"you-can-choose-the-users-privilege": "You can choose the user's privilege. The editor role only can write pages and posts.",
|
||||||
"email-will-not-be-publicly-displayed": "Email will not be publicly displayed. Recommended for recovery password and notifications.",
|
"email-will-not-be-publicly-displayed": "Email will not be publicly displayed. Recommended for recovery password and notifications.",
|
||||||
"use-this-field-to-name-your-site": "Use this field to name your site, it will appear at the top of every page of your site.",
|
"use-this-field-to-name-your-site": "Use this field to name your site, it will appear at the top of every page of your site.",
|
||||||
|
@ -116,26 +114,35 @@
|
||||||
"number-of-posts-to-show-per-page": "Number of posts to show per page.",
|
"number-of-posts-to-show-per-page": "Number of posts to show per page.",
|
||||||
"the-url-of-your-site": "The URL of your site.",
|
"the-url-of-your-site": "The URL of your site.",
|
||||||
"add-or-edit-description-tags-or": "Add or edit description, tags or modify the friendly URL.",
|
"add-or-edit-description-tags-or": "Add or edit description, tags or modify the friendly URL.",
|
||||||
"select-your-sites-language": "Select your site's language.",
|
"select-your-sites-language": "Seleccione el lenguage de su sitio.",
|
||||||
"select-a-timezone-for-a-correct": "Select a timezone for a correct date/time display on your site.",
|
"select-a-timezone-for-a-correct": "Select a timezone for a correct date/time display on your site.",
|
||||||
"you-can-use-this-field-to-define-a-set-of": "You can use this field to define a set of parameters related to the languege, country and special preferences.",
|
"you-can-use-this-field-to-define-a-set-of": "You can use this field to define a set of parameters related to the languege, country and special preferences.",
|
||||||
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
|
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
|
||||||
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
|
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
|
||||||
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
|
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
|
||||||
"delete": "Delete",
|
|
||||||
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
|
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
|
||||||
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
|
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
|
||||||
"read-more": "Read more",
|
"read-more": "Leer mas",
|
||||||
"show-blog": "Show blog",
|
"show-blog": "Mostrar blog",
|
||||||
"default-home-page": "Default home page",
|
"default-home-page": "Pagina de inicio predeterminada",
|
||||||
"version": "Version",
|
"version": "Version",
|
||||||
"there-are-no-drafts": "There are no drafts.",
|
"there-are-no-drafts": "No hay borradores.",
|
||||||
"create-a-new-article-for-your-blog":"Create a new article for your blog.",
|
"create-a-new-article-for-your-blog":"Create a new article for your blog.",
|
||||||
"create-a-new-page-for-your-website":"Create a new page for your website.",
|
"create-a-new-page-for-your-website":"Create a new page for your website.",
|
||||||
"invite-a-friend-to-collaborate-on-your-website":"Invite a friend to collaborate on your website.",
|
"invite-a-friend-to-collaborate-on-your-website":"Invite a friend to collaborate on your website.",
|
||||||
"change-your-language-and-region-settings":"Change your language and region settings.",
|
"change-your-language-and-region-settings":"Change your language and region settings.",
|
||||||
"language-and-timezone":"Language and timezone",
|
"language-and-timezone":"Lenguage y zona horaria",
|
||||||
"author": "Author",
|
"author": "Autor",
|
||||||
"start-here": "Start here",
|
"start-here": "Comience aqui",
|
||||||
"install-theme": "Install theme"
|
"install-theme": "Instalar tema",
|
||||||
|
"first-post": "Primer post",
|
||||||
|
"congratulations-you-have-successfully-installed-your-bludit": "Congratulations you have successfully installed your **Bludit**",
|
||||||
|
"whats-next": "Que sigue",
|
||||||
|
"manage-your-bludit-from-the-admin-panel": "Manage your Bludit from the [admin area](./admin/)",
|
||||||
|
"follow-bludit-on": "Siga Bludit en",
|
||||||
|
"visit-the-support-forum": "Visite el [foro](http://forum.bludit.com) para soporte",
|
||||||
|
"read-the-documentation-for-more-information": "Lea la [documentacion](http://docs.bludit.com) para mas informacion",
|
||||||
|
"share-with-your-friends-and-enjoy": "Comparti con tus amigos y a disfrutar",
|
||||||
|
"the-page-has-not-been-found": "La pagina no fue encontrada.",
|
||||||
|
"error": "Error"
|
||||||
}
|
}
|
|
@ -69,7 +69,6 @@
|
||||||
"website": "Site",
|
"website": "Site",
|
||||||
"timezone": "Fuseau horaire",
|
"timezone": "Fuseau horaire",
|
||||||
"locale": "Localisation",
|
"locale": "Localisation",
|
||||||
"notifications": "Notifications",
|
|
||||||
"new-post": "Nouvel article",
|
"new-post": "Nouvel article",
|
||||||
"html-and-markdown-code-supported": "Code HTML et Markdown pris en charge.",
|
"html-and-markdown-code-supported": "Code HTML et Markdown pris en charge.",
|
||||||
"new-page": "Nouvelle page",
|
"new-page": "Nouvelle page",
|
||||||
|
@ -98,7 +97,6 @@
|
||||||
"username-or-password-incorrect": "Nom d’utilisateur ou mot de passe incorrect.",
|
"username-or-password-incorrect": "Nom d’utilisateur ou mot de passe incorrect.",
|
||||||
"database-regenerated": "Base de données régénérée.",
|
"database-regenerated": "Base de données régénérée.",
|
||||||
"the-changes-have-been-saved": "Les modifications on était sauvegardées.",
|
"the-changes-have-been-saved": "Les modifications on était sauvegardées.",
|
||||||
"html-markdown-code-supported": "Code HTML et Markdown pris en charge.",
|
|
||||||
"enable-more-features-at": "Activer plus de fonctionnalités en vous rendant vers ",
|
"enable-more-features-at": "Activer plus de fonctionnalités en vous rendant vers ",
|
||||||
"username-already-exists-or-is-empty": "Le nom d’utilisateur existe déjà ou est inexistant.",
|
"username-already-exists-or-is-empty": "Le nom d’utilisateur existe déjà ou est inexistant.",
|
||||||
"username-field-is-empty": "Le champ utilisateur est vide !",
|
"username-field-is-empty": "Le champ utilisateur est vide !",
|
||||||
|
@ -122,7 +120,6 @@
|
||||||
"you-can-modify-the-url-which-identifies":"Vous pouvez modifier l'URL qui identifie une page ou un article, en utilisant des mots-clés lisibles. Pas plus de 150 caractères.",
|
"you-can-modify-the-url-which-identifies":"Vous pouvez modifier l'URL qui identifie une page ou un article, en utilisant des mots-clés lisibles. Pas plus de 150 caractères.",
|
||||||
"this-field-can-help-describe-the-content": "Ce champ peut aider à décrire le contenu en quelques mots. Pas plus de 150 caractères.",
|
"this-field-can-help-describe-the-content": "Ce champ peut aider à décrire le contenu en quelques mots. Pas plus de 150 caractères.",
|
||||||
"write-the-tags-separeted-by-comma": "Écrivez les tags en les séparant par une virgule. par exemple : tag1, tag2, tag3",
|
"write-the-tags-separeted-by-comma": "Écrivez les tags en les séparant par une virgule. par exemple : tag1, tag2, tag3",
|
||||||
"delete": "Supprimer",
|
|
||||||
"delete-the-user-and-all-its-posts":"Supprimer l’utilisateur et tous ses messages associés.",
|
"delete-the-user-and-all-its-posts":"Supprimer l’utilisateur et tous ses messages associés.",
|
||||||
"delete-the-user-and-associate-its-posts-to-admin-user": "Supprimez l’utilisateur et associez ses messages à l’administrateur principal.",
|
"delete-the-user-and-associate-its-posts-to-admin-user": "Supprimez l’utilisateur et associez ses messages à l’administrateur principal.",
|
||||||
"read-more": "Lire la suite...",
|
"read-more": "Lire la suite...",
|
||||||
|
@ -136,5 +133,17 @@
|
||||||
"change-your-language-and-region-settings":"Modifiez vos paramètres linguistiques et régionaux.",
|
"change-your-language-and-region-settings":"Modifiez vos paramètres linguistiques et régionaux.",
|
||||||
"language-and-timezone":"Langue et fuseau horaire",
|
"language-and-timezone":"Langue et fuseau horaire",
|
||||||
"author": "Auteur",
|
"author": "Auteur",
|
||||||
"start-here": "Prise en main rapide"
|
"start-here": "Prise en main rapide",
|
||||||
|
"install-theme": "Installer ce thème",
|
||||||
|
"first-post": "Premier article",
|
||||||
|
"congratulations-you-have-successfully-installed-your-bludit": "Félicitations, vous avez correctement installé **Bludit**",
|
||||||
|
"whats-next": "pour la prochaine étape",
|
||||||
|
"manage-your-bludit-from-the-admin-panel": "Gérez Bludit dans la [zone d’administration](./admin/)",
|
||||||
|
"follow-bludit-on": "Suivez Bludit sur",
|
||||||
|
"visit-the-support-forum": "Visitez le [forum](http://forum.bludit.com) de support",
|
||||||
|
"read-the-documentation-for-more-information": "Lisez la [documentation](http://docs.bludit.com) pour plus d’information",
|
||||||
|
"share-with-your-friends-and-enjoy": "Partagez avec vos amis et apprécier !",
|
||||||
|
"the-page-has-not-been-found": "La page n’a pas été trouvée.",
|
||||||
|
"error": "Erreur"
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"plugin-data":
|
||||||
|
{
|
||||||
|
"name": "Maintenance mode",
|
||||||
|
"description": "Set your site on maintenance mode, you can access to admin area.",
|
||||||
|
"author": "Bludit",
|
||||||
|
"email": "",
|
||||||
|
"website": "http://www.bludit.com",
|
||||||
|
"version": "0.1",
|
||||||
|
"releaseDate": "2015-08-02"
|
||||||
|
},
|
||||||
|
|
||||||
|
"enable-maintence-mode": "Enable maintence mode",
|
||||||
|
"message": "Message"
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class pluginMaintanceMode extends Plugin {
|
||||||
|
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->dbFields = array(
|
||||||
|
'enable'=>true,
|
||||||
|
'message'=>'Temporarily down for maintenance.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function form()
|
||||||
|
{
|
||||||
|
global $Language;
|
||||||
|
|
||||||
|
$html = '<div>';
|
||||||
|
$html .= '<input name="enable" id="jsenable" type="checkbox" value="true" '.($this->getDbField('enable')?'checked':'').'>';
|
||||||
|
$html .= '<label class="forCheckbox" for="jsenable">'.$Language->get('Enable maintence mode').'</label>';
|
||||||
|
$html .= '</div>';
|
||||||
|
|
||||||
|
$html .= '<div>';
|
||||||
|
$html .= '<label>'.$Language->get('Message').'</label>';
|
||||||
|
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getDbField('message').'">';
|
||||||
|
$html .= '</div>';
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function beforeSiteLoad()
|
||||||
|
{
|
||||||
|
if($this->getDbField('enable')) {
|
||||||
|
exit( $this->getDbField('message') );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class pluginOpenGraph extends Plugin {
|
class pluginOpenGraph extends Plugin {
|
||||||
|
|
||||||
public function onSiteHead()
|
public function siteHead()
|
||||||
{
|
{
|
||||||
global $Url, $Site;
|
global $Url, $Site;
|
||||||
global $Post, $Page;
|
global $Post, $Page;
|
||||||
|
|
|
@ -27,7 +27,7 @@ class pluginPages extends Plugin {
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onSiteSidebar()
|
public function siteSidebar()
|
||||||
{
|
{
|
||||||
global $Language;
|
global $Language;
|
||||||
global $pagesParents;
|
global $pagesParents;
|
||||||
|
@ -46,6 +46,8 @@ class pluginPages extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($parents as $parent)
|
foreach($parents as $parent)
|
||||||
|
{
|
||||||
|
if($Site->homepage()!==$parent->key())
|
||||||
{
|
{
|
||||||
// Print the parent
|
// Print the parent
|
||||||
$html .= '<li><a class="parent" href="'.$parent->permalink().'">'.$parent->title().'</a></li>';
|
$html .= '<li><a class="parent" href="'.$parent->permalink().'">'.$parent->title().'</a></li>';
|
||||||
|
@ -64,6 +66,7 @@ class pluginPages extends Plugin {
|
||||||
$html .= '</ul></li>';
|
$html .= '</ul></li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$html .= '</ul>';
|
$html .= '</ul>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
|
@ -34,7 +34,7 @@ class pluginTinymce extends Plugin {
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onAdminHead()
|
public function adminHead()
|
||||||
{
|
{
|
||||||
global $Language;
|
global $Language;
|
||||||
global $Site;
|
global $Site;
|
||||||
|
@ -55,7 +55,7 @@ class pluginTinymce extends Plugin {
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onAdminBodyEnd()
|
public function adminBodyEnd()
|
||||||
{
|
{
|
||||||
global $Language;
|
global $Language;
|
||||||
global $Site;
|
global $Site;
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins Site Body Begin -->
|
||||||
<?php Theme::plugins('onSiteBodyBegin') ?>
|
<?php Theme::plugins('siteBodyBegin') ?>
|
||||||
|
|
||||||
<!-- Layout -->
|
<!-- Layout -->
|
||||||
<div id="layout" class="pure-g">
|
<div id="layout" class="pure-g">
|
||||||
|
@ -47,8 +47,8 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins Site Body End -->
|
||||||
<?php Theme::plugins('onSiteBodyEnd') ?>
|
<?php Theme::plugins('siteBodyEnd') ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -47,7 +47,5 @@ html, button, input, select, textarea,
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins Site Head -->
|
||||||
<?php
|
<?php Theme::plugins('siteHead') ?>
|
||||||
Theme::plugins('onSiteHead');
|
|
||||||
?>
|
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
<section class="post">
|
<section class="post">
|
||||||
|
|
||||||
|
<!-- Plugins Post Begin -->
|
||||||
|
<?php Theme::plugins('postBegin') ?>
|
||||||
|
|
||||||
<!-- Post header -->
|
<!-- Post header -->
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
|
|
||||||
|
@ -34,7 +37,7 @@
|
||||||
<!-- Post content -->
|
<!-- Post content -->
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<?php
|
<?php
|
||||||
// FALSE to get the first part of the post
|
// Call the method with FALSE to get the first part of the post
|
||||||
echo $Post->content(false)
|
echo $Post->content(false)
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,10 +46,14 @@
|
||||||
<a class="read-more" href="<?php echo $Post->permalink() ?>"><?php $Language->printMe('Read more') ?></a>
|
<a class="read-more" href="<?php echo $Post->permalink() ?>"><?php $Language->printMe('Read more') ?></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<!-- Plugins Post End -->
|
||||||
|
<?php Theme::plugins('postEnd') ?>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<!-- Paginator for posts -->
|
||||||
<?php
|
<?php
|
||||||
echo Paginator::html();
|
echo Paginator::html();
|
||||||
?>
|
?>
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
<section class="page">
|
<section class="page">
|
||||||
|
|
||||||
|
<!-- Plugins Page Begin -->
|
||||||
|
<?php Theme::plugins('pageBegin') ?>
|
||||||
|
|
||||||
<!-- page header -->
|
<!-- page header -->
|
||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
|
|
||||||
|
@ -17,4 +20,7 @@
|
||||||
<?php echo $Page->content() ?>
|
<?php echo $Page->content() ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Plugins Page Begin -->
|
||||||
|
<?php Theme::plugins('pageEnd') ?>
|
||||||
|
|
||||||
</section>
|
</section>
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
<section class="post">
|
<section class="post">
|
||||||
|
|
||||||
|
<!-- Plugins Post Begin -->
|
||||||
|
<?php Theme::plugins('postBegin') ?>
|
||||||
|
|
||||||
<!-- Post header -->
|
<!-- Post header -->
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
|
|
||||||
|
@ -34,4 +37,7 @@
|
||||||
<?php echo $Post->content() ?>
|
<?php echo $Post->content() ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Plugins Post End -->
|
||||||
|
<?php Theme::plugins('postEnd') ?>
|
||||||
|
|
||||||
</section>
|
</section>
|
|
@ -1,7 +1,5 @@
|
||||||
<h1 class="title"><?php echo $Site->title() ?></h1>
|
<h1 class="title"><?php echo $Site->title() ?></h1>
|
||||||
<h2 class="slogan"><?php echo $Site->slogan() ?></h2>
|
<h2 class="slogan"><?php echo $Site->slogan() ?></h2>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins Sidebar -->
|
||||||
<?php
|
<?php Theme::plugins('siteSidebar') ?>
|
||||||
Theme::plugins('onSiteSidebar');
|
|
||||||
?>
|
|
Binary file not shown.
Before Width: | Height: | Size: 27 KiB |
Loading…
Reference in New Issue