Skip to content

Commit

Permalink
Merge pull request #188 from auth0/dev
Browse files Browse the repository at this point in the history
2.1.7
  • Loading branch information
glena committed Apr 5, 2016
2 parents 4adb154 + 77d3da4 commit 6e07db0
Show file tree
Hide file tree
Showing 22 changed files with 535 additions and 121 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ This JWT should match with a registered user in your WP instalation.

You can use this feature with API's provided by plugins like **WP REST API (WP API)**.

## Fedback webtask creation

```
wt create --name wp-auth0-slack \
--secret SLACK_WEBHOOK_URL=... \
--secret SLACK_CHANNEL_NAME=... \
--output url slack-notifier.js
```

## Technical Notes

**IMPORTANT**: By using this plugin you are delegating the site authentication to Auth0. That means that you won't be using the **WordPress** database to authenticate users anymore and the default WP login box won't show anymore. However, we can still associate your existing users by merging them by email. This section explains how.
Expand Down
6 changes: 3 additions & 3 deletions WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Auth0 for WordPress
* Description: Let your users login with any social provider from Twitter to Facebook as well as many others like Github. Enterprise? We've got you covered - <a href="https://auth0.com">Auth0</a> is a full enterprise solution and will work with your Active Directory or any other environment to take control of your wordpress sites.
* Version: 2.1.6
* Version: 2.1.7
* Author: Auth0
* Author URI: https://auth0.com
*/
Expand All @@ -12,7 +12,7 @@
define( 'WPA0_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
define( 'WPA0_LANG', 'wp-auth0' );
define( 'AUTH0_DB_VERSION', 4 );
define( 'WPA0_VERSION', '2.1.6' );
define( 'WPA0_VERSION', '2.1.7' );

/**
* Main plugin class
Expand Down Expand Up @@ -350,7 +350,7 @@ function get_currentauth0userinfo() {

$result = get_currentauth0user();
if ($result) {
$currentauth0_user = unserialize( $result->auth0_obj );
$currentauth0_user = WP_Auth0_Serializer::unserialize( $result->auth0_obj );
}

return $currentauth0_user;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/initial-setup.css

Large diffs are not rendered by default.

127 changes: 120 additions & 7 deletions assets/css/initial-setup/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@
color:softText;
}

ul.list {
font-size: 17px;
color:softText;

li {
list-style-type: disc;
margin-left: 25px;
}
}

textarea.code {
font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
font-size: 12px;
Expand Down Expand Up @@ -176,6 +186,7 @@
display: inline-block;
text-align: center;
padding: 0 30px;
transition: background-color 0.2s ease;

&:focus {
box-shadow: none;
Expand Down Expand Up @@ -209,6 +220,18 @@
color: buttonSecondaryText;
}
}

&.default {

background: #fff;
color: rgba(0,0,0,0.86);
border-color: #d0d2d3;

&:hover {
background: #d0d2d3;
}

}
}

#wpa0_choose_icon {
Expand Down Expand Up @@ -281,13 +304,17 @@
}
}

p.a0-message {
line-height: 38px;
.a0-message {
line-height: 24px;
font-size: 12px;
border-radius: 3px;
position: relative;
color:text;
padding-left:20px;
padding: 15px;

&.a0-step-text {
font-size: 14px;
}

&.multiline {
line-height: 25px;
Expand All @@ -307,8 +334,12 @@ p.a0-message {
}
}
&.a0-warning {
background: #f8edb5;
color: #a78e11;
background: #fff7c9;
color: #786600;
a {
color: #786600;
font-decoration:underline;
}
}

b {
Expand All @@ -325,6 +356,15 @@ p.a0-message {
left:20px;
top:20px;
}

.a0-button {
border: 0;
margin: -4px;
margin-left: 10px;
font-size: 12px;
line-height: 12px;
padding: 10px 15px;
}
}

.modal-content {
Expand Down Expand Up @@ -752,7 +792,9 @@ p.a0-message {
.top-margin {
margin-top: 30px;
}

.no-bottom-margin {
margin-bottom: 0;
}

.form-table th, .form-table label, .form-wrap label {
color:formFieldsText;
Expand Down Expand Up @@ -822,4 +864,75 @@ p.a0-message {

#manuallySetToken {
margin-right:15px;
}
}

.a0-feedback {
background-color: profileBG;
padding:30px;
margin-top: 30px;
border-radius: 3px;

h2 {
font-size:18px;
margin-bottom:15px;
&.message {
margin:0;
}
}

.a0-separator {
margin:20px 0;
}

input.feedback_calification {
display:none;
}

input:checked + .feedback-face {
opacity:1;
}

.a0-buttons {
margin:15px 0 0;

.a0-button{
min-width: auto;
cursor:pointer;
}
}

textarea {
padding:10px;
height:90px;
}

.feedback-face {
width:40px;
height:40px;
display:inline-block;
background-size:contain;
opacity:0.4;
margin-right:30px;
cursor:pointer;

&:hover {
opacity:0.7;
}

&.calification-1 {
background-image: url('../img/rates/01.svg');
}
&.calification-2 {
background-image: url('../img/rates/02.svg');
}
&.calification-3 {
background-image: url('../img/rates/03.svg');
}
&.calification-4 {
background-image: url('../img/rates/04.svg');
}
&.calification-5 {
background-image: url('../img/rates/05.svg');
}
}
}
2 changes: 1 addition & 1 deletion assets/css/initial-setup/partials/_colors.styl
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ adminFormBG=#e5e5e5
loadingText=#A78E11
loadingBG=#F8EDB5

separatorBorder=rgba(208,210,211,1)
separatorBorder=rgba(0,0,0,0.05)
15 changes: 15 additions & 0 deletions assets/img/rates/01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/img/rates/02.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/img/rates/03.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/img/rates/04.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/img/rates/05.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/WP_Auth0_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ protected function defaults(){
// 'auto_provisioning' => true,
'default_login_redirection' => home_url(),

'auth0_server_domain' => 'auth0.auth0.com',


//DASHBOARD
'chart_idp_type' => 'donut',
Expand Down
12 changes: 12 additions & 0 deletions lib/WP_Auth0_Settings_Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function init(){

public function init_menu() {

if (isset($_REQUEST['page']) && $_REQUEST['page'] === 'wpa0-help') {
wp_redirect( admin_url( 'admin.php?page=wpa0#help' ), 301 );
exit;
}

$client_id = $this->a0_options->get('client_id');
$client_secret = $this->a0_options->get('client_secret');
$domain = $this->a0_options->get('domain');
Expand All @@ -46,6 +51,9 @@ public function init_menu() {
add_submenu_page($main_menu, __('Settings', WPA0_LANG), __('Settings', WPA0_LANG), '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, __('Help', WPA0_LANG), __('Help', WPA0_LANG), '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') );
}

Expand All @@ -57,4 +65,8 @@ public function init_menu() {
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') );
}
}

public function redirect_to_help() {

}
}
15 changes: 15 additions & 0 deletions lib/admin/WP_Auth0_Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,21 @@ public function render_settings_page() {
$social_connections[] = $this->get_social_connection($provider['provider'], $provider['name'], $provider['icon']);
}

$domain = $this->a0_options->get('domain');
$parts = explode('.', $domain);

$tenant = $parts[0];

if (strpos($domain, 'au.auth0.com') !== false) {
$tenant .= '@au';
}
elseif (strpos($domain, 'eu.auth0.com') !== false) {
$tenant .= '@eu';
}
elseif (strpos($domain, 'auth0.com') !== false) {
$tenant .= '@us';
}

include WPA0_PLUGIN_DIR . 'templates/settings.php';
}
}
Loading

0 comments on commit 6e07db0

Please sign in to comment.