Skip to main content
Topic: [ADDON] OASL - ONE ALL SOCIAL LOGIN (Read 4714 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[ADDON] OASL - ONE ALL SOCIAL LOGIN

OASL - ONE ALL SOCIAL LOGIN is an addon for multiple social login which can be registered and set at https://app.oneall.com/signin/ and the relevant social media.[1]It is free up to  2,500 unique users per year.[2].

This is a non-stable-alpha-package but do not use it in an active forum of yours, unless you really know what  you are doing. It is attached below and will be updated only if I know how, so do contribute, at least by reporting errors.[3].

1.png 2.png 3.png 4.png 5.png
The original discussion is in here.
You can upgrade to premium service for more but I am not promoting this.
I hope this can be a start for coding multiple social login / registration to ElkArte forum whether using Hybridauth as suggested by @emanuele or something similar/better.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #1

I suggest many things, not that I can keep up with the expectations! xD
Anyway good job! :D
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #2

I might just drop this effort since @Spuds already come out with the fully free version just now using HybridAuth in this post. However, I decided that I will continue with it.

Tested the latest version and ended up this error.
QuoteThe database value you're trying to insert does not exist: member_ip
Function: registerMember
https://elkarte.sch.my/index.php?action=oasl_callback;oasl_source=login
/var/www/clients/client2/web1/web/sources/subs/Members.subs.php
Line: 778

Seems like it is asking for member ip but it is not supplied by the addon. Will try to resolve this if I got some idea on how to resolve it.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #3

Yes please continue ! 

This version has several features which I have not done with HybridAuth and it will be good to know what features / control folks want use.  Plus this one has some learning history with it since its been around, some of that can be useful.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #4

I learned some code from your Social Login @Spuds and from that I added ip and ip2 in the new version of this addon.

Adding user via facebook will get error 500 but after a refresh, the user is logged in.

I think the following is the fix in the sdk file but it doesn't import the avatar if I am using it. If I am not using it, the addon will import the avatar, but with the above error 500:
Code: [Select]
						require_once(SUBSDIR . '/ManageAttachments.subs.php');
removeAttachments(array('id_member' => $id_member));

Will keep trying...
Last Edit: March 30, 2017, 05:15:57 am by ahrasis

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #5

1.0 or 1.1?
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #6

Tested this on 1.0.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #7

Can you have a look what are the surroundings of line 778 in your Members.subs.php?
And post the relevant query? (I think you are using a testing one and may be slightly different from the one in the repo right now.)
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #8

Yes. After modification, here is the the line from 754 to 800:
Quote   // Call an optional function to validate the users' input.
   call_integration_hook('integrate_register', array(&$regOptions, &$theme_vars, &$knownInts, &$knownFloats));

   $column_names = array();
   $values = array();
   foreach ($regOptions['register_vars'] as $var => $val)
   {
      $type = 'string';
      if (in_array($var, $knownInts))
         $type = 'int';
      elseif (in_array($var, $knownFloats))
         $type = 'float';
      elseif ($var == 'birthdate')
         $type = 'date';

      $column_names[$var] = $type;
      $values[$var] = $val;
   }

   // Register them into the database.
   $db->insert('',
      '{db_prefix}members',
      $column_names,
      $values,
      array('id_member') <--- line 778
   );
   $memberID = $db->insert_id('{db_prefix}members', 'id_member');

   // Update the number of members and latest member's info - and pass the name, but remove the 's.
   if ($regOptions['register_vars']['is_activated'] == 1)
      updateMemberStats($memberID, $regOptions['register_vars']['real_name']);
   else
      updateMemberStats();

   // Theme variables too?
   if (!empty($theme_vars))
   {
      $inserts = array();
      foreach ($theme_vars as $var => $val)
         $inserts[] = array($memberID, $var, $val);
      $db->insert('insert',
         '{db_prefix}themes',
         array('id_member' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),
         $inserts,
         array('id_member', 'variable')
      );
   }

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #9

The 500 error I think it's just a missing:
Code: [Select]
require_once(SUBSDIR . '/ManageAttachments.subs.php');
in oneall_social_upload_user_avatar.
Worth a try.

On the db error, at the moment I'm a little lost.
I guess the error log doesn't give anything more than that.
The problem is with the preg_replace_callback of the insert, but the insert should not be able to create such an error I think...
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #10

Mentioned that in reply#4 as a solution for error 500, but as mentioned there as well, the avatar doesn't shows if I am using that option. I haven't look into this for few days but I will compare some more with @Spuds Social Login version and see what EA related code OASL might be missing or something later.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #11

In reply #4 you added a:
Code: [Select]
removeAttachments(array('id_member' => $id_member));
to the require_once, so it's kind of normal that the avatar wouldn't show up. :P
I'm saying you miss just the require_once. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] OASL - ONE ALL SOCIAL LOGIN

Reply #12

Code: [Select]
require_once(SUBSDIR . '/ManageAttachments.subs.php');
removeAttachments(array('id_member' => $id_member));
This second line of the code is already in the function twice and the require once is what I added, not the other way around. It failed to show the avatar.

I also tried this way and it also failed to show the avatar:
Code: [Select]
	// Manage Attachments.
require_once(CONTROLLERDIR . '/Attachment.controller.php');
require_once(SUBSDIR . '/ManageAttachments.subs.php');

All of the above mods are made inside of the oneall_social_upload_user_avatar function.

There is a link created for the avatar though, but it is broken.

So far I don't know what else to try.