From 7baa9ddb897281fe23bc844c23ae47a79413c42f Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Thu, 5 Feb 2004 13:38:57 +0000 Subject: [PATCH] Force password change after defined number of days git-svn-id: file:///svn/phpbb/trunk@4793 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 83639adafa..a2577cc417 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -575,6 +575,19 @@ class user extends session $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['primary']['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang']; + // Does the user need to change their password? If so, redirect to the + // ucp profile reg_details page ... of course do not redirect if we're + // already in the ucp + if (!defined('IN_ADMIN') && $config['chg_passforce'] && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) + { + global $SID; + + if (!preg_match('#' . preg_quote("ucp.$phpEx$SID") . '&i\=[a-z0-9]+?&mode\=reg_details#', $_SERVER['REQUEST_URI'])) + { + redirect("ucp.$phpEx$SID&i=profile&mode=reg_details"); + } + } + return; }