Changeset 25104 for extensions/Password_Policy/include/functions.inc.php
- Timestamp:
- Oct 24, 2013, 12:01:51 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.