diff options
author | David King <imkingdavid@gmail.com> | 2013-09-10 15:48:29 -0700 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2013-09-10 15:48:29 -0700 |
commit | fc1dfd779da37128382322ffdc75bf751a0834a3 (patch) | |
tree | 5d43d1847832169510c55c3358c42ccd095b2128 /phpBB/phpbb/db | |
parent | 71aeec40f6c4c5e6a69699486b618c2ba67dff2d (diff) | |
parent | 18f6a161017f5350d9487181f4b4ed66a53a0284 (diff) | |
download | forums-fc1dfd779da37128382322ffdc75bf751a0834a3.tar forums-fc1dfd779da37128382322ffdc75bf751a0834a3.tar.gz forums-fc1dfd779da37128382322ffdc75bf751a0834a3.tar.bz2 forums-fc1dfd779da37128382322ffdc75bf751a0834a3.tar.xz forums-fc1dfd779da37128382322ffdc75bf751a0834a3.zip |
Merge remote-tracking branch 'Hardolaf/feature/oauth' into develop
Diffstat (limited to 'phpBB/phpbb/db')
-rw-r--r-- | phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php new file mode 100644 index 0000000000..8706d14798 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php @@ -0,0 +1,71 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +class phpbb_db_migration_data_310_auth_provider_oauth extends phpbb_db_migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'oauth_tokens' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), // phpbb_users.user_id + 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set + 'provider' => array('VCHAR', ''), // Name of the OAuth provider + 'oauth_token' => array('MTEXT', ''), // Serialized token + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'provider' => array('INDEX', 'provider'), + ), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'provider' => array('VCHAR', ''), + 'oauth_provider_id' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => array( + 'user_id', + 'provider', + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'oauth_tokens', + $this->table_prefix . 'oauth_accounts', + ), + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'ucp', + 'UCP_AUTH_LINK', + array( + 'module_basename' => 'ucp_auth_link', + 'modes' => array('auth_link'), + ), + )), + ); + } +} |