Changeset 3016412
- Timestamp:
- 01/02/2024 12:08:25 PM (2 years ago)
- Location:
- iteras/trunk
- Files:
-
- 8 edited
-
README.txt (modified) (2 diffs)
-
admin/iteras-admin.php (modified) (2 diffs)
-
admin/views/admin.php (modified) (1 diff)
-
admin/views/post-meta-box.php (modified) (1 diff)
-
iteras.php (modified) (1 diff)
-
languages/iteras-da_DK.mo (modified) (previous)
-
languages/iteras-da_DK.po (modified) (11 diffs)
-
public/iteras-public.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iteras/trunk/README.txt
r3012163 r3016412 3 3 Requires at least: 3.5.1 4 4 Tested up to: 6.4.2 5 Stable tag: 1. 6.05 Stable tag: 1.7.0 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 111 111 112 112 == Changelog == 113 = 1.7.0 = 114 * Paywall signing key is now handled separately 115 113 116 = 1.6.0 = 114 117 * Added bulk action for updating paywall state on posts -
iteras/trunk/admin/iteras-admin.php
r3012163 r3016412 21 21 22 22 protected $plugin = null; 23 24 public $access_levels = null; 25 23 protected $plugin_slug = null; 24 25 protected $access_levels = null; 26 protected $paywall_display_types = null; 27 protected $paywall_integration_methods = null; 26 28 27 29 private function __construct() { … … 334 336 $settings = array( 335 337 'api_key' => sanitize_text_field($_POST['api_key']), 338 'signing_key' => sanitize_text_field($_POST['signing_key']), 336 339 'paywalls' => $prev_settings['paywalls'], 337 340 'profile_name' => sanitize_text_field($_POST['profile']), -
iteras/trunk/admin/views/admin.php
r2417359 r3016412 20 20 21 21 <tr> 22 <th scope="row"><label for="signingkey"><?php _e('ITERAS signing key', $domain); ?></label></th> 23 <td> 24 <input class="regular-text" id="signingkey" name="signing_key" placeholder="<?php _e('e.g.', $domain); ?> j8kau2v3lzp0n12ilw1d0hurr6059gyo" type="text" value="<?=$settings['signing_key']; ?>"> 25 <p class="description"><?php _e('You can find your signing key in the general settings section in the top right menu in ITERAS.', $domain); ?></p> 26 </td> 27 </tr> 28 29 <tr> 22 30 <th scope="row"><label for="apikey"><?php _e('ITERAS API key', $domain); ?></label></th> 23 31 <td> 24 <input class="regular-text" id="apikey" name="api_key" placeholder="<?php _e('e.g. drurhphapaikr5fcywk158n93ghat0vz', $domain); ?>" type="text" value="<?=$settings['api_key']; ?>">25 <p class="description"><?php _e('You can find your API key in the general settings sectionin the top right menu in ITERAS.', $domain); ?></p>32 <input class="regular-text" id="apikey" name="api_key" placeholder="<?php _e('e.g.', $domain); ?> drurhphapaikr5fcywk158n93ghat0vz" type="text" value="<?=$settings['api_key']; ?>"> 33 <p class="description"><?php _e('You can create an API key under integrations in the top right menu in ITERAS.', $domain); ?></p> 26 34 </td> 27 35 </tr> -
iteras/trunk/admin/views/post-meta-box.php
r1880666 r3016412 3 3 wp_nonce_field( "post".$post->ID, 'iteras_paywall_post_nonce' ); 4 4 5 if (!$settings['api_key'] ) {5 if (!$settings['api_key'] || !$settings['signing_key']) { 6 6 ?> 7 7 <div class="attention-box"> -
iteras/trunk/iteras.php
r3012163 r3016412 13 13 * Plugin URI: https://app.iteras.dk 14 14 * Description: Integration with ITERAS, a cloud-based state-of-the-art system for managing subscriptions/memberships and payments. 15 * Version: 1. 6.015 * Version: 1.7.0 16 16 * Author: ITERAS 17 17 * Author URI: https://www.iteras.dk -
iteras/trunk/languages/iteras-da_DK.po
r3012163 r3016412 6 6 "Project-Id-Version: iteras\n" 7 7 "Report-Msgid-Bugs-To: [email protected]\n" 8 "POT-Creation-Date: 202 3-12-19 19:48+0100\n"9 "PO-Revision-Date: 202 3-12-19 19:48+0100\n"8 "POT-Creation-Date: 2024-01-02 13:05+0100\n" 9 "PO-Revision-Date: 2024-01-02 13:05+0100\n" 10 10 "Last-Translator: Ole Laursen <[email protected]>\n" 11 11 "Language-Team: da\n" … … 15 15 "Content-Transfer-Encoding: 8bit\n" 16 16 17 #: admin/iteras-admin.php: 5917 #: admin/iteras-admin.php:61 18 18 msgid "Everybody" 19 19 msgstr "Alle" 20 20 21 #: admin/iteras-admin.php:6 521 #: admin/iteras-admin.php:67 22 22 msgid "Redirect to subscribe landing page" 23 23 msgstr "Omdiriger til abonnér-landingsside" 24 24 25 #: admin/iteras-admin.php:6 625 #: admin/iteras-admin.php:68 26 26 msgid "Cut text and add call-to-action box" 27 27 msgstr "Beskær tekst og tilføj call to action-boks" 28 28 29 #: admin/iteras-admin.php:7 029 #: admin/iteras-admin.php:72 30 30 msgid "Automatic" 31 31 msgstr "Automatisk" 32 32 33 #: admin/iteras-admin.php:7 133 #: admin/iteras-admin.php:73 34 34 msgid "Custom" 35 35 msgstr "Specialudviklet" 36 36 37 #: admin/iteras-admin.php: 8837 #: admin/iteras-admin.php:90 38 38 msgid "ITERAS Paywall" 39 39 msgstr "ITERAS-paywall" 40 40 41 #: admin/iteras-admin.php:9 341 #: admin/iteras-admin.php:95 42 42 msgid "Paywall" 43 43 msgstr "Betalingsmur" 44 44 45 #: admin/iteras-admin.php:1 3845 #: admin/iteras-admin.php:140 46 46 msgid "Does not restrict visitors, everyone can see the content" 47 47 msgstr "Begrænser ingen besøgende, alle kan se indholdet" 48 48 49 #: admin/iteras-admin.php:1 3949 #: admin/iteras-admin.php:141 50 50 msgid "" 51 51 "Content restricted to visitors who are in the subscriber database (but they " … … 55 55 "have et aktivt abonnement)" 56 56 57 #: admin/iteras-admin.php:14 057 #: admin/iteras-admin.php:142 58 58 msgid "Content restricted to visitors with an active subscription" 59 59 msgstr "Indhold begrænset til besøgende i abonnentdatabasen" 60 60 61 #: admin/iteras-admin.php:18 561 #: admin/iteras-admin.php:184 62 62 msgid "Add paywall" 63 63 msgstr "Tilføj betalingsmur" 64 64 65 #: admin/iteras-admin.php:18 865 #: admin/iteras-admin.php:187 66 66 msgid "Remove paywalls" 67 67 msgstr "Fjern betalingsmure" 68 68 69 #: admin/iteras-admin.php:24 769 #: admin/iteras-admin.php:246 70 70 msgid "ITERAS configuration" 71 71 msgstr "ITERAS-konfiguration" 72 72 73 #: admin/iteras-admin.php:24 873 #: admin/iteras-admin.php:247 74 74 msgid "ITERAS" 75 75 msgstr "ITERAS" 76 76 77 #: admin/iteras-admin.php:28 777 #: admin/iteras-admin.php:286 78 78 msgid "Synchronization of paywalls from ITERAS complete" 79 79 msgstr "Synkronisering af betalingsmure fra ITERAS gennemført" 80 80 81 #: admin/iteras-admin.php:29 381 #: admin/iteras-admin.php:292 82 82 msgid "Couldn't synchronize paywalls from ITERAS" 83 83 msgstr "Kunne ikke synkronisere betalingsmure fra ITERAS" 84 84 85 #: admin/iteras-admin.php:32 585 #: admin/iteras-admin.php:324 86 86 msgid "Settings" 87 87 msgstr "Indstillinger" … … 104 104 105 105 #: admin/views/admin.php:22 106 msgid "ITERAS signing key" 107 msgstr "ITERAS signeringsnøgle" 108 109 #: admin/views/admin.php:24 admin/views/admin.php:32 110 msgid "e.g." 111 msgstr "f.eks." 112 113 #: admin/views/admin.php:25 114 msgid "" 115 "You can find your signing key in the general settings section in the top " 116 "right menu in ITERAS." 117 msgstr "" 118 "Du kan finde din signeringsnøgle under grundindstillingerne i menuen øverst " 119 "til højre i ITERAS." 120 121 #: admin/views/admin.php:30 106 122 msgid "ITERAS API key" 107 123 msgstr "ITERAS API-nøgle" 108 124 109 #: admin/views/admin.php:24 110 msgid "e.g. drurhphapaikr5fcywk158n93ghat0vz" 111 msgstr "f.eks. drurhphapaikr5fcywk158n93ghat0vz" 112 113 #: admin/views/admin.php:25 114 msgid "" 115 "You can find your API key in the general settings section in the top right " 116 "menu in ITERAS." 117 msgstr "" 118 "Du kan finde din API-nøgle under grundindstillingerne i menuen øverst til " 119 "højre i ITERAS." 120 121 #: admin/views/admin.php:30 125 #: admin/views/admin.php:33 126 msgid "" 127 "You can create an API key under integrations in the top right menu in ITERAS." 128 msgstr "" 129 "Du kan oprette en API-nøgle under integrationer i menuen øverst til højre i " 130 "ITERAS." 131 132 #: admin/views/admin.php:38 122 133 msgid "Available paywalls" 123 134 msgstr "Tilgængelige betalingsmure" 124 135 125 #: admin/views/admin.php: 34136 #: admin/views/admin.php:42 126 137 msgid "No paywalls available" 127 138 msgstr "Ingen betalingsmure tilgængelig" 128 139 129 #: admin/views/admin.php: 44140 #: admin/views/admin.php:52 130 141 msgid "Synchronize" 131 142 msgstr "Synkronisér" 132 143 133 #: admin/views/admin.php: 45144 #: admin/views/admin.php:53 134 145 msgid "" 135 146 "You can configure paywalls in ITERAS in the paywalls section under " … … 141 152 "knappen her bagefter." 142 153 143 #: admin/views/admin.php:5 0154 #: admin/views/admin.php:58 144 155 msgid "Default paywall access" 145 156 msgstr "Forvalgt paywall-adgang" 146 157 147 #: admin/views/admin.php: 58158 #: admin/views/admin.php:66 148 159 msgid "Default paywall access for new posts." 149 160 msgstr "Betalingsmur-indstilling som nye indlæg og sider får som forvalg." 150 161 151 #: admin/views/admin.php: 63162 #: admin/views/admin.php:71 152 163 msgid "Access restriction" 153 164 msgstr "Adgangsbegrænsning" 154 165 155 #: admin/views/admin.php:7 1166 #: admin/views/admin.php:79 156 167 msgid "How users will be greeted on an article they don't have access to." 157 168 msgstr "" 158 169 "Hvordan besøgende bliver modtaget på en artikel som de ikke har adgang til." 159 170 160 #: admin/views/admin.php: 76171 #: admin/views/admin.php:84 161 172 msgid "Subscribe landing page" 162 173 msgstr "Abonnér-landingsside" 163 174 164 #: admin/views/admin.php: 78175 #: admin/views/admin.php:86 165 176 msgid "e.g. /?page_id=1" 166 177 msgstr "f.eks. /?page_id=1" 167 178 168 #: admin/views/admin.php: 79179 #: admin/views/admin.php:87 169 180 msgid "" 170 181 "URL to the landing page for logging in or becoming a <b>paying subscriber</" … … 174 185 "b>." 175 186 176 #: admin/views/admin.php: 84187 #: admin/views/admin.php:92 177 188 msgid "User landing page" 178 189 msgstr "Bruger-landingsside" 179 190 180 #: admin/views/admin.php: 86191 #: admin/views/admin.php:94 181 192 msgid "e.g. /?page_id=2" 182 193 msgstr "f.eks. /?page_id=2" 183 194 184 #: admin/views/admin.php: 87195 #: admin/views/admin.php:95 185 196 msgid "" 186 197 "URL to the landing page for logging in or registering as a <b>user</b>. The " … … 190 201 "b>. Abonnér- og bruger-landingssiderne kan pege på den samme Wordpress-side." 191 202 192 #: admin/views/admin.php: 92203 #: admin/views/admin.php:100 193 204 msgid "Cut text at" 194 205 msgstr "Beskær tekst ved" 195 206 196 #: admin/views/admin.php: 94207 #: admin/views/admin.php:102 197 208 msgid "characters" 198 209 msgstr "tegn" 199 210 200 #: admin/views/admin.php: 94211 #: admin/views/admin.php:102 201 212 msgid "e.g. 30" 202 213 msgstr "f.eks. 30" 203 214 204 #: admin/views/admin.php: 99215 #: admin/views/admin.php:107 205 216 msgid "Call-to-action content" 206 217 msgstr "Call to action-indhold" 207 218 208 #: admin/views/admin.php:1 02219 #: admin/views/admin.php:110 209 220 msgid "" 210 221 "Present ordering offers and a login option. If you link to separate ordering " … … 220 231 "side efter at have bestilt eller logget ind." 221 232 222 #: admin/views/admin.php:1 07233 #: admin/views/admin.php:115 223 234 msgid "Validation method" 224 235 msgstr "Verifikationsmåde" 225 236 226 #: admin/views/admin.php:1 09237 #: admin/views/admin.php:117 227 238 msgid "Enable server-side validation of access pass cookie" 228 239 msgstr "Aktiver serverkontrol af adgangstegn-cookie" 229 240 230 #: admin/views/admin.php:1 12241 #: admin/views/admin.php:120 231 242 msgid "" 232 243 "With server-side validation, the ITERAS API key will be used to check the " … … 247 258 "serverkontrol." 248 259 249 #: admin/views/admin.php:1 17260 #: admin/views/admin.php:125 250 261 msgid "Paywall integration method" 251 262 msgstr "Integrationsmåde for betalingsmur" 252 263 253 #: admin/views/admin.php:1 25264 #: admin/views/admin.php:133 254 265 msgid "" 255 266 "For custom integration use either <code>[iteras-paywall-content]...[/iteras-" … … 261 272 "<code>Iteras::get_instance().potentially_paywall_content(...)</code>." 262 273 263 #: admin/views/admin.php:1 37274 #: admin/views/admin.php:145 264 275 msgid "" 265 276 "For more information about the ITERAS API check out the <a target=\"_blank\" " … … 290 301 "href='%url%'>siden med indstillinger</a> for at rette dem." 291 302 292 #: public/iteras-public.php:42 5 public/iteras-public.php:596303 #: public/iteras-public.php:429 public/iteras-public.php:604 293 304 msgid "This content is paywalled" 294 305 msgstr "Dette indhold er bag betalingsmur" 295 306 296 #: public/iteras-public.php:42 5 public/iteras-public.php:603297 #: public/iteras-public.php:65 1307 #: public/iteras-public.php:429 public/iteras-public.php:611 308 #: public/iteras-public.php:659 298 309 msgid "You are seeing the content because you are logged into WordPress admin." 299 310 msgstr "Du ser indholdet da du er logget ind i WordPress admin." 300 311 301 #: public/iteras-public.php:43 4312 #: public/iteras-public.php:438 302 313 msgid "ITERAS plugin improperly configured. Paywall box content is missing" 303 314 msgstr "" 304 315 "ITERAS-plugin er ikke konfigureret rigtigt. Call to action-indhold mangler." 305 316 306 #: public/iteras-public.php:5 77317 #: public/iteras-public.php:585 307 318 msgid "You need to be logged in to see this content" 308 319 msgstr "Du skal være logget ind for at se indholdet" 309 320 310 #: public/iteras-public.php:60 0321 #: public/iteras-public.php:608 311 322 msgid "paywallid not declared" 312 323 msgstr "paywallid ikke udfyldt" 324 325 #~ msgid "e.g. drurhphapaikr5fcywk158n93ghat0vz" 326 #~ msgstr "f.eks. drurhphapaikr5fcywk158n93ghat0vz" 313 327 314 328 #~ msgid "Paying subscribers" -
iteras/trunk/public/iteras-public.php
r3012163 r3016412 16 16 class Iteras { 17 17 18 const VERSION = '1. 6.0';18 const VERSION = '1.7.0'; 19 19 20 20 const SETTINGS_KEY = "iteras_settings"; … … 194 194 $settings['paywall_server_side_validation'] = true; 195 195 } 196 if (version_compare($old_version, "1.7", "lt")) { 197 $settings['signing_key'] = $settings['api_key']; 198 } 196 199 197 200 wp_cache_delete(self::SETTINGS_KEY); … … 261 264 if (empty($settings)) { 262 265 $settings = array( 266 'signing_key' => "", 263 267 'api_key' => "", 264 268 'profile_name' => "", // outphase … … 340 344 } 341 345 342 private function pass_authorized($pass, $restriction, $ key) {346 private function pass_authorized($pass, $restriction, $signing_key) { 343 347 // check signature 344 348 $pos = strrpos($pass, "/"); … … 357 361 return false; 358 362 359 $computed_hmac = hash_hmac($algo, $data, $ key);360 361 if ($computed_hmac !== false && $ key && (function_exists("hash_equals") ? !hash_equals($computed_hmac, $hmac) : $computed_hmac != $hmac))363 $computed_hmac = hash_hmac($algo, $data, $signing_key); 364 365 if ($computed_hmac !== false && $signing_key && (function_exists("hash_equals") ? !hash_equals($computed_hmac, $hmac) : $computed_hmac != $hmac)) 362 366 return false; 363 367 … … 399 403 400 404 $user_authorized = ( 401 isset($_COOKIE['iteraspass']) && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings[' api_key'])405 isset($_COOKIE['iteraspass']) && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings['signing_key']) 402 406 ); 403 407 … … 610 614 $content = $admin_paywall_notice . $content; 611 615 } else { 612 if (isset($_COOKIE['iteraspass']) && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings[' api_key'])) {616 if (isset($_COOKIE['iteraspass']) && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings['signing_key'])) { 613 617 // User has access 614 618 } else { … … 655 659 $content = __("You are seeing the content because you are logged into WordPress admin.") . $content; 656 660 } else { 657 if ((isset($_COOKIE['iteraspass']) && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings[' api_key'])) == $show_if_logged_in) {661 if ((isset($_COOKIE['iteraspass']) && $this->pass_authorized($_COOKIE['iteraspass'], $paywall_ids, $this->settings['signing_key'])) == $show_if_logged_in) { 658 662 // Returns the content without manipulation 659 663 } else {
Note: See TracChangeset
for help on using the changeset viewer.