Remote Login v1.1

Release Notes

Upload, extract, enable... Enjoy!

  • is username variable posted to the external site? if yes, this can be usefull for me to create customize application intergrated with elgg!

  • i guess this function much worth if you can create simple javascript shoutbox so people can keep in touch anywhere if they registered in elgg site

  • @Alfirus

    This plugin does not expose the username or password of the user anywhere. So unfortunately, it cannot be used for integration other than displaying a login form outside the elgg directory.

    As for the shoutbox, I appreciate if you can send me more details about the idea here

  • How do I have to change this to show the latest members using the mod/members plugin?

  • Thanks for the plugin

    Can you let me know how to show the latest river activity in external page

    thanks in advance

  • Apologies for being late in replying... I have been experimenting options and while I have not been able to reach a solid solution to displaying different portions, views, or widgets remotely, I thought to share my findings and probably wait for elgg geeks to help with it :)

    First off, this current plugin can be edited to show any portion of any page of elgg by changing the

    pg/remotelogin #login-box

    Of course the first part is the page URL and the second is the "id" of the element you want clipped and included in your page.

    I tested some pages and elements and did not like the results. Furthermore, it is a very heavy load... This will prepare the whole page, download it locally using remote ajax (including YQL calls), parsethe page locally, and clip the portion of the page required. Personally speaking, I do not want this to happen on every page of my remote site :)

    In order to overcome this, I was thinking of creating a "Remote View" plugin. This plugin will render a single view and return it with minimal header and meta data. This plugin can be used to embed the returned HTML in a <iframe> element therefore minimizing the need for javascript and parsing and the rest...

    What I was testing is a plugin that accepts view names in the URL itself like this:

    http://example.com/pg/remoteview/riverdashboard/newestmembers/normal.html

    In this example, the "riverdashboard/newestmembers" part is the view name (in this case a view to display the recent members), and "normal.html" is where we pass parameters to the plugin including, for example, options like "nocss" to omit the css from the output.

    The code I tested goes like this:

    register_page_handler('remoteview', 'remoteview_page_handler');

    function remoteview_page_handler ($page)

    {

      global $CONFIG;

      if (!is_array($page) || count($page) == 0 || $page[0] == '' || is_null($page[0]) || !isset($page[0])):

        header("Content-type: text/html; charset=UTF-8");

        echo "Wrong call format. Please check the plugin usage!";

        return false;

      endif;

     

      $rv_params = $page;

     

      $rv_options = strtolower(array_pop ($rv_params));

      $rv_no_css = (strrpos($rv_options, "nocss")!== false);

      $rv_html_call =  (strrpos($rv_options, ".html")!== false);

      $rv_js_call =  (strrpos($rv_options, ".js")!== false); //TODO: Support js with document.write instead of iframe

     

      $rv_view_name = implode ('/', $rv_params);

     

      header("Content-type: text/html; charset=UTF-8");

      echo '<html>';

      echo '<head>';

      echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';

      echo '<title>' . $CONFIG->sitename . ' : Remote View Plugin : ' . $rv_view_name . '</title>';

      if (!$rv_no_css):

        echo '<link rel="stylesheet" href="' . $CONFIG->url . '_css/css.css?lastcache=' . $CONFIG->lastcache . '&amp;viewtype=default" type="text/css" />';

      endif;

      echo '</head>';

      echo '<body>';

     

      echo elgg_view($rv_view_name);

     

      echo '</body>';

      echo '</html>';

    }

    This along with the URL above will display a page with only the recent members in it. Put that in an <iframe> and voila! should be charming...
    Unfortunately, while the concept worked, I could not display the river elements as grabbing river items is part of the engine, used in widgets, and referenced in areas I could not include as views.
    Can anybody help with this... What are my options? Allow displaying a single widget? create mini views for different required portions? 
    Thanks in advance for your help ;)
  • Thanks a lot for the plugin, this is exaclty what I need!

    Unfortunately, the plugin does not work on my setup. When I enter the login data on the external page, I am transferred to the elgg site, but receive an error ("Token mismatch").

    From my web server logs:

    WARNING: Action file/icon was called without an action token. It is stongly recommended that you consider doing this. Plugin authors should use 'input/form' or pass is_action=true to 'output/confirmlink' or 'output/url'., referer: http://myexamplepage.com/

    I am using Elgg 1.6.1. Thanks for any help!

  • I have been looking for something like this.  I was able to put the login box on different pages on my site and it worked, but did not work on one of my other sites.  The box worked but when you enter the info and try to log on it says:  Fatal error: Call to a member function getGUID() on a non-object in /home/content/z/0/9/z09jmm/html/dfsn/engine/lib/entities.php on line 2078.  Any suggestions?  I am new to all of this and am trying to learn it, but I am way behind.  Thanks 1.61

  • I also get: Fatal error: Call to a member function getGUID() on a non-object in /home/content/z/0/9/z09jmm/html/dfsn/engine/lib/entities.php on line 2078

  • @Alex, @Bigyack

    Would you please open the page example.com/pg/remotelogin and try to login from there directly and let me know about the result.

  • I opened mysite.com/pg/remotelogin and after I logged in it gave me a token mismatch error, but did not give me the fatal error from before. 

  • @BigYack,

    When is the last time you actually hired $paid or pretented to to pay for --  fix your elgg/ php problems ?

     

  • @Khaled, thanks for you reply. Logging in through mysite.com/pg/remotelogin actually works fine.

    Also, I now assume that the web server error I cited above is NOT related to this issue.

    Any ideas why the login does not work from the remote site?

     

  • @Khaled, if you can help me to fix the issue with the plugin so that it will work on my Elgg installation, I will gladly donate 20 EUR. I know it's noch that much, but that's what I can offer.

    Please write to
    emergenz //at// gmail //dot// com

     

  • @Alex.. that's a nice gesture from you ;-) quite not so often people here do that ;-O -- Regards.

  • @Alex... A free cup of coffee ;) will email you to get the details

  • @KA--> Now that's a good developer LOLZ ;-P``  I think I'll send you my long list of nice-to-have features for PlugIns ;-) All the coffee (the finest Arabica beans) that you want heh heh.. BTW I am "jealous" that you coded this plugin ;-O My earlier custom solution let the user create their own external homepage with one small trick - they defined a special tag (::LOGIN::) within their htnl, which then gets read in by the real index.php for the external site, picks out the ::LOGIN:: abd replaces that by all the Elgg stuff, adding the external site's styling on the fly. What you've done makes it easier for the average user to implement external logins. ps: have you looked at using sessions vars to "expose the logged-in user details ? I wonder if that could make it work ? (haven't actually tries to test this myself b/c 16 hours per day x 7 days = code, code, code...)

  • Thank you very much for this plugin, that is exacely what I was looking for!

  • @Khaled

    Sorry for late reply. I'm bz with clients' web. Now I have times to test it out with my partner's web base game. Will keep in touch with you once tested.

  • Hi !

    Thanks for your plugin, it is very usefull.
    But I have still a problem :
    When I create users after installed remote plugin, and when I connect these users I'm not able to disconnect them.
    I'm working on 1.6.1 version.

    Do you have any idea ?

    Regards,

    Benoit

  • Hello

    I found a solution. You had registered the action "logout.php" with the parameter admin_only to 'true' so only the admin could logout. I set this parameter to 'false' and that work, for the moment ^^

    Have a nice day

    Benoit

  • @Benoit

    Thanks for posting a solution :)

Stats

  • Category: Authentication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 1541
  • Recommendations: 7

Other Projects

View Khaled Afiouni's plugins