@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Slack authentication adapter

Summary: For phabricator. Adds a Slack auth adapater and icon.

Test Plan:
Create a new Slack Application for login, generate id and secret. Activate login and registration for Slack. Create a new account with Slack credentials. Log out. Log in with Slack credentials. Set my avatar with Slack. Slack. Slack.

{F1802649}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16496

authored by

Chad and committed by
chad
defee938 7e365fd3

+60 -13
+5 -5
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => 'aee99781', 10 + 'core.pkg.css' => 'ee3f9253', 11 11 'core.pkg.js' => '1d376fa9', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '3fb7f532', ··· 163 163 'rsrc/css/phui/workboards/phui-workboard.css' => 'bda3ef58', 164 164 'rsrc/css/phui/workboards/phui-workcard.css' => '0c62d7c5', 165 165 'rsrc/css/phui/workboards/phui-workpanel.css' => '92197373', 166 - 'rsrc/css/sprite-login.css' => '60e8560e', 166 + 'rsrc/css/sprite-login.css' => '6dbbbd97', 167 167 'rsrc/css/sprite-tokens.css' => '9cdfd599', 168 168 'rsrc/css/syntax/syntax-default.css' => '9923583c', 169 169 'rsrc/externals/d3/d3.min.js' => 'a11a5ff2', ··· 342 342 'rsrc/image/phrequent_active.png' => 'a466a8ed', 343 343 'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 344 344 'rsrc/image/resize.png' => 'fd476de4', 345 - 'rsrc/image/sprite-login-X2.png' => 'e3991e37', 346 - 'rsrc/image/sprite-login.png' => '03d5af29', 345 + 'rsrc/image/sprite-login-X2.png' => '4abee916', 346 + 'rsrc/image/sprite-login.png' => '2b9663fd', 347 347 'rsrc/image/sprite-tokens-X2.png' => '804a5232', 348 348 'rsrc/image/sprite-tokens.png' => 'b41d03da', 349 349 'rsrc/image/texture/card-gradient.png' => '815f26e8', ··· 890 890 'releeph-request-differential-create-dialog' => '8d8b92cd', 891 891 'releeph-request-typeahead-css' => '667a48ae', 892 892 'setup-issue-css' => 'f794cfc3', 893 - 'sprite-login-css' => '60e8560e', 893 + 'sprite-login-css' => '6dbbbd97', 894 894 'sprite-tokens-css' => '9cdfd599', 895 895 'syntax-default-css' => '9923583c', 896 896 'syntax-highlighting-css' => '769d3498',
resources/sprite/login_1x/Slack.png

This is a binary file and will not be displayed.

resources/sprite/login_2x/Slack.png

This is a binary file and will not be displayed.

