Jump to content

dfunk006

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by dfunk006

  1. I have created a page which uses the Hybridauth API to authenticate through a provider. The part that generates the error is the following: $adapter = $hybridauth->authenticate( $provider_name ); I have no prior experience in developing modules for PW. I was hoping someone in this forum could help me develop that. This should not be an issue.
  2. I have included it in the first line. Everything works fine independently, but when I include PW and try to access the page, I get the following error: You cannot access this page directly So, I'm pretty sure that the error is caused because PHP's SESSION have been renamed. When the session name is default (PHPSESSID), hybridauth works fine. But when PW is included, the session name changes to 'wire' which throws the above error. I have not used $session. I think most of the session storage happens in Storage.php file of hybridauth. Maybe, rather than bootstrapping, if I put the hybridauth library in the templates folder and change all reference of $_SESSION in Storage.php to $session, do you think it might work? Yes. I'm getting the following error: PHP session.name diff from default PHPSESSID. http://php.net/manual/en/session.configuration.php#ini.session.name. I hope that helps! Let me know if you require any other details. Thanks a lot for your help!
  3. I have tried bootstrapping processwire within the script and it does not work. There seems to be some conflict between the Hybridauth session and PW session. Without bootstrapping, the script works absolutely fine. Has anyone encountered a session conflict before between $_SESSION and $session?
  4. Yup, I did, and associated it with the template that had the code you had written earlier. There you go! We're on the same page now. Which problem did you encounter though? The 403 Forbidden one or the "You cannot access this page directly". The latter is an error that is coming from the Endpoint.php file in Hybridauth i believe. Also, i think the problem is with hybridauth's session within processwire. Independently it works fine. Have you managed to find any solution to this yet? I've thought of a workaround solution. Will try and implement it and let you know if I was successful.
  5. Check the following lines in processwire's .htaccess file: # Block access to any PHP files in /site/modules/ RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ [OR] Processwire blocks access to site modules and templates for security reasons. More information can be found here: http://processwire.com/talk/topic/1794-how-to-change-permissions-inside-processwire/ I'm using processwire 2.4 on a web server. I uploaded the module folder (ProcessHybridAuth) in the /sites/modules/ folder and then installed it via the processwire admin. I put the endpoint as the URL to the hybridauth folder that contains the hybridauth config.php file (http://hostname/site/modules/ProcessHybridAuth/hybridauth/), enabled Facebook, entered the Facebook app id and secret and put the code you wrote down earlier in a template called login. When i tried to access this login page, i get a 403 Forbidden error. So, i move the hybridauth library from the modules folder to the site folder and change the endpoint URL accordingly. Accessing the login page then gives me the following error: You cannot access this page directly. I found these hybridauth FAQs which indicate that this error could be most likely a session issue. (Link - http://hybridauth.sourceforge.net/wsl/faq.html) Any help would be much appreciated
  6. That's strange. The processwire .htaccess file doesn't allow you to run php files placed within templates or modules via an HTTP request. It throws a 403 Forbidden error if you try. Few questions: - Are you running this on localhost or on a web server? - Which version of processwire are you running? - What is your endpoint? Thanks a lot for your help!
  7. @Harmster: Great Stuff! I downloaded and installed the module and i'm getting the following error: "You cannot access this page directly" In fact, I tried integrating Hybridauth with my processwire site earlier (without making it a module) and I got a 403 Forbidden error. I realised that as per processwire's security settings, you cannot run external php scripts from within the templates folder. So, I created a login.php template and moved the Hybridauth library to the site folder. But when I tried to access the login.php template, i got the same error: "You cannot access this page directly" So, I decided to move the entire authentication externally - I placed all the files (Hybridauth library and login.php file) in the site directory and when i tried to access the login.php, it worked! I wanted to access the $user variable externally, so I bootstrapped processwire to access its APIs. As soon as I included the processwire index.php file, i got the same error again: "You cannot access this page directly" Not sure what's exactly happening there but seems to me that there is some conflict between processwire session and hybridauth session. Have you encountered this issue?
  8. @Harmster: Yes, Hybridauth should handle most it. The processwire module should add social login / register functionality to a website or application (login using multiple providers such as Facebook, Google, Twitter and more). The module should have a configuration screen in the admin which allows admins to select the providers and enter their App ID and App Secret from the respective social network. apeisa has created a similar module only for Facebook login (Link - http://modules.processwire.com/modules/facebook-login/) I would like to develop a module that allows multiple social networks. @felix: glad you found the link helpful! Hopefully this module will be helpful to a lot of others as well!
  9. Hello, Would anyone be interested in creating a social sign in module using Hybridauth? Hybridauth (Link - http://hybridauth.sourceforge.net/) supports social sign in from Google, Facebook, Twitter and many more. Hybridauth plugins are available for Wordpress, Drupal, Joomla, Modx and many more. (Link - http://hybridauth.sourceforge.net/plugins.html) Let me know if anyone would be interested in developing this for Processwire. Thanks
  10. I'd suggest cron job that periodically updates the source JSON. ProcessWire even provides nifty "lazy cron" module you could use, but for tasks like this I prefer proper cron job -- that way there's not even that (rare) slowdown for end-users and you don't have to worry at all about that process getting interrupted halfway. Thanks for the suggestion @teppo - i'll definitely try that out! However, instead of a cron job, I was thinking of updating the source JSON every time a page is updated (created/modified/deleted) using hooks. That should pretty much give me the same results, right?
  11. @teppo, you're absolutely right - in most cases there won't be any need for it. However, if I want to create an auto-complete search engine in which a user can search for any page on the site by its title, I would have to pass a JSON array of all the pages as its source, for which i'll need to get all pages in the site along with their titles. This might slow things down - unless there is a better way of doing this. Also, I wasn't able to find the "autoload" setting. Do you mean "autojoin" by any chance? One more thing, apart from adding more muscle to the server, adding sensible limits and using pagination, are there any other optimizations that can be achieved when using $page->find("selector")?
  12. Thank you for all your inputs. Your help is much appreciated! So from what I understand, searching is not an issue, but if there are lots of results then it might cause a slow down since there will be lots of pages in the memory. In a scenario like this, increasing memory on the server should ideally fix this right? @Martijn Geerts, in Modx there is an option to turn off the loading of fields by setting ProcessTVs as 0 in the getResources call. This makes it a bit faster, but overall it's still slow! @kongondo, thanks for the tip, and for the awesome tutorial!
  13. Hi, I've recently moved from Modx Revolution to Processwire and so far my experience with the platform has been great! The jqueryUI admin is much faster as compared to Modx's extJS manager. kongondo's article for those transitioning from Modx has been very helpful. Link - http://processwire.com/talk/topic/3691-tutorial-a-quick-guide-to-processwire-for-those-transitioning-from-modx/ One of the things that really bugged me about Modx was the slowness of getResources. Even after optimising and caching the getResources call, it would still produce slow response times if the number of resources were high. Now, I understand that the equivalent of getResources in Processwire is $pages->find("selector"). My question is: Has anyone had any experience with running $pages->find("selector") api call on over 10,000 pages? What are the response times like? Thanks
×
×
  • Create New...