Skip to content

Commit 9dd1ca0

Browse files
author
Chris Gårdenberg
committed
Release 0.10.10: Fixes logout-problem in nginx
1 parent 8daf021 commit 9dd1ca0

3 files changed

Lines changed: 22 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Changelog
22

3-
## [Unreleased]
3+
## [0.10.10]
44
### Added
55
- Fixing issues stated by scrutinizer
66
- Added `exit()` after `wp_redirect()`
7+
- Bugfix: Correctly matching logout with `stristr`
78

89
## [0.10.9]
910
### Added
@@ -288,7 +289,8 @@
288289
### Added
289290
- Added inquiry support in course
290291

291-
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.10.9...HEAD
292+
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.10.10...HEAD
293+
[0.10.10]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.10.9...v0.10.10
292294
[0.10.9]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.10.8...v0.10.9
293295
[0.10.8]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.10.7...v0.10.8
294296
[0.10.7]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.10.6...v0.10.7

eduadmin.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function edu_register_session() {
1616
* Plugin URI: http://www.eduadmin.se
1717
* Description: EduAdmin plugin to allow visitors to book courses at your website
1818
* Tags: booking, participants, courses, events, eduadmin, lega online
19-
* Version: 0.10.9
19+
* Version: 0.10.10
2020
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
2121
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
2222
* Requires at least: 3.0
@@ -76,12 +76,12 @@ public function __construct() {
7676
}
7777

7878
public function get_token() {
79-
$apiKey = get_option('eduadmin-api-key');
80-
if ( ! $apiKey || empty($apiKey) ) {
79+
$apiKey = get_option( 'eduadmin-api-key' );
80+
if ( ! $apiKey || empty( $apiKey ) ) {
8181
add_action( 'admin_notices', array( $this, 'SetupWarning' ) );
8282
return;
8383
} else {
84-
$key = DecryptApiKey($apiKey);
84+
$key = DecryptApiKey( $apiKey );
8585
if ( ! $key ) {
8686
add_action( 'admin_notices', array( $this, 'SetupWarning' ) );
8787
return;
@@ -93,7 +93,7 @@ public function get_token() {
9393
set_transient( 'eduadmin-token', $edutoken, HOUR_IN_SECONDS );
9494
} else {
9595
if ( get_transient( 'eduadmin-validatedToken_' . $edutoken ) === false ) {
96-
$valid = $this->api->ValidateAuthToken($edutoken);
96+
$valid = $this->api->ValidateAuthToken( $edutoken );
9797
if ( ! $valid) {
9898
$edutoken = $this->api->GetAuthToken( $key->UserId, $key->Hash );
9999
set_transient( 'eduadmin-token', $edutoken, HOUR_IN_SECONDS );
@@ -135,13 +135,13 @@ private function includes() {
135135
private function init_hooks() {
136136
register_activation_hook( __FILE__, 'eduadmin_activate_rewrite' );
137137

138-
add_action( 'after_switch_theme', array($this, 'new_theme') );
139-
add_action( 'init', array($this, 'init') );
140-
add_action( 'init', array($this, 'load_language') );
141-
add_action( 'eduadmin_call_home', array($this, 'call_home') );
138+
add_action( 'after_switch_theme', array( $this, 'new_theme' ) );
139+
add_action( 'init', array( $this, 'init' ) );
140+
add_action( 'init', array( $this, 'load_language' ) );
141+
add_action( 'eduadmin_call_home', array( $this, 'call_home' ) );
142142
add_action( 'wp_footer', 'edu_getTimers' );
143143

144-
register_deactivation_hook( __FILE__, array($this, 'deactivate') );
144+
register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
145145
}
146146

147147
public function init() {
@@ -157,7 +157,7 @@ public static function SetupWarning() {
157157
}
158158

159159
public function get_plugin_version() {
160-
$cachedVersion = wp_cache_get('eduadmin-version', 'eduadmin');
160+
$cachedVersion = wp_cache_get( 'eduadmin-version', 'eduadmin' );
161161
if ( false !== $cachedVersion ) {
162162
return $cachedVersion;
163163
}
@@ -167,23 +167,23 @@ public function get_plugin_version() {
167167
}
168168

169169
$version = get_plugin_data( __FILE__ )['Version'];
170-
wp_cache_set('eduadmin-version', $version, 'eduadmin', 3600);
170+
wp_cache_set( 'eduadmin-version', $version, 'eduadmin', 3600 );
171171
return $version;
172172
}
173173

174174
public function call_home() {
175175
global $wp_version;
176176
$usageData = array(
177177
'siteUrl' => get_site_url(),
178-
'siteName' => get_option('blogname'),
178+
'siteName' => get_option( 'blogname' ),
179179
'wpVersion' => $wp_version,
180-
'token' => get_option('eduadmin-api-key'),
181-
'officialVersion' => file_exists(dirname(__FILE__) . "/.official.plugin.php"),
180+
'token' => get_option( 'eduadmin-api-key' ),
181+
'officialVersion' => file_exists( dirname( __FILE__ ) . "/.official.plugin.php" ),
182182
'pluginVersion' => $this->get_plugin_version()
183183
);
184184

185185
$callHomeUrl = 'http://ws10.multinet.se/edu-plugin/wp_phone_home.php';
186-
wp_remote_post($callHomeUrl, array('body' => $usageData));
186+
wp_remote_post( $callHomeUrl, array( 'body' => $usageData ) );
187187
}
188188

189189
public function load_language() {

includes/_loginFunctions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function logoutUser() {
7676
unset($_SESSION['eduadmin-loginUser']);
7777
unset($_SESSION['needsLogin']);
7878
unset($_SESSION['checkEmail']);
79-
wp_redirect($baseUrl . edu_getQueryString());
79+
wp_redirect($baseUrl . edu_getQueryString("q"));
8080
exit();
8181
}
8282

@@ -101,7 +101,7 @@ function() {
101101
$cat = get_option('eduadmin-rewriteBaseUrl');
102102
$baseUrl = $surl . '/' . $cat;
103103

104-
if ($_SERVER['REQUEST_URI'] == "/$cat/profile/logout" || $_SERVER['REQUEST_URI'] == "/$cat/profile/logout/") {
104+
if ( stristr( $_SERVER['REQUEST_URI'], "/$cat/profile/logout" ) !== false ) {
105105
logoutUser();
106106
}
107107

0 commit comments

Comments
 (0)