1 | <?php |
||
17 | class Terms_Of_Service { |
||
18 | /** |
||
19 | * Jetpack option name where the terms of service state is stored. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | const OPTION_NAME = 'tos_agreed'; |
||
24 | |||
25 | /** |
||
26 | * Allow the site to agree to the terms of service. |
||
27 | */ |
||
28 | public function agree() { |
||
37 | |||
38 | /** |
||
39 | * Allow the site to reject to the terms of service. |
||
40 | */ |
||
41 | public function reject() { |
||
50 | |||
51 | /** |
||
52 | * Returns whether the master user has agreed to the terms of service. |
||
53 | * |
||
54 | * The following conditions have to be met in order to agree to the terms of service. |
||
55 | * 1. The master user has gone though the connect flow. |
||
56 | * 2. The site is not in dev mode. |
||
57 | * 3. The master user of the site is still connected (deprecated @since 8.9.0). |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function has_agreed() { |
||
75 | |||
76 | /** |
||
77 | * Abstracted for testing purposes. |
||
78 | * Tells us if the site is in dev mode. |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | protected function is_offline_mode() { |
||
85 | |||
86 | /** |
||
87 | * Gets just the Jetpack Option that contains the terms of service state. |
||
88 | * Abstracted for testing purposes. |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | protected function get_raw_has_agreed() { |
||
95 | |||
96 | /** |
||
97 | * Sets the correct Jetpack Option to mark the that the site has agreed to the terms of service. |
||
98 | * Abstracted for testing purposes. |
||
99 | */ |
||
100 | protected function set_agree() { |
||
103 | |||
104 | /** |
||
105 | * Sets the correct Jetpack Option to mark that the site has rejected the terms of service. |
||
106 | * Abstracted for testing purposes. |
||
107 | */ |
||
108 | protected function set_reject() { |
||
111 | |||
112 | } |
||
113 |