From df8e5f4c3c333be677489d2317f6991598a6cebf Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 11 Aug 2013 15:04:25 -0500 Subject: [feature/passwords] Move migrations file to phpbb folder PHPBB3-11610 --- phpBB/phpbb/db/migration/data/310/crypto.php | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/310/crypto.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/310/crypto.php b/phpBB/phpbb/db/migration/data/310/crypto.php new file mode 100644 index 0000000000..c8ac8360ad --- /dev/null +++ b/phpBB/phpbb/db/migration/data/310/crypto.php @@ -0,0 +1,63 @@ +db->sql_return_on_error(true); + // Set user_password to 64 character long string + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_password = '" . md5('foobar') . md5('foobar') . "' + WHERE user_id = '" . ANONYMOUS . "'"; + $this->db->sql_query($sql); + $this->db->sql_return_on_error(false); + + if ($this->db->sql_affectedrows()) + { + $ret = true; + } + + // Reset user password + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_password = '' + WHERE user_id = '" . ANONYMOUS . "'"; + $this->db->sql_query($sql); + + return $ret; + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_11'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:40', ''), + ), + ), + ); + } +} -- cgit v1.2.1 From 1970c69c8c9d6b898680aa3e94d5222c8f150d58 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 20 Sep 2013 18:10:42 +0200 Subject: [feature/passwords] Rename migrations file to passwords Also removed the effectively_installed() check that is not needed according to EXreaction. PHPBB3-11610 --- phpBB/phpbb/db/migration/data/310/crypto.php | 63 ------------------------- phpBB/phpbb/db/migration/data/310/passwords.php | 38 +++++++++++++++ 2 files changed, 38 insertions(+), 63 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/310/crypto.php create mode 100644 phpBB/phpbb/db/migration/data/310/passwords.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/310/crypto.php b/phpBB/phpbb/db/migration/data/310/crypto.php deleted file mode 100644 index c8ac8360ad..0000000000 --- a/phpBB/phpbb/db/migration/data/310/crypto.php +++ /dev/null @@ -1,63 +0,0 @@ -db->sql_return_on_error(true); - // Set user_password to 64 character long string - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_password = '" . md5('foobar') . md5('foobar') . "' - WHERE user_id = '" . ANONYMOUS . "'"; - $this->db->sql_query($sql); - $this->db->sql_return_on_error(false); - - if ($this->db->sql_affectedrows()) - { - $ret = true; - } - - // Reset user password - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_password = '' - WHERE user_id = '" . ANONYMOUS . "'"; - $this->db->sql_query($sql); - - return $ret; - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_password' => array('VCHAR:255', ''), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_password' => array('VCHAR:40', ''), - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/passwords.php b/phpBB/phpbb/db/migration/data/310/passwords.php new file mode 100644 index 0000000000..0611abb79d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/310/passwords.php @@ -0,0 +1,38 @@ + array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:40', ''), + ), + ), + ); + } +} -- cgit v1.2.1 From 5bc5e4716cc7437941e9cdb6a2b15ed1f4f19b95 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 27 Sep 2013 16:58:06 +0200 Subject: [feature/passwords] More changes due to namespacing PHPBB3-11610 --- phpBB/phpbb/db/migration/data/310/passwords.php | 38 ---------------------- phpBB/phpbb/db/migration/data/v310/passwords.php | 40 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 38 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/310/passwords.php create mode 100644 phpBB/phpbb/db/migration/data/v310/passwords.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/310/passwords.php b/phpBB/phpbb/db/migration/data/310/passwords.php deleted file mode 100644 index 0611abb79d..0000000000 --- a/phpBB/phpbb/db/migration/data/310/passwords.php +++ /dev/null @@ -1,38 +0,0 @@ - array( - $this->table_prefix . 'users' => array( - 'user_password' => array('VCHAR:255', ''), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_password' => array('VCHAR:40', ''), - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v310/passwords.php b/phpBB/phpbb/db/migration/data/v310/passwords.php new file mode 100644 index 0000000000..c422f681ba --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/passwords.php @@ -0,0 +1,40 @@ + array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:40', ''), + ), + ), + ); + } +} -- cgit v1.2.1 From 841dd6b19f08a575fe6d6e4794bdb9729e2ce6b8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 13 Oct 2013 11:33:59 +0200 Subject: [feature/passwords] Modify forum_password column type for new hash types PHPBB3-11610 --- phpBB/phpbb/db/migration/data/v310/passwords.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/passwords.php b/phpBB/phpbb/db/migration/data/v310/passwords.php index c422f681ba..3422f75917 100644 --- a/phpBB/phpbb/db/migration/data/v310/passwords.php +++ b/phpBB/phpbb/db/migration/data/v310/passwords.php @@ -20,8 +20,11 @@ class passwords extends \phpbb\db\migration\migration { return array( 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_password' => array('VCHAR:255', ''), + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:255', ''), + ), + $this->table_prefix . 'forums' => array( + 'forum_password' => array('VCHAR:255', ''), ), ), ); @@ -31,8 +34,11 @@ class passwords extends \phpbb\db\migration\migration { return array( 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_password' => array('VCHAR:40', ''), + $this->table_prefix . 'users' => array( + 'user_password' => array('VCHAR:40', ''), + ), + $this->table_prefix . 'forums' => array( + 'forum_password' => array('VCHAR:40', ''), ), ), ); -- cgit v1.2.1