Dan Brown

Started work on user profile pages

...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
2 2
3 namespace BookStack\Http\Controllers; 3 namespace BookStack\Http\Controllers;
4 4
5 +use BookStack\Activity;
5 use Illuminate\Http\Request; 6 use Illuminate\Http\Request;
6 7
7 use Illuminate\Http\Response; 8 use Illuminate\Http\Response;
...@@ -92,10 +93,9 @@ class UserController extends Controller ...@@ -92,10 +93,9 @@ class UserController extends Controller
92 $user->save(); 93 $user->save();
93 } 94 }
94 95
95 - return redirect('/users'); 96 + return redirect('/settings/users');
96 } 97 }
97 98
98 -
99 /** 99 /**
100 * Show the form for editing the specified user. 100 * Show the form for editing the specified user.
101 * @param int $id 101 * @param int $id
...@@ -159,7 +159,7 @@ class UserController extends Controller ...@@ -159,7 +159,7 @@ class UserController extends Controller
159 } 159 }
160 160
161 $user->save(); 161 $user->save();
162 - return redirect('/users'); 162 + return redirect('/settings/users');
163 } 163 }
164 164
165 /** 165 /**
...@@ -197,6 +197,19 @@ class UserController extends Controller ...@@ -197,6 +197,19 @@ class UserController extends Controller
197 } 197 }
198 $this->userRepo->destroy($user); 198 $this->userRepo->destroy($user);
199 199
200 - return redirect('/users'); 200 + return redirect('/settings/users');
201 + }
202 +
203 + /**
204 + * Show the user profile page
205 + * @param $id
206 + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
207 + */
208 + public function showProfilePage($id)
209 + {
210 + $user = $this->userRepo->getById($id);
211 + $userActivity = $this->userRepo->getActivity($user);
212 + $recentPages = $this->userRepo->getCreatedPages($user, 5, 0);
213 + return view('users/profile', ['user' => $user, 'activity' => $userActivity, 'recentPages' => $recentPages]);
201 } 214 }
202 } 215 }
......
...@@ -47,14 +47,8 @@ Route::group(['middleware' => 'auth'], function () { ...@@ -47,14 +47,8 @@ Route::group(['middleware' => 'auth'], function () {
47 47
48 }); 48 });
49 49
50 - // Users 50 + // User Profile routes
51 - Route::get('/users', 'UserController@index'); 51 + Route::get('/user/{userId}', 'UserController@showProfilePage');
52 - Route::get('/users/create', 'UserController@create');
53 - Route::get('/users/{id}/delete', 'UserController@delete');
54 - Route::post('/users/create', 'UserController@store');
55 - Route::get('/users/{id}', 'UserController@edit');
56 - Route::put('/users/{id}', 'UserController@update');
57 - Route::delete('/users/{id}', 'UserController@destroy');
58 52
59 // Image routes 53 // Image routes
60 Route::group(['prefix' => 'images'], function() { 54 Route::group(['prefix' => 'images'], function() {
...@@ -82,8 +76,18 @@ Route::group(['middleware' => 'auth'], function () { ...@@ -82,8 +76,18 @@ Route::group(['middleware' => 'auth'], function () {
82 Route::get('/home', 'HomeController@index'); 76 Route::get('/home', 'HomeController@index');
83 77
84 // Settings 78 // Settings
85 - Route::get('/settings', 'SettingController@index'); 79 + Route::group(['prefix' => 'settings'], function() {
86 - Route::post('/settings', 'SettingController@update'); 80 + Route::get('/', 'SettingController@index');
81 + Route::post('/', 'SettingController@update');
82 + // Users
83 + Route::get('/users', 'UserController@index');
84 + Route::get('/users/create', 'UserController@create');
85 + Route::get('/users/{id}/delete', 'UserController@delete');
86 + Route::post('/users/create', 'UserController@store');
87 + Route::get('/users/{id}', 'UserController@edit');
88 + Route::put('/users/{id}', 'UserController@update');
89 + Route::delete('/users/{id}', 'UserController@destroy');
90 + });
87 91
88 }); 92 });
89 93
......
1 <?php namespace BookStack\Repos; 1 <?php namespace BookStack\Repos;
2 2
3 3
4 +use BookStack\Page;
4 use BookStack\Role; 5 use BookStack\Role;
6 +use BookStack\Services\EntityService;
5 use BookStack\User; 7 use BookStack\User;
6 use Setting; 8 use Setting;
7 9
...@@ -10,15 +12,19 @@ class UserRepo ...@@ -10,15 +12,19 @@ class UserRepo
10 12
11 protected $user; 13 protected $user;
12 protected $role; 14 protected $role;
15 + protected $entityService;
13 16
14 /** 17 /**
15 * UserRepo constructor. 18 * UserRepo constructor.
16 - * @param $user 19 + * @param User $user
20 + * @param Role $role
21 + * @param EntityService $entityService
17 */ 22 */
18 - public function __construct(User $user, Role $role) 23 + public function __construct(User $user, Role $role, EntityService $entityService)
19 { 24 {
20 $this->user = $user; 25 $this->user = $user;
21 $this->role = $role; 26 $this->role = $role;
27 + $this->entityService = $entityService;
22 } 28 }
23 29
24 /** 30 /**
...@@ -112,4 +118,42 @@ class UserRepo ...@@ -112,4 +118,42 @@ class UserRepo
112 $user->socialAccounts()->delete(); 118 $user->socialAccounts()->delete();
113 $user->delete(); 119 $user->delete();
114 } 120 }
121 +
122 + /**
123 + * Get the latest activity for a user.
124 + * @param User $user
125 + * @param int $count
126 + * @param int $page
127 + * @return array
128 + */
129 + public function getActivity(User $user, $count = 20, $page = 0)
130 + {
131 + return \Activity::userActivity($user, $count, $page);
132 + }
133 +
134 + /**
135 + * Get the pages the the given user has created.
136 + * @param User $user
137 + * @param int $count
138 + * @param int $page
139 + * @return mixed
140 + */
141 + public function getCreatedPages(User $user, $count = 20, $page = 0)
142 + {
143 + return $this->entityService->page->where('created_by', '=', $user->id)->orderBy('created_at', 'desc')
144 + ->skip($page * $count)->take($count)->get();
145 + }
146 +
147 + /**
148 + * Get asset created counts for the give user.
149 + * @return array
150 + */
151 + public function getAssetCounts(User $user)
152 + {
153 + return [
154 + 'pages' => $this->entityService->page->where('created_by', '=', $user->id)->count(),
155 + 'chapters' => $this->entityService->chapter->where('created_by', '=', $user->id)->count(),
156 + 'books' => $this->entityService->book->where('created_by', '=', $user->id)->count(),
157 + ];
158 + }
115 } 159 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -91,14 +91,14 @@ class ActivityService ...@@ -91,14 +91,14 @@ class ActivityService
91 } 91 }
92 92
93 /** 93 /**
94 - * Gets the latest activity for an entitiy, Filtering out similar 94 + * Gets the latest activity for an entity, Filtering out similar
95 * items to prevent a message activity list. 95 * items to prevent a message activity list.
96 * @param Entity $entity 96 * @param Entity $entity
97 * @param int $count 97 * @param int $count
98 * @param int $page 98 * @param int $page
99 * @return array 99 * @return array
100 */ 100 */
101 - function entityActivity($entity, $count = 20, $page = 0) 101 + public function entityActivity($entity, $count = 20, $page = 0)
102 { 102 {
103 $activity = $entity->hasMany('BookStack\Activity')->orderBy('created_at', 'desc') 103 $activity = $entity->hasMany('BookStack\Activity')->orderBy('created_at', 'desc')
104 ->skip($count * $page)->take($count)->get(); 104 ->skip($count * $page)->take($count)->get();
...@@ -107,15 +107,30 @@ class ActivityService ...@@ -107,15 +107,30 @@ class ActivityService
107 } 107 }
108 108
109 /** 109 /**
110 + * Get latest activity for a user, Filtering out similar
111 + * items.
112 + * @param $user
113 + * @param int $count
114 + * @param int $page
115 + * @return array
116 + */
117 + public function userActivity($user, $count = 20, $page = 0)
118 + {
119 + $activity = $this->activity->where('user_id', '=', $user->id)
120 + ->orderBy('created_at', 'desc')->skip($count * $page)->take($count)->get();
121 + return $this->filterSimilar($activity);
122 + }
123 +
124 + /**
110 * Filters out similar activity. 125 * Filters out similar activity.
111 - * @param Activity[] $activity 126 + * @param Activity[] $activities
112 * @return array 127 * @return array
113 */ 128 */
114 - protected function filterSimilar($activity) 129 + protected function filterSimilar($activities)
115 { 130 {
116 $newActivity = []; 131 $newActivity = [];
117 $previousItem = false; 132 $previousItem = false;
118 - foreach ($activity as $activityItem) { 133 + foreach ($activities as $activityItem) {
119 if ($previousItem === false) { 134 if ($previousItem === false) {
120 $previousItem = $activityItem; 135 $previousItem = $activityItem;
121 $newActivity[] = $activityItem; 136 $newActivity[] = $activityItem;
......
1 +<?php namespace BookStack\Services;
2 +
3 +
4 +use BookStack\Book;
5 +use BookStack\Chapter;
6 +use BookStack\Page;
7 +
8 +class EntityService
9 +{
10 +
11 + public $book;
12 + public $chapter;
13 + public $page;
14 +
15 + /**
16 + * EntityService constructor.
17 + * @param $book
18 + * @param $chapter
19 + * @param $page
20 + */
21 + public function __construct(Book $book, Chapter $chapter, Page $page)
22 + {
23 + $this->book = $book;
24 + $this->chapter = $chapter;
25 + $this->page = $page;
26 + }
27 +
28 +
29 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -164,6 +164,6 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon ...@@ -164,6 +164,6 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
164 */ 164 */
165 public function getEditUrl() 165 public function getEditUrl()
166 { 166 {
167 - return '/users/' . $this->id; 167 + return '/settings/users/' . $this->id;
168 } 168 }
169 } 169 }
......
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
9 "packages": [ 9 "packages": [
10 { 10 {
11 "name": "aws/aws-sdk-php", 11 "name": "aws/aws-sdk-php",
12 - "version": "3.14.2", 12 + "version": "3.15.1",
13 "source": { 13 "source": {
14 "type": "git", 14 "type": "git",
15 "url": "https://github.com/aws/aws-sdk-php.git", 15 "url": "https://github.com/aws/aws-sdk-php.git",
16 - "reference": "2970cb63e7b7b37dd8c07a4fa4e4e18a110ed4e2" 16 + "reference": "5e6078913293576de969703481994b77c380ca30"
17 }, 17 },
18 "dist": { 18 "dist": {
19 "type": "zip", 19 "type": "zip",
20 - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2970cb63e7b7b37dd8c07a4fa4e4e18a110ed4e2", 20 + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5e6078913293576de969703481994b77c380ca30",
21 - "reference": "2970cb63e7b7b37dd8c07a4fa4e4e18a110ed4e2", 21 + "reference": "5e6078913293576de969703481994b77c380ca30",
22 "shasum": "" 22 "shasum": ""
23 }, 23 },
24 "require": { 24 "require": {
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
40 "ext-simplexml": "*", 40 "ext-simplexml": "*",
41 "ext-spl": "*", 41 "ext-spl": "*",
42 "nette/neon": "^2.3", 42 "nette/neon": "^2.3",
43 - "phpunit/phpunit": "~4.0|~5.0" 43 + "phpunit/phpunit": "~4.0|~5.0",
44 + "psr/cache": "^1.0"
44 }, 45 },
45 "suggest": { 46 "suggest": {
46 "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", 47 "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
...@@ -84,7 +85,7 @@ ...@@ -84,7 +85,7 @@
84 "s3", 85 "s3",
85 "sdk" 86 "sdk"
86 ], 87 ],
87 - "time": "2016-01-28 21:33:18" 88 + "time": "2016-02-11 23:23:31"
88 }, 89 },
89 { 90 {
90 "name": "barryvdh/laravel-debugbar", 91 "name": "barryvdh/laravel-debugbar",
...@@ -918,16 +919,16 @@ ...@@ -918,16 +919,16 @@
918 }, 919 },
919 { 920 {
920 "name": "laravel/framework", 921 "name": "laravel/framework",
921 - "version": "v5.2.12", 922 + "version": "v5.2.16",
922 "source": { 923 "source": {
923 "type": "git", 924 "type": "git",
924 "url": "https://github.com/laravel/framework.git", 925 "url": "https://github.com/laravel/framework.git",
925 - "reference": "6b6255ad7bfbdb721b8d00b09d52b146c5d363d7" 926 + "reference": "39e89553c124dce266da03ee3c0260bdd62f1848"
926 }, 927 },
927 "dist": { 928 "dist": {
928 "type": "zip", 929 "type": "zip",
929 - "url": "https://api.github.com/repos/laravel/framework/zipball/6b6255ad7bfbdb721b8d00b09d52b146c5d363d7", 930 + "url": "https://api.github.com/repos/laravel/framework/zipball/39e89553c124dce266da03ee3c0260bdd62f1848",
930 - "reference": "6b6255ad7bfbdb721b8d00b09d52b146c5d363d7", 931 + "reference": "39e89553c124dce266da03ee3c0260bdd62f1848",
931 "shasum": "" 932 "shasum": ""
932 }, 933 },
933 "require": { 934 "require": {
...@@ -1042,7 +1043,7 @@ ...@@ -1042,7 +1043,7 @@
1042 "framework", 1043 "framework",
1043 "laravel" 1044 "laravel"
1044 ], 1045 ],
1045 - "time": "2016-01-26 04:15:37" 1046 + "time": "2016-02-15 17:46:58"
1046 }, 1047 },
1047 { 1048 {
1048 "name": "laravel/socialite", 1049 "name": "laravel/socialite",
...@@ -1629,16 +1630,16 @@ ...@@ -1629,16 +1630,16 @@
1629 }, 1630 },
1630 { 1631 {
1631 "name": "paragonie/random_compat", 1632 "name": "paragonie/random_compat",
1632 - "version": "1.1.6", 1633 + "version": "v1.2.0",
1633 "source": { 1634 "source": {
1634 "type": "git", 1635 "type": "git",
1635 "url": "https://github.com/paragonie/random_compat.git", 1636 "url": "https://github.com/paragonie/random_compat.git",
1636 - "reference": "e6f80ab77885151908d0ec743689ca700886e8b0" 1637 + "reference": "b0e69d10852716b2ccbdff69c75c477637220790"
1637 }, 1638 },
1638 "dist": { 1639 "dist": {
1639 "type": "zip", 1640 "type": "zip",
1640 - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/e6f80ab77885151908d0ec743689ca700886e8b0", 1641 + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/b0e69d10852716b2ccbdff69c75c477637220790",
1641 - "reference": "e6f80ab77885151908d0ec743689ca700886e8b0", 1642 + "reference": "b0e69d10852716b2ccbdff69c75c477637220790",
1642 "shasum": "" 1643 "shasum": ""
1643 }, 1644 },
1644 "require": { 1645 "require": {
...@@ -1673,7 +1674,7 @@ ...@@ -1673,7 +1674,7 @@
1673 "pseudorandom", 1674 "pseudorandom",
1674 "random" 1675 "random"
1675 ], 1676 ],
1676 - "time": "2016-01-29 16:19:52" 1677 + "time": "2016-02-06 03:52:05"
1677 }, 1678 },
1678 { 1679 {
1679 "name": "phenx/php-font-lib", 1680 "name": "phenx/php-font-lib",
...@@ -2024,16 +2025,16 @@ ...@@ -2024,16 +2025,16 @@
2024 }, 2025 },
2025 { 2026 {
2026 "name": "symfony/console", 2027 "name": "symfony/console",
2027 - "version": "v3.0.1", 2028 + "version": "v3.0.2",
2028 "source": { 2029 "source": {
2029 "type": "git", 2030 "type": "git",
2030 "url": "https://github.com/symfony/console.git", 2031 "url": "https://github.com/symfony/console.git",
2031 - "reference": "ebcdc507829df915f4ca23067bd59ee4ef61f6c3" 2032 + "reference": "5a02eaadaa285e2bb727eb6bbdfb8201fcd971b0"
2032 }, 2033 },
2033 "dist": { 2034 "dist": {
2034 "type": "zip", 2035 "type": "zip",
2035 - "url": "https://api.github.com/repos/symfony/console/zipball/ebcdc507829df915f4ca23067bd59ee4ef61f6c3", 2036 + "url": "https://api.github.com/repos/symfony/console/zipball/5a02eaadaa285e2bb727eb6bbdfb8201fcd971b0",
2036 - "reference": "ebcdc507829df915f4ca23067bd59ee4ef61f6c3", 2037 + "reference": "5a02eaadaa285e2bb727eb6bbdfb8201fcd971b0",
2037 "shasum": "" 2038 "shasum": ""
2038 }, 2039 },
2039 "require": { 2040 "require": {
...@@ -2080,20 +2081,20 @@ ...@@ -2080,20 +2081,20 @@
2080 ], 2081 ],
2081 "description": "Symfony Console Component", 2082 "description": "Symfony Console Component",
2082 "homepage": "https://symfony.com", 2083 "homepage": "https://symfony.com",
2083 - "time": "2015-12-22 10:39:06" 2084 + "time": "2016-02-02 13:44:19"
2084 }, 2085 },
2085 { 2086 {
2086 "name": "symfony/debug", 2087 "name": "symfony/debug",
2087 - "version": "v3.0.1", 2088 + "version": "v3.0.2",
2088 "source": { 2089 "source": {
2089 "type": "git", 2090 "type": "git",
2090 "url": "https://github.com/symfony/debug.git", 2091 "url": "https://github.com/symfony/debug.git",
2091 - "reference": "73612266ac709769effdbfc0762e5b07cfd2ac2a" 2092 + "reference": "29606049ced1ec715475f88d1bbe587252a3476e"
2092 }, 2093 },
2093 "dist": { 2094 "dist": {
2094 "type": "zip", 2095 "type": "zip",
2095 - "url": "https://api.github.com/repos/symfony/debug/zipball/73612266ac709769effdbfc0762e5b07cfd2ac2a", 2096 + "url": "https://api.github.com/repos/symfony/debug/zipball/29606049ced1ec715475f88d1bbe587252a3476e",
2096 - "reference": "73612266ac709769effdbfc0762e5b07cfd2ac2a", 2097 + "reference": "29606049ced1ec715475f88d1bbe587252a3476e",
2097 "shasum": "" 2098 "shasum": ""
2098 }, 2099 },
2099 "require": { 2100 "require": {
...@@ -2137,20 +2138,20 @@ ...@@ -2137,20 +2138,20 @@
2137 ], 2138 ],
2138 "description": "Symfony Debug Component", 2139 "description": "Symfony Debug Component",
2139 "homepage": "https://symfony.com", 2140 "homepage": "https://symfony.com",
2140 - "time": "2015-12-26 13:39:53" 2141 + "time": "2016-01-27 05:14:46"
2141 }, 2142 },
2142 { 2143 {
2143 "name": "symfony/event-dispatcher", 2144 "name": "symfony/event-dispatcher",
2144 - "version": "v3.0.1", 2145 + "version": "v3.0.2",
2145 "source": { 2146 "source": {
2146 "type": "git", 2147 "type": "git",
2147 "url": "https://github.com/symfony/event-dispatcher.git", 2148 "url": "https://github.com/symfony/event-dispatcher.git",
2148 - "reference": "d36355e026905fa5229e1ed7b4e9eda2e67adfcf" 2149 + "reference": "4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa"
2149 }, 2150 },
2150 "dist": { 2151 "dist": {
2151 "type": "zip", 2152 "type": "zip",
2152 - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d36355e026905fa5229e1ed7b4e9eda2e67adfcf", 2153 + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa",
2153 - "reference": "d36355e026905fa5229e1ed7b4e9eda2e67adfcf", 2154 + "reference": "4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa",
2154 "shasum": "" 2155 "shasum": ""
2155 }, 2156 },
2156 "require": { 2157 "require": {
...@@ -2197,20 +2198,20 @@ ...@@ -2197,20 +2198,20 @@
2197 ], 2198 ],
2198 "description": "Symfony EventDispatcher Component", 2199 "description": "Symfony EventDispatcher Component",
2199 "homepage": "https://symfony.com", 2200 "homepage": "https://symfony.com",
2200 - "time": "2015-10-30 23:35:59" 2201 + "time": "2016-01-27 05:14:46"
2201 }, 2202 },
2202 { 2203 {
2203 "name": "symfony/finder", 2204 "name": "symfony/finder",
2204 - "version": "v3.0.1", 2205 + "version": "v3.0.2",
2205 "source": { 2206 "source": {
2206 "type": "git", 2207 "type": "git",
2207 "url": "https://github.com/symfony/finder.git", 2208 "url": "https://github.com/symfony/finder.git",
2208 - "reference": "8617895eb798b6bdb338321ce19453dc113e5675" 2209 + "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723"
2209 }, 2210 },
2210 "dist": { 2211 "dist": {
2211 "type": "zip", 2212 "type": "zip",
2212 - "url": "https://api.github.com/repos/symfony/finder/zipball/8617895eb798b6bdb338321ce19453dc113e5675", 2213 + "url": "https://api.github.com/repos/symfony/finder/zipball/623bda0abd9aa29e529c8e9c08b3b84171914723",
2213 - "reference": "8617895eb798b6bdb338321ce19453dc113e5675", 2214 + "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723",
2214 "shasum": "" 2215 "shasum": ""
2215 }, 2216 },
2216 "require": { 2217 "require": {
...@@ -2246,20 +2247,20 @@ ...@@ -2246,20 +2247,20 @@
2246 ], 2247 ],
2247 "description": "Symfony Finder Component", 2248 "description": "Symfony Finder Component",
2248 "homepage": "https://symfony.com", 2249 "homepage": "https://symfony.com",
2249 - "time": "2015-12-05 11:13:14" 2250 + "time": "2016-01-27 05:14:46"
2250 }, 2251 },
2251 { 2252 {
2252 "name": "symfony/http-foundation", 2253 "name": "symfony/http-foundation",
2253 - "version": "v3.0.1", 2254 + "version": "v3.0.2",
2254 "source": { 2255 "source": {
2255 "type": "git", 2256 "type": "git",
2256 "url": "https://github.com/symfony/http-foundation.git", 2257 "url": "https://github.com/symfony/http-foundation.git",
2257 - "reference": "939c8c28a5b1e4ab7317bc30c1f9aa881c4b06b5" 2258 + "reference": "9344a87ceedfc50354a39653e54257ee9aa6a77d"
2258 }, 2259 },
2259 "dist": { 2260 "dist": {
2260 "type": "zip", 2261 "type": "zip",
2261 - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/939c8c28a5b1e4ab7317bc30c1f9aa881c4b06b5", 2262 + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9344a87ceedfc50354a39653e54257ee9aa6a77d",
2262 - "reference": "939c8c28a5b1e4ab7317bc30c1f9aa881c4b06b5", 2263 + "reference": "9344a87ceedfc50354a39653e54257ee9aa6a77d",
2263 "shasum": "" 2264 "shasum": ""
2264 }, 2265 },
2265 "require": { 2266 "require": {
...@@ -2298,20 +2299,20 @@ ...@@ -2298,20 +2299,20 @@
2298 ], 2299 ],
2299 "description": "Symfony HttpFoundation Component", 2300 "description": "Symfony HttpFoundation Component",
2300 "homepage": "https://symfony.com", 2301 "homepage": "https://symfony.com",
2301 - "time": "2015-12-18 15:43:53" 2302 + "time": "2016-02-02 13:44:19"
2302 }, 2303 },
2303 { 2304 {
2304 "name": "symfony/http-kernel", 2305 "name": "symfony/http-kernel",
2305 - "version": "v3.0.1", 2306 + "version": "v3.0.2",
2306 "source": { 2307 "source": {
2307 "type": "git", 2308 "type": "git",
2308 "url": "https://github.com/symfony/http-kernel.git", 2309 "url": "https://github.com/symfony/http-kernel.git",
2309 - "reference": "f7933e9f19e26e7baba7ec04735b466fedd3a6db" 2310 + "reference": "cec02604450481ac26710ca4249cc61b57b23942"
2310 }, 2311 },
2311 "dist": { 2312 "dist": {
2312 "type": "zip", 2313 "type": "zip",
2313 - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f7933e9f19e26e7baba7ec04735b466fedd3a6db", 2314 + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/cec02604450481ac26710ca4249cc61b57b23942",
2314 - "reference": "f7933e9f19e26e7baba7ec04735b466fedd3a6db", 2315 + "reference": "cec02604450481ac26710ca4249cc61b57b23942",
2315 "shasum": "" 2316 "shasum": ""
2316 }, 2317 },
2317 "require": { 2318 "require": {
...@@ -2380,7 +2381,7 @@ ...@@ -2380,7 +2381,7 @@
2380 ], 2381 ],
2381 "description": "Symfony HttpKernel Component", 2382 "description": "Symfony HttpKernel Component",
2382 "homepage": "https://symfony.com", 2383 "homepage": "https://symfony.com",
2383 - "time": "2015-12-26 16:46:13" 2384 + "time": "2016-02-03 12:38:44"
2384 }, 2385 },
2385 { 2386 {
2386 "name": "symfony/polyfill-mbstring", 2387 "name": "symfony/polyfill-mbstring",
...@@ -2551,16 +2552,16 @@ ...@@ -2551,16 +2552,16 @@
2551 }, 2552 },
2552 { 2553 {
2553 "name": "symfony/process", 2554 "name": "symfony/process",
2554 - "version": "v3.0.1", 2555 + "version": "v3.0.2",
2555 "source": { 2556 "source": {
2556 "type": "git", 2557 "type": "git",
2557 "url": "https://github.com/symfony/process.git", 2558 "url": "https://github.com/symfony/process.git",
2558 - "reference": "f4794f1d00f0746621be3020ffbd8c5e0b217ee3" 2559 + "reference": "dfecef47506179db2501430e732adbf3793099c8"
2559 }, 2560 },
2560 "dist": { 2561 "dist": {
2561 "type": "zip", 2562 "type": "zip",
2562 - "url": "https://api.github.com/repos/symfony/process/zipball/f4794f1d00f0746621be3020ffbd8c5e0b217ee3", 2563 + "url": "https://api.github.com/repos/symfony/process/zipball/dfecef47506179db2501430e732adbf3793099c8",
2563 - "reference": "f4794f1d00f0746621be3020ffbd8c5e0b217ee3", 2564 + "reference": "dfecef47506179db2501430e732adbf3793099c8",
2564 "shasum": "" 2565 "shasum": ""
2565 }, 2566 },
2566 "require": { 2567 "require": {
...@@ -2596,20 +2597,20 @@ ...@@ -2596,20 +2597,20 @@
2596 ], 2597 ],
2597 "description": "Symfony Process Component", 2598 "description": "Symfony Process Component",
2598 "homepage": "https://symfony.com", 2599 "homepage": "https://symfony.com",
2599 - "time": "2015-12-23 11:04:02" 2600 + "time": "2016-02-02 13:44:19"
2600 }, 2601 },
2601 { 2602 {
2602 "name": "symfony/routing", 2603 "name": "symfony/routing",
2603 - "version": "v3.0.1", 2604 + "version": "v3.0.2",
2604 "source": { 2605 "source": {
2605 "type": "git", 2606 "type": "git",
2606 "url": "https://github.com/symfony/routing.git", 2607 "url": "https://github.com/symfony/routing.git",
2607 - "reference": "3b1bac52f42cb0f54df1a2dbabd55a1d214e2a59" 2608 + "reference": "4686baa55a835e1c1ede9b86ba02415c8c8d6166"
2608 }, 2609 },
2609 "dist": { 2610 "dist": {
2610 "type": "zip", 2611 "type": "zip",
2611 - "url": "https://api.github.com/repos/symfony/routing/zipball/3b1bac52f42cb0f54df1a2dbabd55a1d214e2a59", 2612 + "url": "https://api.github.com/repos/symfony/routing/zipball/4686baa55a835e1c1ede9b86ba02415c8c8d6166",
2612 - "reference": "3b1bac52f42cb0f54df1a2dbabd55a1d214e2a59", 2613 + "reference": "4686baa55a835e1c1ede9b86ba02415c8c8d6166",
2613 "shasum": "" 2614 "shasum": ""
2614 }, 2615 },
2615 "require": { 2616 "require": {
...@@ -2670,20 +2671,20 @@ ...@@ -2670,20 +2671,20 @@
2670 "uri", 2671 "uri",
2671 "url" 2672 "url"
2672 ], 2673 ],
2673 - "time": "2015-12-23 08:00:11" 2674 + "time": "2016-01-27 05:14:46"
2674 }, 2675 },
2675 { 2676 {
2676 "name": "symfony/translation", 2677 "name": "symfony/translation",
2677 - "version": "v3.0.1", 2678 + "version": "v3.0.2",
2678 "source": { 2679 "source": {
2679 "type": "git", 2680 "type": "git",
2680 "url": "https://github.com/symfony/translation.git", 2681 "url": "https://github.com/symfony/translation.git",
2681 - "reference": "dff0867826a7068d673801b7522f8e2634016ef9" 2682 + "reference": "2de0b6f7ebe43cffd8a06996ebec6aab79ea9e91"
2682 }, 2683 },
2683 "dist": { 2684 "dist": {
2684 "type": "zip", 2685 "type": "zip",
2685 - "url": "https://api.github.com/repos/symfony/translation/zipball/dff0867826a7068d673801b7522f8e2634016ef9", 2686 + "url": "https://api.github.com/repos/symfony/translation/zipball/2de0b6f7ebe43cffd8a06996ebec6aab79ea9e91",
2686 - "reference": "dff0867826a7068d673801b7522f8e2634016ef9", 2687 + "reference": "2de0b6f7ebe43cffd8a06996ebec6aab79ea9e91",
2687 "shasum": "" 2688 "shasum": ""
2688 }, 2689 },
2689 "require": { 2690 "require": {
...@@ -2734,20 +2735,20 @@ ...@@ -2734,20 +2735,20 @@
2734 ], 2735 ],
2735 "description": "Symfony Translation Component", 2736 "description": "Symfony Translation Component",
2736 "homepage": "https://symfony.com", 2737 "homepage": "https://symfony.com",
2737 - "time": "2015-12-05 17:45:07" 2738 + "time": "2016-02-02 13:44:19"
2738 }, 2739 },
2739 { 2740 {
2740 "name": "symfony/var-dumper", 2741 "name": "symfony/var-dumper",
2741 - "version": "v3.0.1", 2742 + "version": "v3.0.2",
2742 "source": { 2743 "source": {
2743 "type": "git", 2744 "type": "git",
2744 "url": "https://github.com/symfony/var-dumper.git", 2745 "url": "https://github.com/symfony/var-dumper.git",
2745 - "reference": "87db8700deb12ba2b65e858f656a1f885530bcb0" 2746 + "reference": "24bb94807eff00db49374c37ebf56a0304e8aef3"
2746 }, 2747 },
2747 "dist": { 2748 "dist": {
2748 "type": "zip", 2749 "type": "zip",
2749 - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/87db8700deb12ba2b65e858f656a1f885530bcb0", 2750 + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/24bb94807eff00db49374c37ebf56a0304e8aef3",
2750 - "reference": "87db8700deb12ba2b65e858f656a1f885530bcb0", 2751 + "reference": "24bb94807eff00db49374c37ebf56a0304e8aef3",
2751 "shasum": "" 2752 "shasum": ""
2752 }, 2753 },
2753 "require": { 2754 "require": {
...@@ -2797,7 +2798,7 @@ ...@@ -2797,7 +2798,7 @@
2797 "debug", 2798 "debug",
2798 "dump" 2799 "dump"
2799 ], 2800 ],
2800 - "time": "2015-12-05 11:13:14" 2801 + "time": "2016-01-07 13:38:51"
2801 }, 2802 },
2802 { 2803 {
2803 "name": "vlucas/phpdotenv", 2804 "name": "vlucas/phpdotenv",
...@@ -3182,22 +3183,24 @@ ...@@ -3182,22 +3183,24 @@
3182 }, 3183 },
3183 { 3184 {
3184 "name": "phpspec/prophecy", 3185 "name": "phpspec/prophecy",
3185 - "version": "v1.5.0", 3186 + "version": "v1.6.0",
3186 "source": { 3187 "source": {
3187 "type": "git", 3188 "type": "git",
3188 "url": "https://github.com/phpspec/prophecy.git", 3189 "url": "https://github.com/phpspec/prophecy.git",
3189 - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" 3190 + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972"
3190 }, 3191 },
3191 "dist": { 3192 "dist": {
3192 "type": "zip", 3193 "type": "zip",
3193 - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", 3194 + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972",
3194 - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", 3195 + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972",
3195 "shasum": "" 3196 "shasum": ""
3196 }, 3197 },
3197 "require": { 3198 "require": {
3198 "doctrine/instantiator": "^1.0.2", 3199 "doctrine/instantiator": "^1.0.2",
3200 + "php": "^5.3|^7.0",
3199 "phpdocumentor/reflection-docblock": "~2.0", 3201 "phpdocumentor/reflection-docblock": "~2.0",
3200 - "sebastian/comparator": "~1.1" 3202 + "sebastian/comparator": "~1.1",
3203 + "sebastian/recursion-context": "~1.0"
3201 }, 3204 },
3202 "require-dev": { 3205 "require-dev": {
3203 "phpspec/phpspec": "~2.0" 3206 "phpspec/phpspec": "~2.0"
...@@ -3205,7 +3208,7 @@ ...@@ -3205,7 +3208,7 @@
3205 "type": "library", 3208 "type": "library",
3206 "extra": { 3209 "extra": {
3207 "branch-alias": { 3210 "branch-alias": {
3208 - "dev-master": "1.4.x-dev" 3211 + "dev-master": "1.5.x-dev"
3209 } 3212 }
3210 }, 3213 },
3211 "autoload": { 3214 "autoload": {
...@@ -3238,7 +3241,7 @@ ...@@ -3238,7 +3241,7 @@
3238 "spy", 3241 "spy",
3239 "stub" 3242 "stub"
3240 ], 3243 ],
3241 - "time": "2015-08-13 10:07:40" 3244 + "time": "2016-02-15 07:46:21"
3242 }, 3245 },
3243 { 3246 {
3244 "name": "phpunit/php-code-coverage", 3247 "name": "phpunit/php-code-coverage",
...@@ -3482,16 +3485,16 @@ ...@@ -3482,16 +3485,16 @@
3482 }, 3485 },
3483 { 3486 {
3484 "name": "phpunit/phpunit", 3487 "name": "phpunit/phpunit",
3485 - "version": "4.8.21", 3488 + "version": "4.8.23",
3486 "source": { 3489 "source": {
3487 "type": "git", 3490 "type": "git",
3488 "url": "https://github.com/sebastianbergmann/phpunit.git", 3491 "url": "https://github.com/sebastianbergmann/phpunit.git",
3489 - "reference": "ea76b17bced0500a28098626b84eda12dbcf119c" 3492 + "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483"
3490 }, 3493 },
3491 "dist": { 3494 "dist": {
3492 "type": "zip", 3495 "type": "zip",
3493 - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea76b17bced0500a28098626b84eda12dbcf119c", 3496 + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483",
3494 - "reference": "ea76b17bced0500a28098626b84eda12dbcf119c", 3497 + "reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483",
3495 "shasum": "" 3498 "shasum": ""
3496 }, 3499 },
3497 "require": { 3500 "require": {
...@@ -3550,7 +3553,7 @@ ...@@ -3550,7 +3553,7 @@
3550 "testing", 3553 "testing",
3551 "xunit" 3554 "xunit"
3552 ], 3555 ],
3553 - "time": "2015-12-12 07:45:58" 3556 + "time": "2016-02-11 14:56:33"
3554 }, 3557 },
3555 { 3558 {
3556 "name": "phpunit/phpunit-mock-objects", 3559 "name": "phpunit/phpunit-mock-objects",
...@@ -3981,16 +3984,16 @@ ...@@ -3981,16 +3984,16 @@
3981 }, 3984 },
3982 { 3985 {
3983 "name": "symfony/css-selector", 3986 "name": "symfony/css-selector",
3984 - "version": "v3.0.1", 3987 + "version": "v3.0.2",
3985 "source": { 3988 "source": {
3986 "type": "git", 3989 "type": "git",
3987 "url": "https://github.com/symfony/css-selector.git", 3990 "url": "https://github.com/symfony/css-selector.git",
3988 - "reference": "4613311fd46e146f506403ce2f8a0c71d402d2a3" 3991 + "reference": "6605602690578496091ac20ec7a5cbd160d4dff4"
3989 }, 3992 },
3990 "dist": { 3993 "dist": {
3991 "type": "zip", 3994 "type": "zip",
3992 - "url": "https://api.github.com/repos/symfony/css-selector/zipball/4613311fd46e146f506403ce2f8a0c71d402d2a3", 3995 + "url": "https://api.github.com/repos/symfony/css-selector/zipball/6605602690578496091ac20ec7a5cbd160d4dff4",
3993 - "reference": "4613311fd46e146f506403ce2f8a0c71d402d2a3", 3996 + "reference": "6605602690578496091ac20ec7a5cbd160d4dff4",
3994 "shasum": "" 3997 "shasum": ""
3995 }, 3998 },
3996 "require": { 3999 "require": {
...@@ -4030,20 +4033,20 @@ ...@@ -4030,20 +4033,20 @@
4030 ], 4033 ],
4031 "description": "Symfony CssSelector Component", 4034 "description": "Symfony CssSelector Component",
4032 "homepage": "https://symfony.com", 4035 "homepage": "https://symfony.com",
4033 - "time": "2015-12-05 17:45:07" 4036 + "time": "2016-01-27 05:14:46"
4034 }, 4037 },
4035 { 4038 {
4036 "name": "symfony/dom-crawler", 4039 "name": "symfony/dom-crawler",
4037 - "version": "v3.0.1", 4040 + "version": "v3.0.2",
4038 "source": { 4041 "source": {
4039 "type": "git", 4042 "type": "git",
4040 "url": "https://github.com/symfony/dom-crawler.git", 4043 "url": "https://github.com/symfony/dom-crawler.git",
4041 - "reference": "7c622b0c9fb8bdb146d6dfa86c5f91dcbfdbc11d" 4044 + "reference": "b693a9650aa004576b593ff2e91ae749dc90123d"
4042 }, 4045 },
4043 "dist": { 4046 "dist": {
4044 "type": "zip", 4047 "type": "zip",
4045 - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/7c622b0c9fb8bdb146d6dfa86c5f91dcbfdbc11d", 4048 + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b693a9650aa004576b593ff2e91ae749dc90123d",
4046 - "reference": "7c622b0c9fb8bdb146d6dfa86c5f91dcbfdbc11d", 4049 + "reference": "b693a9650aa004576b593ff2e91ae749dc90123d",
4047 "shasum": "" 4050 "shasum": ""
4048 }, 4051 },
4049 "require": { 4052 "require": {
...@@ -4086,20 +4089,20 @@ ...@@ -4086,20 +4089,20 @@
4086 ], 4089 ],
4087 "description": "Symfony DomCrawler Component", 4090 "description": "Symfony DomCrawler Component",
4088 "homepage": "https://symfony.com", 4091 "homepage": "https://symfony.com",
4089 - "time": "2015-12-26 13:42:31" 4092 + "time": "2016-01-25 09:56:57"
4090 }, 4093 },
4091 { 4094 {
4092 "name": "symfony/yaml", 4095 "name": "symfony/yaml",
4093 - "version": "v3.0.1", 4096 + "version": "v3.0.2",
4094 "source": { 4097 "source": {
4095 "type": "git", 4098 "type": "git",
4096 "url": "https://github.com/symfony/yaml.git", 4099 "url": "https://github.com/symfony/yaml.git",
4097 - "reference": "3df409958a646dad2bc5046c3fb671ee24a1a691" 4100 + "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a"
4098 }, 4101 },
4099 "dist": { 4102 "dist": {
4100 "type": "zip", 4103 "type": "zip",
4101 - "url": "https://api.github.com/repos/symfony/yaml/zipball/3df409958a646dad2bc5046c3fb671ee24a1a691", 4104 + "url": "https://api.github.com/repos/symfony/yaml/zipball/3cf0709d7fe936e97bee9e954382e449003f1d9a",
4102 - "reference": "3df409958a646dad2bc5046c3fb671ee24a1a691", 4105 + "reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a",
4103 "shasum": "" 4106 "shasum": ""
4104 }, 4107 },
4105 "require": { 4108 "require": {
...@@ -4135,7 +4138,7 @@ ...@@ -4135,7 +4138,7 @@
4135 ], 4138 ],
4136 "description": "Symfony Yaml Component", 4139 "description": "Symfony Yaml Component",
4137 "homepage": "https://symfony.com", 4140 "homepage": "https://symfony.com",
4138 - "time": "2015-12-26 13:39:53" 4141 + "time": "2016-02-02 13:44:19"
4139 } 4142 }
4140 ], 4143 ],
4141 "aliases": [], 4144 "aliases": [],
......
...@@ -18,7 +18,7 @@ class CreateUsersTable extends Migration ...@@ -18,7 +18,7 @@ class CreateUsersTable extends Migration
18 $table->string('email')->unique(); 18 $table->string('email')->unique();
19 $table->string('password', 60); 19 $table->string('password', 60);
20 $table->rememberToken(); 20 $table->rememberToken();
21 - $table->timestamps(); 21 + $table->nullableTimestamps();
22 }); 22 });
23 23
24 \BookStack\User::forceCreate([ 24 \BookStack\User::forceCreate([
......
...@@ -17,7 +17,7 @@ class CreateBooksTable extends Migration ...@@ -17,7 +17,7 @@ class CreateBooksTable extends Migration
17 $table->string('name'); 17 $table->string('name');
18 $table->string('slug')->indexed(); 18 $table->string('slug')->indexed();
19 $table->text('description'); 19 $table->text('description');
20 - $table->timestamps(); 20 + $table->nullableTimestamps();
21 }); 21 });
22 } 22 }
23 23
......
...@@ -21,7 +21,7 @@ class CreatePagesTable extends Migration ...@@ -21,7 +21,7 @@ class CreatePagesTable extends Migration
21 $table->longText('html'); 21 $table->longText('html');
22 $table->longText('text'); 22 $table->longText('text');
23 $table->integer('priority'); 23 $table->integer('priority');
24 - $table->timestamps(); 24 + $table->nullableTimestamps();
25 }); 25 });
26 } 26 }
27 27
......
...@@ -16,7 +16,7 @@ class CreateImagesTable extends Migration ...@@ -16,7 +16,7 @@ class CreateImagesTable extends Migration
16 $table->increments('id'); 16 $table->increments('id');
17 $table->string('name'); 17 $table->string('name');
18 $table->string('url'); 18 $table->string('url');
19 - $table->timestamps(); 19 + $table->nullableTimestamps();
20 }); 20 });
21 } 21 }
22 22
......
...@@ -19,7 +19,7 @@ class CreateChaptersTable extends Migration ...@@ -19,7 +19,7 @@ class CreateChaptersTable extends Migration
19 $table->text('name'); 19 $table->text('name');
20 $table->text('description'); 20 $table->text('description');
21 $table->integer('priority'); 21 $table->integer('priority');
22 - $table->timestamps(); 22 + $table->nullableTimestamps();
23 }); 23 });
24 } 24 }
25 25
......
...@@ -19,7 +19,7 @@ class CreatePageRevisionsTable extends Migration ...@@ -19,7 +19,7 @@ class CreatePageRevisionsTable extends Migration
19 $table->longText('html'); 19 $table->longText('html');
20 $table->longText('text'); 20 $table->longText('text');
21 $table->integer('created_by'); 21 $table->integer('created_by');
22 - $table->timestamps(); 22 + $table->nullableTimestamps();
23 }); 23 });
24 } 24 }
25 25
......
...@@ -20,7 +20,7 @@ class CreateActivitiesTable extends Migration ...@@ -20,7 +20,7 @@ class CreateActivitiesTable extends Migration
20 $table->integer('user_id'); 20 $table->integer('user_id');
21 $table->integer('entity_id'); 21 $table->integer('entity_id');
22 $table->string('entity_type'); 22 $table->string('entity_type');
23 - $table->timestamps(); 23 + $table->nullableTimestamps();
24 }); 24 });
25 } 25 }
26 26
......
...@@ -28,7 +28,7 @@ class AddRolesAndPermissions extends Migration ...@@ -28,7 +28,7 @@ class AddRolesAndPermissions extends Migration
28 $table->string('name')->unique(); 28 $table->string('name')->unique();
29 $table->string('display_name')->nullable(); 29 $table->string('display_name')->nullable();
30 $table->string('description')->nullable(); 30 $table->string('description')->nullable();
31 - $table->timestamps(); 31 + $table->nullableTimestamps();
32 }); 32 });
33 33
34 // Create table for associating roles to users (Many-to-Many) 34 // Create table for associating roles to users (Many-to-Many)
...@@ -50,7 +50,7 @@ class AddRolesAndPermissions extends Migration ...@@ -50,7 +50,7 @@ class AddRolesAndPermissions extends Migration
50 $table->string('name')->unique(); 50 $table->string('name')->unique();
51 $table->string('display_name')->nullable(); 51 $table->string('display_name')->nullable();
52 $table->string('description')->nullable(); 52 $table->string('description')->nullable();
53 - $table->timestamps(); 53 + $table->nullableTimestamps();
54 }); 54 });
55 55
56 // Create table for associating permissions to roles (Many-to-Many) 56 // Create table for associating permissions to roles (Many-to-Many)
......
...@@ -15,7 +15,7 @@ class CreateSettingsTable extends Migration ...@@ -15,7 +15,7 @@ class CreateSettingsTable extends Migration
15 Schema::create('settings', function (Blueprint $table) { 15 Schema::create('settings', function (Blueprint $table) {
16 $table->string('setting_key')->primary()->indexed(); 16 $table->string('setting_key')->primary()->indexed();
17 $table->text('value'); 17 $table->text('value');
18 - $table->timestamps(); 18 + $table->nullableTimestamps();
19 }); 19 });
20 } 20 }
21 21
......
...@@ -18,7 +18,7 @@ class CreateSocialAccountsTable extends Migration ...@@ -18,7 +18,7 @@ class CreateSocialAccountsTable extends Migration
18 $table->string('driver')->index(); 18 $table->string('driver')->index();
19 $table->string('driver_id'); 19 $table->string('driver_id');
20 $table->string('avatar'); 20 $table->string('avatar');
21 - $table->timestamps(); 21 + $table->nullableTimestamps();
22 }); 22 });
23 } 23 }
24 24
......
...@@ -20,7 +20,7 @@ class AddEmailConfirmationTable extends Migration ...@@ -20,7 +20,7 @@ class AddEmailConfirmationTable extends Migration
20 $table->increments('id'); 20 $table->increments('id');
21 $table->integer('user_id')->index(); 21 $table->integer('user_id')->index();
22 $table->string('token')->index(); 22 $table->string('token')->index();
23 - $table->timestamps(); 23 + $table->nullableTimestamps();
24 }); 24 });
25 } 25 }
26 26
......
...@@ -18,7 +18,7 @@ class CreateViewsTable extends Migration ...@@ -18,7 +18,7 @@ class CreateViewsTable extends Migration
18 $table->integer('viewable_id'); 18 $table->integer('viewable_id');
19 $table->string('viewable_type'); 19 $table->string('viewable_type');
20 $table->integer('views'); 20 $table->integer('views');
21 - $table->timestamps(); 21 + $table->nullableTimestamps();
22 }); 22 });
23 } 23 }
24 24
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
58 </span> 58 </span>
59 <ul> 59 <ul>
60 <li> 60 <li>
61 - <a href="/users/{{$currentUser->id}}" class="text-primary"><i class="zmdi zmdi-edit zmdi-hc-lg"></i>Edit Profile</a> 61 + <a href="/settings/users/{{$currentUser->id}}" class="text-primary"><i class="zmdi zmdi-edit zmdi-hc-lg"></i>Edit Profile</a>
62 </li> 62 </li>
63 <li> 63 <li>
64 <a href="/logout" class="text-neg"><i class="zmdi zmdi-run zmdi-hc-lg"></i>Logout</a> 64 <a href="/logout" class="text-neg"><i class="zmdi zmdi-run zmdi-hc-lg"></i>Logout</a>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 <div class="row"> 4 <div class="row">
5 <div class="col-md-12 setting-nav"> 5 <div class="col-md-12 setting-nav">
6 <a href="/settings" @if($selected == 'settings') class="selected text-button" @endif><i class="zmdi zmdi-settings"></i>Settings</a> 6 <a href="/settings" @if($selected == 'settings') class="selected text-button" @endif><i class="zmdi zmdi-settings"></i>Settings</a>
7 - <a href="/users" @if($selected == 'users') class="selected text-button" @endif><i class="zmdi zmdi-accounts"></i>Users</a> 7 + <a href="/settings/users" @if($selected == 'users') class="selected text-button" @endif><i class="zmdi zmdi-accounts"></i>Users</a>
8 </div> 8 </div>
9 </div> 9 </div>
10 </div> 10 </div>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <div class="container small" ng-non-bindable> 6 <div class="container small" ng-non-bindable>
7 <h1>Create User</h1> 7 <h1>Create User</h1>
8 8
9 - <form action="/users/create" method="post"> 9 + <form action="/settings/users/create" method="post">
10 {!! csrf_field() !!} 10 {!! csrf_field() !!}
11 @include('users.forms.' . $authMethod) 11 @include('users.forms.' . $authMethod)
12 </form> 12 </form>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <p>This will fully delete this user with the name '<span class="text-neg">{{$user->name}}</span>' from the system.</p> 7 <p>This will fully delete this user with the name '<span class="text-neg">{{$user->name}}</span>' from the system.</p>
8 <p class="text-neg">Are you sure you want to delete this user?</p> 8 <p class="text-neg">Are you sure you want to delete this user?</p>
9 9
10 - <form action="/users/{{$user->id}}" method="POST"> 10 + <form action="/settings/users/{{$user->id}}" method="POST">
11 {!! csrf_field() !!} 11 {!! csrf_field() !!}
12 <input type="hidden" name="_method" value="DELETE"> 12 <input type="hidden" name="_method" value="DELETE">
13 <a href="/users/{{$user->id}}" class="button muted">Cancel</a> 13 <a href="/users/{{$user->id}}" class="button muted">Cancel</a>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <div class="col-sm-6"></div> 9 <div class="col-sm-6"></div>
10 <div class="col-sm-6 faded"> 10 <div class="col-sm-6 faded">
11 <div class="action-buttons"> 11 <div class="action-buttons">
12 - <a href="/users/{{$user->id}}/delete" class="text-neg text-button"><i class="zmdi zmdi-delete"></i>Delete User</a> 12 + <a href="/settings/users/{{$user->id}}/delete" class="text-neg text-button"><i class="zmdi zmdi-delete"></i>Delete User</a>
13 </div> 13 </div>
14 </div> 14 </div>
15 </div> 15 </div>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
19 19
20 20
21 <div class="container small"> 21 <div class="container small">
22 - <form action="/users/{{$user->id}}" method="post"> 22 + <form action="/settings/users/{{$user->id}}" method="post">
23 <div class="row"> 23 <div class="row">
24 <div class="col-md-6" ng-non-bindable> 24 <div class="col-md-6" ng-non-bindable>
25 <h1>Edit {{ $user->id === $currentUser->id ? 'Profile' : 'User' }}</h1> 25 <h1>Edit {{ $user->id === $currentUser->id ? 'Profile' : 'User' }}</h1>
......
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
25 @endif 25 @endif
26 26
27 <div class="form-group"> 27 <div class="form-group">
28 - <a href="/users" class="button muted">Cancel</a> 28 + <a href="/settings/users" class="button muted">Cancel</a>
29 <button class="button pos" type="submit">Save</button> 29 <button class="button pos" type="submit">Save</button>
30 </div> 30 </div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
34 </div> 34 </div>
35 35
36 <div class="form-group"> 36 <div class="form-group">
37 - <a href="/users" class="button muted">Cancel</a> 37 + <a href="/settings/users" class="button muted">Cancel</a>
38 <button class="button pos" type="submit">Save</button> 38 <button class="button pos" type="submit">Save</button>
39 </div> 39 </div>
40 40
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
10 <h1>Users</h1> 10 <h1>Users</h1>
11 @if($currentUser->can('user-create')) 11 @if($currentUser->can('user-create'))
12 <p> 12 <p>
13 - <a href="/users/create" class="text-pos"><i class="zmdi zmdi-account-add"></i>Add new user</a> 13 + <a href="/settings/users/create" class="text-pos"><i class="zmdi zmdi-account-add"></i>Add new user</a>
14 </p> 14 </p>
15 @endif 15 @endif
16 <table class="table"> 16 <table class="table">
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
25 <td style="line-height: 0;"><img class="avatar med" src="{{$user->getAvatar(40)}}" alt="{{$user->name}}"></td> 25 <td style="line-height: 0;"><img class="avatar med" src="{{$user->getAvatar(40)}}" alt="{{$user->name}}"></td>
26 <td> 26 <td>
27 @if($currentUser->can('user-update') || $currentUser->id == $user->id) 27 @if($currentUser->can('user-update') || $currentUser->id == $user->id)
28 - <a href="/users/{{$user->id}}"> 28 + <a href="/settings/users/{{$user->id}}">
29 @endif 29 @endif
30 {{ $user->name }} 30 {{ $user->name }}
31 @if($currentUser->can('user-update') || $currentUser->id == $user->id) 31 @if($currentUser->can('user-update') || $currentUser->id == $user->id)
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
34 </td> 34 </td>
35 <td> 35 <td>
36 @if($currentUser->can('user-update') || $currentUser->id == $user->id) 36 @if($currentUser->can('user-update') || $currentUser->id == $user->id)
37 - <a href="/users/{{$user->id}}"> 37 + <a href="/settings/users/{{$user->id}}">
38 @endif 38 @endif
39 {{ $user->email }} 39 {{ $user->email }}
40 @if($currentUser->can('user-update') || $currentUser->id == $user->id) 40 @if($currentUser->can('user-update') || $currentUser->id == $user->id)
......
1 +@extends('base')
2 +
3 +@section('content')
4 +
5 + <div class="container" ng-non-bindable>
6 + <div class="row">
7 + <div class="col-sm-8">
8 +
9 + <div class="padded-top large"></div>
10 + <img class="" src="{{$user->getAvatar(120)}}" alt="{{ $user->name }}">
11 + <h3>{{ $user->name }}</h3>
12 + <p class="text-muted">
13 + User for {{ $user->created_at->diffForHumans(null, true) }}
14 + </p>
15 +
16 + </div>
17 +
18 + <div class="col-sm-4">
19 + <h3>Recent Activity</h3>
20 + @include('partials/activity-list', ['activity' => $activity])
21 + </div>
22 +
23 + </div>
24 + </div>
25 +
26 +
27 +@stop
...\ No newline at end of file ...\ No newline at end of file
...@@ -129,7 +129,7 @@ class AuthTest extends TestCase ...@@ -129,7 +129,7 @@ class AuthTest extends TestCase
129 $user = factory(\BookStack\User::class)->make(); 129 $user = factory(\BookStack\User::class)->make();
130 130
131 $this->asAdmin() 131 $this->asAdmin()
132 - ->visit('/users') 132 + ->visit('/settings/users')
133 ->click('Add new user') 133 ->click('Add new user')
134 ->type($user->name, '#name') 134 ->type($user->name, '#name')
135 ->type($user->email, '#email') 135 ->type($user->email, '#email')
...@@ -138,7 +138,7 @@ class AuthTest extends TestCase ...@@ -138,7 +138,7 @@ class AuthTest extends TestCase
138 ->type($user->password, '#password-confirm') 138 ->type($user->password, '#password-confirm')
139 ->press('Save') 139 ->press('Save')
140 ->seeInDatabase('users', $user->toArray()) 140 ->seeInDatabase('users', $user->toArray())
141 - ->seePageIs('/users') 141 + ->seePageIs('/settings/users')
142 ->see($user->name); 142 ->see($user->name);
143 } 143 }
144 144
...@@ -147,13 +147,13 @@ class AuthTest extends TestCase ...@@ -147,13 +147,13 @@ class AuthTest extends TestCase
147 $user = \BookStack\User::all()->last(); 147 $user = \BookStack\User::all()->last();
148 $password = $user->password; 148 $password = $user->password;
149 $this->asAdmin() 149 $this->asAdmin()
150 - ->visit('/users') 150 + ->visit('/settings/users')
151 ->click($user->name) 151 ->click($user->name)
152 - ->seePageIs('/users/' . $user->id) 152 + ->seePageIs('/settings/users/' . $user->id)
153 ->see($user->email) 153 ->see($user->email)
154 ->type('Barry Scott', '#name') 154 ->type('Barry Scott', '#name')
155 ->press('Save') 155 ->press('Save')
156 - ->seePageIs('/users') 156 + ->seePageIs('/settings/users')
157 ->seeInDatabase('users', ['id' => $user->id, 'name' => 'Barry Scott', 'password' => $password]) 157 ->seeInDatabase('users', ['id' => $user->id, 'name' => 'Barry Scott', 'password' => $password])
158 ->notSeeInDatabase('users', ['name' => $user->name]); 158 ->notSeeInDatabase('users', ['name' => $user->name]);
159 } 159 }
...@@ -161,7 +161,7 @@ class AuthTest extends TestCase ...@@ -161,7 +161,7 @@ class AuthTest extends TestCase
161 public function test_user_password_update() 161 public function test_user_password_update()
162 { 162 {
163 $user = \BookStack\User::all()->last(); 163 $user = \BookStack\User::all()->last();
164 - $userProfilePage = '/users/' . $user->id; 164 + $userProfilePage = '/settings/users/' . $user->id;
165 $this->asAdmin() 165 $this->asAdmin()
166 ->visit($userProfilePage) 166 ->visit($userProfilePage)
167 ->type('newpassword', '#password') 167 ->type('newpassword', '#password')
...@@ -172,7 +172,7 @@ class AuthTest extends TestCase ...@@ -172,7 +172,7 @@ class AuthTest extends TestCase
172 ->type('newpassword', '#password') 172 ->type('newpassword', '#password')
173 ->type('newpassword', '#password-confirm') 173 ->type('newpassword', '#password-confirm')
174 ->press('Save') 174 ->press('Save')
175 - ->seePageIs('/users'); 175 + ->seePageIs('/settings/users');
176 176
177 $userPassword = \BookStack\User::find($user->id)->password; 177 $userPassword = \BookStack\User::find($user->id)->password;
178 $this->assertTrue(Hash::check('newpassword', $userPassword)); 178 $this->assertTrue(Hash::check('newpassword', $userPassword));
...@@ -184,11 +184,11 @@ class AuthTest extends TestCase ...@@ -184,11 +184,11 @@ class AuthTest extends TestCase
184 $user = $this->getNewUser($userDetails->toArray()); 184 $user = $this->getNewUser($userDetails->toArray());
185 185
186 $this->asAdmin() 186 $this->asAdmin()
187 - ->visit('/users/' . $user->id) 187 + ->visit('/settings/users/' . $user->id)
188 ->click('Delete User') 188 ->click('Delete User')
189 ->see($user->name) 189 ->see($user->name)
190 ->press('Confirm') 190 ->press('Confirm')
191 - ->seePageIs('/users') 191 + ->seePageIs('/settings/users')
192 ->notSeeInDatabase('users', ['name' => $user->name]); 192 ->notSeeInDatabase('users', ['name' => $user->name]);
193 } 193 }
194 194
...@@ -199,10 +199,10 @@ class AuthTest extends TestCase ...@@ -199,10 +199,10 @@ class AuthTest extends TestCase
199 $this->assertEquals(1, $adminRole->users()->count()); 199 $this->assertEquals(1, $adminRole->users()->count());
200 $user = $adminRole->users->first(); 200 $user = $adminRole->users->first();
201 201
202 - $this->asAdmin()->visit('/users/' . $user->id) 202 + $this->asAdmin()->visit('/settings/users/' . $user->id)
203 ->click('Delete User') 203 ->click('Delete User')
204 ->press('Confirm') 204 ->press('Confirm')
205 - ->seePageIs('/users/' . $user->id) 205 + ->seePageIs('/settings/users/' . $user->id)
206 ->see('You cannot delete the only admin'); 206 ->see('You cannot delete the only admin');
207 } 207 }
208 208
......
...@@ -94,7 +94,7 @@ class LdapTest extends \TestCase ...@@ -94,7 +94,7 @@ class LdapTest extends \TestCase
94 94
95 public function test_create_user_form() 95 public function test_create_user_form()
96 { 96 {
97 - $this->asAdmin()->visit('/users/create') 97 + $this->asAdmin()->visit('/settings/users/create')
98 ->dontSee('Password') 98 ->dontSee('Password')
99 ->type($this->mockUser->name, '#name') 99 ->type($this->mockUser->name, '#name')
100 ->type($this->mockUser->email, '#email') 100 ->type($this->mockUser->email, '#email')
...@@ -102,19 +102,19 @@ class LdapTest extends \TestCase ...@@ -102,19 +102,19 @@ class LdapTest extends \TestCase
102 ->see('The external auth id field is required.') 102 ->see('The external auth id field is required.')
103 ->type($this->mockUser->name, '#external_auth_id') 103 ->type($this->mockUser->name, '#external_auth_id')
104 ->press('Save') 104 ->press('Save')
105 - ->seePageIs('/users') 105 + ->seePageIs('/settings/users')
106 ->seeInDatabase('users', ['email' => $this->mockUser->email, 'external_auth_id' => $this->mockUser->name, 'email_confirmed' => true]); 106 ->seeInDatabase('users', ['email' => $this->mockUser->email, 'external_auth_id' => $this->mockUser->name, 'email_confirmed' => true]);
107 } 107 }
108 108
109 public function test_user_edit_form() 109 public function test_user_edit_form()
110 { 110 {
111 $editUser = User::all()->last(); 111 $editUser = User::all()->last();
112 - $this->asAdmin()->visit('/users/' . $editUser->id) 112 + $this->asAdmin()->visit('/settings/users/' . $editUser->id)
113 ->see('Edit User') 113 ->see('Edit User')
114 ->dontSee('Password') 114 ->dontSee('Password')
115 ->type('test_auth_id', '#external_auth_id') 115 ->type('test_auth_id', '#external_auth_id')
116 ->press('Save') 116 ->press('Save')
117 - ->seePageIs('/users') 117 + ->seePageIs('/settings/users')
118 ->seeInDatabase('users', ['email' => $editUser->email, 'external_auth_id' => 'test_auth_id']); 118 ->seeInDatabase('users', ['email' => $editUser->email, 'external_auth_id' => 'test_auth_id']);
119 } 119 }
120 120
...@@ -127,7 +127,7 @@ class LdapTest extends \TestCase ...@@ -127,7 +127,7 @@ class LdapTest extends \TestCase
127 public function test_non_admins_cannot_change_auth_id() 127 public function test_non_admins_cannot_change_auth_id()
128 { 128 {
129 $testUser = User::all()->last(); 129 $testUser = User::all()->last();
130 - $this->actingAs($testUser)->visit('/users/' . $testUser->id) 130 + $this->actingAs($testUser)->visit('/settings/users/' . $testUser->id)
131 ->dontSee('External Authentication'); 131 ->dontSee('External Authentication');
132 } 132 }
133 133
......