Changeset 1822317
- Timestamp:
- 02/14/2018 08:38:07 PM (8 years ago)
- Location:
- userecho
- Files:
-
- 2 edited
- 3 copied
-
tags/1.0.12 (copied) (copied from userecho/trunk)
-
tags/1.0.12/readme.txt (copied) (copied from userecho/trunk/readme.txt) (2 diffs)
-
tags/1.0.12/userecho.php (copied) (copied from userecho/trunk/userecho.php) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/userecho.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
userecho/tags/1.0.12/readme.txt
r1822254 r1822317 5 5 Requires at least: 2.8 6 6 Tested up to: 4.9.4 7 Stable tag: 1.0.1 17 Stable tag: 1.0.12 8 8 9 9 Integrate UserEcho - customer feedback and helpdesk system into your blog. Using widget or link. Support SSO. … … 45 45 == Changelog == 46 46 47 = 1.0.12 = 48 * SSO integration - fix bugs in some specific cases 47 49 = 1.0.11 = 48 50 * SSO integration - mcrypt module is deprecated in php 7.2.0 (replace with openssl) -
userecho/tags/1.0.12/userecho.php
r1822254 r1822317 2 2 /* 3 3 Plugin Name: UserEcho for Wordpress - collect feedback for your blog 4 Version: 1.0.1 14 Version: 1.0.12 5 5 Plugin URI: https://userecho.com 6 6 Author: UserEcho … … 27 27 define( 'UE_URL', plugins_url() . '/userecho' ); 28 28 29 if(!function_exists('wp_get_current_user')) { 30 require_once ABSPATH . "wp-includes/pluggable.php"; 31 } 32 29 33 class UserEcho { 34 public $current_user = 0; 30 35 public function __construct() { 31 36 $this->check_if_sso_login(); … … 35 40 add_action( 'wp_footer', array( $this, 'show_tab_widget' ) ); 36 41 42 } 43 public function get_current_user(){ 44 #global $current_user; 45 if (empty( $this->$current_user->ID )){ 46 $this->$current_user = wp_get_current_user(); 47 } 48 return $this->$current_user; 37 49 } 38 50 … … 300 312 301 313 private function get_sso_token() { 302 global $current_user;314 $current_user = $this->get_current_user(); 303 315 $options = $this->get_options(); 304 316 … … 387 399 public function check_if_sso_login() 388 400 { 389 global $current_user, $pagenow;390 401 #http://127.0.0.1/wordpress/wp-login.php 391 402 # http://127.0.0.1/wordpress/wp-login.php?host_url=https://userecho.com&action=ue-login 392 393 403 if ( isset( $_GET['action'] ) && $_GET['action'] == 'ue-login' ) { 394 404 if ( ! isset( $_REQUEST['return']) || ! $_REQUEST['return'] ) { … … 397 407 $return_url = $_REQUEST['return']; 398 408 399 if ( !empty( $ current_user->ID) ) {409 if ( !empty( $this->get_current_user()->ID) ) { 400 410 // If user is logged into WP, generate SSO and redirect him back to UE 401 411 header( 'Location: '.$this->get_sso_redirect_url($return_url) ) ; … … 529 539 return $url; 530 540 } 531 532 if (isset( $_REQUEST['wp-submit'] ) && $_REQUEST['wp-submit'] == "Log In" && is_a( $user, 'WP_User' )) { 541 #if (isset( $_REQUEST['wp-submit'] ) && $_REQUEST['wp-submit'] == "Log In" && is_a( $user, 'WP_User' )) { 542 if (is_a( $user, 'WP_User' )) { 543 $ue->$current_user = $user; 533 544 header("Location: ".$ue->get_sso_redirect_url($return_url)); 534 545 die(); -
userecho/trunk/readme.txt
r1822254 r1822317 5 5 Requires at least: 2.8 6 6 Tested up to: 4.9.4 7 Stable tag: 1.0.1 17 Stable tag: 1.0.12 8 8 9 9 Integrate UserEcho - customer feedback and helpdesk system into your blog. Using widget or link. Support SSO. … … 45 45 == Changelog == 46 46 47 = 1.0.12 = 48 * SSO integration - fix bugs in some specific cases 47 49 = 1.0.11 = 48 50 * SSO integration - mcrypt module is deprecated in php 7.2.0 (replace with openssl) -
userecho/trunk/userecho.php
r1822254 r1822317 2 2 /* 3 3 Plugin Name: UserEcho for Wordpress - collect feedback for your blog 4 Version: 1.0.1 14 Version: 1.0.12 5 5 Plugin URI: https://userecho.com 6 6 Author: UserEcho … … 27 27 define( 'UE_URL', plugins_url() . '/userecho' ); 28 28 29 if(!function_exists('wp_get_current_user')) { 30 require_once ABSPATH . "wp-includes/pluggable.php"; 31 } 32 29 33 class UserEcho { 34 public $current_user = 0; 30 35 public function __construct() { 31 36 $this->check_if_sso_login(); … … 35 40 add_action( 'wp_footer', array( $this, 'show_tab_widget' ) ); 36 41 42 } 43 public function get_current_user(){ 44 #global $current_user; 45 if (empty( $this->$current_user->ID )){ 46 $this->$current_user = wp_get_current_user(); 47 } 48 return $this->$current_user; 37 49 } 38 50 … … 300 312 301 313 private function get_sso_token() { 302 global $current_user;314 $current_user = $this->get_current_user(); 303 315 $options = $this->get_options(); 304 316 … … 387 399 public function check_if_sso_login() 388 400 { 389 global $current_user, $pagenow;390 401 #http://127.0.0.1/wordpress/wp-login.php 391 402 # http://127.0.0.1/wordpress/wp-login.php?host_url=https://userecho.com&action=ue-login 392 393 403 if ( isset( $_GET['action'] ) && $_GET['action'] == 'ue-login' ) { 394 404 if ( ! isset( $_REQUEST['return']) || ! $_REQUEST['return'] ) { … … 397 407 $return_url = $_REQUEST['return']; 398 408 399 if ( !empty( $ current_user->ID) ) {409 if ( !empty( $this->get_current_user()->ID) ) { 400 410 // If user is logged into WP, generate SSO and redirect him back to UE 401 411 header( 'Location: '.$this->get_sso_redirect_url($return_url) ) ; … … 529 539 return $url; 530 540 } 531 532 if (isset( $_REQUEST['wp-submit'] ) && $_REQUEST['wp-submit'] == "Log In" && is_a( $user, 'WP_User' )) { 541 #if (isset( $_REQUEST['wp-submit'] ) && $_REQUEST['wp-submit'] == "Log In" && is_a( $user, 'WP_User' )) { 542 if (is_a( $user, 'WP_User' )) { 543 $ue->$current_user = $user; 533 544 header("Location: ".$ue->get_sso_redirect_url($return_url)); 534 545 die();
Note: See TracChangeset
for help on using the changeset viewer.