+5
resources/sprite/manifest/login.json
··· 91 91 "rule": ".login-Phabricator", 92 92 "hash": "d0f830803593bbcc025d7d5a29ee3ecd" 93 93 }, 94 + "login-Slack": { 95 + "name": "login-Slack", 96 + "rule": ".login-Slack", 97 + "hash": "fe0df2df040032b949aa05948b6bd986" 98 + }, 94 99 "login-Stripe": { 95 100 "name": "login-Stripe", 96 101 "rule": ".login-Stripe",
+2
src/__phutil_library_map__.php
··· 3587 3587 'PhabricatorShowFiletreeSetting' => 'applications/settings/setting/PhabricatorShowFiletreeSetting.php', 3588 3588 'PhabricatorSimpleEditType' => 'applications/transactions/edittype/PhabricatorSimpleEditType.php', 3589 3589 'PhabricatorSite' => 'aphront/site/PhabricatorSite.php', 3590 + 'PhabricatorSlackAuthProvider' => 'applications/auth/provider/PhabricatorSlackAuthProvider.php', 3590 3591 'PhabricatorSlowvoteApplication' => 'applications/slowvote/application/PhabricatorSlowvoteApplication.php', 3591 3592 'PhabricatorSlowvoteChoice' => 'applications/slowvote/storage/PhabricatorSlowvoteChoice.php', 3592 3593 'PhabricatorSlowvoteCloseController' => 'applications/slowvote/controller/PhabricatorSlowvoteCloseController.php', ··· 8590 8591 'PhabricatorShowFiletreeSetting' => 'PhabricatorSelectSetting', 8591 8592 'PhabricatorSimpleEditType' => 'PhabricatorEditType', 8592 8593 'PhabricatorSite' => 'AphrontSite', 8594 + 'PhabricatorSlackAuthProvider' => 'PhabricatorOAuth2AuthProvider', 8593 8595 'PhabricatorSlowvoteApplication' => 'PhabricatorApplication', 8594 8596 'PhabricatorSlowvoteChoice' => 'PhabricatorSlowvoteDAO', 8595 8597 'PhabricatorSlowvoteCloseController' => 'PhabricatorSlowvoteController',
+36
src/applications/auth/provider/PhabricatorSlackAuthProvider.php
··· 1 + <?php 2 + 3 + final class PhabricatorSlackAuthProvider 4 + extends PhabricatorOAuth2AuthProvider { 5 + 6 + public function getProviderName() { 7 + return pht('Slack'); 8 + } 9 + 10 + protected function getProviderConfigurationHelp() { 11 + $login_uri = PhabricatorEnv::getURI($this->getLoginURI()); 12 + 13 + return pht( 14 + "To configure Slack OAuth, create a new application here:". 15 + "\n\n". 16 + "https://api.slack.com/docs/sign-in-with-slack#create_slack_app". 17 + "\n\n". 18 + "When creating your application, use these settings:". 19 + "\n\n". 20 + " - **Redirect URI:** Set this to: `%s`". 21 + "\n\n". 22 + "After completing configuration, copy the **Client ID** and ". 23 + "**Client Secret** to the fields above. (You may need to generate the ". 24 + "client secret by clicking 'New Secret' first.)", 25 + $login_uri); 26 + } 27 + 28 + protected function newOAuthAdapter() { 29 + return new PhutilSlackAuthAdapter(); 30 + } 31 + 32 + protected function getLoginIcon() { 33 + return 'Slack'; 34 + } 35 + 36 + }
+12 -8
webroot/rsrc/css/sprite-login.css
··· 14 14 only screen and (min-resolution: 1.5dppx) { 15 15 .sprite-login { 16 16 background-image: url(/rsrc/image/sprite-login-X2.png); 17 - background-size: 145px 145px; 17 + background-size: 145px 174px; 18 18 } 19 19 } 20 20 ··· 91 91 background-position: -58px -87px; 92 92 } 93 93 94 - .login-Stripe { 94 + .login-Slack { 95 95 background-position: -87px -87px; 96 96 } 97 97 98 - .login-TestPayment { 98 + .login-Stripe { 99 99 background-position: -116px -87px; 100 100 } 101 101 102 - .login-TwitchTV { 102 + .login-TestPayment { 103 103 background-position: 0px -116px; 104 104 } 105 105 106 - .login-Twitter { 106 + .login-TwitchTV { 107 107 background-position: -29px -116px; 108 108 } 109 109 110 - .login-WePay { 110 + .login-Twitter { 111 111 background-position: -58px -116px; 112 + } 113 + 114 + .login-WePay { 115 + background-position: -87px -116px; 112 116 } 113 117 114 118 .login-WordPressCOM { 115 - background-position: -87px -116px; 119 + background-position: -116px -116px; 116 120 } 117 121 118 122 .login-Yahoo { 119 - background-position: -116px -116px; 123 + background-position: 0px -145px; 120 124 }
webroot/rsrc/image/sprite-login-X2.png

This is a binary file and will not be displayed.

webroot/rsrc/image/sprite-login.png

This is a binary file and will not be displayed.