# HG changeset patch # User Dan # Date 1213071694 14400 # Node ID 3700f7124c2b95f2dab66f63e0be8786ca38abc9 # Parent 7f196509bf789353a39bd88c2efe801a9e9a4702 A bit of UX improvement to upgrade UI; updated readme for 1.1.4 diff -r 7f196509bf78 -r 3700f7124c2b README --- a/README Mon Jun 09 20:52:34 2008 -0400 +++ b/README Tue Jun 10 00:21:34 2008 -0400 @@ -1,5 +1,5 @@ Enano CMS -Version 1.1.3 +Version 1.1.4 ----------------------------- Thanks for downloading Enano! If you're looking for an installation guide, @@ -44,28 +44,25 @@ from other projects that are also released under Free licenses; see the various files under the licenses/ directory included with this release for details. -If you are planning to make a commercial fork of Enano, all of the software and -libraries included with Enano are available under licenses that allow you to do -so; however, in compliance with the GPL, you must: +Please be reminded that if you create a commercial fork of Enano, that while +all of the components included with Enano are licensed in such a way that you +are allowed to do so, you must make the project in its entirety available under +the GNU General Public License, notwithstanding licenses for specific +components of Enano named in /licenses/index.html and in various source code +files. -a) provide attribution to the Enano team in source code files and on the - (renamed) Special:About_Enano page, -b) remove all instances of the word Enano and the Enano logo from your - derivative work, with the exception of the following phrase, which must - be shown on the (renamed) Special:About_Enano page: +We also ask that if you fork Enano, you provide attribution to the Enano team +by including the following notice on the (renamed) Special:About_Enano page: - "The software used on this website was based on Enano CMS. Copyright - (C) 2006-2007 Dan Fuhry." + "This software is based on Enano CMS, copyright (C) 2006-2008 Dan Fuhry." - The words "Enano CMS" must link to the page . You may - (at your option) also include a notice of non-endorsement by the Enano - Foundation, unless you're lucky enough to become an official fork - maintainer. - -c) Provide the complete source code for your modified version of Enano under - the terms of the GNU General Public License, and -d) Include the complete and unmodified licenses/ directory, which contains - licensing information for third-party libraries that Enano uses. +While you have no legal obligation to do so, we ask that any forks of Enano +be renamed so that they do not contain the word "Enano" anywhere in the +product name. This is for identity and support reasons - users may get +confused as to which one is the "real" Enano CMS. We also strongly recommend +that you include a notice of non-endorsement from Dan Fuhry and the Enano +Foundation and a disclaimer of liability for damages incurred through the use +of the software. As permitted by the GPL, you may charge for the service of downloading Enano from your server; however, you may not prevent others from distributing Enano @@ -74,7 +71,7 @@ CHANGES IN THIS RELEASE ----------------------------- -Please see for a list of changes in +Please see for a list of changes in this release. UPGRADING FROM PREVIOUS RELEASES diff -r 7f196509bf78 -r 3700f7124c2b includes/clientside/jsres.php --- a/includes/clientside/jsres.php Mon Jun 09 20:52:34 2008 -0400 +++ b/includes/clientside/jsres.php Tue Jun 10 00:21:34 2008 -0400 @@ -102,6 +102,35 @@ header('Content-type: text/javascript'); $everything = ''; +// if we only want the tiny version of the API (just enough to get by until the full one is loaded), send that +// with a simple ETag and far future expires header +if ( isset($_GET['early']) ) +{ + header('ETag: enanocms-lib-early-r1'); + header('Expires: Wed, 1 Jan 2020 00:00:00 GMT'); + + echo <<load_list = array(); + return false; + } + $dir = ENANO_ROOT.'/plugins/'; $this->load_list = $this->system_plugins; diff -r 7f196509bf78 -r 3700f7124c2b includes/sessions.php --- a/includes/sessions.php Mon Jun 09 20:52:34 2008 -0400 +++ b/includes/sessions.php Tue Jun 10 00:21:34 2008 -0400 @@ -513,7 +513,7 @@ $this->real_name = $userdata['real_name']; $this->email = $userdata['email']; $this->unread_pms = $userdata['num_pms']; - $this->user_title = $userdata['user_title']; + $this->user_title = ( isset($userdata['user_title']) ) ? $userdata['user_title'] : null; if(!$this->compat) { $this->theme = $userdata['theme']; @@ -1075,7 +1075,7 @@ $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'auth_bad\', '.time().', \''.enano_date('d M Y h:i a').'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')'); // Do we also need to increment the lockout countdown? - if ( $policy != 'disable' && !defined('IN_ENANO_INSTALL') ) + if ( !defined('IN_ENANO_INSTALL') && $policy != 'disable' ) { $ipaddr = $db->escape($_SERVER['REMOTE_ADDR']); // increment fail count @@ -1326,7 +1326,7 @@ $fail = true; if ( defined('IN_ENANO_UPGRADE') ) { - if ( installer_enano_version() == '1.1.3' && substr($ip, 0, 10) == substr($row['source_ip'], 0, 10) ) + if ( substr($ip, 0, 10) == substr($row['source_ip'], 0, 10) ) $fail = false; } // Failed IP address check diff -r 7f196509bf78 -r 3700f7124c2b install/images/css/installer.css --- a/install/images/css/installer.css Mon Jun 09 20:52:34 2008 -0400 +++ b/install/images/css/installer.css Tue Jun 10 00:21:34 2008 -0400 @@ -124,7 +124,7 @@ border-color: #D0D0D0; -moz-border-radius: 5px; } -a.icon { +a.icon, span.icon { display: block; font-size: 18pt; line-height: 48px; @@ -134,22 +134,22 @@ color: #002266; text-decoration: none !important; } -a.icon:hover { +a.icon:hover, span.icon:hover { cursor: pointer; color: #002266 !important; background-color: #F0F0F0; } -a.icon-disabled { +a.icon-disabled, span.icon-disabled { color: #808080 !important; opacity: 0.7; filter: alpha(opacity=70); } -a.icon-disabled:hover { +a.icon-disabled:hover, span.icon-disabled:hover { color: #808080 !important; background-color: #FCFCFC; border-color: #F8F8F8; } -a.icon small, a.icon-disabled small { +a.icon small, a.icon-disabled small, span.icon small, span.icon-disabled small { display: block; font-size: 8pt; line-height: normal; @@ -167,7 +167,7 @@ a.upgrade { background-image: url(../icons/upgrade.png); } -a.upgrade-disabled { +a.upgrade-disabled, span.upgrade-disabled { background-image: url(../icons/upgrade-disabled.png); } @@ -204,14 +204,14 @@ border-width: 1px; border-style: solid; } -input[type ^="submit"] { +input[type ^="submit"], button.submit { background-color: #4F729A; color: #FFFFFF; border-width: 1px; border-style: solid; border-color: #1F426A #7FA2CA #7FA2CA #1F426A; } -input[type ^="submit"]:hover, input[type ^="submit"]:focus { +input[type ^="submit"]:hover, input[type ^="submit"]:focus, button.submit:hover, button.submit:focus { background-color: #5f82aa; } input[type ^="text"], input[type ^="password"] { diff -r 7f196509bf78 -r 3700f7124c2b install/images/icons/pimp.png Binary file install/images/icons/pimp.png has changed diff -r 7f196509bf78 -r 3700f7124c2b install/index.php --- a/install/index.php Mon Jun 09 20:52:34 2008 -0400 +++ b/install/index.php Tue Jun 10 00:21:34 2008 -0400 @@ -36,6 +36,9 @@ require('includes/common.php'); } +// are we in PHP5? +define('HAVE_PHP5', version_compare(PHP_VERSION, '5.0.0', '>=')); + ?>
@@ -112,7 +115,18 @@ } else { - echo '
  • Upgrade
  • '; + if ( HAVE_PHP5 && !isset($_GET['debug_warn_php4']) ) + echo '
  • Upgrade
  • '; + else + echo '
  • + + Upgrade + + Your server doesn\'t have PHP 5 or later installed. Enano 1.2 does not have support for PHP 4. + Learn more » + + +
  • '; } endif; ?> diff -r 7f196509bf78 -r 3700f7124c2b install/upgrade.php --- a/install/upgrade.php Mon Jun 09 20:52:34 2008 -0400 +++ b/install/upgrade.php Tue Jun 10 00:21:34 2008 -0400 @@ -33,59 +33,27 @@ require_once('includes/libenanoinstall.php'); // when the installer's common is loaded, it runs chdir() to the ENANO_ROOT, thus making this Enano's common.php +// PHP5 notice removed in 1.1.4 since the existing common is loaded and that loads lang and json2, which will +// give syntax errors on PHP4. So much for that. The installer will warn about this anyway. require_once('includes/common.php'); @ini_set('display_errors', 'on'); $ui = new Enano_Installer_UI('Enano upgrader', false); -if ( version_compare(PHP_VERSION, '5.0.0', '<') ) -{ - $ui->__construct('Enano upgrader', false); -} + $stg_welcome = $ui->add_stage('Welcome', true); $stg_confirm = $ui->add_stage('Confirmation', true); $stg_upgrade = $ui->add_stage('Perform upgrade', true); $stg_finish = $ui->add_stage('Finish', true); -$stg_php4 = $ui->add_stage('PHP4 compatibility notice', false); -if ( version_compare(PHP_VERSION, '5.0.0', '<') || isset($_GET['debug_warn_php4']) ) -{ - $ui->set_visible_stage($stg_php4); - $ui->step = ''; - - $ui->show_header(); - - // This isn't localized because all localization code is dependent on - // PHP 5 (loading lang.php will throw a parser error under PHP4). This - // one message probably doesn't need to be localized anyway. - - ?> -

    - Your server doesn't have support for PHP 5. -

    -

    - PHP 5 is the latest version of the language on which Enano was built. Its many new features have been available since early 2004, yet - many web hosts have not migrated to it because of the work involved. In 2007, Zend Corporation announced that support for the aging - PHP 4.x would be discontinued at the end of the year. An initiative called GoPHP5 was started to - encourage web hosts to migrate to PHP 5. -

    -

    - Because of the industry's decision to not support PHP 4 any longer, the Enano team decided that it was time to begin using the powerful - features of PHP 5 at the expense of PHP 4 compatibility. Therefore, this version of Enano cannot be installed on your server until it - is upgraded to at least PHP 5.0.0, and preferably the latest available version. - -

    -

    - If you need to use Enano but can't upgrade your PHP because you're on a shared or reseller hosting service, you can use the - 1.0.x series of Enano on your site. While the Enano team attempts to make this - older series work on PHP 4, official support is not provided for installations of Enano on PHP 4. -

    - show_footer(); - exit(0); -} +// init languages +$lang_id_list = array_keys($languages); +$lang_id = $lang_id_list[0]; +$language_dir = $languages[$lang_id]['dir']; + +// load the language file +$lang = new Language($lang_id); +$lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/install.json'); +$lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/user.json'); // Version check if ( enano_version() == installer_enano_version() ) @@ -106,35 +74,57 @@ { $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_MEMBER); } - $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_ADMIN); - if ( $result['success'] ) + if ( !isset($result) || ( isset($result) && $result['success']) ) { - header('HTTP/1.1 302 Some kind of redirect with implied no content'); - header('Location: ' . scriptPath . '/install/' . $session->append_sid('upgrade.php')); - exit(); + $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_ADMIN); + if ( $result['success'] ) + { + header('HTTP/1.1 302 Some kind of redirect with implied no content'); + header('Location: ' . scriptPath . '/install/' . $session->append_sid('upgrade.php')); + exit(); + } } } $ui->show_header(); ?> -

    Authentication needed

    +

    get('upgrade_login_msg_auth_needed_title'); ?>

    '; if ( isset($result) ) { - echo 'Session manager returned error:' . '
    ' . print_r($result, true) . '
    '; + echo '' . $lang->get('upgrade_login_err_failed', array('error_code' => $result['error'])) . ''; } ?> -

    You need user_logged_in ) echo 'to be logged in and have '; ?>an active admin session to continue.

    -

    - Username:   
    - Password:   
    - -

    +

    user_logged_in ) + { + echo $lang->get('upgrade_login_msg_auth_needed_body_level2'); + } + else + { + echo $lang->get('upgrade_login_msg_auth_needed_body_level1'); + } + ?>

    + + + + + + + + + + + + +
    get('user_login_field_username'); ?>:
    get('user_login_field_password'); ?>:
    + +
    '; @@ -213,7 +203,19 @@ else { ?> -

    Nothing's really implemented for now except the actual migration code, which is not very smart. Just do the upgrade and get it over with.

    +

    get('upgrade_confirm_title'); ?>

    +

    get('upgrade_confirm_body', array('enano_version' => installer_enano_version())); ?>

    +
      +
    • get('upgrade_confirm_objective_backup_fs', array('dir' => ENANO_ROOT)); ?>
    • +
    • get('upgrade_confirm_objective_backup_db', array('dbname' => $dbname)); ?>
    • +
    +
    + + +
    http://yoursite.com/path-to-enano/Main_Page.

    ', btn_close_window: 'Close window', + }, + upgrade: { + login_msg_auth_needed_title: 'Authentication needed', + login_msg_auth_needed_body_level1: 'To continue, you need to log in. Please enter an administrator username and password below.', + login_msg_auth_needed_body_level2: 'To confirm the upgrade, you need to re-enter your login information. Please enter your username and password below.', + login_btn_login: 'Log in', + login_err_failed: 'The following error occurred during the login process: %error_code%.', + + confirm_title: 'Confirm upgrade', + confirm_body: 'You are about to upgrade to Enano version %enano_version%. You should make sure that you\'ve done the following before you continue:', + confirm_objective_backup_fs: 'Back up Enano installation directory (%dir%)', + confirm_objective_backup_db: 'Back up Enano database, including non-Enano tables if any (%dbname%)', + confirm_btn_upgrade: 'Pimp my Enano!', } } } diff -r 7f196509bf78 -r 3700f7124c2b themes/oxygen/header.tpl --- a/themes/oxygen/header.tpl Mon Jun 09 20:52:34 2008 -0400 +++ b/themes/oxygen/header.tpl Tue Jun 10 00:21:34 2008 -0400 @@ -7,6 +7,9 @@ {JS_DYNAMIC_VARS} + + +