Changeset 2419182
- Timestamp:
- 11/16/2020 07:04:33 AM (5 years ago)
- Location:
- censorreact/trunk
- Files:
-
- 4 edited
-
assets/css/styles.css (modified) (4 diffs)
-
censorreact.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/admin-page.php (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
censorreact/trunk/assets/css/styles.css
r2247872 r2419182 14 14 } 15 15 16 h1{ 17 color: rgb(32,116,57); 18 font-weight: 400; 19 } 20 21 h2{ 22 text-align: center; 23 color: rgb(32,116,57); 24 font-weight: 400; 25 } 26 27 h3{ 28 text-align: center; 29 color: rgb(32,116,57); 30 font-weight: 400; 31 } 32 33 label{ 16 label.censorreact-label{ 34 17 display: block; 35 18 text-align: left; … … 40 23 } 41 24 42 input {25 input.censorreact-input{ 43 26 width: 100%; 44 27 } … … 428 411 } 429 412 430 div#censorreact-form-errors-div{431 /* height: 30px; */432 position: relative;433 }434 413 div#censorreact-show-errors{ 435 414 color: red; 436 415 text-align: left; 437 position: absolute;438 top: -25px;439 416 } 440 417 … … 442 419 color: black; 443 420 } 421 422 div#censorreact-intygrate-website a { 423 color: white; 424 } -
censorreact/trunk/censorreact.php
r2247884 r2419182 12 12 Plugin URI: https://intygrate.com/censorreact 13 13 Description: censorREACT protects your site, from inappropriate content, when filtering/verifying text and moderating images. censorREACT offers both pre-defined and customised settings to ensure protection for your business. 14 Version: 1.0. 114 Version: 1.0.2 15 15 Author: Intygrate 16 16 Author URI: https://intygrate.com -
censorreact/trunk/readme.txt
r2249578 r2419182 4 4 Requires at least: 4.0 5 5 Tested up to: 5.3.2 6 Stable tag: 1.0. 16 Stable tag: 1.0.2 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html … … 202 202 * Split the login and signup forms into individual forms. 203 203 * Added a resend code button in the confirmation code form. 204 * Bug fixes 204 * Bug fixes. 205 206 = 1.0.2 = 207 208 * removed conflicting CSS. -
censorreact/trunk/templates/admin-page.php
r2247872 r2419182 1 1 <!-- Place the title of the page --> 2 2 <div class='censorreact-plugin-page'> 3 <!-- <div class='censorreact-plugin-page-inner'> -->4 5 3 <div class='censorreact-plugin-logo-div'> 6 4 <img class='censorreact-plugin-logo' src= '<?= CENSORREACT_PLUGIN_URL ?>assets/images/censorREACT-logo.png' alt='censorREACT logo'> 7 5 </div> 8 9 10 6 <hr class="wp-header-end"> 11 12 13 7 <?php 14 //This global variable connects to the wordpress database15 8 global $wpdb; 16 //Creating the table name for the returned key17 9 $plugin_table_name = "censorreact_plugin"; 18 19 //Get the key from the database20 10 $get_key_from_database = $wpdb->get_results("SELECT `key` FROM `$plugin_table_name`"); 21 11 … … 83 73 84 74 censorreact_register_user($email, $password, $confirmPassword, $confirmationCode, $terms); 85 86 75 } 87 76 88 77 //Check if the form 'get-key-user' is set 89 78 if(isset($_POST['censorreact-get-key-user'])) { 90 91 79 //This global variable connects to the wordpress database 92 80 global $wpdb; … … 195 183 return; 196 184 } 197 198 185 199 186 //if the code isnt success then it will display the error from the API … … 260 247 261 248 if(array_key_exists('code', $apiResponse)) { 262 263 249 if($apiResponse['code'] === 200) { 264 265 250 //Make sure the key is set before moving on, if not then show an error 266 251 if(isset($apiBody->data->key)) { 267 268 252 //Set the key from the api response to the variable 269 253 $censorReactKey = $apiBody->data->key; 270 271 254 //Set the key from the API into the database 272 255 $wpdb->query("UPDATE `{$plugin_table_name}` … … 274 257 WHERE `id` = 1" 275 258 ); 276 277 259 return; 278 260 } 279 280 261 //If for some reason the code is a success and the key is still not in there then it will display this error code 281 262 print('<div class="notice-error notice"><p>Your key could not be found. Please try again.</p></div>'); … … 301 282 //Make sure they enter a password 302 283 if(!empty($password) && !empty($confirmPassword)) { 303 304 284 //If the passwords are the same 305 285 if($password === $confirmPassword) { 306 307 286 //Get the arguments ready to send through to the API 308 287 $args = array( … … 323 302 //Connect to the API 324 303 $apiReturn = wp_remote_request( 'https://api.censorreact.intygrate.com/v1/register', $args ); 325 326 304 $encodedBody = json_decode($apiReturn['body'], true); 327 305 $apiBody = json_decode($apiReturn['body']); 328 306 329 error_log(print_r($apiReturn, true));330 331 307 if($encodedBody['data'] === 'confirm_required') { 332 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes' 333 "); 308 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'"); 334 309 335 310 //Set the key from the API into the database … … 341 316 return; 342 317 } else if(isset($apiBody->data->key)) { 343 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes' 344 "); 318 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'"); 345 319 346 320 //Set the key from the API into the database … … 358 332 359 333 if(array_key_exists('code', $apiResponse)) { 360 361 334 if($apiResponse['code'] === 200) { 362 363 335 //Make sure the key is set before moving on, if not then show an error 364 336 if(isset($apiBody->data->key)) { 365 366 337 //Set the key from the api response to the variable 367 338 $censorReactKey = $apiBody->data->key; 368 369 339 //Set the key from the API into the database 370 340 $wpdb->query("UPDATE `{$plugin_table_name}` 371 SET `key` = '{$censorReactKey}', `user_confirmed` = 'yes', `key_is_valid` = 'yes'372 WHERE `id` = 1"341 SET `key` = '{$censorReactKey}', `user_confirmed` = 'yes', `key_is_valid` = 'yes' 342 WHERE `id` = 1" 373 343 ); 374 344 … … 425 395 426 396 if($encodedBody['data'] === 'confirm_required') { 427 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes' 428 "); 397 $wpdb->query(" UPDATE `{$plugin_table_name}` SET `confirmation_sent` = 'yes'"); 429 398 430 399 //Set the key from the API into the database … … 469 438 if(isset($get_key_from_database[0]->key) && $user_confirmed[0]->user_confirmed == 'yes') { 470 439 ?> 471 472 440 <div id="censorreact-activated-page" class="censorreact-container"> 473 474 441 <div id="censorreact-activated-page-inner"> 475 476 442 <div id="censorreact-user-key"> 477 443 <h2>Details</h2> 478 479 444 <div id="censorreact-user-key-inner"> 480 481 445 <div id="censorreact-status"> 482 446 <p>Account Status:</p> 483 484 447 <?php 485 448 if ($get_key_valid[0]->key_is_valid === 'yes' && $limit_reached[0]->limit_reached !== 'yes' ) { … … 493 456 } 494 457 ?> 495 496 458 </div> 497 459 <div id="censorreact-username"> … … 502 464 <p>Key:</p> 503 465 <p><?= $get_key_from_database[0]->key ?></p> 504 </div>466 </div> 505 467 </div> 506 468 </div> 507 508 469 <div id="censorreact-get-latest"> 509 470 <div id="censorreact-get-latest-inner"> 510 471 <h2>Get latest key</h2> 511 512 472 <p>Enter your censorREACT login details.</p> 513 514 473 <div id='censorreact-settings-page-content'> 515 <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK! -->516 474 <div id="censorreact-form-errors-div"> 517 475 <div id='censorreact-show-errors' class=''></div> … … 520 478 <form name='censorreact-get-key-form' id='censorreact-get-key-form' method='post'> 521 479 <div class='censorreact-input-group'> 522 <label >Email</label>523 <input type='email' name='censorreact-get-key-email' id='censorreact-get-key-email' placeholder='<?= $get_user_email[0]->email ?>' readonly>480 <label class="censorreact-label">Email</label> 481 <input class='censorreact-input' type='email' name='censorreact-get-key-email' id='censorreact-get-key-email' placeholder='<?= $get_user_email[0]->email ?>' readonly> 524 482 </div> 525 483 <div class='censorreact-input-group'> 526 <label >Password</label>527 <input type='password' name='censorreact-get-key-password' id='censorreact-get-key-password' placeholder='Enter Password'>484 <label class="censorreact-label">Password</label> 485 <input class="censorreact-input" type='password' name='censorreact-get-key-password' id='censorreact-get-key-password' placeholder='Enter Password'> 528 486 </div> 529 487 <div class='censorreact-button-div'> … … 547 505 <div id='censorreact-confirm'> 548 506 <div id='censorreact-confirm-inner'> 549 550 507 <div id='censorreact-plugin-subtitle'> 551 508 <h2 id='login-text'>Confirmation</h2> 552 509 <p id='verify-text'>A verification code has been sent to your email. Please enter your code below.</p> 553 510 </div> 554 555 511 <div id='censorreact-confirm-page-content'> 556 512 <div id='censorreact-confirm-form'> 557 <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK! -->558 513 <div id="censorreact-form-errors-div"> 559 514 <div id='censorreact-show-errors' class=''></div> … … 561 516 <form name='censorreact-confirm-form' id='censorreact-confirm-form' method='post'> 562 517 <div class='censorreact-input-group'> 563 <label >Email</label>564 <input type='email' name='censorreact-confirm-email' id='censorreact-confirm-email' placeholder='<?= $get_user_email[0]->email ?>' readonly>518 <label class="censorreact-label">Email</label> 519 <input class="censorreact-input" type='email' name='censorreact-confirm-email' id='censorreact-confirm-email' placeholder='<?= $get_user_email[0]->email ?>' readonly> 565 520 </div> 566 521 <div class='censorreact-confirmation-code-input'> 567 <label >Confirmation Code</label>568 <input type='text' name='censorreact-confirmation-code' id='censorreact-confirmation-code'522 <label class="censorreact-label">Confirmation Code</label> 523 <input class="censorreact-input" type='text' name='censorreact-confirmation-code' id='censorreact-confirmation-code' 569 524 maxlength='6' 570 525 placeholder='Confirmation Code'> … … 586 541 <?php 587 542 } else { 588 589 590 591 543 if(isset($_POST['censorreact-login-signup'])){ 592 544 error_log('is set loginsignup'); … … 608 560 } 609 561 ?> 610 611 612 562 <div id='censorreact-login-signup-div'> 613 563 <form name='censorreact-login-signup' id='censorreact-login-signup' method='post'> … … 616 566 </form> 617 567 </div> 618 619 568 <div id="censorreact-login-signup-page"> 620 621 569 <?php if($_SESSION['signup-login'] === 'login') { ?> 622 623 570 <div id='censorreact-login'> 624 571 <div id='censorreact-login-inner'> 625 626 <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK! -->627 572 <div id="censorreact-form-errors-div"> 628 573 <div id='censorreact-show-errors' class=''></div> … … 631 576 <form name='censorreact-login-form' id='censorreact-login-form' method='post' novalidate> 632 577 <div class='censorreact-input-group'> 633 <label >Email</label>634 <input type='email' name='censorreact-login-email' id='censorreact-login-email' placeholder='Enter Email'>578 <label class="censorreact-label">Email</label> 579 <input class="censorreact-input" type='email' name='censorreact-login-email' id='censorreact-login-email' placeholder='Enter Email'> 635 580 </div> 636 581 <div class='censorreact-input-group'> 637 <label >Password</label>638 <input type='password' name='censorreact-login-password' id='censorreact-login-password' placeholder='Enter Password'>582 <label class="censorreact-label">Password</label> 583 <input class="censorreact-input" type='password' name='censorreact-login-password' id='censorreact-login-password' placeholder='Enter Password'> 639 584 </div> 640 585 <div class='censorreact-button-div'> … … 648 593 <div id='censorreact-signup'> 649 594 <div id='censorreact-signup-inner'> 650 651 <!-- THIS IS NEEDED FOR JAVASCRIPT VALIDATION TO WORK! -->652 595 <div id="censorreact-form-errors-div"> 653 596 <div id='censorreact-show-errors' class=''></div> … … 656 599 <form name='censorreact-register-form' id='censorreact-register-form' method='post' novalidate> 657 600 <div class='censorreact-input-group'> 658 <label >Email</label>659 <input type='email' name='censorreact-register-email' id='censorreact-register-email' placeholder='Enter Email'>601 <label class="censorreact-label">Email</label> 602 <input class="censorreact-input" type='email' name='censorreact-register-email' id='censorreact-register-email' placeholder='Enter Email'> 660 603 </div> 661 604 <div class='censorreact-input-group'> 662 <label >Password</label>663 <input type='password' name='censorreact-register-password' id='censorreact-register-password' placeholder='Enter Password'>605 <label class="censorreact-label">Password</label> 606 <input class="censorreact-input" type='password' name='censorreact-register-password' id='censorreact-register-password' placeholder='Enter Password'> 664 607 </div> 665 608 <div class='censorreact-input-group'> 666 <label >Confirm password</label>667 <input type='password' name='censorreact-register-password-confirm' id='censorreact-register-password-confirm' placeholder='Confirm Password'>609 <label class="censorreact-label">Confirm password</label> 610 <input class="censorreact-input" type='password' name='censorreact-register-password-confirm' id='censorreact-register-password-confirm' placeholder='Confirm Password'> 668 611 </div> 669 612 <div id="censorreact-terms-div" class='censorreact-input-group'> 670 613 <input type="checkbox" name="censorreact-terms" id='censorreact-terms'> 671 <label id='censorreact-terms'>I agree to the <a href='https://intygrate.com/terms-of-service' target='_blank'>Intygrate Terms of Service</a></label>614 <label class="censorreact-label" id='censorreact-terms'>I agree to the <a href='https://intygrate.com/terms-of-service' target='_blank'>Intygrate Terms of Service</a></label> 672 615 </div> 673 616 <div class='censorreact-button-div'> … … 678 621 </div> 679 622 </div> 680 681 682 623 <?php } ?> 683 624 </div> 684 685 686 625 <?php 687 626 } 688 627 ?> 689 690 <!-- </div> -->691 628 </div>
Note: See TracChangeset
for help on using the changeset viewer.