diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-02 10:19:33 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-02 11:32:38 +0200 |
commit | 426bb453d295900fb3e35dce2f9081a42639cf27 (patch) | |
tree | 77fc6aedf17640a9d13a817e25fbd06ab89b471f /src/Wallabag/CoreBundle/Command | |
parent | a687c8d915276eee0c0494156700f7d0c0606735 (diff) | |
download | wallabag-426bb453d295900fb3e35dce2f9081a42639cf27.tar.gz wallabag-426bb453d295900fb3e35dce2f9081a42639cf27.tar.zst wallabag-426bb453d295900fb3e35dce2f9081a42639cf27.zip |
API user creation behing a toggle
I've added a toggle feature (in internal settings) so that user api creation can be disabled while form registration still can be enabled.
Also, the /api/user endpoint shouldn't require authentication. Even if we check the authentication when sending a GET request, to retrieve current user information.
I've moved all the internal settings definition to config to avoid duplicated place to define them.
I don't know why we didn't did that earlier.
Diffstat (limited to 'src/Wallabag/CoreBundle/Command')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 160 |
1 files changed, 1 insertions, 159 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index d9608246..0f119377 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -292,165 +292,7 @@ class InstallCommand extends ContainerAwareCommand | |||
292 | // cleanup before insert new stuff | 292 | // cleanup before insert new stuff |
293 | $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute(); | 293 | $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute(); |
294 | 294 | ||
295 | $settings = [ | 295 | foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) { |
296 | [ | ||
297 | 'name' => 'share_public', | ||
298 | 'value' => '1', | ||
299 | 'section' => 'entry', | ||
300 | ], | ||
301 | [ | ||
302 | 'name' => 'carrot', | ||
303 | 'value' => '1', | ||
304 | 'section' => 'entry', | ||
305 | ], | ||
306 | [ | ||
307 | 'name' => 'share_diaspora', | ||
308 | 'value' => '1', | ||
309 | 'section' => 'entry', | ||
310 | ], | ||
311 | [ | ||
312 | 'name' => 'diaspora_url', | ||
313 | 'value' => 'http://diasporapod.com', | ||
314 | 'section' => 'entry', | ||
315 | ], | ||
316 | [ | ||
317 | 'name' => 'share_unmark', | ||
318 | 'value' => '1', | ||
319 | 'section' => 'entry', | ||
320 | ], | ||
321 | [ | ||
322 | 'name' => 'unmark_url', | ||
323 | 'value' => 'https://unmark.it', | ||
324 | 'section' => 'entry', | ||
325 | ], | ||
326 | [ | ||
327 | 'name' => 'share_shaarli', | ||
328 | 'value' => '1', | ||
329 | 'section' => 'entry', | ||
330 | ], | ||
331 | [ | ||
332 | 'name' => 'shaarli_url', | ||
333 | 'value' => 'http://myshaarli.com', | ||
334 | 'section' => 'entry', | ||
335 | ], | ||
336 | [ | ||
337 | 'name' => 'share_scuttle', | ||
338 | 'value' => '1', | ||
339 | 'section' => 'entry', | ||
340 | ], | ||
341 | [ | ||
342 | 'name' => 'scuttle_url', | ||
343 | 'value' => 'http://scuttle.org', | ||
344 | 'section' => 'entry', | ||
345 | ], | ||
346 | [ | ||
347 | 'name' => 'share_mail', | ||
348 | 'value' => '1', | ||
349 | 'section' => 'entry', | ||
350 | ], | ||
351 | [ | ||
352 | 'name' => 'share_twitter', | ||
353 | 'value' => '1', | ||
354 | 'section' => 'entry', | ||
355 | ], | ||
356 | [ | ||
357 | 'name' => 'export_epub', | ||
358 | 'value' => '1', | ||
359 | 'section' => 'export', | ||
360 | ], | ||
361 | [ | ||
362 | 'name' => 'export_mobi', | ||
363 | 'value' => '1', | ||
364 | 'section' => 'export', | ||
365 | ], | ||
366 | [ | ||
367 | 'name' => 'export_pdf', | ||
368 | 'value' => '1', | ||
369 | 'section' => 'export', | ||
370 | ], | ||
371 | [ | ||
372 | 'name' => 'export_csv', | ||
373 | 'value' => '1', | ||
374 | 'section' => 'export', | ||
375 | ], | ||
376 | [ | ||
377 | 'name' => 'export_json', | ||
378 | 'value' => '1', | ||
379 | 'section' => 'export', | ||
380 | ], | ||
381 | [ | ||
382 | 'name' => 'export_txt', | ||
383 | 'value' => '1', | ||
384 | 'section' => 'export', | ||
385 | ], | ||
386 | [ | ||
387 | 'name' => 'export_xml', | ||
388 | 'value' => '1', | ||
389 | 'section' => 'export', | ||
390 | ], | ||
391 | [ | ||
392 | 'name' => 'import_with_redis', | ||
393 | 'value' => '0', | ||
394 | 'section' => 'import', | ||
395 | ], | ||
396 | [ | ||
397 | 'name' => 'import_with_rabbitmq', | ||
398 | 'value' => '0', | ||
399 | 'section' => 'import', | ||
400 | ], | ||
401 | [ | ||
402 | 'name' => 'show_printlink', | ||
403 | 'value' => '1', | ||
404 | 'section' => 'entry', | ||
405 | ], | ||
406 | [ | ||
407 | 'name' => 'wallabag_support_url', | ||
408 | 'value' => 'https://www.wallabag.org/pages/support.html', | ||
409 | 'section' => 'misc', | ||
410 | ], | ||
411 | [ | ||
412 | 'name' => 'wallabag_url', | ||
413 | 'value' => '', | ||
414 | 'section' => 'misc', | ||
415 | ], | ||
416 | [ | ||
417 | 'name' => 'piwik_enabled', | ||
418 | 'value' => '0', | ||
419 | 'section' => 'analytics', | ||
420 | ], | ||
421 | [ | ||
422 | 'name' => 'piwik_host', | ||
423 | 'value' => 'v2.wallabag.org', | ||
424 | 'section' => 'analytics', | ||
425 | ], | ||
426 | [ | ||
427 | 'name' => 'piwik_site_id', | ||
428 | 'value' => '1', | ||
429 | 'section' => 'analytics', | ||
430 | ], | ||
431 | [ | ||
432 | 'name' => 'demo_mode_enabled', | ||
433 | 'value' => '0', | ||
434 | 'section' => 'misc', | ||
435 | ], | ||
436 | [ | ||
437 | 'name' => 'demo_mode_username', | ||
438 | 'value' => 'wallabag', | ||
439 | 'section' => 'misc', | ||
440 | ], | ||
441 | [ | ||
442 | 'name' => 'download_images_enabled', | ||
443 | 'value' => '0', | ||
444 | 'section' => 'misc', | ||
445 | ], | ||
446 | [ | ||
447 | 'name' => 'restricted_access', | ||
448 | 'value' => '0', | ||
449 | 'section' => 'entry', | ||
450 | ], | ||
451 | ]; | ||
452 | |||
453 | foreach ($settings as $setting) { | ||
454 | $newSetting = new Setting(); | 296 | $newSetting = new Setting(); |
455 | $newSetting->setName($setting['name']); | 297 | $newSetting->setName($setting['name']); |
456 | $newSetting->setValue($setting['value']); | 298 | $newSetting->setValue($setting['value']); |