diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | cpanfile | 2 | ||||
-rw-r--r-- | cpanfile.snapshot | 505 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth/Profile.pm | 34 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Oxfordshire.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/Test.pm | 13 | ||||
-rw-r--r-- | t/app/controller/auth_profile.t | 67 | ||||
-rw-r--r-- | t/app/controller/report_new_text.t | 4 | ||||
-rw-r--r-- | t/app/controller/report_update_text.t | 2 | ||||
-rw-r--r-- | templates/web/base/auth/change_password.html | 16 | ||||
-rw-r--r-- | templates/web/base/auth/change_phone.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/_inspect.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/new/form_user_loggedin.html | 4 | ||||
-rw-r--r-- | templates/web/fixamingata/report/new/form_user_loggedout.html | 2 |
16 files changed, 389 insertions, 283 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d94138d87..5606a3c0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ - Front end improvements: - Zoom out as much as necessary on body map page, even on mobile. #1958 - Show loading message on initial /around map load #1976 + - Ask for current password/send email on password change. #1974 - Add minimum password length and common password checking. + - Nicer display of national phone numbers. - Bugfixes: - Fix bug specifying category in URL on /around. #1950 - Fix bug with multiple select-multiples on a page. #1951 @@ -82,7 +82,7 @@ requires 'Net::Domain::TLD', '1.75'; requires 'Net::Facebook::Oauth2', '0.10'; requires 'Net::OAuth'; requires 'Net::Twitter::Lite::WithAPIv1_1', '0.12008'; -requires 'Number::Phone'; +requires 'Number::Phone', '3.4003'; requires 'Path::Class'; requires 'POSIX'; requires 'Readonly'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index c43ad0653..5fa44e318 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -4508,15 +4508,18 @@ DISTRIBUTIONS Carp 0 ExtUtils::MakeMaker 0 POSIX 0 - Number-Phone-3.4002 - pathname: D/DC/DCANTRELL/Number-Phone-3.4002.tar.gz + Number-Phone-3.4003 + pathname: D/DC/DCANTRELL/Number-Phone-3.4003.tar.gz provides: - Number::Phone 3.4002 + Number::Phone 3.4003 Number::Phone::Country 1.93 Number::Phone::Country::Data 1.6 + Number::Phone::Formatter 1.0 + Number::Phone::Formatter::National 1.0 + Number::Phone::Formatter::NationallyPreferredIntl 1.0 Number::Phone::Formatter::Raw undef Number::Phone::Lib 1.0 - Number::Phone::NANP 1.5 + Number::Phone::NANP 1.6000 Number::Phone::NANP::AG 1.1 Number::Phone::NANP::AI 1.1 Number::Phone::NANP::AS 1.1 @@ -4526,7 +4529,7 @@ DISTRIBUTIONS Number::Phone::NANP::CA 1.1 Number::Phone::NANP::DM 1.1 Number::Phone::NANP::DO 1.1 - Number::Phone::NANP::Data 1.20170908113144 + Number::Phone::NANP::Data 1.20180203200229 Number::Phone::NANP::GD 1.1 Number::Phone::NANP::GU 1.1 Number::Phone::NANP::JM 1.1 @@ -4543,252 +4546,252 @@ DISTRIBUTIONS Number::Phone::NANP::VC 1.1 Number::Phone::NANP::VG 1.1 Number::Phone::NANP::VI 1.1 - Number::Phone::StubCountry 1.3 - Number::Phone::StubCountry::AC 1.20170908113147 - Number::Phone::StubCountry::AD 1.20170908113147 - Number::Phone::StubCountry::AE 1.20170908113147 - Number::Phone::StubCountry::AF 1.20170908113147 - Number::Phone::StubCountry::AG 1.20170908113147 - Number::Phone::StubCountry::AI 1.20170908113147 - Number::Phone::StubCountry::AL 1.20170908113147 - Number::Phone::StubCountry::AM 1.20170908113147 - Number::Phone::StubCountry::AO 1.20170908113147 - Number::Phone::StubCountry::AR 1.20170908113147 - Number::Phone::StubCountry::AS 1.20170908113147 - Number::Phone::StubCountry::AT 1.20170908113147 - Number::Phone::StubCountry::AU 1.20170908113147 - Number::Phone::StubCountry::AW 1.20170908113147 - Number::Phone::StubCountry::AX 1.20170908113147 - Number::Phone::StubCountry::AZ 1.20170908113147 - Number::Phone::StubCountry::BA 1.20170908113147 - Number::Phone::StubCountry::BB 1.20170908113147 - Number::Phone::StubCountry::BD 1.20170908113147 - Number::Phone::StubCountry::BE 1.20170908113147 - Number::Phone::StubCountry::BF 1.20170908113147 - Number::Phone::StubCountry::BG 1.20170908113147 - Number::Phone::StubCountry::BH 1.20170908113147 - Number::Phone::StubCountry::BI 1.20170908113147 - Number::Phone::StubCountry::BJ 1.20170908113147 - Number::Phone::StubCountry::BL 1.20170908113147 - Number::Phone::StubCountry::BM 1.20170908113147 - Number::Phone::StubCountry::BN 1.20170908113147 - Number::Phone::StubCountry::BO 1.20170908113147 - Number::Phone::StubCountry::BQ 1.20170908113147 - Number::Phone::StubCountry::BR 1.20170908113147 - Number::Phone::StubCountry::BS 1.20170908113147 - Number::Phone::StubCountry::BT 1.20170908113147 - Number::Phone::StubCountry::BW 1.20170908113147 - Number::Phone::StubCountry::BY 1.20170908113147 - Number::Phone::StubCountry::BZ 1.20170908113147 - Number::Phone::StubCountry::CA 1.20170908113147 - Number::Phone::StubCountry::CC 1.20170908113147 - Number::Phone::StubCountry::CD 1.20170908113147 - Number::Phone::StubCountry::CF 1.20170908113147 - Number::Phone::StubCountry::CG 1.20170908113147 - Number::Phone::StubCountry::CH 1.20170908113147 - Number::Phone::StubCountry::CI 1.20170908113147 - Number::Phone::StubCountry::CK 1.20170908113147 - Number::Phone::StubCountry::CL 1.20170908113147 - Number::Phone::StubCountry::CM 1.20170908113147 - Number::Phone::StubCountry::CN 1.20170908113147 - Number::Phone::StubCountry::CO 1.20170908113148 - Number::Phone::StubCountry::CR 1.20170908113148 - Number::Phone::StubCountry::CU 1.20170908113148 - Number::Phone::StubCountry::CV 1.20170908113148 - Number::Phone::StubCountry::CW 1.20170908113148 - Number::Phone::StubCountry::CX 1.20170908113148 - Number::Phone::StubCountry::CY 1.20170908113148 - Number::Phone::StubCountry::CZ 1.20170908113148 - Number::Phone::StubCountry::DE 1.20170908113148 - Number::Phone::StubCountry::DJ 1.20170908113148 - Number::Phone::StubCountry::DK 1.20170908113148 - Number::Phone::StubCountry::DM 1.20170908113148 - Number::Phone::StubCountry::DO 1.20170908113148 - Number::Phone::StubCountry::DZ 1.20170908113148 - Number::Phone::StubCountry::EC 1.20170908113148 - Number::Phone::StubCountry::EE 1.20170908113148 - Number::Phone::StubCountry::EG 1.20170908113148 - Number::Phone::StubCountry::EH 1.20170908113148 - Number::Phone::StubCountry::ER 1.20170908113148 - Number::Phone::StubCountry::ES 1.20170908113148 - Number::Phone::StubCountry::ET 1.20170908113148 - Number::Phone::StubCountry::FI 1.20170908113148 - Number::Phone::StubCountry::FJ 1.20170908113148 - Number::Phone::StubCountry::FK 1.20170908113148 - Number::Phone::StubCountry::FM 1.20170908113148 - Number::Phone::StubCountry::FO 1.20170908113148 - Number::Phone::StubCountry::FR 1.20170908113148 - Number::Phone::StubCountry::GA 1.20170908113148 - Number::Phone::StubCountry::GB 1.20170908113148 - Number::Phone::StubCountry::GD 1.20170908113148 - Number::Phone::StubCountry::GE 1.20170908113148 - Number::Phone::StubCountry::GF 1.20170908113148 - Number::Phone::StubCountry::GG 1.20170908113148 - Number::Phone::StubCountry::GH 1.20170908113148 - Number::Phone::StubCountry::GI 1.20170908113148 - Number::Phone::StubCountry::GL 1.20170908113148 - Number::Phone::StubCountry::GM 1.20170908113148 - Number::Phone::StubCountry::GN 1.20170908113148 - Number::Phone::StubCountry::GP 1.20170908113148 - Number::Phone::StubCountry::GQ 1.20170908113148 - Number::Phone::StubCountry::GR 1.20170908113148 - Number::Phone::StubCountry::GT 1.20170908113148 - Number::Phone::StubCountry::GU 1.20170908113148 - Number::Phone::StubCountry::GW 1.20170908113148 - Number::Phone::StubCountry::GY 1.20170908113148 - Number::Phone::StubCountry::HK 1.20170908113148 - Number::Phone::StubCountry::HN 1.20170908113148 - Number::Phone::StubCountry::HR 1.20170908113148 - Number::Phone::StubCountry::HT 1.20170908113148 - Number::Phone::StubCountry::HU 1.20170908113148 - Number::Phone::StubCountry::ID 1.20170908113148 - Number::Phone::StubCountry::IE 1.20170908113148 - Number::Phone::StubCountry::IL 1.20170908113148 - Number::Phone::StubCountry::IM 1.20170908113148 - Number::Phone::StubCountry::IN 1.20170908113148 - Number::Phone::StubCountry::IO 1.20170908113148 - Number::Phone::StubCountry::IQ 1.20170908113148 - Number::Phone::StubCountry::IR 1.20170908113148 - Number::Phone::StubCountry::IS 1.20170908113148 - Number::Phone::StubCountry::IT 1.20170908113148 - Number::Phone::StubCountry::JE 1.20170908113148 - Number::Phone::StubCountry::JM 1.20170908113148 - Number::Phone::StubCountry::JO 1.20170908113148 - Number::Phone::StubCountry::JP 1.20170908113148 - Number::Phone::StubCountry::KE 1.20170908113148 - Number::Phone::StubCountry::KG 1.20170908113148 - Number::Phone::StubCountry::KH 1.20170908113148 - Number::Phone::StubCountry::KI 1.20170908113148 - Number::Phone::StubCountry::KM 1.20170908113148 - Number::Phone::StubCountry::KN 1.20170908113148 - Number::Phone::StubCountry::KP 1.20170908113148 - Number::Phone::StubCountry::KR 1.20170908113148 - Number::Phone::StubCountry::KW 1.20170908113148 - Number::Phone::StubCountry::KY 1.20170908113148 - Number::Phone::StubCountry::KZ 1.20170908113148 - Number::Phone::StubCountry::LA 1.20170908113148 - Number::Phone::StubCountry::LB 1.20170908113148 - Number::Phone::StubCountry::LC 1.20170908113148 - Number::Phone::StubCountry::LI 1.20170908113148 - Number::Phone::StubCountry::LK 1.20170908113148 - Number::Phone::StubCountry::LR 1.20170908113148 - Number::Phone::StubCountry::LS 1.20170908113148 - Number::Phone::StubCountry::LT 1.20170908113148 - Number::Phone::StubCountry::LU 1.20170908113148 - Number::Phone::StubCountry::LV 1.20170908113148 - Number::Phone::StubCountry::LY 1.20170908113148 - Number::Phone::StubCountry::MA 1.20170908113148 - Number::Phone::StubCountry::MC 1.20170908113148 - Number::Phone::StubCountry::MD 1.20170908113148 - Number::Phone::StubCountry::ME 1.20170908113148 - Number::Phone::StubCountry::MF 1.20170908113148 - Number::Phone::StubCountry::MG 1.20170908113148 - Number::Phone::StubCountry::MH 1.20170908113148 - Number::Phone::StubCountry::MK 1.20170908113148 - Number::Phone::StubCountry::ML 1.20170908113148 - Number::Phone::StubCountry::MM 1.20170908113148 - Number::Phone::StubCountry::MN 1.20170908113148 - Number::Phone::StubCountry::MO 1.20170908113148 - Number::Phone::StubCountry::MP 1.20170908113148 - Number::Phone::StubCountry::MQ 1.20170908113148 - Number::Phone::StubCountry::MR 1.20170908113148 - Number::Phone::StubCountry::MS 1.20170908113148 - Number::Phone::StubCountry::MT 1.20170908113148 - Number::Phone::StubCountry::MU 1.20170908113148 - Number::Phone::StubCountry::MV 1.20170908113148 - Number::Phone::StubCountry::MW 1.20170908113148 - Number::Phone::StubCountry::MX 1.20170908113148 - Number::Phone::StubCountry::MY 1.20170908113148 - Number::Phone::StubCountry::MZ 1.20170908113148 - Number::Phone::StubCountry::NA 1.20170908113148 - Number::Phone::StubCountry::NC 1.20170908113148 - Number::Phone::StubCountry::NE 1.20170908113148 - Number::Phone::StubCountry::NF 1.20170908113148 - Number::Phone::StubCountry::NG 1.20170908113148 - Number::Phone::StubCountry::NI 1.20170908113148 - Number::Phone::StubCountry::NL 1.20170908113148 - Number::Phone::StubCountry::NO 1.20170908113148 - Number::Phone::StubCountry::NP 1.20170908113148 - Number::Phone::StubCountry::NR 1.20170908113148 - Number::Phone::StubCountry::NU 1.20170908113148 - Number::Phone::StubCountry::NZ 1.20170908113148 - Number::Phone::StubCountry::OM 1.20170908113148 - Number::Phone::StubCountry::PA 1.20170908113148 - Number::Phone::StubCountry::PE 1.20170908113148 - Number::Phone::StubCountry::PF 1.20170908113148 - Number::Phone::StubCountry::PG 1.20170908113148 - Number::Phone::StubCountry::PH 1.20170908113148 - Number::Phone::StubCountry::PK 1.20170908113148 - Number::Phone::StubCountry::PL 1.20170908113148 - Number::Phone::StubCountry::PM 1.20170908113148 - Number::Phone::StubCountry::PR 1.20170908113149 - Number::Phone::StubCountry::PS 1.20170908113149 - Number::Phone::StubCountry::PT 1.20170908113149 - Number::Phone::StubCountry::PW 1.20170908113149 - Number::Phone::StubCountry::PY 1.20170908113149 - Number::Phone::StubCountry::QA 1.20170908113149 - Number::Phone::StubCountry::RE 1.20170908113149 - Number::Phone::StubCountry::RO 1.20170908113149 - Number::Phone::StubCountry::RS 1.20170908113149 - Number::Phone::StubCountry::RU 1.20170908113149 - Number::Phone::StubCountry::RW 1.20170908113149 - Number::Phone::StubCountry::SA 1.20170908113149 - Number::Phone::StubCountry::SB 1.20170908113149 - Number::Phone::StubCountry::SC 1.20170908113149 - Number::Phone::StubCountry::SD 1.20170908113149 - Number::Phone::StubCountry::SE 1.20170908113149 - Number::Phone::StubCountry::SG 1.20170908113149 - Number::Phone::StubCountry::SH 1.20170908113149 - Number::Phone::StubCountry::SI 1.20170908113149 - Number::Phone::StubCountry::SJ 1.20170908113149 - Number::Phone::StubCountry::SK 1.20170908113149 - Number::Phone::StubCountry::SL 1.20170908113149 - Number::Phone::StubCountry::SM 1.20170908113149 - Number::Phone::StubCountry::SN 1.20170908113149 - Number::Phone::StubCountry::SO 1.20170908113149 - Number::Phone::StubCountry::SR 1.20170908113149 - Number::Phone::StubCountry::SS 1.20170908113149 - Number::Phone::StubCountry::ST 1.20170908113149 - Number::Phone::StubCountry::SV 1.20170908113149 - Number::Phone::StubCountry::SX 1.20170908113149 - Number::Phone::StubCountry::SY 1.20170908113149 - Number::Phone::StubCountry::SZ 1.20170908113149 - Number::Phone::StubCountry::TA 1.20170908113149 - Number::Phone::StubCountry::TC 1.20170908113149 - Number::Phone::StubCountry::TD 1.20170908113149 - Number::Phone::StubCountry::TG 1.20170908113149 - Number::Phone::StubCountry::TH 1.20170908113149 - Number::Phone::StubCountry::TJ 1.20170908113149 - Number::Phone::StubCountry::TK 1.20170908113149 - Number::Phone::StubCountry::TL 1.20170908113149 - Number::Phone::StubCountry::TM 1.20170908113149 - Number::Phone::StubCountry::TN 1.20170908113149 - Number::Phone::StubCountry::TO 1.20170908113149 - Number::Phone::StubCountry::TR 1.20170908113149 - Number::Phone::StubCountry::TT 1.20170908113149 - Number::Phone::StubCountry::TV 1.20170908113149 - Number::Phone::StubCountry::TW 1.20170908113149 - Number::Phone::StubCountry::TZ 1.20170908113149 - Number::Phone::StubCountry::UA 1.20170908113149 - Number::Phone::StubCountry::UG 1.20170908113149 - Number::Phone::StubCountry::US 1.20170908113149 - Number::Phone::StubCountry::UY 1.20170908113149 - Number::Phone::StubCountry::UZ 1.20170908113149 - Number::Phone::StubCountry::VA 1.20170908113149 - Number::Phone::StubCountry::VC 1.20170908113149 - Number::Phone::StubCountry::VE 1.20170908113149 - Number::Phone::StubCountry::VG 1.20170908113149 - Number::Phone::StubCountry::VI 1.20170908113149 - Number::Phone::StubCountry::VN 1.20170908113149 - Number::Phone::StubCountry::VU 1.20170908113149 - Number::Phone::StubCountry::WF 1.20170908113149 - Number::Phone::StubCountry::WS 1.20170908113149 - Number::Phone::StubCountry::YE 1.20170908113149 - Number::Phone::StubCountry::YT 1.20170908113149 - Number::Phone::StubCountry::ZA 1.20170908113149 - Number::Phone::StubCountry::ZM 1.20170908113149 - Number::Phone::StubCountry::ZW 1.20170908113149 - Number::Phone::UK 1.67 + Number::Phone::StubCountry 1.4000 + Number::Phone::StubCountry::AC 1.20180203200231 + Number::Phone::StubCountry::AD 1.20180203200231 + Number::Phone::StubCountry::AE 1.20180203200232 + Number::Phone::StubCountry::AF 1.20180203200232 + Number::Phone::StubCountry::AG 1.20180203200232 + Number::Phone::StubCountry::AI 1.20180203200232 + Number::Phone::StubCountry::AL 1.20180203200232 + Number::Phone::StubCountry::AM 1.20180203200232 + Number::Phone::StubCountry::AO 1.20180203200232 + Number::Phone::StubCountry::AR 1.20180203200232 + Number::Phone::StubCountry::AS 1.20180203200232 + Number::Phone::StubCountry::AT 1.20180203200232 + Number::Phone::StubCountry::AU 1.20180203200232 + Number::Phone::StubCountry::AW 1.20180203200232 + Number::Phone::StubCountry::AX 1.20180203200232 + Number::Phone::StubCountry::AZ 1.20180203200232 + Number::Phone::StubCountry::BA 1.20180203200232 + Number::Phone::StubCountry::BB 1.20180203200232 + Number::Phone::StubCountry::BD 1.20180203200232 + Number::Phone::StubCountry::BE 1.20180203200232 + Number::Phone::StubCountry::BF 1.20180203200232 + Number::Phone::StubCountry::BG 1.20180203200232 + Number::Phone::StubCountry::BH 1.20180203200232 + Number::Phone::StubCountry::BI 1.20180203200232 + Number::Phone::StubCountry::BJ 1.20180203200232 + Number::Phone::StubCountry::BL 1.20180203200232 + Number::Phone::StubCountry::BM 1.20180203200232 + Number::Phone::StubCountry::BN 1.20180203200232 + Number::Phone::StubCountry::BO 1.20180203200232 + Number::Phone::StubCountry::BQ 1.20180203200232 + Number::Phone::StubCountry::BR 1.20180203200232 + Number::Phone::StubCountry::BS 1.20180203200232 + Number::Phone::StubCountry::BT 1.20180203200232 + Number::Phone::StubCountry::BW 1.20180203200232 + Number::Phone::StubCountry::BY 1.20180203200232 + Number::Phone::StubCountry::BZ 1.20180203200232 + Number::Phone::StubCountry::CA 1.20180203200232 + Number::Phone::StubCountry::CC 1.20180203200232 + Number::Phone::StubCountry::CD 1.20180203200233 + Number::Phone::StubCountry::CF 1.20180203200233 + Number::Phone::StubCountry::CG 1.20180203200233 + Number::Phone::StubCountry::CH 1.20180203200233 + Number::Phone::StubCountry::CI 1.20180203200233 + Number::Phone::StubCountry::CK 1.20180203200233 + Number::Phone::StubCountry::CL 1.20180203200233 + Number::Phone::StubCountry::CM 1.20180203200233 + Number::Phone::StubCountry::CN 1.20180203200233 + Number::Phone::StubCountry::CO 1.20180203200234 + Number::Phone::StubCountry::CR 1.20180203200234 + Number::Phone::StubCountry::CU 1.20180203200234 + Number::Phone::StubCountry::CV 1.20180203200234 + Number::Phone::StubCountry::CW 1.20180203200234 + Number::Phone::StubCountry::CX 1.20180203200234 + Number::Phone::StubCountry::CY 1.20180203200234 + Number::Phone::StubCountry::CZ 1.20180203200234 + Number::Phone::StubCountry::DE 1.20180203200234 + Number::Phone::StubCountry::DJ 1.20180203200234 + Number::Phone::StubCountry::DK 1.20180203200234 + Number::Phone::StubCountry::DM 1.20180203200234 + Number::Phone::StubCountry::DO 1.20180203200234 + Number::Phone::StubCountry::DZ 1.20180203200234 + Number::Phone::StubCountry::EC 1.20180203200234 + Number::Phone::StubCountry::EE 1.20180203200234 + Number::Phone::StubCountry::EG 1.20180203200234 + Number::Phone::StubCountry::EH 1.20180203200234 + Number::Phone::StubCountry::ER 1.20180203200234 + Number::Phone::StubCountry::ES 1.20180203200234 + Number::Phone::StubCountry::ET 1.20180203200234 + Number::Phone::StubCountry::FI 1.20180203200234 + Number::Phone::StubCountry::FJ 1.20180203200234 + Number::Phone::StubCountry::FK 1.20180203200234 + Number::Phone::StubCountry::FM 1.20180203200234 + Number::Phone::StubCountry::FO 1.20180203200234 + Number::Phone::StubCountry::FR 1.20180203200234 + Number::Phone::StubCountry::GA 1.20180203200234 + Number::Phone::StubCountry::GB 1.20180203200234 + Number::Phone::StubCountry::GD 1.20180203200234 + Number::Phone::StubCountry::GE 1.20180203200234 + Number::Phone::StubCountry::GF 1.20180203200234 + Number::Phone::StubCountry::GG 1.20180203200234 + Number::Phone::StubCountry::GH 1.20180203200234 + Number::Phone::StubCountry::GI 1.20180203200234 + Number::Phone::StubCountry::GL 1.20180203200234 + Number::Phone::StubCountry::GM 1.20180203200234 + Number::Phone::StubCountry::GN 1.20180203200234 + Number::Phone::StubCountry::GP 1.20180203200234 + Number::Phone::StubCountry::GQ 1.20180203200234 + Number::Phone::StubCountry::GR 1.20180203200234 + Number::Phone::StubCountry::GT 1.20180203200234 + Number::Phone::StubCountry::GU 1.20180203200234 + Number::Phone::StubCountry::GW 1.20180203200234 + Number::Phone::StubCountry::GY 1.20180203200234 + Number::Phone::StubCountry::HK 1.20180203200234 + Number::Phone::StubCountry::HN 1.20180203200234 + Number::Phone::StubCountry::HR 1.20180203200234 + Number::Phone::StubCountry::HT 1.20180203200234 + Number::Phone::StubCountry::HU 1.20180203200234 + Number::Phone::StubCountry::ID 1.20180203200234 + Number::Phone::StubCountry::IE 1.20180203200235 + Number::Phone::StubCountry::IL 1.20180203200235 + Number::Phone::StubCountry::IM 1.20180203200235 + Number::Phone::StubCountry::IN 1.20180203200235 + Number::Phone::StubCountry::IO 1.20180203200235 + Number::Phone::StubCountry::IQ 1.20180203200235 + Number::Phone::StubCountry::IR 1.20180203200235 + Number::Phone::StubCountry::IS 1.20180203200235 + Number::Phone::StubCountry::IT 1.20180203200235 + Number::Phone::StubCountry::JE 1.20180203200235 + Number::Phone::StubCountry::JM 1.20180203200235 + Number::Phone::StubCountry::JO 1.20180203200235 + Number::Phone::StubCountry::JP 1.20180203200235 + Number::Phone::StubCountry::KE 1.20180203200235 + Number::Phone::StubCountry::KG 1.20180203200235 + Number::Phone::StubCountry::KH 1.20180203200235 + Number::Phone::StubCountry::KI 1.20180203200235 + Number::Phone::StubCountry::KM 1.20180203200235 + Number::Phone::StubCountry::KN 1.20180203200235 + Number::Phone::StubCountry::KP 1.20180203200235 + Number::Phone::StubCountry::KR 1.20180203200235 + Number::Phone::StubCountry::KW 1.20180203200235 + Number::Phone::StubCountry::KY 1.20180203200235 + Number::Phone::StubCountry::KZ 1.20180203200235 + Number::Phone::StubCountry::LA 1.20180203200235 + Number::Phone::StubCountry::LB 1.20180203200235 + Number::Phone::StubCountry::LC 1.20180203200235 + Number::Phone::StubCountry::LI 1.20180203200235 + Number::Phone::StubCountry::LK 1.20180203200235 + Number::Phone::StubCountry::LR 1.20180203200235 + Number::Phone::StubCountry::LS 1.20180203200235 + Number::Phone::StubCountry::LT 1.20180203200235 + Number::Phone::StubCountry::LU 1.20180203200235 + Number::Phone::StubCountry::LV 1.20180203200235 + Number::Phone::StubCountry::LY 1.20180203200235 + Number::Phone::StubCountry::MA 1.20180203200235 + Number::Phone::StubCountry::MC 1.20180203200235 + Number::Phone::StubCountry::MD 1.20180203200235 + Number::Phone::StubCountry::ME 1.20180203200235 + Number::Phone::StubCountry::MF 1.20180203200235 + Number::Phone::StubCountry::MG 1.20180203200235 + Number::Phone::StubCountry::MH 1.20180203200235 + Number::Phone::StubCountry::MK 1.20180203200235 + Number::Phone::StubCountry::ML 1.20180203200235 + Number::Phone::StubCountry::MM 1.20180203200235 + Number::Phone::StubCountry::MN 1.20180203200235 + Number::Phone::StubCountry::MO 1.20180203200235 + Number::Phone::StubCountry::MP 1.20180203200235 + Number::Phone::StubCountry::MQ 1.20180203200235 + Number::Phone::StubCountry::MR 1.20180203200235 + Number::Phone::StubCountry::MS 1.20180203200235 + Number::Phone::StubCountry::MT 1.20180203200235 + Number::Phone::StubCountry::MU 1.20180203200235 + Number::Phone::StubCountry::MV 1.20180203200235 + Number::Phone::StubCountry::MW 1.20180203200235 + Number::Phone::StubCountry::MX 1.20180203200235 + Number::Phone::StubCountry::MY 1.20180203200235 + Number::Phone::StubCountry::MZ 1.20180203200235 + Number::Phone::StubCountry::NA 1.20180203200235 + Number::Phone::StubCountry::NC 1.20180203200235 + Number::Phone::StubCountry::NE 1.20180203200235 + Number::Phone::StubCountry::NF 1.20180203200235 + Number::Phone::StubCountry::NG 1.20180203200235 + Number::Phone::StubCountry::NI 1.20180203200235 + Number::Phone::StubCountry::NL 1.20180203200235 + Number::Phone::StubCountry::NO 1.20180203200235 + Number::Phone::StubCountry::NP 1.20180203200235 + Number::Phone::StubCountry::NR 1.20180203200235 + Number::Phone::StubCountry::NU 1.20180203200235 + Number::Phone::StubCountry::NZ 1.20180203200235 + Number::Phone::StubCountry::OM 1.20180203200235 + Number::Phone::StubCountry::PA 1.20180203200235 + Number::Phone::StubCountry::PE 1.20180203200235 + Number::Phone::StubCountry::PF 1.20180203200235 + Number::Phone::StubCountry::PG 1.20180203200235 + Number::Phone::StubCountry::PH 1.20180203200235 + Number::Phone::StubCountry::PK 1.20180203200235 + Number::Phone::StubCountry::PL 1.20180203200235 + Number::Phone::StubCountry::PM 1.20180203200235 + Number::Phone::StubCountry::PR 1.20180203200235 + Number::Phone::StubCountry::PS 1.20180203200235 + Number::Phone::StubCountry::PT 1.20180203200235 + Number::Phone::StubCountry::PW 1.20180203200235 + Number::Phone::StubCountry::PY 1.20180203200235 + Number::Phone::StubCountry::QA 1.20180203200235 + Number::Phone::StubCountry::RE 1.20180203200235 + Number::Phone::StubCountry::RO 1.20180203200235 + Number::Phone::StubCountry::RS 1.20180203200235 + Number::Phone::StubCountry::RU 1.20180203200235 + Number::Phone::StubCountry::RW 1.20180203200235 + Number::Phone::StubCountry::SA 1.20180203200236 + Number::Phone::StubCountry::SB 1.20180203200236 + Number::Phone::StubCountry::SC 1.20180203200236 + Number::Phone::StubCountry::SD 1.20180203200236 + Number::Phone::StubCountry::SE 1.20180203200236 + Number::Phone::StubCountry::SG 1.20180203200236 + Number::Phone::StubCountry::SH 1.20180203200236 + Number::Phone::StubCountry::SI 1.20180203200236 + Number::Phone::StubCountry::SJ 1.20180203200236 + Number::Phone::StubCountry::SK 1.20180203200236 + Number::Phone::StubCountry::SL 1.20180203200236 + Number::Phone::StubCountry::SM 1.20180203200236 + Number::Phone::StubCountry::SN 1.20180203200236 + Number::Phone::StubCountry::SO 1.20180203200236 + Number::Phone::StubCountry::SR 1.20180203200236 + Number::Phone::StubCountry::SS 1.20180203200236 + Number::Phone::StubCountry::ST 1.20180203200236 + Number::Phone::StubCountry::SV 1.20180203200236 + Number::Phone::StubCountry::SX 1.20180203200236 + Number::Phone::StubCountry::SY 1.20180203200236 + Number::Phone::StubCountry::SZ 1.20180203200236 + Number::Phone::StubCountry::TA 1.20180203200236 + Number::Phone::StubCountry::TC 1.20180203200236 + Number::Phone::StubCountry::TD 1.20180203200236 + Number::Phone::StubCountry::TG 1.20180203200236 + Number::Phone::StubCountry::TH 1.20180203200236 + Number::Phone::StubCountry::TJ 1.20180203200236 + Number::Phone::StubCountry::TK 1.20180203200236 + Number::Phone::StubCountry::TL 1.20180203200236 + Number::Phone::StubCountry::TM 1.20180203200236 + Number::Phone::StubCountry::TN 1.20180203200236 + Number::Phone::StubCountry::TO 1.20180203200236 + Number::Phone::StubCountry::TR 1.20180203200236 + Number::Phone::StubCountry::TT 1.20180203200236 + Number::Phone::StubCountry::TV 1.20180203200236 + Number::Phone::StubCountry::TW 1.20180203200236 + Number::Phone::StubCountry::TZ 1.20180203200236 + Number::Phone::StubCountry::UA 1.20180203200236 + Number::Phone::StubCountry::UG 1.20180203200236 + Number::Phone::StubCountry::US 1.20180203200236 + Number::Phone::StubCountry::UY 1.20180203200236 + Number::Phone::StubCountry::UZ 1.20180203200236 + Number::Phone::StubCountry::VA 1.20180203200236 + Number::Phone::StubCountry::VC 1.20180203200236 + Number::Phone::StubCountry::VE 1.20180203200236 + Number::Phone::StubCountry::VG 1.20180203200236 + Number::Phone::StubCountry::VI 1.20180203200236 + Number::Phone::StubCountry::VN 1.20180203200236 + Number::Phone::StubCountry::VU 1.20180203200236 + Number::Phone::StubCountry::WF 1.20180203200236 + Number::Phone::StubCountry::WS 1.20180203200236 + Number::Phone::StubCountry::YE 1.20180203200236 + Number::Phone::StubCountry::YT 1.20180203200236 + Number::Phone::StubCountry::ZA 1.20180203200236 + Number::Phone::StubCountry::ZM 1.20180203200236 + Number::Phone::StubCountry::ZW 1.20180203200236 + Number::Phone::UK 1.68 Number::Phone::UK::Data 2.0 Number::Phone::UK::Exchanges 1.20060823121334 Number::Phone::UK::GG 1 diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm index 86e3e8434..95f8bb9a2 100644 --- a/perllib/FixMyStreet/App/Controller/Auth.pm +++ b/perllib/FixMyStreet/App/Controller/Auth.pm @@ -85,6 +85,12 @@ sub sign_in : Private { my $parsed = FixMyStreet::SMS->parse_username($username); if ($parsed->{username} && $password && $c->forward('authenticate', [ $parsed->{type}, $parsed->{username}, $password ])) { + # Upgrade hash count if necessary + my $cost = sprintf("%02d", FixMyStreet::DB::Result::User->cost); + if ($c->user->password !~ /^\$2a\$$cost\$/) { + $c->user->update({ password => $password }); + } + # unless user asked to be remembered limit the session to browser $c->set_session_cookie_expire(0) unless $remember_me; diff --git a/perllib/FixMyStreet/App/Controller/Auth/Profile.pm b/perllib/FixMyStreet/App/Controller/Auth/Profile.pm index d1fb32c41..2d8ae081e 100644 --- a/perllib/FixMyStreet/App/Controller/Auth/Profile.pm +++ b/perllib/FixMyStreet/App/Controller/Auth/Profile.pm @@ -19,7 +19,7 @@ verifying email, phone, password. =cut -sub auto { +sub auto : Private { my ( $self, $c ) = @_; $c->detach( '/auth/redirect' ) unless $c->user; @@ -49,8 +49,17 @@ sub change_password : Path('/auth/change_password') { my $new = $c->get_param('new_password') // ''; my $confirm = $c->get_param('confirm') // ''; + my $password_error; + + # Check existing password, if available + if ($c->user->password) { + my $current = $c->get_param('current_password') // ''; + $c->stash->{current_password} = $current; + $password_error = 'incorrect' unless $c->user->check_password($current); + } + # check for errors - my $password_error = + $password_error ||= !$new && !$confirm ? 'missing' : $new ne $confirm ? 'mismatch' : !$c->forward('/auth/test_password', [ $new ]) ? 'failed' @@ -63,10 +72,17 @@ sub change_password : Path('/auth/change_password') { return; } - # we should have a usable password - save it to the user - $c->user->obj->update( { password => $new } ); - $c->stash->{password_changed} = 1; - + if ($c->user->password) { + # we should have a usable password - save it to the user + $c->user->obj->update( { password => $new } ); + $c->stash->{password_changed} = 1; + } else { + # Set up arguments for code sign in + $c->set_param('username', $c->user->username); + $c->set_param('password_register', $new); + $c->set_param('r', 'auth/change_password/success'); + $c->detach('/auth/code_sign_in'); + } } =head2 change_email @@ -149,6 +165,12 @@ sub change_phone_success : Path('/auth/change_phone/success') { $c->res->redirect('/my'); } +sub change_password_success : Path('/auth/change_password/success') { + my ( $self, $c ) = @_; + $c->flash->{flash_message} = _('Your password has been changed'); + $c->res->redirect('/my'); +} + sub generate_token : Path('/auth/generate_token') { my ($self, $c) = @_; diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm index 23324e763..00f099278 100644 --- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm +++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm @@ -15,8 +15,6 @@ sub is_council_with_case_management { return FixMyStreet->config('STAGING_SITE'); } -sub map_type { 'OSM' } - sub base_url { my $self = shift; return $self->next::method() if FixMyStreet->config('STAGING_SITE'); diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index d02039ac3..97f2132b1 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -125,11 +125,15 @@ with 'FixMyStreet::Roles::Extra'; __PACKAGE__->many_to_many( planned_reports => 'user_planned_reports', 'report' ); +sub cost { + FixMyStreet->test_mode ? 1 : 12; +} + __PACKAGE__->add_columns( "password" => { encode_column => 1, encode_class => 'Crypt::Eksblowfish::Bcrypt', - encode_args => { cost => 8 }, + encode_args => { cost => cost() }, encode_check_method => 'check_password', }, ); @@ -150,8 +154,9 @@ sub username { sub phone_display { my $self = shift; return $self->phone unless $self->phone; + my $country = FixMyStreet->config('PHONE_COUNTRY'); my $parsed = FixMyStreet::SMS->parse_username($self->phone); - return $parsed->{phone} ? $parsed->{phone}->format : $self->phone; + return $parsed->{phone} ? $parsed->{phone}->format_for_country($country) : $self->phone; } sub latest_anonymity { diff --git a/perllib/FixMyStreet/Test.pm b/perllib/FixMyStreet/Test.pm index 572ae0a44..aa1a63c21 100644 --- a/perllib/FixMyStreet/Test.pm +++ b/perllib/FixMyStreet/Test.pm @@ -7,6 +7,13 @@ use warnings FATAL => 'all'; use utf8; use Test::More; use mySociety::Locale; + +BEGIN { + use FixMyStreet; + FixMyStreet->test_mode(1); + mySociety::Locale::gettext_domain('FixMyStreet', 1); +} + use FixMyStreet::DB; my $db = FixMyStreet::DB->schema->storage; @@ -19,12 +26,6 @@ sub import { $db->txn_begin; } -BEGIN { - use FixMyStreet; - FixMyStreet->test_mode(1); - mySociety::Locale::gettext_domain('FixMyStreet', 1); -} - END { $db->txn_rollback if $db; } diff --git a/t/app/controller/auth_profile.t b/t/app/controller/auth_profile.t index 224365eb6..de2ad6534 100644 --- a/t/app/controller/auth_profile.t +++ b/t/app/controller/auth_profile.t @@ -75,9 +75,68 @@ subtest "Test change password page" => sub { { form_name => 'change_password', fields => - { new_password => $test_password, confirm => $test_password, }, + { new_password => 'new_password', confirm => 'new_password', }, }, - "change_password with '$test_password' and '$test_password'" + "change_password with 'new_password' and 'new_password'" + ); + is $mech->uri->path, '/auth/change_password', + "still on change password page"; + $mech->content_contains('check your email'); + + $link = $mech->get_link_from_email; + $mech->get_ok($link); + is $mech->uri->path, '/my', "redirected to /my"; + + $mech->content_contains( 'password has been changed', + "found password changed" ); + + $user->discard_changes(); + ok $user->password, "user now has a password"; +}; + +# Change password, when already got one +subtest "Test change password page with current password" => sub { + $mech->get_ok('/auth/change_password'); + + ok my $form = $mech->form_name('change_password'), + "found change password form"; + is_deeply [ sort grep { $_ } map { $_->name } $form->inputs ], # + [ 'confirm', 'current_password', 'new_password', 'token' ], + "check we got expected fields (ie not old_password)"; + + # check the various ways the form can be wrong + for my $test ( + { current => '', new => '', conf => '', err => 'check the passwords', }, + { current => 'new_password', new => '', conf => '', err => 'enter a password', }, + { current => 'new_password', new => 'secret', conf => '', err => 'do not match', }, + { current => 'new_password', new => '', conf => 'secret', err => 'do not match', }, + { current => 'new_password', new => 'secret', conf => 'not_secret', err => 'do not match', }, + ) + { + $mech->get_ok('/auth/change_password'); + $mech->content_lacks( $test->{err}, "did not find expected error" ); + $mech->submit_form_ok( + { + form_name => 'change_password', + fields => + { current_password => $test->{current}, new_password => $test->{new}, confirm => $test->{conf}, }, + }, + "change_password with '$test->{current}', '$test->{new}' and '$test->{conf}'" + ); + $mech->content_contains( $test->{err}, "found expected error" ); + } + + my $user = FixMyStreet::App->model('DB::User')->find( { email => $test_email } ); + ok $user, "got a user"; + + $mech->get_ok('/auth/change_password'); + $mech->submit_form_ok( + { + form_name => 'change_password', + fields => + { current_password => 'new_password', new_password => $test_password, confirm => $test_password }, + }, + "change_password with 'new_password' and '$test_password'" ); is $mech->uri->path, '/auth/change_password', "still on change password page"; @@ -92,12 +151,12 @@ subtest 'check password length/common' => sub { $mech->get_ok('/auth/change_password'); $mech->submit_form_ok({ form_name => 'change_password', - fields => { new_password => 'short', confirm => 'short' }, + fields => { current_password => $test_password, new_password => 'short', confirm => 'short' }, }); $mech->content_contains("Please make sure your password is at least"); $mech->submit_form_ok({ form_name => 'change_password', - fields => { new_password => 'common', confirm => 'common' }, + fields => { current_password => $test_password, new_password => 'common', confirm => 'common' }, }); $mech->content_contains("Please choose a less commonly-used password"); }; diff --git a/t/app/controller/report_new_text.t b/t/app/controller/report_new_text.t index 734b9dbb4..cb07e57ee 100644 --- a/t/app/controller/report_new_text.t +++ b/t/app/controller/report_new_text.t @@ -45,8 +45,8 @@ foreach my $test ( password_register => '', password_sign_in => '', }, changes => { - username => '+44 121 496 0000', - phone => '+44 121 496 0000', + username => '0121 496 0000', + phone => '0121 496 0000', }, errors => [ 'Please enter a mobile number', ], }, diff --git a/t/app/controller/report_update_text.t b/t/app/controller/report_update_text.t index 45b4e78c2..a3b767221 100644 --- a/t/app/controller/report_update_text.t +++ b/t/app/controller/report_update_text.t @@ -95,7 +95,7 @@ for my $test ( password_sign_in => '', }, changes => { - username => '+44 121 496 0000', + username => '0121 496 0000', }, field_errors => [ 'Please enter a mobile number' ] }, diff --git a/templates/web/base/auth/change_password.html b/templates/web/base/auth/change_password.html index 543a33ed5..7a38e0134 100644 --- a/templates/web/base/auth/change_password.html +++ b/templates/web/base/auth/change_password.html @@ -1,7 +1,9 @@ [% SET bclass = 'authpage'; SET bclass = 'fullwidthpage' IF password_changed; -INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass +SET title = loc('Set password'); +SET title = loc('Change password') IF c.user.password; +INCLUDE 'header.html', title = title bodyclass = bclass %] [% IF password_changed %] @@ -13,7 +15,7 @@ INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass [% ELSE %] -<h1>[% loc('Change password') %]</h1> +<h1>[% title %]</h1> <form action="[% c.uri_for_action('/auth/profile/change_password') %]" method="post" name="change_password" class="fieldset"> <input type="hidden" name="token" value="[% csrf_token %]"> @@ -33,6 +35,14 @@ INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass <div class="form-error">[% loc_password_error %]</div> [% END %] +[% IF c.user.password %] + <div class="form-field"> + <label for="current_password">[% loc('Current password:') %]</label> + <input class="form-control" type="password" name="current_password" value="[% current_password | html %]"> + </div> + <hr> +[% END %] + <div class="form-field"> <label for="new_password">[% loc('New password:') %]</label> <input class="form-control" type="password" name="new_password" value="[% new_password | html %]"> @@ -42,7 +52,7 @@ INCLUDE 'header.html', title = loc('Change password'), bodyclass = bclass <input class="form-control" type="password" name="confirm" value="[% confirm | html %]"> </div> <div class="final-submit"> - <input type="submit" class="btn" value="[% loc('Change password') %]"> + <input type="submit" class="btn" value="[% title %]"> </div> </fieldset> diff --git a/templates/web/base/auth/change_phone.html b/templates/web/base/auth/change_phone.html index 27a2f63dd..62e9fa6d6 100644 --- a/templates/web/base/auth/change_phone.html +++ b/templates/web/base/auth/change_phone.html @@ -18,7 +18,7 @@ END [% IF c.user.phone_verified OR (c.user.phone AND NOT verifying) %] [% loc('Your phone number') %]: [% c.user.phone_display %] [% ELSIF c.user.phone %] -[% DEFAULT username = c.user.phone %] +[% DEFAULT username = c.user.phone_display %] [% END %] <form method="post" name="change_phone"> diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index 5088332ce..eb2564157 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -17,7 +17,7 @@ [% IF permissions.report_inspect AND problem.user.phone %] <p> <strong>[% loc('Phone Reporter:') %]</strong> - <a href="tel:[% problem.user.phone | html %]">[% problem.user.phone | html %]</a> + <a href="tel:[% problem.user.phone | html %]">[% problem.user.phone_display | html %]</a> </p> [% END %] <p> diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html index bd4ce1cf7..04a93ef74 100644 --- a/templates/web/base/report/new/form_user_loggedin.html +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -31,7 +31,7 @@ [% IF c.user.phone_verified %] <label for="form_phone">[% loc('Phone number') %]</label> - <input class="form-control" id="form_phone" name="phone" disabled type="text" value="[% c.user.phone | html %]"> + <input class="form-control" id="form_phone" name="phone" disabled type="text" value="[% c.user.phone_display | html %]"> [% END %] [% IF c.user.email_verified %] @@ -65,7 +65,7 @@ [% IF NOT c.user.phone_verified %] <label for="form_phone">[% loc('Phone number (optional)') %]</label> - <input class="form-control" type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone"> + <input class="form-control" type="text" value="[% report.user.phone_display | html %]" name="phone" id="form_phone"> [% END %] [% IF NOT c.user.email_verified %] <label for="form_username">[% loc('Email address (optional)') %]</label> diff --git a/templates/web/fixamingata/report/new/form_user_loggedout.html b/templates/web/fixamingata/report/new/form_user_loggedout.html index 7505730e5..bbb9864a3 100644 --- a/templates/web/fixamingata/report/new/form_user_loggedout.html +++ b/templates/web/fixamingata/report/new/form_user_loggedout.html @@ -27,7 +27,7 @@ </div> <label for="form_phone">[% loc('Phone number (optional)') %]</label> - <input type="text" class="form-control" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> + <input type="text" class="form-control" value="[% report.user.phone_display | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> <div class="general-notes form-focus-hidden"> <p>[% loc('We never show your email address or phone number.') %]</p> |