fix when edit a category, log function improves, fix in login css

This commit is contained in:
Diego Najar 2018-07-10 19:53:53 +02:00
parent e57420e7a5
commit 767c421858
6 changed files with 19 additions and 15 deletions

View File

@ -58,7 +58,7 @@ class dbJSON
// Returns the value from the field.
public function getField($field)
{
if(isset($this->db[$field])) {
if (isset($this->db[$field])) {
return $this->db[$field];
}

View File

@ -94,8 +94,8 @@ class dbList extends dbJSON
// $args => 'name', 'oldkey', 'newKey', 'template'
public function edit($args)
{
if (isset($this->db[$args['newKey']])) {
Log::set(__METHOD__.LOG_SEP.'The new key already exists. Key: '.$args['newKey']);
if ( isset($this->db[$args['newKey']]) && ($args['newKey']!==$args['oldKey']) ) {
Log::set(__METHOD__.LOG_SEP.'The new key already exists. Key: '.$args['newKey'], LOG_TYPE_WARN);
return false;
}

View File

@ -12,10 +12,9 @@
<!-- CSS -->
<?php
echo Theme::bootstrapCSS();
echo Bootstrap::css(array(
echo Theme::css(array(
'bludit.css'
));
), DOMAIN_ADMIN_THEME_CSS);
?>
<!-- Javascript -->

View File

@ -5,8 +5,11 @@
If you are going to change some variable from here is recommended do it before the installation
*/
// Log separator
// Log
define('LOG_SEP', ' | ');
define('LOG_TYPE_INFO', '[INFO]');
define('LOG_TYPE_WARN', '[WARN]');
define('LOG_TYPE_ERROR', '[ERROR]');
// Protecting against Symlink attacks
define('CHECK_SYMBOLIC_LINKS', TRUE);

View File

@ -2,18 +2,20 @@
class Log {
public static function set($text, $type=0)
public static function set($text, $type=LOG_TYPE_INFO)
{
$messageType = 0;
if (is_array($text) ) {
error_log('------------------------', $type);
error_log('Array', $type);
error_log('------------------------', $type);
error_log('------------------------', $messageType);
error_log('Array', $messageType);
error_log('------------------------', $messageType);
foreach ($text as $key=>$value) {
error_log($key.'=>'.$value, $type);
error_log($key.'=>'.$value, $messageType);
}
error_log('------------------------', $type);
error_log('------------------------', $messageType);
}
error_log('('.BLUDIT_VERSION.') ('.$_SERVER['REQUEST_URI'].') '.$text, $type);
error_log($type.' ['.BLUDIT_VERSION.'] ['.$_SERVER['REQUEST_URI'].'] '.$text, $messageType);
}
}

View File

@ -147,9 +147,9 @@ class Text {
}
$string = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $string);
$string = trim($string, '-');
$string = self::lowercase($string);
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
$string = trim($string, '-');
return $string;
}