Changeset 1967665
- Timestamp:
- 11/02/2018 10:18:56 AM (7 years ago)
- Location:
- ose-lets-encrypt
- Files:
-
- 2 added
- 10 edited
- 1 copied
-
tags/1.2.4 (copied) (copied from ose-lets-encrypt/trunk)
-
tags/1.2.4/README.txt (modified) (2 diffs)
-
tags/1.2.4/acme.php (modified) (1 diff)
-
tags/1.2.4/assets/css/admin.css (modified) (1 diff)
-
tags/1.2.4/assets/js/admin.js (modified) (2 diffs)
-
tags/1.2.4/cron.php (added)
-
tags/1.2.4/ose-letsencrypt.php (modified) (10 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/acme.php (modified) (1 diff)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/js/admin.js (modified) (2 diffs)
-
trunk/cron.php (added)
-
trunk/ose-letsencrypt.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ose-lets-encrypt/tags/1.2.4/README.txt
r1966376 r1967665 6 6 Tested up to: 4.9.8 7 7 Requires PHP: 5.3 8 Stable tag: 1.2. 38 Stable tag: 1.2.4 9 9 License: GNU General Public License v3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 65 65 66 66 == Changelog == 67 = 1.2.4 68 * Change web token generation function to generate token only once 69 * Add automatic renewal of ssl certificates function in cronjob setting section 70 67 71 = 1.2.3 68 72 * Change clear all option cache to clear ose-lets-encrypt cache data -
ose-lets-encrypt/tags/1.2.4/acme.php
r1966139 r1967665 22 22 if(file_exists($wp_load)) { 23 23 require( $wp_load); 24 wp_cache_delete ( 'oseletsencrypt_data', 'options' ); 24 25 $options = get_option('oseletsencrypt_data', array()); 25 26 if($options['web_token'] == $_GET['token'] && $options['filename'] == $_GET['filename']){ -
ose-lets-encrypt/tags/1.2.4/assets/css/admin.css
r1958953 r1967665 89 89 padding: 5px 15px !important; 90 90 } 91 92 #timer{ 93 display: none; 94 } 95 #cronjob-setting{ 96 margin-left: 10px; 97 } -
ose-lets-encrypt/tags/1.2.4/assets/js/admin.js
r1965009 r1967665 102 102 data = jQuery.parseJSON(response); 103 103 jQuery('#response-message').text(data.message); 104 reloadPage(); 104 105 } 105 106 } ); … … 108 109 }); 109 110 } 111 112 function reloadPage() { 113 jQuery('#timer').show(); 114 var timeleft = 10; 115 var downloadTimer = setInterval(function(){ 116 timeleft--; 117 document.getElementById("countdowntimer").textContent = timeleft; 118 if(timeleft <= 0){ 119 clearInterval(downloadTimer); 120 window.location.reload(); 121 } 122 },1000); 123 } 124 110 125 } ); -
ose-lets-encrypt/tags/1.2.4/ose-letsencrypt.php
r1966376 r1967665 16 16 * Plugin URI: https://www.opensource-excellence.com/ 17 17 * Description: OSE Free SSL is an easy-to-use plugin to create SSL certificates from Let’s Encrypt (https://letsencrypt.org) platform which provides free SSL certificates for everyone to turn on https protocol. 18 * Version: 1.2. 318 * Version: 1.2.4 19 19 * Author: Open Source Excellence 20 20 * Author URI: https://www.opensource-excellence.com/ … … 34 34 if(!defined('OSELETSENCRYPT_PATH')) 35 35 define('OSELETSENCRYPT_PATH', plugin_dir_path( __FILE__ )); 36 if(!defined('OSELETSENCRYPT_ENDPOINT'))37 define('OSELETSENCRYPT_ENDPOINT', 'https://www.1o1wp.com/');38 36 if(!defined('OSELETSENCRYPT_PROTOCOL')) 39 37 define('OSELETSENCRYPT_PROTOCOL', 'https'); … … 78 76 add_action('wp_ajax_store_account_data', array($this,'storeAccountData')); 79 77 add_action('wp_ajax_check_account_data', array($this,'checkAccountData')); 80 add_action('wp_ajax_send_ssl_request', array($this,'sendSslRequest '));78 add_action('wp_ajax_send_ssl_request', array($this,'sendSslRequestAjax')); 81 79 add_action('wp_ajax_create_folders', array($this,'createFolders')); 82 80 //add_action('wp_ajax_get_terms', array($this,'getTerms')); … … 262 260 return; 263 261 } 264 wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css' );265 wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css' );266 wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map' );262 wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css', array(), 1.0); 263 wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css', array(), 1.0); 264 wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map', array(), 1.0); 267 265 wp_enqueue_style('oseletsencrypt-googleapis', 'https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic'); 268 wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css' );269 wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css' );266 wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css', array(), 1.0); 267 wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css' ,array(), '1.2.4'); 270 268 wp_enqueue_script('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/js/bootstrap.min.js', array(), 1.0); 271 269 wp_enqueue_script('oseletsencrypt-bootbox', OSELETSENCRYPT_URL. 'assets/js/bootbox.min.js', array(), 1.0); 272 wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), 1.0);270 wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), '1.2.4'); 273 271 274 272 $admin_options = array( … … 307 305 ?> 308 306 309 < divclass="wrap">307 <hr class="wrap"> 310 308 <form id="oseletsencrypt-account-form" class=""> 311 309 <!-- … … 373 371 <div id="response-message" class="success-message"> 374 372 </div> 375 373 <div id="timer"><?php echo __( 'This Page will be reloaded in', 'ose-lets-encrypt' ); ?> <span id="countdowntimer">10 </span> <?php echo __( 'seconds', 'ose-lets-encrypt' ); ?></div> 376 374 <button class="button" id="oseletsencrypt-account-save" type="submit" disabled="true"> 377 375 <?php echo __( 'Save Configuration', 'ose-lets-encrypt' ); ?> … … 389 387 </div> 390 388 </fieldset> 389 <hr> 390 <div id="cronjob-setting"> 391 <?php echo __( 'Automatic SSL certificates renewal Cron Job Example', 'ose-lets-encrypt' ); ?>: 392 </br> 393 <?php 394 if(isset($data['web_token']) && !empty($data['web_token'])) { 395 $min = date("i"); 396 $hour = date("H"); 397 $day = date("d"); 398 $cron = $min . " " . $hour . " " . $day . " */2 *"; 399 echo $cron . " /usr/bin/curl --silent " . $this->getCronJobUrl(). "&>/dev/null"; 400 } 401 ?> 402 </div> 391 403 </div> 392 404 </form> … … 415 427 </div> 416 428 417 </div> 429 418 430 <?php 419 431 } 420 432 421 public function sendSslRequest (){433 public function sendSslRequestAjax(){ 422 434 if (wp_verify_nonce($_POST['security'], $this->_nonce) === false) 423 435 die(__( 'Invalid Request! Reload your page please.', 'ose-lets-encrypt' )); 424 436 return $this->sendSslRequest(); 437 } 438 public function sendSslRequest(){ 425 439 $data = $this->getData(); 426 440 $data = $this->sanitizeData($data); … … 452 466 } 453 467 protected function generateToken($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') { 468 $token = $this->getWebToken(); 469 if(!empty($token)){ 470 return $token; 471 } 454 472 $chars_length = (strlen($chars) - 1); 455 473 $string = $chars{rand(0, $chars_length)}; … … 574 592 return $result; 575 593 } 594 protected function getCronJobUrl(){ 595 $token = $this->getWebToken(); 596 return str_replace("http://","https://",OSELETSENCRYPT_URL.'cron.php?web_token='.$token); 597 } 598 protected function getWebToken(){ 599 $data = $this->getData(); 600 if(isset($data['web_token']) && !empty($data['web_token'])){ 601 return $data['web_token']; 602 } 603 return false; 604 } 576 605 } 577 606 -
ose-lets-encrypt/trunk/README.txt
r1966376 r1967665 6 6 Tested up to: 4.9.8 7 7 Requires PHP: 5.3 8 Stable tag: 1.2. 38 Stable tag: 1.2.4 9 9 License: GNU General Public License v3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 65 65 66 66 == Changelog == 67 = 1.2.4 68 * Change web token generation function to generate token only once 69 * Add automatic renewal of ssl certificates function in cronjob setting section 70 67 71 = 1.2.3 68 72 * Change clear all option cache to clear ose-lets-encrypt cache data -
ose-lets-encrypt/trunk/acme.php
r1966139 r1967665 22 22 if(file_exists($wp_load)) { 23 23 require( $wp_load); 24 wp_cache_delete ( 'oseletsencrypt_data', 'options' ); 24 25 $options = get_option('oseletsencrypt_data', array()); 25 26 if($options['web_token'] == $_GET['token'] && $options['filename'] == $_GET['filename']){ -
ose-lets-encrypt/trunk/assets/css/admin.css
r1958953 r1967665 89 89 padding: 5px 15px !important; 90 90 } 91 92 #timer{ 93 display: none; 94 } 95 #cronjob-setting{ 96 margin-left: 10px; 97 } -
ose-lets-encrypt/trunk/assets/js/admin.js
r1965009 r1967665 102 102 data = jQuery.parseJSON(response); 103 103 jQuery('#response-message').text(data.message); 104 reloadPage(); 104 105 } 105 106 } ); … … 108 109 }); 109 110 } 111 112 function reloadPage() { 113 jQuery('#timer').show(); 114 var timeleft = 10; 115 var downloadTimer = setInterval(function(){ 116 timeleft--; 117 document.getElementById("countdowntimer").textContent = timeleft; 118 if(timeleft <= 0){ 119 clearInterval(downloadTimer); 120 window.location.reload(); 121 } 122 },1000); 123 } 124 110 125 } ); -
ose-lets-encrypt/trunk/ose-letsencrypt.php
r1966376 r1967665 16 16 * Plugin URI: https://www.opensource-excellence.com/ 17 17 * Description: OSE Free SSL is an easy-to-use plugin to create SSL certificates from Let’s Encrypt (https://letsencrypt.org) platform which provides free SSL certificates for everyone to turn on https protocol. 18 * Version: 1.2. 318 * Version: 1.2.4 19 19 * Author: Open Source Excellence 20 20 * Author URI: https://www.opensource-excellence.com/ … … 34 34 if(!defined('OSELETSENCRYPT_PATH')) 35 35 define('OSELETSENCRYPT_PATH', plugin_dir_path( __FILE__ )); 36 if(!defined('OSELETSENCRYPT_ENDPOINT'))37 define('OSELETSENCRYPT_ENDPOINT', 'https://www.1o1wp.com/');38 36 if(!defined('OSELETSENCRYPT_PROTOCOL')) 39 37 define('OSELETSENCRYPT_PROTOCOL', 'https'); … … 78 76 add_action('wp_ajax_store_account_data', array($this,'storeAccountData')); 79 77 add_action('wp_ajax_check_account_data', array($this,'checkAccountData')); 80 add_action('wp_ajax_send_ssl_request', array($this,'sendSslRequest '));78 add_action('wp_ajax_send_ssl_request', array($this,'sendSslRequestAjax')); 81 79 add_action('wp_ajax_create_folders', array($this,'createFolders')); 82 80 //add_action('wp_ajax_get_terms', array($this,'getTerms')); … … 262 260 return; 263 261 } 264 wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css' );265 wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css' );266 wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map' );262 wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css', array(), 1.0); 263 wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css', array(), 1.0); 264 wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map', array(), 1.0); 267 265 wp_enqueue_style('oseletsencrypt-googleapis', 'https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic'); 268 wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css' );269 wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css' );266 wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css', array(), 1.0); 267 wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css' ,array(), '1.2.4'); 270 268 wp_enqueue_script('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/js/bootstrap.min.js', array(), 1.0); 271 269 wp_enqueue_script('oseletsencrypt-bootbox', OSELETSENCRYPT_URL. 'assets/js/bootbox.min.js', array(), 1.0); 272 wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), 1.0);270 wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), '1.2.4'); 273 271 274 272 $admin_options = array( … … 307 305 ?> 308 306 309 < divclass="wrap">307 <hr class="wrap"> 310 308 <form id="oseletsencrypt-account-form" class=""> 311 309 <!-- … … 373 371 <div id="response-message" class="success-message"> 374 372 </div> 375 373 <div id="timer"><?php echo __( 'This Page will be reloaded in', 'ose-lets-encrypt' ); ?> <span id="countdowntimer">10 </span> <?php echo __( 'seconds', 'ose-lets-encrypt' ); ?></div> 376 374 <button class="button" id="oseletsencrypt-account-save" type="submit" disabled="true"> 377 375 <?php echo __( 'Save Configuration', 'ose-lets-encrypt' ); ?> … … 389 387 </div> 390 388 </fieldset> 389 <hr> 390 <div id="cronjob-setting"> 391 <?php echo __( 'Automatic SSL certificates renewal Cron Job Example', 'ose-lets-encrypt' ); ?>: 392 </br> 393 <?php 394 if(isset($data['web_token']) && !empty($data['web_token'])) { 395 $min = date("i"); 396 $hour = date("H"); 397 $day = date("d"); 398 $cron = $min . " " . $hour . " " . $day . " */2 *"; 399 echo $cron . " /usr/bin/curl --silent " . $this->getCronJobUrl(). "&>/dev/null"; 400 } 401 ?> 402 </div> 391 403 </div> 392 404 </form> … … 415 427 </div> 416 428 417 </div> 429 418 430 <?php 419 431 } 420 432 421 public function sendSslRequest (){433 public function sendSslRequestAjax(){ 422 434 if (wp_verify_nonce($_POST['security'], $this->_nonce) === false) 423 435 die(__( 'Invalid Request! Reload your page please.', 'ose-lets-encrypt' )); 424 436 return $this->sendSslRequest(); 437 } 438 public function sendSslRequest(){ 425 439 $data = $this->getData(); 426 440 $data = $this->sanitizeData($data); … … 452 466 } 453 467 protected function generateToken($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') { 468 $token = $this->getWebToken(); 469 if(!empty($token)){ 470 return $token; 471 } 454 472 $chars_length = (strlen($chars) - 1); 455 473 $string = $chars{rand(0, $chars_length)}; … … 574 592 return $result; 575 593 } 594 protected function getCronJobUrl(){ 595 $token = $this->getWebToken(); 596 return str_replace("http://","https://",OSELETSENCRYPT_URL.'cron.php?web_token='.$token); 597 } 598 protected function getWebToken(){ 599 $data = $this->getData(); 600 if(isset($data['web_token']) && !empty($data['web_token'])){ 601 return $data['web_token']; 602 } 603 return false; 604 } 576 605 } 577 606
Note: See TracChangeset
for help on using the changeset viewer.