This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
Hello,


Right after installing and configuring both Google Connect and Facebook Login plugins from osclasspoint market, I've noticed that when using Facebook, user is prompted with a cool message "You have been successfully logged in."  When payment pluggin is enabdled user is promted also with "As a bonus for registration we have just boost your wallet with 10.00 лв. Feel free to use them for promotion of your listings!" which is really nice.

But none of these messages displays when using google connect.


I have loooked in the code and found that both plugins have this block:

Code: [Select]
// Flash messages
      if($login_code == 0) {
        osc_add_flash_error_message(__('This account does not exist.', 'google_connect'));
      } else if ($login_code == 1) {
        osc_add_flash_error_message(__('This account has not been activated.', 'google_connect'));
      } else if ($login_code == 2) {
        osc_add_flash_error_message(__('This account has been blocked.', 'google_connect'));
      } else if ($login_code == 3) {
        osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));
      }

      header('Location: ' . filter_var($google_redirect_url, FILTER_SANITIZE_URL));
    }


However this somehow does not get applied on Google Connect plugin.

Has anyone experienced the same behaviour ?


URL to reproduce : https://muzikalnik.com/user/register


Thanks!
« Last Edit: January 30, 2018, 02:51:59 PM by Lyubomir Minchev »

*

zovi

  • *
  • 29 posts
Re: "You have been successfully logged in." message does not display
« Reply #1 on: March 08, 2018, 05:08:19 PM »
Hi
I have the same problem. No flash messages are visible.

Theme zara | v1.2.13
Google Connect Plugin | Version 1.0.3

*

MB Themes

Re: "You have been successfully logged in." message does not display
« Reply #2 on: March 09, 2018, 11:05:57 AM »
You may try to replace:
Code: [Select]
header('Location: ' . filter_var($google_redirect_url, FILTER_SANITIZE_URL));
with:
Code: [Select]
header('Location:' . osc_base_url());
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • *
  • 29 posts
Re: "You have been successfully logged in." message does not display
« Reply #3 on: March 10, 2018, 04:56:07 PM »
Hi my Hero
thanks for reply.

I tried that. However, no flash messages are displayed.

Any other idea?

Thanks in advance
Zovi

*

MB Themes

Re: "You have been successfully logged in." message does not display
« Reply #4 on: March 10, 2018, 08:03:51 PM »
you do not see it even if you access backoffice?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • *
  • 29 posts
Re: "You have been successfully logged in." message does not display
« Reply #5 on: March 13, 2018, 01:06:54 AM »
you do not see it even if you access backoffice?

not 100% sure what you mean

When I login with your Facebook Login, the Flashmessages poping up like attachment 1

If I login with Google connect it shows me like attachment 2

After Google Login no Flashmessages is poping up.

I did both in a new "private" Firefox Tab (clean cookies,...).

Thanks for help.
Zovi

*

MB Themes

Re: "You have been successfully logged in." message does not display
« Reply #6 on: March 13, 2018, 10:01:34 AM »
@zovi
Can you try to put before line starting with "header(" this line:
Code: [Select]
        osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));
maybe no code is got from google so no message is shown.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • *
  • 29 posts
Re: "You have been successfully logged in." message does not display
« Reply #7 on: March 13, 2018, 10:45:03 AM »
Hi

I did it like this
Code: [Select]

      // Flash messages
      if($login_code == 0) {
        osc_add_flash_error_message(__('This account does not exist.', 'google_connect'));
      } else if ($login_code == 1) {
        osc_add_flash_error_message(__('This account has not been activated.', 'google_connect'));
      } else if ($login_code == 2) {
        osc_add_flash_error_message(__('This account has been blocked.', 'google_connect'));
      } else if ($login_code == 3) {
        osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));
      }
  /* ad by zovi - Redirect after login to dashboard =====================================================================
          header('Location: ' . filter_var($google_redirect_url, FILTER_SANITIZE_URL));
  */
  osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));
  header('Location:' . osc_user_profile_url());

    }

But no message are shown.  :-[

After, I tried the following: I put a Name into the Namefield, saved and relogin again. But no flashmessage is showing.
Other Ideas?

Thanks for help

« Last Edit: March 13, 2018, 10:54:12 AM by zovi »

*

MB Themes

Re: "You have been successfully logged in." message does not display
« Reply #8 on: March 13, 2018, 11:43:14 AM »
@zovi
Well on plugin side everything seems to be alright.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

zovi

  • *
  • 29 posts
Re: "You have been successfully logged in." message does not display
« Reply #9 on: March 14, 2018, 10:19:59 AM »
@Lyubomir Minchev
Did you got a solution?

@ Hero
My google_connect is not show Flashmessages at all.
Also I uninstall the plugin and reinstall it. But same result.

So I tried the following:

Thought maybe it works with the Facebook Flashmessage because in the Facebook Plugin the Flashmessages works.
Code: [Select]
      } else if ($login_code == 3) {
        osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));
      }
  osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));  //  Test  ======================
  osc_add_flash_ok_message(__('You have been successfully logged in.', 'facebook_login'));   // Test ======================
  header('Location:' . osc_user_profile_url());

