Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.3.2 #349

Merged
merged 5 commits into from
Oct 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## [3.3.2](https://github.com/auth0/wp-auth0/tree/3.3.2) (2017-10-05)
[Full Changelog](https://github.com/auth0/wp-auth0/compare/3.3.2...3.2.24)

**Added**
- Added translation support for a few user-facing exception messages [\#312](https://github.com/auth0/wp-auth0/pull/312) ([idpaterson](https://github.com/idpaterson))

**Changed**
- Use literal 'wp-auth0' rather than WPA0_LANG constant [\#311](https://github.com/auth0/wp-auth0/pull/311) ([idpaterson](https://github.com/idpaterson))

**Fixed**
- Properly handle auto login configuration + custom parse url hash in login page ([glena](https://github.com/glena))
- Implicit mode in auto login ([glena](https://github.com/glena))

**Notes**
There is a jump in version due to a release issue which required bumping the version a few times.

## [3.2.24](https://github.com/auth0/wp-auth0/tree/3.2.23) (2017-08-14)
[Full Changelog](https://github.com/auth0/wp-auth0/compare/3.2.23...3.2.24)

Expand Down
6 changes: 3 additions & 3 deletions WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
/**
* Plugin Name: PLUGIN_NAME
* Description: PLUGIN_DESCRIPTION
* Version: 3.3.1
* Version: 3.3.2
* Author: Auth0
* Author URI: https://auth0.com
*/
define( 'WPA0_PLUGIN_FILE', __FILE__ );
define( 'WPA0_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'WPA0_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
define( 'WPA0_LANG', 'wp-auth0' );
define( 'WPA0_LANG', 'wp-auth0' ); // deprecated; do not use for translations
define( 'AUTH0_DB_VERSION', 14 );
define( 'WPA0_VERSION', '3.3.1' );
define( 'WPA0_VERSION', '3.3.2' );

/**
* Main plugin class
Expand Down
14 changes: 7 additions & 7 deletions lib/WP_Auth0_Api_Operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function social_validation( $app_token, $old_options, $input, $strategy,
$connections = WP_Auth0_Api_Client::search_connection( $domain, $app_token, $strategy );

// if ( ! $connections ) {
// $error = __( 'There was an error searching your active social connections.', WPA0_LANG );
// $error = __( 'There was an error searching your active social connections.', 'wp-auth0' );
// $this->add_validation_error( $error );
//
// $input[$main_key] = 0;
Expand Down Expand Up @@ -229,7 +229,7 @@ public function social_validation( $app_token, $old_options, $input, $strategy,
$response = WP_Auth0_Api_Client::update_connection($domain, $app_token, $selected_connection->id, $data);

if ( false === $response ) {
$error = __( 'There was an error updating your social connection', WPA0_LANG );
$error = __( 'There was an error updating your social connection', 'wp-auth0' );
throw new Exception( $error );

$input[$main_key] = 0;
Expand All @@ -256,7 +256,7 @@ public function social_validation( $app_token, $old_options, $input, $strategy,
$response = WP_Auth0_Api_Client::update_connection($domain, $app_token, $selected_connection->id, $data);

if ( false === $response ) {
$error = __( 'There was an error updating your social connection', WPA0_LANG );
$error = __( 'There was an error updating your social connection', 'wp-auth0' );
throw new Exception( $error );

$input[$main_key] = 0;
Expand All @@ -277,7 +277,7 @@ public function social_validation( $app_token, $old_options, $input, $strategy,
);

if ( false === WP_Auth0_Api_Client::create_connection($domain, $app_token, $data) ) {
$error = __( 'There was an error creating your social connection', WPA0_LANG );
$error = __( 'There was an error creating your social connection', 'wp-auth0' );
throw new Exception( $error );

$input[$main_key] = 0;
Expand All @@ -297,7 +297,7 @@ public function social_validation( $app_token, $old_options, $input, $strategy,
}

if ( false === $a = WP_Auth0_Api_Client::update_connection($domain, $app_token, $selected_connection->id, $data) ) {
$error = __( 'There was an error disabling your social connection for this app.', WPA0_LANG );
$error = __( 'There was an error disabling your social connection for this app.', 'wp-auth0' );
throw new Exception( $error );
$input[$main_key] = 1;
}
Expand All @@ -319,15 +319,15 @@ public function toggle_rule($app_token, $rule_id, $rule_name, $rule_script) {
$rule = WP_Auth0_Api_Client::create_rule( $domain, $app_token, $rule_name, $rule_script );

if ( $rule === false ) {
$error = __( 'There was an error creating the Auth0 rule. You can do it manually from your Auth0 dashboard.', WPA0_LANG );
$error = __( 'There was an error creating the Auth0 rule. You can do it manually from your Auth0 dashboard.', 'wp-auth0' );
throw new Exception( $error );
} else {
return $rule->id;
}
}
else {
if ( false === WP_Auth0_Api_Client::delete_rule($domain, $app_token, $rule_id) ) {
$error = __( 'There was an error deleting the Auth0 rule. You can do it manually from your Auth0 dashboard.', WPA0_LANG );
$error = __( 'There was an error deleting the Auth0 rule. You can do it manually from your Auth0 dashboard.', 'wp-auth0' );
throw new Exception( $error );
}
return null;
Expand Down
8 changes: 4 additions & 4 deletions lib/WP_Auth0_EditProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function validate_new_password( $errors, $update, $user ) {
$auth0_repeat_password = isset( $_POST['auth0_repeat_password'] ) ? $_POST['auth0_repeat_password'] : null;

if ( $auth0_password != $auth0_repeat_password ) {
$errors->add( 'auth0_password', __( '<strong>ERROR</strong>: The password does not match' ), array( 'form-field' => 'auth0_password' ) );
$errors->add( 'auth0_password', __( '<strong>ERROR</strong>: The password does not match', 'wp-auth0' ), array( 'form-field' => 'auth0_password' ) );
}
}

Expand Down Expand Up @@ -296,17 +296,17 @@ public function override_email_update() {
}

if ( $connection === null ) {
$errors->add( 'user_email', __( "<strong>ERROR</strong>: You can't change your email if you are using a social connection." ), array( 'form-field' => 'email' ) );
$errors->add( 'user_email', __( "<strong>ERROR</strong>: You can't change your email if you are using a social connection.", "wp-auth0" ), array( 'form-field' => 'email' ) );
return false;
}

if ( ! is_email( $_POST['email'] ) ) {
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address isn&#8217;t correct." ), array( 'form-field' => 'email' ) );
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address isn&#8217;t correct.", "wp-auth0" ), array( 'form-field' => 'email' ) );
return false;
}

if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) {
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address is already used." ), array( 'form-field' => 'email' ) );
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address is already used.", "wp-auth0" ), array( 'form-field' => 'email' ) );
delete_option( $current_user->ID . '_new_email' );
return;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/WP_Auth0_Embed_Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public function form( $instance ) {
wp_enqueue_script( 'wpa0_admin', WPA0_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery' ) );
wp_enqueue_style( 'media' );
wp_localize_script( 'wpa0_admin', 'wpa0', array(
'media_title' => __( 'Choose your icon', WPA0_LANG ),
'media_button' => __( 'Choose icon', WPA0_LANG ),
'media_title' => __( 'Choose your icon', 'wp-auth0' ),
'media_button' => __( 'Choose icon', 'wp-auth0' ),
) );
require WPA0_PLUGIN_DIR . 'templates/a0-widget-setup-form.php';
}
Expand Down
9 changes: 9 additions & 0 deletions lib/WP_Auth0_Metrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ function metricsTrack(event, trackData, callback) {
a0metricsLib.track(event, params, callback);
}
</script>
<?php
}
else {
?>
<script>
function metricsTrack() {
// Metrics are disabled
}
</script>
<?php
}
}
Expand Down
20 changes: 10 additions & 10 deletions lib/WP_Auth0_Settings_Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,26 @@ public function init_menu() {
$main_menu = 'wpa0-setup';
}

add_menu_page( __( 'Auth0', WPA0_LANG ), __( 'Auth0', WPA0_LANG ), 'manage_options', $main_menu,
add_menu_page( __( 'Auth0', 'wp-auth0' ), __( 'Auth0', 'wp-auth0' ), 'manage_options', $main_menu,
( $show_initial_setup ? array( $this->initial_setup, 'render_setup_page' ) : array( $this->auth0_admin, 'render_settings_page' ) ), WP_Auth0::get_plugin_dir_url() . 'assets/img/a0icon.png', 85.55 );

if ( $show_initial_setup ) {
add_submenu_page( $main_menu, __( 'Auth0 for WordPress - Setup Wizard', WPA0_LANG ), __( 'Setup Wizard', WPA0_LANG ), 'manage_options', 'wpa0-setup', array( $this->initial_setup, 'render_setup_page' ) );
add_submenu_page( $main_menu, __( 'Settings', WPA0_LANG ), __( 'Settings', WPA0_LANG ), 'manage_options', 'wpa0', array( $this->auth0_admin, 'render_settings_page' ) );
add_submenu_page( $main_menu, __( 'Auth0 for WordPress - Setup Wizard', 'wp-auth0' ), __( 'Setup Wizard', 'wp-auth0' ), 'manage_options', 'wpa0-setup', array( $this->initial_setup, 'render_setup_page' ) );
add_submenu_page( $main_menu, __( 'Settings', 'wp-auth0' ), __( 'Settings', 'wp-auth0' ), 'manage_options', 'wpa0', array( $this->auth0_admin, 'render_settings_page' ) );
} else {
add_submenu_page( $main_menu, __( 'Settings', WPA0_LANG ), __( 'Settings', WPA0_LANG ), 'manage_options', 'wpa0', array( $this->auth0_admin, 'render_settings_page' ) );
add_submenu_page( $main_menu, __( 'Settings', 'wp-auth0' ), __( 'Settings', 'wp-auth0' ), 'manage_options', 'wpa0', array( $this->auth0_admin, 'render_settings_page' ) );

add_submenu_page( $main_menu, __( 'Help', WPA0_LANG ), __( 'Help', WPA0_LANG ), 'manage_options', 'wpa0-help', array( $this, 'redirect_to_help' ) );
add_submenu_page( $main_menu, __( 'Help', 'wp-auth0' ), __( 'Help', 'wp-auth0' ), 'manage_options', 'wpa0-help', array( $this, 'redirect_to_help' ) );

add_submenu_page( $main_menu, __( 'Auth0 for WordPress - Setup Wizard', WPA0_LANG ), __( 'Setup Wizard', WPA0_LANG ), 'manage_options', 'wpa0-setup', array( $this->initial_setup, 'render_setup_page' ) );
add_submenu_page( $main_menu, __( 'Auth0 for WordPress - Setup Wizard', 'wp-auth0' ), __( 'Setup Wizard', 'wp-auth0' ), 'manage_options', 'wpa0-setup', array( $this->initial_setup, 'render_setup_page' ) );
}

add_submenu_page( $main_menu, __( 'Export Users Data', WPA0_LANG ), __( 'Export Users Data', WPA0_LANG ), 'manage_options', 'wpa0-users-export', array( $this->users_exporter, 'render_export_users' ) );
add_submenu_page( $main_menu, __( 'Error Log', WPA0_LANG ), __( 'Error Log', WPA0_LANG ), 'manage_options', 'wpa0-errors', array( $this->error_log, 'render_settings_page' ) );
add_submenu_page( $main_menu, __( 'Import-Export settings', WPA0_LANG ), __( 'Import-Export settings', WPA0_LANG ), 'manage_options', 'wpa0-import-settings', array( $this->import_settings, 'render_import_settings_page' ) );
add_submenu_page( $main_menu, __( 'Export Users Data', 'wp-auth0' ), __( 'Export Users Data', 'wp-auth0' ), 'manage_options', 'wpa0-users-export', array( $this->users_exporter, 'render_export_users' ) );
add_submenu_page( $main_menu, __( 'Error Log', 'wp-auth0' ), __( 'Error Log', 'wp-auth0' ), 'manage_options', 'wpa0-errors', array( $this->error_log, 'render_settings_page' ) );
add_submenu_page( $main_menu, __( 'Import-Export settings', 'wp-auth0' ), __( 'Import-Export settings', 'wp-auth0' ), 'manage_options', 'wpa0-import-settings', array( $this->import_settings, 'render_import_settings_page' ) );

if ( WP_Auth0_Configure_JWTAUTH::is_jwt_auth_enabled() ) {
add_submenu_page( $main_menu, __( 'JWT Auth integration', WPA0_LANG ), __( 'JWT Auth integration', WPA0_LANG ), 'manage_options', 'wpa0-jwt-auth', array( $this->configure_jwt_auth, 'render_settings_page' ) );
add_submenu_page( $main_menu, __( 'JWT Auth integration', 'wp-auth0' ), __( 'JWT Auth integration', 'wp-auth0' ), 'manage_options', 'wpa0-jwt-auth', array( $this->configure_jwt_auth, 'render_settings_page' ) );
}
}

Expand Down
8 changes: 6 additions & 2 deletions lib/WP_Auth0_UsersRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public function create( $userinfo, $token, $access_token = null, $role = null, $
$auth0_id = get_user_meta( $joinUser->ID, $wpdb->prefix.'auth0_id', true);

if ($auth0_id) { // if it has an a0 id, we cant join it
throw new WP_Auth0_CouldNotCreateUserException('There is a user with the same email');
$msg = __( 'There is a user with the same email', 'wp-auth0' );

throw new WP_Auth0_CouldNotCreateUserException( $msg );
}
}

Expand All @@ -142,7 +144,9 @@ public function create( $userinfo, $token, $access_token = null, $role = null, $
if ( is_wp_error( $user_id ) ) {
throw new WP_Auth0_CouldNotCreateUserException( $user_id->get_error_message() );
}elseif ( $user_id == -2 ) {
throw new WP_Auth0_CouldNotCreateUserException( 'Could not create user. The registration process were rejected. Please verify that your account is whitelisted for this system. Please contact your site’s administrator.' );
$msg = __( 'Could not create user. The registration process were rejected. Please verify that your account is whitelisted for this system. Please contact your site’s administrator.', 'wp-auth0' );

throw new WP_Auth0_CouldNotCreateUserException( $msg );
}elseif ( $user_id <0 ) {
throw new WP_Auth0_CouldNotCreateUserException();
}
Expand Down
16 changes: 8 additions & 8 deletions lib/admin/WP_Auth0_Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public function admin_enqueue() {
wp_enqueue_style( 'media' );

wp_localize_script( 'wpa0_admin', 'wpa0', array(
'media_title' => __( 'Choose your icon', WPA0_LANG ),
'media_button' => __( 'Choose icon', WPA0_LANG ),
'media_title' => __( 'Choose your icon', 'wp-auth0' ),
'media_button' => __( 'Choose icon', 'wp-auth0' ),
) );
}

Expand All @@ -106,9 +106,9 @@ public function cant_connect_to_auth0() {
<div id="message" class="error">
<p>
<strong>
<?php echo __( 'The current user is not authorized to manage the Auth0 account. You must be both a WordPress site administrator and a user known to Auth0 to control Auth0 from this settings page. Please see the', WPA0_LANG ); ?>
<a href="https://auth0.com/docs/cms/wordpress/troubleshoot#the-settings-page-shows-me-this-warning-the-current-user-is-not-authorized-to-manage-the-auth0-account-"><?php echo __( 'documentation', WPA0_LANG ); ?></a>
<?php echo __( 'for more information.', WPA0_LANG ); ?>
<?php echo __( 'The current user is not authorized to manage the Auth0 account. You must be both a WordPress site administrator and a user known to Auth0 to control Auth0 from this settings page. Please see the', 'wp-auth0' ); ?>
<a href="https://auth0.com/docs/cms/wordpress/troubleshoot#the-settings-page-shows-me-this-warning-the-current-user-is-not-authorized-to-manage-the-auth0-account-"><?php echo __( 'documentation', 'wp-auth0' ); ?></a>
<?php echo __( 'for more information.', 'wp-auth0' ); ?>
</strong>
</p>
</div>
Expand Down Expand Up @@ -164,9 +164,9 @@ public function create_account_message() {
<div id="message" class="updated">
<p>
<strong>
<?php echo __( 'In order to use this plugin, you need to first', WPA0_LANG ); ?>
<a target="_blank" href="https://manage.auth0.com/#/applications"><?php echo __( 'create an application', WPA0_LANG ); ?></a>
<?php echo __( ' on Auth0 and copy the information here.', WPA0_LANG ); ?>
<?php echo __( 'In order to use this plugin, you need to first', 'wp-auth0' ); ?>
<a target="_blank" href="https://manage.auth0.com/#/applications"><?php echo __( 'create an application', 'wp-auth0' ); ?></a>
<?php echo __( ' on Auth0 and copy the information here.', 'wp-auth0' ); ?>
</strong>
</p>
</div>
Expand Down
Loading