Changeset 25104 for extensions/Password_Policy
- Timestamp:
- Oct 24, 2013, 12:01:51 AM (10 years ago)
- Location:
- extensions/Password_Policy
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Password_Policy/changelog.txt.php
r25028 r25104 5 5 6 6 -- 2.5.0 : Initial release for Piwigo 2.5 7 8 -- 2.5.1 : Improve workflow when account is locked and a password renewal is set 9 Missing translation keys 10 Update it_IT, thanks to : Ericnet 7 11 */ 8 12 ?> -
extensions/Password_Policy/include/functions.inc.php
r25089 r25104 30 30 * Triggered on loc_begin_index 31 31 * 32 * Initiating GhostTracker - Perform user logout after registration if account locked32 * Perform user logout after registration if account locked and redirection to profile page is password renewal is set 33 33 */ 34 34 function PP_Init() … … 40 40 $conf_PP = unserialize($conf['PasswordPolicy']); 41 41 42 // Admins, Guests and Adult_Content users are excluded43 // ----------------------------------------- ----------44 if (!is_a dmin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18")42 // Perfoming redirection for locked accounts 43 // ----------------------------------------- 44 if (!is_a_guest() and $user['username'] != "16" and $user['username'] != "18") 45 45 { 46 46 // Perform user logout if user account is locked 47 47 if ( 48 (isset($conf_PP['LOGFAILBLOCK']) and $conf_PP['LOGFAILBLOCK'] == 'true')49 and PP_UsrBlock_Verif($user['username'])50 and !is_admin()51 and !is_webmaster()52 )48 (isset($conf_PP['LOGFAILBLOCK']) and $conf_PP['LOGFAILBLOCK'] == 'true') 49 and PP_UsrBlock_Verif($user['username']) 50 //and (isset($userlocked) and $userlocked == 'true') 51 and !is_admin() 52 and !is_webmaster()) 53 53 { 54 54 invalidate_user_cache(); … … 64 64 } 65 65 } 66 67 // Performing redirection to profile page for password reset 68 // --------------------------------------------------------- 69 if ((isset($conf_PP['PWDRESET']) and $conf_PP['PWDRESET'] == 'true')) 70 { 71 $query =' 72 SELECT user_id, status 73 FROM '.USER_INFOS_TABLE.' 74 WHERE user_id = '.$user['id'].' 75 ;'; 76 $data = pwg_db_fetch_assoc(pwg_query($query)); 77 78 if ($data['status'] <> "webmaster" and $data['status'] <> "generic") // Exclusion of specific accounts 79 { 80 if (PP_check_pwdreset($user['id'])) 81 { 82 redirect(PHPWG_ROOT_PATH.'profile.php'); 83 } 84 } 85 } 86 87 66 88 } 67 89 … … 219 241 /** 220 242 * PP_user_list_locked 221 * Adds a new feature in user_list to allow password reset for selected usersby admin243 * Adds a new feature in user_list to allow user unlocking by admin 222 244 * 223 245 */ … … 266 288 } 267 289 return $visible_user_list; 268 }269 270 271 /**272 * Triggered on login_success273 *274 * Redirects a visitor (except for admins, webmasters and generic statuses) to his profile.php page if password reset is needed275 *276 */277 function PP_LoginTasks()278 {279 global $conf, $user;280 281 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');282 283 $conf_PP = unserialize($conf['PasswordPolicy']);284 285 // Perfoming redirection for locked accounts286 // -----------------------------------------287 if (!is_admin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18")288 {289 // Perform user logout if user account is locked290 if ((isset($conf_PP['LOGFAILBLOCK']) and $conf_PP['LOGFAILBLOCK'] == 'true')291 and PP_UsrBlock_Verif($user['username'])292 and !is_admin()293 and !is_webmaster())294 {295 invalidate_user_cache();296 logout_user();297 if ($conf['guest_access'])298 {299 redirect(make_index_url().'?PP_msg=locked', 0);300 }301 else302 {303 redirect(get_root_url().'identification.php?PP_msg=locked' , 0);304 }305 }306 }307 308 // Performing redirection to profile page for password reset309 // ---------------------------------------------------------310 if ((isset($conf_PP['PWDRESET']) and $conf_PP['PWDRESET'] == 'true'))311 {312 $query ='313 SELECT user_id, status314 FROM '.USER_INFOS_TABLE.'315 WHERE user_id = '.$user['id'].'316 ;';317 $data = pwg_db_fetch_assoc(pwg_query($query));318 319 if ($data['status'] <> "webmaster" and $data['status'] <> "generic") // Exclusion of specific accounts320 {321 if (PP_check_pwdreset($user['id']))322 {323 redirect(PHPWG_ROOT_PATH.'profile.php');324 }325 }326 }327 290 } 328 291 -
extensions/Password_Policy/language/en_UK/plugin.lang.php
r25091 r25104 69 69 $lang['PP_User Locked'] = 'User locked'; 70 70 $lang['PP_You need to confirm unlock'] = 'You must confirm unlocking (check box)!'; 71 $lang['PP %d user unlocked'] = '%d user unlocked'; 72 $lang['PP %d users unlocked'] = '%d users unlocked'; 71 73 ?> -
extensions/Password_Policy/language/fr_FR/plugin.lang.php
r25091 r25104 57 57 $lang['PP_UserLocked_Custom_Txt'] = 'Personnalisation du message d\'information à l\'utilisateur verrouillé'; 58 58 $lang['PP_UserLocked_Custom_Txt_d'] = 'Vous pouvez modifier ici le texte du message affiché à l\'utilisateur dont le compte est verrouillé. Pour une utilisation multi-langues, vous pouvez utiliser les balises [lang] du plugin Extended Description si celui-ci est actif.'; 59 $lang['PP_LockedUsers'] = 'Verrou illages';59 $lang['PP_LockedUsers'] = 'Verrous'; 60 60 $lang['PP_Unlock'] = 'Déverrouillage'; 61 61 $lang['PP_Unlock selected users'] = 'Déverrouiller les utilisateurs sélectionnés'; … … 69 69 $lang['PP_User Locked'] = 'Utilisateur verrouillé'; 70 70 $lang['PP_You need to confirm unlock'] = 'Vous devez confirmer le déverrouillage (case à cocher) !'; 71 $lang['PP %d user unlocked'] = '%d utilisateur déverrouillé'; 72 $lang['PP %d users unlocked'] = '%d utilisateurs déverrouillés'; 71 73 ?> -
extensions/Password_Policy/main.inc.php
r25090 r25104 27 27 add_event_handler('get_admin_plugin_menu_links', 'PP_admin_menu'); 28 28 29 // Display messages on index page 30 // ------------------------------ 31 add_event_handler('init', 'PP_InitPage'); 32 29 33 // Features and controls on user connexion 30 34 // --------------------------------------- 31 35 add_event_handler('loc_begin_index', 'PP_Init'); 32 33 // Display messages on index page34 // ------------------------------35 add_event_handler('init', 'PP_InitPage');36 36 37 37 // Check users registration … … 43 43 add_event_handler('loc_begin_profile', 'PP_Profile_Init'); 44 44 } 45 46 // Redirection to profile page47 // ---------------------------48 add_event_handler('login_success', 'PP_LoginTasks',EVENT_HANDLER_PRIORITY_NEUTRAL+10, 1);49 45 50 46 // Security option : Count of login failure and lock account after x attempt
Note: See TracChangeset
for help on using the changeset viewer.