...but nothing happens.

Second I tried:
Code: [Select]
        } else {
          osc_add_flash_error_message(__('Your profile picture could not be saved, because there is already picture uploaded by you or you do not have any picture uploaded in your Google account.','google_connect'));
        }
      }
    }
    osc_add_flash_ok_message(__('Hello World 1', 'google_connect'));  //Test one ================================
 
    if($osclass_user == 0 or $osclass_user == '') {
      $get_user = ModelGC::newInstance()->getUserByEmail($email);
      $login_code = gc_user_login($get_user['pk_i_id']);

      osc_add_flash_ok_message(__('Hello World 2', 'google_connect'));  // Test two ===================================

      if($login_code == 3) {
        //Remeber user login & save user to cookies
        //this include contains de osc_genRandomPassword function
        require_once osc_lib_path() . 'osclass/helpers/hSecurity.php';

on line 162 i put the first message in. it is before the IF loop " if($osclass_user == 0 or $osclass_user == '') " begins. This message (Hello world 1) is showing on front-end (Attachment 1).
The second message is on line 168. But no message (Hello world 2) is showing.

What is happen in this IF loop? I'm not a programmer so I don't understand what it really does/should doe.


Re: "You have been successfully logged in." message does not display
« Reply #10 on: March 14, 2018, 10:28:45 AM »
Nope, I still don't have a solution.
I've decided not to use google connect plugin, but just the facebook one.

However I will be still interested knowing the resolution of this issue. I might enable the plugin again.

*

zovi

  • *
  • 29 posts
Re: "You have been successfully logged in." message does not display
« Reply #11 on: March 15, 2018, 04:09:30 PM »
Hi
When I comment out the header section, it works.

Code: [Select]
// Flash messages
      if($login_code == 0) {
        osc_add_flash_error_message(__('This account does not exist.', 'google_connect'));
      } else if ($login_code == 1) {
        osc_add_flash_error_message(__('This account has not been activated.', 'google_connect'));
      } else if ($login_code == 2) {
        osc_add_flash_error_message(__('This account has been blocked.', 'google_connect'));
      } else if ($login_code == 3) {
        osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));
      }

// disable this - header('Location: ' . filter_var($google_redirect_url, FILTER_SANITIZE_URL));

    }

But why it works with code "//header('Location:' . osc_user_profile_url());" or "header('Location: ' . osc_base_url());" in the Facebook plugin? just not in Google plugin.
I can't find out what happens with this code. And I really want to redirect to osc_user_profile_url after login!
Any idea?

Thanks


*

MB Themes

Re: "You have been successfully logged in." message does not display
« Reply #12 on: March 15, 2018, 07:22:21 PM »
It is strange, looks like we are trying to fix code that is not related to this issue. Alternative is that there is one extra redirect that actually wipe message.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on March 17, 2018, 09:14:04 AM
*

zovi

  • *
  • 29 posts
Re: "You have been successfully logged in." message does not display
« Reply #13 on: March 16, 2018, 08:42:42 PM »
Juhuu, I got it

Was just a smal piece.

I saw in the Facebook Plugin that there is a exit code (exit;). Make sense for me that rest will stop instead of wipe the flashmessages.
So put just the exit after the redirect line and it works.

Code: [Select]
        osc_add_flash_error_message(__('This account has been blocked.', 'google_connect'));
      } else if ($login_code == 3) {
        osc_add_flash_ok_message(__('You have been successfully logged in.', 'google_connect'));
      }
  header('Location:' . osc_user_profile_url());
      exit;
    }

@MB Themes. Maybe you find a better place to put the exit on it. I don't know what else I stop now with that.

PS: Just for Info. I installed a new fresh Osclass for testing and installed the Facebook- and Google Connect Plugin too. But same same... Google Connect is not showing the messages. After I put the exit on it, it worked too.
« Last Edit: March 16, 2018, 08:44:14 PM by zovi »

*

MB Themes

Re: "You have been successfully logged in." message does not display
« Reply #14 on: March 17, 2018, 09:14:01 AM »
@zovi
Interesting, we put exit after redirect just to speedup script and close all other actions.
I've updated code in plugin and will update it on osclasspoint soon.
Thanks for your feedback ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots