Skip to content

Commit

Permalink
Merge pull request #256 from auth0/dev
Browse files Browse the repository at this point in the history
3.2.14
  • Loading branch information
glena authored Dec 12, 2016
2 parents 7affdf1 + caace86 commit c65dd05
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
18 changes: 10 additions & 8 deletions WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
/**
* Plugin Name: PLUGIN_NAME
* Description: PLUGIN_DESCRIPTION
* Version: 3.2.13
* Version: 3.2.14
* 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( 'AUTH0_DB_VERSION', 12 );
define( 'WPA0_VERSION', '3.2.13' );
define( 'WPA0_VERSION', '3.2.14' );

/**
* Main plugin class
Expand Down Expand Up @@ -357,6 +356,7 @@ public function deactivate() {
public static function uninstall() {
$a0_options = WP_Auth0_Options::Instance();
$a0_options->delete();
delete_option( 'auth0_db_version' );
}

private function autoloader( $class ) {
Expand Down Expand Up @@ -411,15 +411,15 @@ function get_currentauth0userinfo() {
$current_user = wp_get_current_user();

$currentauth0_user = get_auth0userinfo($current_user->ID);

return $currentauth0_user;
}
}

if ( ! function_exists( 'get_currentauth0user' ) ) {
function get_currentauth0user() {

global $wpdb;
global $wpdb;

$current_user = wp_get_current_user();

Expand All @@ -437,14 +437,16 @@ function get_currentauth0user() {

if ( ! function_exists( 'get_auth0_curatedBlogName' ) ) {
function get_auth0_curatedBlogName() {
$name = get_bloginfo( 'name' );

$name = preg_replace("/[^A-Za-z0-9 ]/", '', $name);
$name = get_bloginfo( 'name' );

$name = preg_replace("/[^A-Za-z0-9 ]/", '', $name);
$name = preg_replace("/\s+/", ' ', $name);
$name = str_replace(" ", "-", $name);

return $name;
}
}

$a0_plugin = new WP_Auth0();
$a0_plugin->init();
$a0_plugin->init();
17 changes: 7 additions & 10 deletions lib/WP_Auth0_DBManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function install_db() {

if ($options->get('use_lock_10') === null) {

if ( strpos( $cdn_url, '10.' ) !== false ) {
if ( strpos( $cdn_url, '10.' ) === false ) {
$options->set('use_lock_10', false);
} else {
$options->set('use_lock_10', true);
Expand All @@ -96,14 +96,14 @@ public function install_db() {

$dict = $options->get('dict');

if (!empty($dict))
if (!empty($dict))
{

if (json_decode($dict) === null)
if (json_decode($dict) === null)
{
$options->set('language', $dict);
}
else
}
else
{
$options->set('language_dictionary', $dict);
}
Expand All @@ -116,9 +116,7 @@ public function install_db() {

if ( strpos( $cdn_url, '10.' ) === false ) {
$options->set('use_lock_10', false);
}
else
{
} else {
$options->set('use_lock_10', true);
}

Expand All @@ -135,8 +133,7 @@ protected function migrate_users_data() {

$sql = 'SELECT a.*
FROM ' . $wpdb->auth0_user .' a
JOIN ' . $wpdb->users . ' u ON a.wp_id = u.id
ORDER BY a.last_update DESC;';
JOIN ' . $wpdb->users . ' u ON a.wp_id = u.id;';

$userRows = $wpdb->get_results( $sql );

Expand Down
8 changes: 4 additions & 4 deletions lib/WP_Auth0_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ protected function defaults() {
'passwordless_method' => 'magiclink',
'passwordless_cdn_url' => '//cdn.auth0.com/js/lock-passwordless-2.2.min.js',
'use_lock_10' => null,
'cdn_url' => '//cdn.auth0.com/js/lock/10.3/lock.min.js',
'cdn_url' => '//cdn.auth0.com/js/lock/10.7/lock.min.js',
'cdn_url_legacy' => '//cdn.auth0.com/js/lock-9.2.min.js',
'requires_verified_email' => true,
'wordpress_login_enabled' => true,
'primary_color' => '',

'language' => '',
'language_dictionary' => '',

Expand Down Expand Up @@ -111,8 +111,8 @@ protected function defaults() {
'password_policy' => 'fair',

'force_https_callback' => false,
'auto_provisioning' => true,

'auto_provisioning' => false,
'default_login_redirection' => home_url(),

'auth0_server_domain' => 'auth0.auth0.com',
Expand Down
2 changes: 1 addition & 1 deletion templates/initial-setup/connections.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

</div>
</div>
<script src="http://cdn.auth0.com/js/lock-8.min.js"></script>
<script src="//cdn.auth0.com/js/lock-8.min.js"></script>
<script type="text/javascript">

document.addEventListener("DOMContentLoaded", function() {
Expand Down

0 comments on commit c65dd05

Please sign in to comment.