diff --git a/resources/sprite/login_1x/WordPressCOM.png b/resources/sprite/login_1x/WordPressCOM.png new file mode 100644 index 0000000000..3ca59517c3 Binary files /dev/null and b/resources/sprite/login_1x/WordPressCOM.png differ diff --git a/resources/sprite/login_2x/WordPressCOM.png b/resources/sprite/login_2x/WordPressCOM.png new file mode 100644 index 0000000000..2c901af675 Binary files /dev/null and b/resources/sprite/login_2x/WordPressCOM.png differ diff --git a/resources/sprite/manifest/login.json b/resources/sprite/manifest/login.json index 3b3d8876f4..5e9026356d 100644 --- a/resources/sprite/manifest/login.json +++ b/resources/sprite/manifest/login.json @@ -1,92 +1,97 @@ { "version" : 1, "sprites" : { - "login-Amazon" : { + "login-Amazon" : { "name" : "login-Amazon", "rule" : ".login-Amazon", "hash" : "5961e41c525ef46c88558616fcf23272" }, - "login-Asana" : { + "login-Asana" : { "name" : "login-Asana", "rule" : ".login-Asana", "hash" : "30df492eab339fa64c9ae9b21bb46a18" }, - "login-Disqus" : { + "login-Disqus" : { "name" : "login-Disqus", "rule" : ".login-Disqus", "hash" : "5f46ac50a5d9d13245971c298f49e13b" }, - "login-Dropbox" : { + "login-Dropbox" : { "name" : "login-Dropbox", "rule" : ".login-Dropbox", "hash" : "572ab36301762414365b68c0bc185ac5" }, - "login-Facebook" : { + "login-Facebook" : { "name" : "login-Facebook", "rule" : ".login-Facebook", "hash" : "2b1511f5b4d12076dd9086d1bb187b28" }, - "login-Generic" : { + "login-Generic" : { "name" : "login-Generic", "rule" : ".login-Generic", "hash" : "60d75c38668ffd6eea91a40e66186601" }, - "login-Github" : { + "login-Github" : { "name" : "login-Github", "rule" : ".login-Github", "hash" : "633696beb8c1eaac642ce4955be917d8" }, - "login-Google" : { + "login-Google" : { "name" : "login-Google", "rule" : ".login-Google", "hash" : "b7d3962a31df1e6c13e0a3c97c08f11d" }, - "login-HTTP" : { + "login-HTTP" : { "name" : "login-HTTP", "rule" : ".login-HTTP", "hash" : "6fcf0f666c0f6f1e1cd8f397b41ed176" }, - "login-Jira" : { + "login-Jira" : { "name" : "login-Jira", "rule" : ".login-Jira", "hash" : "0ddadec77a95c1efc398886252ebeda9" }, - "login-LDAP" : { + "login-LDAP" : { "name" : "login-LDAP", "rule" : ".login-LDAP", "hash" : "5b4e01ddf35cd40c8f061c90abc89b6c" }, - "login-Linkedin" : { + "login-Linkedin" : { "name" : "login-Linkedin", "rule" : ".login-Linkedin", "hash" : "0dd89825046fa4fd0fe402aa2cd55fd1" }, - "login-Openid" : { + "login-Openid" : { "name" : "login-Openid", "rule" : ".login-Openid", "hash" : "9267ffbb8d4e6dee409c4d8fa2d50c0a" }, - "login-Persona" : { + "login-Persona" : { "name" : "login-Persona", "rule" : ".login-Persona", "hash" : "949faf7bf5ed377c06aa480da1f42b74" }, - "login-Phabricator" : { + "login-Phabricator" : { "name" : "login-Phabricator", "rule" : ".login-Phabricator", "hash" : "fad258eb347a1ccf5800b0ee2d8e6e49" }, - "login-TwitchTV" : { + "login-TwitchTV" : { "name" : "login-TwitchTV", "rule" : ".login-TwitchTV", "hash" : "dbaa3f5e58fceb86598b2951fc5f9508" }, - "login-Twitter" : { + "login-Twitter" : { "name" : "login-Twitter", "rule" : ".login-Twitter", "hash" : "0b64983507a720b365474b778a966bab" }, - "login-Yahoo" : { + "login-WordPressCOM" : { + "name" : "login-WordPressCOM", + "rule" : ".login-WordPressCOM", + "hash" : "c22a183bfb1e46deeab864223ec48db9" + }, + "login-Yahoo" : { "name" : "login-Yahoo", "rule" : ".login-Yahoo", "hash" : "1cc6fceee294045fe6d1c1d3aa31d2c1" diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 4bfae19988..dbcb00ea2b 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1254,6 +1254,7 @@ phutil_register_library_map(array( 'PhabricatorAuthProviderOAuthGitHub' => 'applications/auth/provider/PhabricatorAuthProviderOAuthGitHub.php', 'PhabricatorAuthProviderOAuthGoogle' => 'applications/auth/provider/PhabricatorAuthProviderOAuthGoogle.php', 'PhabricatorAuthProviderOAuthTwitch' => 'applications/auth/provider/PhabricatorAuthProviderOAuthTwitch.php', + 'PhabricatorAuthProviderOAuthWordPress' => 'applications/auth/provider/PhabricatorAuthProviderOAuthWordPress.php', 'PhabricatorAuthProviderPassword' => 'applications/auth/provider/PhabricatorAuthProviderPassword.php', 'PhabricatorAuthProviderPersona' => 'applications/auth/provider/PhabricatorAuthProviderPersona.php', 'PhabricatorAuthRegisterController' => 'applications/auth/controller/PhabricatorAuthRegisterController.php', @@ -4041,6 +4042,7 @@ phutil_register_library_map(array( 'PhabricatorAuthProviderOAuthGitHub' => 'PhabricatorAuthProviderOAuth2', 'PhabricatorAuthProviderOAuthGoogle' => 'PhabricatorAuthProviderOAuth2', 'PhabricatorAuthProviderOAuthTwitch' => 'PhabricatorAuthProviderOAuth2', + 'PhabricatorAuthProviderOAuthWordPress' => 'PhabricatorAuthProviderOAuth2', 'PhabricatorAuthProviderPassword' => 'PhabricatorAuthProvider', 'PhabricatorAuthProviderPersona' => 'PhabricatorAuthProvider', 'PhabricatorAuthRegisterController' => 'PhabricatorAuthController', diff --git a/src/applications/auth/provider/PhabricatorAuthProviderOAuthWordPress.php b/src/applications/auth/provider/PhabricatorAuthProviderOAuthWordPress.php new file mode 100644 index 0000000000..78a72c41da --- /dev/null +++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuthWordPress.php @@ -0,0 +1,38 @@ +getLoginURI()); + + return pht( + "To configure WordPress.com OAuth, create a new WordPress.com ". + "Application here:\n\n". + "https://developer.wordpress.com/apps/new/.". + "\n\n". + "You should use these settings in your application:". + "\n\n". + " - **URL:** Set this to your full domain with protocol. For this ". + " Phabricator install, the correct value is: `%s`\n". + " - **Redirect URL**: Set this to: `%s`\n". + "\n\n". + "Once you've created an application, copy the **Client ID** and ". + "**Client Secret** into the fields above.", + $uri, + $callback_uri); + } + + protected function newOAuthAdapter() { + return new PhutilAuthAdapterOAuthWordPress(); + } + + protected function getLoginIcon() { + return 'WordPressCOM'; + } +} diff --git a/webroot/rsrc/css/sprite-login.css b/webroot/rsrc/css/sprite-login.css index 4e87b36693..7fe3755e4f 100644 --- a/webroot/rsrc/css/sprite-login.css +++ b/webroot/rsrc/css/sprite-login.css @@ -86,6 +86,10 @@ only screen and (-webkit-min-device-pixel-ratio: 1.5) { background-position: 0px -140px; } -.login-Yahoo { +.login-WordPressCOM { background-position: -35px -140px; } + +.login-Yahoo { + background-position: -70px -140px; +} diff --git a/webroot/rsrc/image/sprite-login-X2.png b/webroot/rsrc/image/sprite-login-X2.png index fde560374b..43a2797b7f 100644 Binary files a/webroot/rsrc/image/sprite-login-X2.png and b/webroot/rsrc/image/sprite-login-X2.png differ diff --git a/webroot/rsrc/image/sprite-login.png b/webroot/rsrc/image/sprite-login.png index 1133fd21e8..7f59282048 100644 Binary files a/webroot/rsrc/image/sprite-login.png and b/webroot/rsrc/image/sprite-login.png differ