|
| 1 | +<?php if (!defined('APPLICATION')) exit(); |
| 2 | + |
| 3 | +$Database = Gdn::database(); |
| 4 | +$SQL = $Database->sql(); |
| 5 | + |
| 6 | +// use Vanilla\Web\CacheControlMiddleware; |
| 7 | + |
| 8 | +if (c('Garden.Installed')) { |
| 9 | + //Disable plugins |
| 10 | + saveToConfig('EnabledPlugins.stubcontent', false); |
| 11 | + |
| 12 | + //Enable plugins |
| 13 | + saveToConfig('EnabledPlugins.Topcoder', true); |
| 14 | + saveToConfig('EnabledPlugins.rich-editor',true); |
| 15 | + saveToConfig('EnabledPlugins.recaptcha', true); |
| 16 | + saveToConfig('EnabledPlugins.editor', true); |
| 17 | + saveToConfig('EnabledPlugins.emojiextender', true); |
| 18 | + saveToConfig('EnabledPlugins.GooglePrettify', true); |
| 19 | + saveToConfig('EnabledPlugins.Quotes', true); |
| 20 | + saveToConfig('EnabledPlugins.swagger-ui', true); |
| 21 | + saveToConfig('EnabledPlugins.oauth2', true); |
| 22 | + |
| 23 | + // Set Theme Options |
| 24 | + saveToConfig('Garden.ThemeOptions.Styles.Key', 'Coral'); |
| 25 | + saveToConfig('Garden.ThemeOptions.Styles.Value', '%s_coral'); |
| 26 | + saveToConfig('Garden.ThemeOptions.Options.panelToLeft',true); |
| 27 | + |
| 28 | + // Add settings for the Topcoder plugin |
| 29 | + saveToConfig('Plugins.Topcoder.BaseApiURL', 'https://api.topcoder-dev.com'); |
| 30 | + saveToConfig('Plugins.Topcoder.MemberApiURI', '/v3/members'); |
| 31 | + saveToConfig('Plugins.Topcoder.MemberProfileURL', 'https://www.topcoder.com/members'); |
| 32 | + |
| 33 | + // Add settings for the Editor plugin |
| 34 | + saveToConfig('Plugins.editor.ForceWysiwyg', false); |
| 35 | + |
| 36 | + // Add settings for the Syntax Prettifier plugin |
| 37 | + saveToConfig('Plugins.GooglePrettify.LineNumbers', ''); |
| 38 | + saveToConfig('Plugins.GooglePrettify.NoCssFile', ''); |
| 39 | + saveToConfig('Plugins.GooglePrettify.UseTabby', ''); |
| 40 | + saveToConfig('Plugins.GooglePrettify.Language',''); |
| 41 | + |
| 42 | + //Add settings for the OAuth 2 SSO plugin |
| 43 | + if ($SQL->getWhere('UserAuthenticationProvider', ['AuthenticationKey' => 'oauth2'])->numRows() == 0) { |
| 44 | + $SQL->insert('UserAuthenticationProvider', [ |
| 45 | + 'AuthenticationKey' => 'oauth2', |
| 46 | + 'AuthenticationSchemeAlias' => 'oauth2', |
| 47 | + 'Name' => 'oauth2', |
| 48 | + 'AssociationSecret' => 'yvaegnvYhFhWUwL3s0nObhZz76ZVYE4qVms3z75ngm3ubHu1ZmwyKStML7N_i9nE', |
| 49 | + 'RegisterUrl' => '', |
| 50 | + 'SignInUrl' => 'https://topcoder-dev.auth0.com', |
| 51 | + 'SignOutUrl' => '', |
| 52 | + 'ProfileUrl' => 'https://topcoder-dev.auth0.com/userinfo', |
| 53 | + 'Attributes' => '{"AssociationKey":"Q9iRXM0QzGRidhcUK8MSTXxBRrmvrjA4","AuthorizeUrl":"https://topcoder-dev.auth0.com/authorize","TokenUrl":"https://topcoder-dev.auth0.com/oauth/token","AcceptedScope":"openid email profile","ProfileKeyEmail":"email","ProfileKeyPhoto":"picture","ProfileKeyName":"nickname","ProfileKeyFullName":"name","ProfileKeyUniqueID":"sub","Prompt":"login","BearerToken":false,"BaseUrl":"https://topcoder-dev.auth0.com"}', |
| 54 | + 'Active' => 1, |
| 55 | + 'IsDefault' => 1 |
| 56 | + ]); |
| 57 | + } |
| 58 | +} |
| 59 | + |
| 60 | + |
0 commit comments