From b8ec5cf30204b181230d5956b58d5ad9c6d446ef Mon Sep 17 00:00:00 2001 From: Git Date: Thu, 26 Jul 2012 08:00:17 +0000 Subject: [PATCH] Empty commit --- sections/ajax/notifications.php | 8 ++------ sections/login/index.php | 2 +- sections/login/recover_step2.php | 3 +-- sections/register/index.php | 2 +- sections/user/takeedit.php | 2 +- static/functions/password_validate.js | 2 -- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/sections/ajax/notifications.php b/sections/ajax/notifications.php index f6c80d16..51f44f32 100644 --- a/sections/ajax/notifications.php +++ b/sections/ajax/notifications.php @@ -43,12 +43,8 @@ $DB->query("SELECT ID, CategoryID FROM torrents_group WHERE ID IN (".implode(',', $GroupIDs).")"); $GroupCategoryIDs = $DB->to_array('ID', MYSQLI_ASSOC, false); - // Only clear the alert if they've specified to. - if (isset($_GET['clear']) && $_GET['clear'] == "1") { - //Clear before header but after query so as to not have the alert bar on this page load - $DB->query("UPDATE users_notify_torrents SET UnRead='0' WHERE UserID=".$LoggedUser['ID']); - $Cache->delete_value('notifications_new_'.$LoggedUser['ID']); - } + $DB->query("UPDATE users_notify_torrents SET UnRead='0' WHERE UserID=".$LoggedUser['ID']); + $Cache->delete_value('notifications_new_'.$LoggedUser['ID']); } $DB->set_query_id($Results); diff --git a/sections/login/index.php b/sections/login/index.php index 7935b05d..25f9f9b9 100644 --- a/sections/login/index.php +++ b/sections/login/index.php @@ -43,7 +43,7 @@ if ($UserID && strtotime($Expires)>time()) { // If the user has requested a password change, and his key has not expired - $Validate->SetFields('password','1','string','You entered an invalid password.',array('minlength'=>'8','maxlength'=>'150')); + $Validate->SetFields('password','1','regex','You entered an invalid password. A strong password is between 8 and 40 characters long, contains at least 1 lowercase and uppercase letter, contains at least a number or symbol',array('regex' => '/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/')); $Validate->SetFields('verifypassword','1','compare','Your passwords did not match.',array('comparefield'=>'password')); if (!empty($_REQUEST['password'])) { diff --git a/sections/login/recover_step2.php b/sections/login/recover_step2.php index c6f8dc6d..b37c2739 100644 --- a/sections/login/recover_step2.php +++ b/sections/login/recover_step2.php @@ -13,8 +13,7 @@ if(!empty($Err)) { ?>

- - Please choose a password between 8 and 40 characters long

+ A strong password is between 8 and 40 characters long, contains at least 1 lowercase and uppercase letter, contains at least a number or symbol

diff --git a/sections/register/index.php b/sections/register/index.php index e78dc4b0..119ca7d5 100644 --- a/sections/register/index.php +++ b/sections/register/index.php @@ -27,7 +27,7 @@ } elseif(OPEN_REGISTRATION || !empty($_REQUEST['invite'])) { $Val->SetFields('username',true,'regex', 'You did not enter a valid username.',array('regex'=>'/^[a-z0-9_?]{1,20}$/iD')); $Val->SetFields('email',true,'email', 'You did not enter a valid email address.'); - $Val->SetFields('password',true,'string', 'You did not enter a valid password, must be at least 8 characters long.',array('minlength'=>8,'maxlength'=>150)); + $Val->SetFields('password',true,'regex','A strong password is between 8 and 40 characters long, contains at least 1 lowercase and uppercase letter contains at least a number or symbol',array('regex'=>'/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/')); $Val->SetFields('confirm_password',true,'compare', 'Your passwords do not match.',array('comparefield'=>'password')); $Val->SetFields('readrules',true,'checkbox', 'You did not check the box that says you will read the rules.'); $Val->SetFields('readwiki',true,'checkbox', 'You did not check the box that says you will read the wiki.'); diff --git a/sections/user/takeedit.php b/sections/user/takeedit.php index aac519db..db3a0dc0 100644 --- a/sections/user/takeedit.php +++ b/sections/user/takeedit.php @@ -32,7 +32,7 @@ $Val->SetFields('email',1,"email","You did not enter a valid email address."); $Val->SetFields('irckey',0,"string","You did not enter a valid IRCKey, must be between 6 and 32 characters long.",array('minlength'=>6,'maxlength'=>32)); $Val->SetFields('cur_pass',0,"string","You did not enter a valid password, must be at least 6 characters long.",array('minlength'=>6,'maxlength'=>150)); -$Val->SetFields('new_pass_1',0,"string","You did not enter a valid password, must be at least 8 characters long.",array('minlength'=>8,'maxlength'=>150)); +$Val->SetFields('new_pass_1',0,"regex","You did not enter a valid password. A strong password is between 8 and 40 characters long contains at least 1 lowercase and uppercase letter, contains at least a number or symbol",array('regex'=>'/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/')); $Val->SetFields('new_pass_2',1,"compare","Your passwords do not match.",array('comparefield'=>'new_pass_1')); if (check_perms('site_advanced_search')) { $Val->SetFields('searchtype',1,"number","You forgot to select your default search preference.",array('minlength'=>0,'maxlength'=>1)); diff --git a/static/functions/password_validate.js b/static/functions/password_validate.js index 07d6ad06..2be29ec3 100644 --- a/static/functions/password_validate.js +++ b/static/functions/password_validate.js @@ -1,8 +1,6 @@ /** * * Validates passwords to make sure they are powerful -* w@author Gwindow -* **/ (function($) {
Password