🌍
English
This shows you the differences between two versions of the page.
dev:changes_in_2.5 [2012/11/02 14:10] plg new password hash in 2.5 |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Technical changes in Piwigo 2.5 ====== | ||
- | ===== Albums pagination ===== | ||
- | http://piwigo.org/bugs/view.php?id=2614 | ||
- | For themes creators. | ||
- | |||
- | On //index.tpl//, add | ||
- | <file> | ||
- | {if !empty($cats_navbar)} | ||
- | {assign var=navbar value=$cats_navbar} | ||
- | {include file='navigation_bar.tpl'|@get_extent:'navbar'} | ||
- | {/if} | ||
- | </file> | ||
- | right after **{$CATEGORIES}** | ||
- | |||
- | And modify existing photos navbar by | ||
- | <file> | ||
- | {if !empty($thumb_navbar)} | ||
- | {assign var=navbar value=$thumb_navbar} | ||
- | {include file='navigation_bar.tpl'|@get_extent:'navbar'} | ||
- | {/if} | ||
- | </file> | ||
- | |||
- | ===== Add action buttons ===== | ||
- | http://piwigo.org/bugs/view.php?id=2781 | ||
- | For plugins creators. | ||
- | |||
- | Introduction of two template methods to add buttons to index and picture toolbars, allowing to place buttons relatively to each other : | ||
- | <file> | ||
- | $template->add_picture_button($content, $rank); | ||
- | $template->add_index_button($content, $rank); | ||
- | </file> | ||
- | |||
- | No changes for themes. | ||
- | |||
- | ===== Infos/Errors messages moved ===== | ||
- | On //index.tpl//, **{include file='infos_errors.tpl'}** was moved away from the main **#content** block. | ||
- | See http://piwigo.org/dev/changeset/18712 | ||
- | |||
- | ===== Jquery UI 1.9 ===== | ||
- | Jquery ui effects filename have changed. For example change | ||
- | <file>footer|combine_script require='jquery.effects.blind'</file> | ||
- | to | ||
- | <file>footer|combine_script require='jquery.ui.effect-blind'</file> | ||
- | We'll have backward naming compatibility for 2.5 version only! | ||
- | |||
- | ===== Password hash ===== | ||
- | |||
- | Until version 2.4 we had a configuration parameter $conf['pass_convert']. Which by default was: | ||
- | |||
- | <code php>$conf['pass_convert'] = create_function('$s', 'return md5($s);');</code> | ||
- | |||
- | Now we have 2 configuration settings : | ||
- | |||
- | <code php>// password_hash: function hash the clear user password to store it in the | ||
- | // database. The function takes only one parameter: the clear password. | ||
- | $conf['password_hash'] = 'pwg_password_hash'; | ||
- | |||
- | // password_verify: function that checks the password against its hash. The | ||
- | // function takes 2 mandatory parameter : clear password, hashed password + | ||
- | // an optional parameter user_id. The user_id is used to update the password | ||
- | // with the new hash introduced in Piwigo 2.5. See function | ||
- | // pwg_password_verify in include/functions_user.inc.php | ||
- | $conf['password_verify'] = 'pwg_password_verify';</code> | ||
- | |||
- | They are used this way: | ||
- | |||
- | <code php>if ($conf['password_verify']($clear_password, $row['password'], $row['id']))</code> | ||
- | |||
- | and | ||
- | |||
- | <code php> single_update( | ||
- | USERS_TABLE, | ||
- | array($conf['user_fields']['password'] => $conf['password_hash']($_POST['use_new_pwd'])), | ||
- | array($conf['user_fields']['id'] => $user_id) | ||
- | );</code> |