1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 01:04:16 +02:00

Update ProcessForgotPassword for IPv6 address suppport

This commit is contained in:
Ryan Cramer
2021-08-13 15:05:49 -04:00
parent 035e947a5a
commit 77fbeccb59

View File

@@ -43,7 +43,7 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
return array(
'title' => __('Forgot Password', __FILE__), // getModuleInfo title
'summary' => __('Provides password reset/email capability for the Login process.', __FILE__), // getModuleInfo summary
'version' => 103,
'version' => 104,
'permanent' => false,
'permission' => 'page-view',
);
@@ -1034,7 +1034,7 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
"name varchar(128) NOT NULL, " .
"token char(32) NOT NULL, " .
"ts INT unsigned NOT NULL, " .
"ip varchar(15) NOT NULL, " .
"ip varchar(45) NOT NULL, " .
"KEY token (token), " .
"KEY ts (ts), " .
"KEY ip (ip) " .
@@ -1053,6 +1053,15 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
$database = $this->wire('database');
$database->exec("DROP TABLE `" . self::table ."`");
}
public function ___upgrade($fromVersion, $toVersion) {
$database = $this->wire()->database;
$table = self::table;
if($fromVersion <= 103) {
$database->exec("ALTER TABLE `$table` MODIFY ip VARCHAR(45) NOT NULL");
$this->message("Added IPv6 address support");
}
}
/**
* Module configuration