aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/bookmark/BookmarkInitializer.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-08-01 11:10:57 +0200
committerArthurHoaro <arthur@hoa.ro>2020-08-01 11:10:57 +0200
commitd6e5f04d3987e498c5cb859eed6bff33d67949df (patch)
treeaec901679761a9bb4dfdbecc6625e4f4583d004e /application/bookmark/BookmarkInitializer.php
parentf7f08ceec1b218e1525153e8bd3d0199f2fb1c9d (diff)
downloadShaarli-d6e5f04d3987e498c5cb859eed6bff33d67949df.tar.gz
Shaarli-d6e5f04d3987e498c5cb859eed6bff33d67949df.tar.zst
Shaarli-d6e5f04d3987e498c5cb859eed6bff33d67949df.zip
Remove anonymous permission and initialize bookmarks on login
Diffstat (limited to 'application/bookmark/BookmarkInitializer.php')
-rw-r--r--application/bookmark/BookmarkInitializer.php9
1 files changed, 1 insertions, 8 deletions
diff --git a/application/bookmark/BookmarkInitializer.php b/application/bookmark/BookmarkInitializer.php
index 479ee9a9..cd2d1724 100644
--- a/application/bookmark/BookmarkInitializer.php
+++ b/application/bookmark/BookmarkInitializer.php
@@ -6,8 +6,7 @@ namespace Shaarli\Bookmark;
6 * Class BookmarkInitializer 6 * Class BookmarkInitializer
7 * 7 *
8 * This class is used to initialized default bookmarks after a fresh install of Shaarli. 8 * This class is used to initialized default bookmarks after a fresh install of Shaarli.
9 * It is no longer call when the data store is empty, 9 * It should be only called if the datastore file does not exist(users might want to delete the default bookmarks).
10 * because user might want to delete default bookmarks after the install.
11 * 10 *
12 * To prevent data corruption, it does not overwrite existing bookmarks, 11 * To prevent data corruption, it does not overwrite existing bookmarks,
13 * even though there should not be any. 12 * even though there should not be any.
@@ -34,8 +33,6 @@ class BookmarkInitializer
34 */ 33 */
35 public function initialize() 34 public function initialize()
36 { 35 {
37 $this->bookmarkService->enableAnonymousPermission();
38
39 $bookmark = new Bookmark(); 36 $bookmark = new Bookmark();
40 $bookmark->setTitle(t('My secret stuff... - Pastebin.com')); 37 $bookmark->setTitle(t('My secret stuff... - Pastebin.com'));
41 $bookmark->setUrl('http://sebsauvage.net/paste/?8434b27936c09649#bR7XsXhoTiLcqCpQbmOpBi3rq2zzQUC5hBI7ZT1O3x8='); 38 $bookmark->setUrl('http://sebsauvage.net/paste/?8434b27936c09649#bR7XsXhoTiLcqCpQbmOpBi3rq2zzQUC5hBI7ZT1O3x8=');
@@ -57,9 +54,5 @@ You use the community supported version of the original Shaarli project, by Seba
57 )); 54 ));
58 $bookmark->setTagsString('opensource software'); 55 $bookmark->setTagsString('opensource software');
59 $this->bookmarkService->add($bookmark, false); 56 $this->bookmarkService->add($bookmark, false);
60
61 $this->bookmarkService->save();
62
63 $this->bookmarkService->disableAnonymousPermission();
64 } 57 }
65} 58}