diff --git a/bl-kernel/boot/admin.php b/bl-kernel/boot/admin.php index f1b8f9e2..54f41f57 100644 --- a/bl-kernel/boot/admin.php +++ b/bl-kernel/boot/admin.php @@ -70,6 +70,10 @@ else $Security->generateTokenCSRF(); } + // Define variables + $ADMIN_CONTROLLER = $layout['controller']; + $ADMIN_VIEW = $layout['view']; + // Load plugins before the admin area will be load. Theme::plugins('beforeAdminLoad'); diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index 5123d763..01629432 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -54,6 +54,7 @@ define('DB_PAGES', PATH_DATABASES.'pages.php'); define('DB_SITE', PATH_DATABASES.'site.php'); define('DB_CATEGORIES', PATH_DATABASES.'categories.php'); define('DB_TAGS', PATH_DATABASES.'tags.php'); +define('DB_NOTIFICATIONS', PATH_DATABASES.'notifications.php'); // ADMIN URI FILTER define('ADMIN_URI_FILTER', '/admin/'); @@ -274,6 +275,9 @@ $L = $Language; // --- CONSTANTS with dependency --- define('ORDER_BY', $Site->orderBy()); +$ADMIN_CONTROLLER = ''; // modified on bl-kernel/ +$ADMIN_VIEW = ''; + // DEBUG: Print constants // $arr = array_filter(get_defined_constants(), 'is_string'); // echo json_encode($arr); diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php index e54d7699..689ebd1b 100644 --- a/bl-kernel/boot/rules/60.plugins.php +++ b/bl-kernel/boot/rules/60.plugins.php @@ -14,22 +14,17 @@ $plugins = array( 'pageBegin'=>array(), 'pageEnd'=>array(), - 'postBegin'=>array(), - 'postEnd'=>array(), + 'beforeAdminLoad'=>array(), + 'afterAdminLoad'=>array(), 'adminHead'=>array(), 'adminBodyBegin'=>array(), 'adminBodyEnd'=>array(), 'adminSidebar'=>array(), - 'beforeAdminLoad'=>array(), - 'afterAdminLoad'=>array(), 'beforeRulesLoad'=>array(), 'afterFormSave'=>array(), - 'afterPostCreate'=>array(), - 'afterPostModify'=>array(), - 'afterPostDelete'=>array(), 'afterPageCreate'=>array(), 'afterPageModify'=>array(), 'afterPageDelete'=>array(), diff --git a/bl-kernel/dbnotifications.php b/bl-kernel/dbnotifications.php new file mode 100644 index 00000000..4f75c086 --- /dev/null +++ b/bl-kernel/dbnotifications.php @@ -0,0 +1,211 @@ + array('inFile'=>false, 'value'=>''), + 'date'=> array('inFile'=>false, 'value'=>''), + 'username'=> array('inFile'=>false, 'value'=>'') + ); + + function __construct() + { + parent::__construct(DB_NOTIFICATIONS); + } + + public function getUser($username) + { + $User = new User(); + + if($this->userExists($username)) + { + $User->setField('username', $username); + + foreach($this->db[$username] as $key=>$value) { + $User->setField($key, $value); + } + + return $User; + } + + return false; + } + + public function getAll() + { + return $this->db; + } + + // Return an array with the username databases, filtered by username. + public function getDb($username) + { + if($this->userExists($username)) + { + $user = $this->db[$username]; + + return $user; + } + + return false; + } + + // Return the username associated to an email, if the email does not exists return FALSE. + public function getByEmail($email) + { + foreach($this->db as $username=>$values) { + if($values['email']==$email) { + return $username; + } + } + + return false; + } + + // Return TRUE if the user exists, FALSE otherwise. + public function userExists($username) + { + return isset($this->db[$username]); + } + + public function generateTokenEmail($username) + { + // Random hash + $token = sha1(Text::randomText(SALT_LENGTH).time()); + $this->db[$username]['tokenEmail'] = $token; + + // Token time to live, defined by TOKEN_EMAIL_TTL + $this->db[$username]['tokenEmailTTL'] = Date::currentOffset(DB_DATE_FORMAT, TOKEN_EMAIL_TTL); + + // Save the database + if( $this->save() === false ) { + Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); + return false; + } + + return $token; + } + + public function setPassword($username, $password) + { + $salt = Text::randomText(SALT_LENGTH); + $hash = sha1($password.$salt); + + $args['username'] = $username; + $args['salt'] = $salt; + $args['password'] = $hash; + + return $this->set($args); + } + + // Disable the user + public function disableUser($username) + { + $args['username'] = $username; + $args['password'] = '!'; + + return $this->set($args); + } + + public function set($args) + { + $dataForDb = array(); + + $user = $this->getDb($args['username']); + + if($user===false) + { + Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the username '.$args['username']); + return false; + } + + // Verify arguments with the database fields. + foreach($args as $field=>$value) + { + if( isset($this->dbFields[$field]) ) + { + // Sanitize. + $tmpValue = Sanitize::html($value); + + // Set type. + settype($tmpValue, gettype($this->dbFields[$field]['value'])); + + $user[$field] = $tmpValue; + } + } + + // Save the database + $this->db[$args['username']] = $user; + if( $this->save() === false ) { + Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); + return false; + } + + return true; + } + + public function delete($username) + { + unset($this->db[$username]); + + if( $this->save() === false ) { + Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); + return false; + } + + return true; + } + + public function add($args) + { + $dataForDb = array(); + + // Verify arguments with the database fields. + foreach($this->dbFields as $field=>$options) + { + // If the user send the field. + if( isset($args[$field]) ) + { + // Sanitize if will be saved on database. + if( !$options['inFile'] ) { + $tmpValue = Sanitize::html($args[$field]); + } + else { + $tmpValue = $args[$field]; + } + } + // Uses a default value for the field. + else + { + $tmpValue = $options['value']; + } + + // Set type + settype($tmpValue, gettype($options['value'])); + + // Save on database + $dataForDb[$field] = $tmpValue; + } + + // Check if the user alredy exists. + if( $this->userExists($dataForDb['username']) ) { + return false; + } + + // Current date. + $dataForDb['registered'] = Date::current(DB_DATE_FORMAT); + + // Password + $dataForDb['salt'] = Text::randomText(SALT_LENGTH); + $dataForDb['password'] = sha1($dataForDb['password'].$dataForDb['salt']); + + // Save the database + $this->db[$dataForDb['username']] = $dataForDb; + if( $this->save() === false ) { + Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.'); + return false; + } + + return true; + } + +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/bg_BG.json b/bl-plugins/timemachine/languages/bg_BG.json new file mode 100644 index 00000000..c12b1a39 --- /dev/null +++ b/bl-plugins/timemachine/languages/bg_BG.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "За мен", + "description": "Кратко описание за вашия сайт или за себе си." + } +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/de_CH.json b/bl-plugins/timemachine/languages/de_CH.json new file mode 100644 index 00000000..45a153ce --- /dev/null +++ b/bl-plugins/timemachine/languages/de_CH.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Über", + "description": "Kurzer Text über die Website oder zu dir." + } +} diff --git a/bl-plugins/timemachine/languages/de_DE.json b/bl-plugins/timemachine/languages/de_DE.json new file mode 100644 index 00000000..a226255d --- /dev/null +++ b/bl-plugins/timemachine/languages/de_DE.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Über", + "description": "Kurzer Text über die Website oder zu dir." + } +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/en_US.json b/bl-plugins/timemachine/languages/en_US.json new file mode 100644 index 00000000..1bcab5c5 --- /dev/null +++ b/bl-plugins/timemachine/languages/en_US.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "About", + "description": "Little description about your site or yourself." + } +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/es_AR.json b/bl-plugins/timemachine/languages/es_AR.json new file mode 100644 index 00000000..22b6a7dd --- /dev/null +++ b/bl-plugins/timemachine/languages/es_AR.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Acerca de", + "description": "Breve descripción de ti mismo o sobre tu sitio." + } +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/ja_JP.json b/bl-plugins/timemachine/languages/ja_JP.json new file mode 100644 index 00000000..353242d5 --- /dev/null +++ b/bl-plugins/timemachine/languages/ja_JP.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "About", + "description": "サイトやあなた自身についての概要を表示します。" + } +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/nl_NL.json b/bl-plugins/timemachine/languages/nl_NL.json new file mode 100644 index 00000000..ac7332d4 --- /dev/null +++ b/bl-plugins/timemachine/languages/nl_NL.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Over mij", + "description": "Een korte beschrijving over je site of jezelf." + } +} diff --git a/bl-plugins/timemachine/languages/ru_RU.json b/bl-plugins/timemachine/languages/ru_RU.json new file mode 100644 index 00000000..9854c7f3 --- /dev/null +++ b/bl-plugins/timemachine/languages/ru_RU.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "О блоге", + "description": "Небольшое описание о вашем сайте или о себя." + } +} \ No newline at end of file diff --git a/bl-plugins/timemachine/languages/tr_TR.json b/bl-plugins/timemachine/languages/tr_TR.json new file mode 100644 index 00000000..9a256d61 --- /dev/null +++ b/bl-plugins/timemachine/languages/tr_TR.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Hakkında", + "description": "Senin veya siten hakkında kısa bilgiler" + } +} diff --git a/bl-plugins/timemachine/languages/uk_UA.json b/bl-plugins/timemachine/languages/uk_UA.json new file mode 100644 index 00000000..39cbf511 --- /dev/null +++ b/bl-plugins/timemachine/languages/uk_UA.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Про блог", + "description": "Невеликий опис вашого сайту або про Вас." + } +} \ No newline at end of file diff --git a/bl-plugins/timemachine/metadata.json b/bl-plugins/timemachine/metadata.json new file mode 100644 index 00000000..8801aa07 --- /dev/null +++ b/bl-plugins/timemachine/metadata.json @@ -0,0 +1,10 @@ +{ + "author": "Bludit", + "email": "", + "website": "https://plugins.bludit.com", + "version": "1.5.2", + "releaseDate": "2016-05-28", + "license": "MIT", + "compatible": "1.5.2", + "notes": "" +} diff --git a/bl-plugins/timemachine/plugin.php b/bl-plugins/timemachine/plugin.php new file mode 100644 index 00000000..ffd27b9b --- /dev/null +++ b/bl-plugins/timemachine/plugin.php @@ -0,0 +1,21 @@ +g('New page created'); + } + } + } +} diff --git a/install.php b/install.php index ba5453cc..7ed98d35 100644 --- a/install.php +++ b/install.php @@ -41,7 +41,6 @@ define('PATH_CONTENT', PATH_ROOT.'bl-content'.DS); define('PATH_KERNEL', PATH_ROOT.'bl-kernel'.DS); define('PATH_LANGUAGES', PATH_ROOT.'bl-languages'.DS); -define('PATH_POSTS', PATH_CONTENT.'posts'.DS); define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS); define('PATH_TMP', PATH_CONTENT.'tmp'.DS); define('PATH_PAGES', PATH_CONTENT.'pages'.DS); @@ -172,9 +171,7 @@ function getLanguageList() $files = glob(PATH_LANGUAGES.'*.json'); $tmp = array(); - - foreach($files as $file) - { + foreach($files as $file) { $t = new dbJSON($file, false); $native = $t->db['language-data']['native']; $locale = basename($file, '.json'); @@ -184,13 +181,13 @@ function getLanguageList() return $tmp; } -// Generate a random string. +// Generate a random string // Thanks, http://stackoverflow.com/questions/4356289/php-random-string-generator function getRandomString($length = 10) { return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length); } -// Check if Bludit is installed. +// Check if Bludit is installed function alreadyInstalled() { return file_exists(PATH_DATABASES.'site.php'); } @@ -203,8 +200,7 @@ function checkSystem() $dirpermissions = 0755; // Check .htaccess file for different webservers - if( !file_exists(PATH_ROOT.'.htaccess') ) - { + if( !file_exists(PATH_ROOT.'.htaccess') ) { if ( !isset($_SERVER['SERVER_SOFTWARE']) || stripos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || @@ -223,8 +219,7 @@ function checkSystem() @mkdir(PATH_CONTENT, $dirpermissions, true); // Check if the directory content is writeable. - if(!is_writable(PATH_CONTENT)) - { + if(!is_writable(PATH_CONTENT)) { $errorText = 'Writing test failure, check directory content permissions. (ERR_205)'; error_log($errorText, 0); @@ -236,7 +231,7 @@ function checkSystem() return $stdOut; } -// Finish with the installation. +// Installation function function install($adminPassword, $email, $timezone) { global $Language; @@ -255,65 +250,54 @@ function install($adminPassword, $email, $timezone) // 7=read,write,execute | 5=read,execute $dirpermissions = 0755; - $firstPostSlug = 'first-post'; - if(!mkdir(PATH_POSTS.$firstPostSlug, $dirpermissions, true)) - { - $errorText = 'Error when trying to created the directory=>'.PATH_POSTS.$firstPostSlug; + if(!mkdir(PATH_PAGES.'welcome', $dirpermissions, true)) { + $errorText = 'Error when trying to created the directory=>'.PATH_PAGES.'welcome'; error_log($errorText, 0); } - if(!mkdir(PATH_PAGES.'error', $dirpermissions, true)) - { - $errorText = 'Error when trying to created the directory=>'.PATH_PAGES.'error'; - error_log($errorText, 0); - } - - if(!mkdir(PATH_PAGES.'about', $dirpermissions, true)) - { + if(!mkdir(PATH_PAGES.'about', $dirpermissions, true)) { $errorText = 'Error when trying to created the directory=>'.PATH_PAGES.'about'; error_log($errorText, 0); } - if(!mkdir(PATH_PLUGINS_DATABASES.'pages', $dirpermissions, true)) - { + if(!mkdir(PATH_PAGES.'error', $dirpermissions, true)) { + $errorText = 'Error when trying to created the directory=>'.PATH_PAGES.'error'; + error_log($errorText, 0); + } + + if(!mkdir(PATH_PLUGINS_DATABASES.'pages', $dirpermissions, true)) { $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'pages'; error_log($errorText, 0); } - if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true)) - { + if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true)) { $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'simplemde'; error_log($errorText, 0); } - if(!mkdir(PATH_PLUGINS_DATABASES.'tags', $dirpermissions, true)) - { + if(!mkdir(PATH_PLUGINS_DATABASES.'tags', $dirpermissions, true)) { $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'tags'; error_log($errorText, 0); } - if(!mkdir(PATH_PLUGINS_DATABASES.'about', $dirpermissions, true)) - { + if(!mkdir(PATH_PLUGINS_DATABASES.'about', $dirpermissions, true)) { $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'about'; error_log($errorText, 0); } - if(!mkdir(PATH_UPLOADS_PROFILES, $dirpermissions, true)) - { + if(!mkdir(PATH_UPLOADS_PROFILES, $dirpermissions, true)) { $errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_PROFILES; error_log($errorText, 0); } - if(!mkdir(PATH_TMP, $dirpermissions, true)) - { - $errorText = 'Error when trying to created the directory=>'.PATH_TMP; + if(!mkdir(PATH_UPLOADS_THUMBNAILS, $dirpermissions, true)) { + $errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_THUMBNAILS; error_log($errorText, 0); } - if(!mkdir(PATH_UPLOADS_THUMBNAILS, $dirpermissions, true)) - { - $errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_THUMBNAILS; + if(!mkdir(PATH_TMP, $dirpermissions, true)) { + $errorText = 'Error when trying to created the directory=>'.PATH_TMP; error_log($errorText, 0); } @@ -326,50 +310,51 @@ function install($adminPassword, $email, $timezone) // File pages.php $data = array( 'error'=>array( - 'description'=>'Error page', - 'username'=>'admin', - 'tags'=>array(), - 'status'=>'published', - 'date'=>$currentDate, - 'position'=>0, - 'coverImage'=>'', - 'md5file'=>'', - 'category'=>'', - 'uuid'=>md5(uniqid()) + 'description'=>$Language->get('Page not found'), + 'username'=>'admin', + 'tags'=>array(), + 'status'=>'published', + 'date'=>$currentDate, + 'dateModified'=>'', + 'allowComments'=>false, + 'position'=>0, + 'coverImage'=>'', + 'md5file'=>'', + 'category'=>'', + 'uuid'=>md5(uniqid()) ), 'about'=>array( - 'description'=>$Language->get('About your site or yourself'), - 'username'=>'admin', - 'tags'=>array(), - 'status'=>'published', - 'date'=>$currentDate, - 'position'=>1, - 'coverImage'=>'', - 'md5file'=>'', - 'category'=>'', - 'uuid'=>md5(uniqid()) + 'description'=>$Language->get('About your site or yourself'), + 'username'=>'admin', + 'tags'=>array(), + 'status'=>'published', + 'date'=>$currentDate, + 'dateModified'=>'', + 'allowComments'=>false, + 'position'=>2, + 'coverImage'=>'', + 'md5file'=>'', + 'category'=>'', + 'uuid'=>md5(uniqid()) + ), + 'welcome'=>array( + 'description'=>$Language->get('Welcome to Bludit'), + 'username'=>'admin', + 'tags'=>array('bludit'=>'Bludit','cms'=>'CMS','flat-files'=>'Flat files'), + 'status'=>'published', + 'date'=>$currentDate, + 'dateModified'=>'', + 'allowComments'=>false, + 'position'=>1, + 'coverImage'=>'', + 'md5file'=>'', + 'category'=>'', + 'uuid'=>md5(uniqid()) ) ); file_put_contents(PATH_DATABASES.'pages.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); - // File posts.php - $data = array( - $firstPostSlug=>array( - 'description'=>$Language->get('Welcome to Bludit'), - 'username'=>'admin', - 'status'=>'published', - 'tags'=>array('bludit'=>'Bludit','cms'=>'CMS','flat-files'=>'Flat files'), - 'allowComments'=>'false', - 'date'=>$currentDate, - 'coverImage'=>'', - 'md5file'=>'', - 'category'=>'', - 'uuid'=>md5(uniqid()) - ) - ); - file_put_contents(PATH_DATABASES.'posts.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); - // File site.php $data = array( 'title'=>'BLUDIT', @@ -383,10 +368,8 @@ function install($adminPassword, $email, $timezone) 'adminTheme'=>'default', 'homepage'=>'', 'postsperpage'=>'6', - 'uriPost'=>'/post/', 'uriPage'=>'/', 'uriTag'=>'/tag/', - 'uriBlog'=>'/blog/', 'uriCategory'=>'/category/', 'url'=>PROTOCOL.DOMAIN.HTML_PATH_ROOT, 'emailFrom'=>'no-reply@'.DOMAIN @@ -433,28 +416,18 @@ function install($adminPassword, $email, $timezone) // File categories.php $data = array( - 'videos'=>array('name'=>'Videos', 'posts'=>array(), 'pages'=>array()) + 'videos'=>array('name'=>'Videos', 'list'=>array()), + 'music'=>array('name'=>'Music', 'list'=>array()) ); file_put_contents(PATH_DATABASES.'categories.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); // File tags.php - file_put_contents( - PATH_DATABASES.'tags.php', - $dataHead.json_encode( - array( - 'postsIndex'=>array( - 'bludit'=>array('name'=>'Bludit', 'posts'=>array('first-post')), - 'cms'=>array('name'=>'CMS', 'posts'=>array('first-post')), - 'flat-files'=>array('name'=>'Flat files', 'posts'=>array('first-post')) - ), - 'pagesIndex'=>array() - ), - JSON_PRETTY_PRINT), - LOCK_EX + $data = array( + 'bludit'=>array('name'=>'Bludit', 'list'=>array('welcome')), + 'cms'=>array('name'=>'CMS', 'list'=>array('welcome')), + 'flat-files'=>array('name'=>'Flat files', 'list'=>array('welcome')) ); - - - // PLUGINS + file_put_contents(PATH_DATABASES.'tags.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); // File plugins/pages/db.php file_put_contents( @@ -507,22 +480,15 @@ function install($adminPassword, $email, $timezone) LOCK_EX ); - // File FILENAME for error page - $data = 'Title: '.$Language->get('Error').' -Content: '.$Language->get('The page has not been found'); - + // File for error page + $data = 'Title: '.$Language->get('Error').PHP_EOL.'Content: '.$Language->get('The page has not been found'); file_put_contents(PATH_PAGES.'error'.DS.FILENAME, $data, LOCK_EX); - // File FILENAME for about page - $data = 'Title: '.$Language->get('About').' -Content: -'.$Language->get('the-about-page-is-very-important').' - -'.$Language->get('change-this-pages-content-on-the-admin-panel'); - + // File for about page + $data = 'Title: '.$Language->get('About').PHP_EOL.'Content: '.$Language->get('the-about-page-is-very-important').' '.$Language->get('change-this-pages-content-on-the-admin-panel'); file_put_contents(PATH_PAGES.'about'.DS.FILENAME, $data, LOCK_EX); - // File FILENAME for welcome post + // File for welcome page $text1 = Text::replaceAssoc( array( '{{ADMIN_AREA_LINK}}'=>PROTOCOL.DOMAIN.HTML_PATH_ROOT.'admin' @@ -530,7 +496,7 @@ Content: $Language->get('Manage your Bludit from the admin panel') ); - $data = 'Title: '.$Language->get('First post').' + $data = 'Title: '.$Language->get('Welcome').' Content: ## '.$Language->get('Whats next').' @@ -541,7 +507,7 @@ Content: - '.$Language->get('Read the documentation for more information').' - '.$Language->get('Share with your friends and enjoy'); - file_put_contents(PATH_POSTS.$firstPostSlug.DS.FILENAME, $data, LOCK_EX); + file_put_contents(PATH_POSTS.$welcomePageKey.DS.FILENAME, $data, LOCK_EX); return true; } @@ -552,17 +518,10 @@ function checkPOST($args) global $Language; // Check empty password - if( strlen($args['password']) < 6 ) - { + if( strlen($args['password']) < 6 ) { return '
'.$Language->g('Password must be at least 6 characters long').'
'; } - // Check invalid email - if( !Valid::email($args['email']) && ($args['noCheckEmail']=='0') ) - { - return '
'.$Language->g('Your email address is invalid').'
'.$Language->g('Proceed anyway').'
'; - } - // Sanitize email $email = sanitize::email($args['email']); @@ -588,7 +547,7 @@ function redirect($url) { $error = ''; if( alreadyInstalled() ) { - exit('Bludit already installed'); + exit('Bludit is already installed'); } if( isset($_GET['demo']) ) { @@ -598,7 +557,6 @@ if( isset($_GET['demo']) ) { if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $error = checkPOST($_POST); - if($error===true) { redirect(HTML_PATH_ROOT); } @@ -625,7 +583,6 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { -
@@ -637,10 +594,8 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $system = checkSystem(); // Missing requirements - if(!empty($system)) - { - foreach($system as $values) - { + if(!empty($system)) { + foreach($system as $values) { echo '
'; echo '
FAIL
'; echo '

'.$values['title'].'

'; @@ -661,7 +616,6 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { ?>
-
@@ -718,19 +672,10 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {