Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
ptibogxiv committed Apr 15, 2019
1 parent 1b5a4b3 commit 28d641c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions doliconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ function doliaccount_shortcode() {
}

if ( isset($_POST['submitted']) ) {
$thirdparty=$_POST['thirdparty'];
$thirdparty=$_POST['thirdparty'];//['0']

if ( email_exists($thirdparty['email']) ) {
$emailError = "".__( 'This email address is already linked to an account. You can reactivate your account through this <a href=\'".wp_lostpassword_url( get_permalink() )."\' title=\'lost password\'>form</a>.', 'doliconnect' )."";
Expand All @@ -570,8 +570,7 @@ function doliaccount_shortcode() {

$role = 'subscriber';

if ( is_multisite() ) {
add_user_to_blog($entity,$ID,$role); }
if ( is_multisite() ) { add_user_to_blog($entity,$ID,$role); }
wp_update_user( array( 'ID' => $ID, 'user_email' => sanitize_email($thirdparty['email'])));
wp_update_user( array( 'ID' => $ID, 'nickname' => sanitize_user($_POST['user_nicename'])));
wp_update_user( array( 'ID' => $ID, 'display_name' => ucfirst(strtolower($thirdparty['firstname']))." ".strtoupper($thirdparty['lastname'])));
Expand Down
1 change: 1 addition & 0 deletions functions/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function informations_menu($arg) {

function informations_module($url) {
global $wpdb,$current_user,$doliconnect;

$ID = $current_user->ID;

$request = "/thirdparties/".constant("DOLIBARR");
Expand Down
3 changes: 2 additions & 1 deletion functions/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ function doliconnectuserform($object, $delay, $mode) {

if ( is_object($object) && $object->id > 0 ) {
$idobject="[".$object->id."]";
}
}
//else { $idobject="[0]"; }

echo "<ul class='list-group list-group-flush'><li class='list-group-item'>";

Expand Down

0 comments on commit 28d641c

Please sign in to comment.