@@ -65,10 +65,10 @@ |
||
| 65 | 65 | redirectWith(base_url(true) . '/' . current_lang() . '/verify', $request->all()); |
| 66 | 66 | } |
| 67 | 67 | } else { |
| 68 | - $token = (string)route_param('code'); |
|
| 68 | + $token = (string) route_param('code'); |
|
| 69 | 69 | |
| 70 | 70 | if (!$this->checkToken($token)) { |
| 71 | - stop(function () use ($response) { |
|
| 71 | + stop(function() use ($response) { |
|
| 72 | 72 | $response->html(partial('errors/404'), 404); |
| 73 | 73 | }); |
| 74 | 74 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $this->validator = new Validator(); |
| 45 | 45 | |
| 46 | - $this->validator->addValidation('uniqueUser', function ($value) { |
|
| 46 | + $this->validator->addValidation('uniqueUser', function($value) { |
|
| 47 | 47 | $userModel = ModelFactory::get(User::class); |
| 48 | 48 | return empty($userModel->findOneBy('email', $value)->asArray()); |
| 49 | 49 | }); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | if ($request->isMethod('post')) { |
| 83 | 83 | $captchaName = captcha()->getName(); |
| 84 | 84 | |
| 85 | - if($request->has($captchaName . '-response')) { |
|
| 85 | + if ($request->has($captchaName . '-response')) { |
|
| 86 | 86 | $request->set('captcha', $request->get($captchaName . '-response')); |
| 87 | 87 | $request->delete($captchaName . '-response'); |
| 88 | 88 | } |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | * @param Response $response |
| 128 | 128 | * @param ViewFactory $view |
| 129 | 129 | */ |
| 130 | - public function myPosts(Request $request, Response $response, PostTransformer $transformer,ViewFactory $view) |
|
| 130 | + public function myPosts(Request $request, Response $response, PostTransformer $transformer, ViewFactory $view) |
|
| 131 | 131 | { |
| 132 | - $myPosts = $this->postService->getMyPosts((int)auth()->user()->id); |
|
| 132 | + $myPosts = $this->postService->getMyPosts((int) auth()->user()->id); |
|
| 133 | 133 | |
| 134 | 134 | $view->setParams([ |
| 135 | 135 | 'title' => t('common.my_posts') . ' | ' . config()->get('app_name'), |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | public function create(Request $request) |
| 163 | 163 | { |
| 164 | 164 | $postData = [ |
| 165 | - 'user_id' => (int)auth()->user()->id, |
|
| 165 | + 'user_id' => (int) auth()->user()->id, |
|
| 166 | 166 | 'title' => $request->get('title', null, true), |
| 167 | 167 | 'content' => $request->get('content', null, true), |
| 168 | 168 | 'image' => '', |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | if ($request->hasFile('image')) { |
| 224 | 224 | if ($post->image) { |
| 225 | - $this->postService->deleteImage(auth()->user()->uuid . DS . $post->image); |
|
| 225 | + $this->postService->deleteImage(auth()->user()->uuid . DS . $post->image); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | $imageName = $this->postService->saveImage( |
@@ -192,7 +192,7 @@ |
||
| 192 | 192 | { |
| 193 | 193 | if ($request->isMethod('post')) { |
| 194 | 194 | try { |
| 195 | - auth()->verifyOtp((int)$request->get('otp'), $request->get('code')); |
|
| 195 | + auth()->verifyOtp((int) $request->get('otp'), $request->get('code')); |
|
| 196 | 196 | redirect(base_url(true) . '/' . current_lang()); |
| 197 | 197 | } catch (AuthException $e) { |
| 198 | 198 | session()->setFlash('error', $e->getMessage()); |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($route) { |
|
| 3 | +return function($route) { |
|
| 4 | 4 | $route->get('[:alpha:2]?', 'PageController', 'home')->name('home'); |
| 5 | 5 | $route->get('[:alpha:2]?/about', 'PageController', 'about')->name('about'); |
| 6 | 6 | |
| 7 | 7 | $route->get('[:alpha:2]?/posts', 'PostController', 'posts')->name('posts'); |
| 8 | 8 | $route->get('[:alpha:2]?/post/[id=:any]', 'PostController', 'post'); |
| 9 | 9 | |
| 10 | - $route->group('guest', function ($route) { |
|
| 10 | + $route->group('guest', function($route) { |
|
| 11 | 11 | $route->add('[:alpha:2]?/signin', 'GET|POST', 'AuthController', 'signin')->name('signin'); |
| 12 | 12 | $route->add('[:alpha:2]?/signup', 'GET|POST', 'AuthController', 'signup')->middlewares(['Signup'])->name('signup'); |
| 13 | 13 | $route->get('[:alpha:2]?/activate/[token=:any]', 'AuthController', 'activate')->middlewares(['Activate']); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $route->add('[:alpha:2]?/verify/[code=:any]?', 'GET|POST', 'AuthController', 'verify')->middlewares(['Verify']); |
| 18 | 18 | })->middlewares(['Guest']); |
| 19 | 19 | |
| 20 | - $route->group('auth', function ($route) { |
|
| 20 | + $route->group('auth', function($route) { |
|
| 21 | 21 | $route->get('[:alpha:2]?/signout', 'AuthController', 'signout'); |
| 22 | 22 | $route->get('[:alpha:2]?/my-posts', 'PostController', 'myPosts')->middlewares(['Editor']); |
| 23 | 23 | $route->get('[:alpha:2]?/my-posts/create', 'PostController', 'createFrom')->middlewares(['Editor']); |
@@ -30,7 +30,8 @@ discard block |
||
| 30 | 30 | </li> |
| 31 | 31 | </ul> |
| 32 | 32 | </li> |
| 33 | - <?php else : ?> |
|
| 33 | + <?php else { |
|
| 34 | + : ?> |
|
| 34 | 35 | <?php if (route_name() != 'signup') : ?> |
| 35 | 36 | <li> |
| 36 | 37 | <a href="<?php echo base_url(true) . '/' . current_lang() ?>/signup"> |
@@ -38,7 +39,9 @@ discard block |
||
| 38 | 39 | <?php _t('common.signup') ?> |
| 39 | 40 | </a> |
| 40 | 41 | </li> |
| 41 | - <?php endif; ?> |
|
| 42 | + <?php endif; |
|
| 43 | +} |
|
| 44 | +?> |
|
| 42 | 45 | <?php if (route_name() != 'signin') : ?> |
| 43 | 46 | <li> |
| 44 | 47 | <a href="<?php echo base_url(true) . '/' . current_lang() ?>/signin"> |
@@ -9,8 +9,11 @@ |
||
| 9 | 9 | <?php endforeach; ?> |
| 10 | 10 | <?php endforeach; ?> |
| 11 | 11 | </ul> |
| 12 | - <?php else: ?> |
|
| 12 | + <?php else { |
|
| 13 | + : ?> |
|
| 13 | 14 | <?php echo $error ?> |
| 14 | - <?php endif; ?> |
|
| 15 | + <?php endif; |
|
| 16 | +} |
|
| 17 | +?> |
|
| 15 | 18 | <?php endif; ?> |
| 16 | 19 | </div>'; |
| 17 | 20 | \ No newline at end of file |
@@ -35,13 +35,16 @@ |
||
| 35 | 35 | </li> |
| 36 | 36 | </ul> |
| 37 | 37 | </li> |
| 38 | - <?php else : ?> |
|
| 38 | + <?php else { |
|
| 39 | + : ?> |
|
| 39 | 40 | <li> |
| 40 | 41 | <?php if (route_name() != 'signup') : ?> |
| 41 | 42 | <a href="<?php echo base_url(true) . '/' . current_lang() ?>/signup" class="white-text"> |
| 42 | 43 | <?php _t('common.signup') ?> |
| 43 | 44 | </a> |
| 44 | - <?php endif; ?> |
|
| 45 | + <?php endif; |
|
| 46 | +} |
|
| 47 | +?> |
|
| 45 | 48 | </li> |
| 46 | 49 | <li> |
| 47 | 50 | <?php if (route_name() != 'signin') : ?> |
@@ -1,9 +1,12 @@ |
||
| 1 | 1 | <li class="collection-item avatar"> |
| 2 | 2 | <?php if ($post['image']) : ?> |
| 3 | 3 | <img src="<?php echo base_url() . '/uploads/' . $post['image'] ?>" class="circle img-my-post"> |
| 4 | - <?php else : ?> |
|
| 4 | + <?php else { |
|
| 5 | + : ?> |
|
| 5 | 6 | <img src="<?php echo base_url() ?>/assets/images/no-image.png" class="circle img-my-post"> |
| 6 | - <?php endif; ?> |
|
| 7 | + <?php endif; |
|
| 8 | +} |
|
| 9 | +?> |
|
| 7 | 10 | <span class="title post-title" title="<?php echo $post['title'] ?>"> |
| 8 | 11 | <a class="teal-text post-title" href="<?php echo base_url(true) . '/' . current_lang() . '/post/' . $post['id'] ?>?ref=my-posts"> |
| 9 | 12 | <?php echo $post['title'] ?> |