'.$value.' |
get('Bludit Installer') ?>
-get('Welcome to the Bludit installer') ?>
+get('Complete the form choose a password for the username admin') ?>
-get('Choose your language') ?>
-diff --git a/admin/controllers/login-email.php b/admin/controllers/login-email.php index 32b0f79e..28ccbb1d 100644 --- a/admin/controllers/login-email.php +++ b/admin/controllers/login-email.php @@ -25,14 +25,15 @@ function checkPost($args) if(Valid::email($email)) { - $user = $dbUsers->getByEmail($email); - if($user!=false) + // Get username associated to an email. + $username = $dbUsers->getByEmail($email); + if($username!=false) { // Generate the token and the token expiration date. - $token = $dbUsers->generateTokenEmail($user['username']); + $token = $dbUsers->generateTokenEmail($username); // ---- EMAIL ---- - $link = $Site->url().'admin/login-email?tokenEmail='.$token.'&username='.$user['username']; + $link = $Site->url().'admin/login-email?tokenEmail='.$token.'&username='.$username; $subject = $Language->g('BLUDIT Login access code'); $message = Text::replaceAssoc( array( diff --git a/admin/themes/default/css/form-password.almost-flat.min.css b/admin/themes/default/css/form-password.almost-flat.min.css new file mode 100755 index 00000000..efdc7aa8 --- /dev/null +++ b/admin/themes/default/css/form-password.almost-flat.min.css @@ -0,0 +1,2 @@ +/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ +.uk-form-password{display:inline-block;position:relative;max-width:100%}.uk-form-password-toggle{display:block;position:absolute;top:50%;right:10px;margin-top:-6px;font-size:13px;line-height:13px;color:#999}.uk-form-password-toggle:hover{color:#999;text-decoration:none}.uk-form-password>input{padding-right:50px!important} \ No newline at end of file diff --git a/admin/themes/default/css/installer.css b/admin/themes/default/css/installer.css new file mode 100644 index 00000000..fe465151 --- /dev/null +++ b/admin/themes/default/css/installer.css @@ -0,0 +1,57 @@ +/* ----------- UIKIT HACKs FOR BLUDIT ----------- */ +html { + background: #f1f1f1; +} + +.uk-button-primary { + background: #444; +} + +.uk-button-primary:hover { + background: #333; +} + +input[type="text"], +input[type="password"] { + border-color: #FFF !important; + background: #FFF; +} + +input:disabled { + background: #ccc; +} + +.uk-vertical-align-middle { + margin-top: -100px; +} + +.uk-panel { + background: #ffffff; + display: block; + margin: 20px 0; + padding: 20px; + position: relative; + text-align: left; +} + +/* ----------- BLUDIT ----------- */ + +h1.title { + font-weight: lighter; + letter-spacing: 4px; + text-transform: uppercase; +} + +h3 { + margin-top: 0px !important; +} + +.content { + text-align: left; +} + +#jsshowPassword { + color: #999; + cursor: pointer; + font-size: 1.3em; +} \ No newline at end of file diff --git a/admin/themes/default/index.php b/admin/themes/default/index.php index 2c1bb726..f800b244 100644 --- a/admin/themes/default/index.php +++ b/admin/themes/default/index.php @@ -19,7 +19,6 @@ - diff --git a/admin/themes/default/js/form-password.min.js b/admin/themes/default/js/form-password.min.js new file mode 100755 index 00000000..f5495f78 --- /dev/null +++ b/admin/themes/default/js/form-password.min.js @@ -0,0 +1,2 @@ +/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ +!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";return t.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},boot:function(){t.$html.on("click.formpassword.uikit","[data-uk-form-password]",function(i){var e=t.$(this);e.data("formPassword")||(i.preventDefault(),t.formPassword(e,t.Utils.options(e.attr("data-uk-form-password"))),e.trigger("click"))})},init:function(){var t=this;this.on("click",function(i){if(i.preventDefault(),t.input.length){var e=t.input.attr("type");t.input.attr("type","text"==e?"password":"text"),t.element.html(t.options["text"==e?"lblShow":"lblHide"])}}),this.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),this.element.html(this.options[this.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this)}}),t.formPassword}); \ No newline at end of file diff --git a/admin/themes/default/login.php b/admin/themes/default/login.php index 43f58412..628d088e 100644 --- a/admin/themes/default/login.php +++ b/admin/themes/default/login.php @@ -12,7 +12,7 @@ - + diff --git a/install.php b/install.php index 844cf5a4..b552088f 100644 --- a/install.php +++ b/install.php @@ -79,6 +79,15 @@ if(isset($_GET['language'])) { $Language = new dbLanguage($localeFromHTTP); +// Timezone +$iniDate = ini_get('date.timezone'); +if(empty($iniDate)) { + date_default_timezone_set('UTC'); +} + +// Locales +setlocale(LC_ALL, $localeFromHTTP); + // ============================================================================ // FUNCTIONS // ============================================================================ @@ -127,7 +136,10 @@ function checkSystem() { $errorText = 'Current PHP version '.phpversion().', you need > 5.3. (ERR_202)'; error_log($errorText, 0); - array_push($stdOut, $errorText); + + $tmp['title'] = 'PHP version'; + $tmp['errorText'] = $errorText; + array_push($stdOut, $tmp); return $stdOut; } @@ -136,34 +148,46 @@ function checkSystem() { $errorText = 'Missing file, upload the file .htaccess (ERR_201)'; error_log($errorText, 0); - array_push($stdOut, $errorText); + + $tmp['title'] = 'File .htaccess'; + $tmp['errorText'] = $errorText; + array_push($stdOut, $tmp); } if(!in_array('dom', $phpModules)) { $errorText = 'PHP module DOM is not installed. (ERR_203)'; error_log($errorText, 0); - array_push($stdOut, $errorText); + + $tmp['title'] = 'PHP module'; + $tmp['errorText'] = $errorText; + array_push($stdOut, $tmp); } if(!in_array('json', $phpModules)) { $errorText = 'PHP module JSON is not installed. (ERR_204)'; error_log($errorText, 0); - array_push($stdOut, $errorText); + + $tmp['title'] = 'PHP module'; + $tmp['errorText'] = $errorText; + array_push($stdOut, $tmp); } if(!is_writable(PATH_CONTENT)) { $errorText = 'Writing test failure, check directory content permissions. (ERR_205)'; error_log($errorText, 0); - array_push($stdOut, $errorText); + + $tmp['title'] = 'PHP permissions'; + $tmp['errorText'] = $errorText; + array_push($stdOut, $tmp); } return $stdOut; } -function install($adminPassword, $email) +function install($adminPassword, $email, $timezoneOffset) { global $Language; @@ -171,6 +195,8 @@ function install($adminPassword, $email) $currentDate = Date::current(DB_DATE_FORMAT); + $timezone = timezone_name_from_abbr("", $timezoneOffset, 0); + // ============================================================================ // Create directories // ============================================================================ @@ -242,7 +268,7 @@ function install($adminPassword, $email) 'username'=>'admin', 'status'=>'published', 'tags'=>array('bludit'=>'Bludit','cms'=>'CMS','flat-files'=>'Flat files'), - 'allowComments'=>false, + 'allowComments'=>'false', 'date'=>$currentDate ) ); @@ -256,7 +282,7 @@ function install($adminPassword, $email) 'footer'=>Date::current('Y'), 'language'=>$Language->getCurrentLocale(), 'locale'=>$Language->getCurrentLocale(), - 'timezone'=>'UTC', + 'timezone'=>$timezone, 'theme'=>'pure', 'adminTheme'=>'default', 'homepage'=>'', @@ -265,7 +291,8 @@ function install($adminPassword, $email) 'uriPage'=>'/', 'uriTag'=>'/tag/', 'url'=>'http://'.DOMAIN.HTML_PATH_ROOT, - 'cliMode'=>true + 'cliMode'=>'true', + 'emailFrom'=>'no-reply@'.DOMAIN ); file_put_contents(PATH_DATABASES.'site.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); @@ -399,7 +426,7 @@ function checkPOST($args) $email = sanitize::email($args['email']); // Install Bludit - install($args['password'], $email, $args['language']); + install($args['password'], $email, $args['timezone']); return true; } @@ -431,9 +458,8 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' ) } ?> - - - + +
get('Welcome to the Bludit installer') ?>
+'.$value.' |
get('Complete the form choose a password for the username admin') ?>
-get('Choose your language') ?>
-This is a notification from your website {{WEBSITE_NAME}}
You request a login access code, follow the next link:
{{LINK}}
", - "there-are-no-scheduled-posts": "There are no scheduled posts" + "there-are-no-scheduled-posts": "There are no scheduled posts." } \ No newline at end of file