PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Services / AuthenticationService.php

AuthenticationService.php in Depicter — Popup & Slider Builder 1.9.2, at app/src/Services/AuthenticationService.php

63 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Depicter\Services;
4
5 class AuthenticationService {
6
7 /**
8 * Retrieves client's tier
9 *
10 * @return string
11 */
12 public function getTier(){
13 return \Depicter::options()->get('user_tier', 'free-user') ?: 'free-user';
14 }
15
16 /**
17 * Whether client has not free tier or not
18 *
19 * @return bool
20 */
21 public function isPaid(){
22 return $this->getTier() !== 'free-user';
23 }
24
25 /**
26 * Verify if it is an activated installation or not
27 *
28 * @return bool
29 */
30 public function verifyActivation(){
31 return \Depicter::client()->validateActivation();
32 }
33
34 /**
35 * Whether it is an activated installation or not
36 *
37 * @return bool
38 */
39 public function isActivated(){
40 return $this->getActivationStatus() === 'activated';
41 }
42
43 /**
44 * Retrieves subscription activation status
45 *
46 * @return string
47 */
48 public function getActivationStatus(){
49 $activationStatus = \Depicter::options()->get('subscription_status', 'not-activated');
50 $activationError = \Depicter::options()->get('activation_error_message', '');
51 return ( 'activated' !== $activationStatus ) && ! empty( $activationError ) ? 'error': $activationStatus;
52 }
53
54 /**
55 * Get client key
56 *
57 * @return string
58 */
59 public function getClientKey(){
60 return \Depicter::options()->get( 'client_key', '' );
61 }
62 }
63