Blame view

common/config/main.php 12.2 KB
b0f143c3   Yarik   first commit
1
  <?php
b82db04a   Yarik   test
2
  
3735dff7   Yarik   test
3
4
      use common\modules\fileloader\controllers\FileloaderController;
  
b82db04a   Yarik   test
5
      return [
376a557b   Administrator   09.02.16
6
      'timeZone' => 'Europe/Kiev',
b0f143c3   Yarik   first commit
7
      'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
06d508f3   Administrator   add Vitaliy's wid...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
      'controllerMap' => [
          'elfinder' => [
              'class' => 'mihaildev\elfinder\Controller',
              'access' => ['@'], //глобальный доступ к фаил менеджеру @ - для авторизорованных , ? - для гостей , чтоб открыть всем ['@', '?']
              'disabledCommands' => ['netmount'], //отключение ненужных команд https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#commands
              'roots' => [
                  [
                      'class' => 'mihaildev\elfinder\UserPath',
                      'path'  => '../../storage/user_{id}',
                      'name'  => 'My Documents'
                  ],
              ],
              'watermark' => [
                  'source'         => __DIR__.'/logo.png', // Path to Water mark image
                  'marginRight'    => 5,          // Margin right pixel
                  'marginBottom'   => 5,          // Margin bottom pixel
                  'quality'        => 95,         // JPEG image save quality
                  'transparency'   => 70,         // Water mark image transparency ( other than PNG )
                  'targetType'     => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP, // Target image formats ( bit-field )
                  'targetMinPixel' => 200         // Target image minimum pixel size
              ]
2d107e9e   Yarik   test
29
30
31
32
          ],
          'artbox-comment' => [
              'class' => \common\modules\comment\Controller::className(),
          ],
3735dff7   Yarik   test
33
34
35
          'fileloader' => [
              'class' => FileloaderController::className(),
          ],
06d508f3   Administrator   add Vitaliy's wid...
36
      ],
9fd076e8   Administrator   01.03.16
37
  
b0f143c3   Yarik   first commit
38
39
      'modules' => [
          'permit' => [
c8a3b6d1   Administrator   firs page
40
              'class' => 'common\components\developeruz\db_rbac\Yii2DbRbac',
b0f143c3   Yarik   first commit
41
42
43
44
45
46
47
              'params' => [
                  'userClass' => 'common\models\User'
              ]
          ],
          'blog' => [
              'class' => 'common\modules\blog\Module',
          ],
ab6d9045   Administrator   add Vitaliy's wid...
48
49
50
          'file' => [
              'class' => 'common\modules\file\Module',
          ],
b82db04a   Yarik   test
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
          'comment' => [
              'class' => 'common\modules\comment\Module',
              'useRbac' => true,
              'rbac' => [
                  'rules' => [
                      \common\modules\comment\rbac\ArtboxCommentCreateRule::className(),
                      \common\modules\comment\rbac\ArtboxCommentDeleteRule::className(),
                      \common\modules\comment\rbac\ArtboxCommentUpdateRule::className(),
                      \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule::className(),
                      \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule::className(),
                  ],
                  'permissions' => [
                      [
                          'name' => common\modules\comment\Permissions::CREATE,
                          'description' => 'Can create comments',
                          'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentCreateRule())->name,
                      ],
                      [
                          'name' => common\modules\comment\Permissions::UPDATE,
                          'description' => 'Can update comments',
                          'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateRule())->name,
                      ],
                      [
                          'name' => common\modules\comment\Permissions::DELETE,
                          'description' => 'Can delete comments',
                          'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteRule())->name,
                      ],
                      [
                          'name' => common\modules\comment\Permissions::UPDATE_OWN,
                          'description' => 'Can update own comments',
                          'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule())->name,
                      ],
                      [
                          'name' => common\modules\comment\Permissions::DELETE_OWN,
                          'description' => 'Can delete own comments',
                          'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule())->name,
                      ],
                  ],
              ],
  
          ],
ab6d9045   Administrator   add Vitaliy's wid...
92
  
b0f143c3   Yarik   first commit
93
94
      ],
      'bootstrap' => [
02524a34   Yarik   test
95
          'options',
b0f143c3   Yarik   first commit
96
97
      ],
      'components' => [
06ec2844   Administrator   28.03.16
98
99
100
101
102
103
104
105
106
107
108
109
          'i18n' => [
              'translations' => [
                  'frontend' => [
                      'class' => 'yii\i18n\PhpMessageSource',
                      'basePath' => '@frontend/messages',
                      'sourceLanguage' => 'en-US',
                      'fileMap' => [
                          'app'       => 'app.php'
                      ],
                  ],
              ],
          ],
b0f143c3   Yarik   first commit
110
111
112
          'cache' => [
              'class' => 'yii\caching\FileCache',
          ],
b95371cf   Yarik   test
113
114
          'formatter' => [
              'booleanFormat' => ['Нет', 'Да'],
c0bffebb   Yarik   test
115
              'defaultTimeZone' => 'Europe/Kiev',
b95371cf   Yarik   test
116
          ],
b0f143c3   Yarik   first commit
117
118
119
120
121
122
123
          'urlManager' => [
              'enablePrettyUrl' => true,
              'showScriptName' => false,
              'class'=> 'common\components\LangUrlManager',
              'rules'=>[
                  '<module:\w+>/<controller:\w+>/<action:(\w|-)+>' => '<module>/<controller>/<action>',
                  '<module:\w+>/<controller:\w+>/<action:(\w|-)+>/<id:\d+>' => '<module>/<controller>/<action>',
57e9745b   Yarik   test
124
              ],
b0f143c3   Yarik   first commit
125
          ],
c8a3b6d1   Administrator   firs page
126
  
06ec2844   Administrator   28.03.16
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
  //        'i18n' => [
  //            'translations' => [
  //                '*' => [
  //                    'class' => 'yii\i18n\PhpMessageSource',
  //                    'basePath' => '@common/translation',
  //                    'fileMap' => [
  //                        'app' => 'app.php',
  //                        'app/error' => 'error.php',
  //                    ],
  //                ],
  //                'app' => [
  //                    'class' => 'yii\i18n\PhpMessageSource',
  //                    'basePath' => '@common/translation',
  //                    'fileMap' => [
  //                        'app' => 'app.php',
  //                        'app/error' => 'error.php',
  //                    ],
  //                ]
  //            ],
  //        ],
71f66dca   Administrator   add Vitaliy's wid...
147
148
          'authManager' => [
              'class' => 'yii\rbac\DbManager',
0c0cdc9d   Yarik   test
149
              'defaultRoles' => ['USER'],
b0f143c3   Yarik   first commit
150
          ],
c8a3b6d1   Administrator   firs page
151
  
b0f143c3   Yarik   first commit
152
          //подключаем конфигурации API соц сетей для авторизации
c8a3b6d1   Administrator   firs page
153
  
b0f143c3   Yarik   first commit
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
          'eauth' => [
              'class' => 'nodge\eauth\EAuth',
              'popup' => true, // Use the popup window instead of redirecting.
              'cache' => false, // Cache component name or false to disable cache. Defaults to 'cache' on production environments.
              'cacheExpire' => 0, // Cache lifetime. Defaults to 0 - means unlimited.
              'httpClient' => [
                  // uncomment this to use streams in safe_mode
                  //'useStreamsFallback' => true,
              ],
              'services' => [ // You can change the providers and their classes.
                  'google' => [
                      // register your app here: https://code.google.com/apis/console/
                      'class' => 'nodge\eauth\services\GoogleOAuth2Service',
                      'clientId' => 'artbox-1138',
                      'clientSecret' => '',
                      'title' => 'Google',
                  ],
                  'twitter' => [
                      // register your app here: https://dev.twitter.com/apps/new
                      'class' => 'nodge\eauth\services\TwitterOAuth1Service',
                      'key' => '8vReLxI63vTs98MBMqhvrszwy',
                      'secret' => 'jOqNbHIkQw4cVKKJkgrMtaEeCcfbeT1GTik4pF6O9D7AmqcwOG',
                  ],
                  'yandex' => [
                      // register your app here: https://oauth.yandex.ru/client/my
                      'class' => 'nodge\eauth\services\YandexOAuth2Service',
                      'clientId' => 'ea13195ac0424ff8a190838bec41bb71',
                      'clientSecret' => '911f2c9afcbf4f5f9319b3134c096c86',
                      'title' => 'Yandex',
                  ],
                  'facebook' => [
                      // register your app here: https://developers.facebook.com/apps/
                      'class' => 'nodge\eauth\services\FacebookOAuth2Service',
                      'clientId' => '1642047622727997',
                      'clientSecret' => 'f5b7ba4f062a568678b764fc74cc416e',
                  ],
                  'yahoo' => [
                      'class' => 'nodge\eauth\services\YahooOpenIDService',
                      //'realm' => '*.example.org', // your domain, can be with wildcard to authenticate on subdomains.
                  ],
                  'linkedin' => [
                      // register your app here: https://www.linkedin.com/secure/developer
                      'class' => 'nodge\eauth\services\LinkedinOAuth1Service',
                      'key' => '77s41eixn3dyvo',
                      'secret' => '1xLZQ7RRK6RNjo4U',
                      'title' => 'LinkedIn (OAuth1)',
                  ],
                  'linkedin_oauth2' => [
                      // register your app here: https://www.linkedin.com/secure/developer
                      'class' => 'nodge\eauth\services\LinkedinOAuth2Service',
                      'clientId' => '77s41eixn3dyvo',
                      'clientSecret' => '1xLZQ7RRK6RNjo4U',
                      'title' => 'LinkedIn (OAuth2)',
                  ],
                  'github' => [
                      // register your app here: https://github.com/settings/applications
                      'class' => 'nodge\eauth\services\GitHubOAuth2Service',
                      'clientId' => 'd00283b5cfb225cd1600',
                      'clientSecret' => 'f482361fad7184819d452f421c8b09db60830b42',
                  ],
                  'live' => [
                      // register your app here: https://account.live.com/developers/applications/index
                      'class' => 'nodge\eauth\services\LiveOAuth2Service',
                      'clientId' => '00000000481796AE',
                      'clientSecret' => 'rt9GiJrlKz3sE6CvdOeuwWyYbl1tQT03',
                  ],
                  'steam' => [
                      'class' => 'nodge\eauth\services\SteamOpenIDService',
                      //'realm' => '*.example.org', // your domain, can be with wildcard to authenticate on subdomains.
                  ],
                  'instagram' => [
                      // register your app here: https://instagram.com/developer/register/
                      'class' => 'nodge\eauth\services\InstagramOAuth2Service',
                      'clientId' => '...',
                      'clientSecret' => '...',
                  ],
                  'vkontakte' => [
                      // register your app here: https://vk.com/editapp?act=create&site=1
                      'class' => 'nodge\eauth\services\VKontakteOAuth2Service',
                      'clientId' => '5155388',
                      'clientSecret' => 'jxgmdGVQw7huGKRpnX3a',
                  ],
                  'mailru' => [
                      // register your app here: http://api.mail.ru/sites/my/add
                      'class' => 'nodge\eauth\services\MailruOAuth2Service',
                      'clientId' => '739322',
                      'clientSecret' => 'd6ce7be6ff791375adff58fe0e4460b2',
                  ],
                  'odnoklassniki' => [
                      // register your app here: http://dev.odnoklassniki.ru/wiki/pages/viewpage.action?pageId=13992188
                      // ... or here: http://www.odnoklassniki.ru/dk?st.cmd=appsInfoMyDevList&st._aid=Apps_Info_MyDev
                      'class' => 'nodge\eauth\services\OdnoklassnikiOAuth2Service',
                      'clientId' => '...',
                      'clientSecret' => '...',
                      'clientPublic' => '...',
                      'title' => 'Odnoklas.',
71f66dca   Administrator   add Vitaliy's wid...
250
                  ],
b0f143c3   Yarik   first commit
251
252
              ],
          ],
c8a3b6d1   Administrator   firs page
253
  
b0f143c3   Yarik   first commit
254
255
256
257
258
259
260
261
262
263
264
          // (optionally) you can configure logging
          'log' => [
              'targets' => [
                  [
                      'class' => 'yii\log\FileTarget',
                      'logFile' => '@app/runtime/logs/eauth.log',
                      'categories' => ['nodge\eauth\*'],
                      'logVars' => [],
                  ],
              ],
          ],
c8a3b6d1   Administrator   firs page
265
  
b0f143c3   Yarik   first commit
266
267
268
269
270
271
272
273
274
          /*========End=======
           *end api sicial
           *  */
          'options' => [
              'class' => 'common\models\OptionHelper',
          ]
      ],
      'language' => 'ru-RU'
  ];