Jump to content

marcus

Members
  • Posts

    289
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by marcus

  1. Haven't found the time to install it and fiddle with it yet - but this looks exactly like the module I was describing in the original post, including solution via sub tree with references. Thanks!
  2. RT @Queen_Europe: Apart from being a beautiful accessory that constantly needs recharging, Greece is nothing like the Apple Watch.

  3. RT @mollywood: I must say, the cognitive disconnect between poverty scenes and an expensive and profoundly unnecessary tech device is ... n…

  4. They appear to have reconsidered
  5. Yay! My @getkirby shirt just arrived (via certified mail!). And no, thank YOU, dear @bastianallgeier ! http://t.co/we6YShjRkY

  6. RT @ryandoherty: "Witnesses later claimed to have seen 3 TIE Fighters in the area." CNN: #HarrisonFord 'battered, but ok' http://t.co/8S7m…

  7. So @SPIEGELONLINE is heavily featuring my hometown Fulda as an "investment opportunity". Worrying about my parent's rent. /cc: @_martinwolf

  8. RT @thomasfuchs: Two CSS properties walk into a bar.A barstool in a completely different bar falls over.

  9. „Builde Dir bloß nichts ein!“ #de #webdev

  10. RT @danielpunkass: "Shit son. Tim Cook on his best day could not conceive of a dastardly plan like this." Google's land-grab for TLDs. http…

  11. ProcessWireres, check out this week's @processwire Weekly http://t.co/bp3KMfPcHX, featuring a module gem from @owzim: http://t.co/4ndjBuYoOt

  12. #de Der Postillon: Archäologen entdecken historische Ruine ungeahnten Ausmaßes im Süden Berlins http://t.co/qM1QAgOdHj

  13. RT @no_fear_inc: New post: On WordPress Talent Shortage http://t.co/uZ4pHEPf1g

  14. I see, this one needs a whole lot of cooking before it gets into the recipe book
  15. The more I learn about TDD/BDD the more I want to use it in PHP based CMSs. So - waiting for @drupal 8, @processwire 3, and WordPress 72.4.

  16. RT @zenoc: Apple building a car… and a watch… Ah ha! NOW it all makes sense!! http://t.co/zrykV5xYyg

  17. Migrating a hobby horse @laravelphp 4.2 application to 5.0 and it's actually way more fun than expected. Lots of simplifications in L5!

  18. RT @tomzalt: The book Javascript Ninja has a Samurai on the cover. That happens because JS is not strongly typed.

  19. Big thanks to @jameschambers for his useful Frontend.md tool: http://t.co/ply8seammy /via @WDRLinfo

  20. Nice one! For larger installations and/or a larger set of roles this will really be a boost. As for naming, I'd root for "Permissions Overview"
  21. What about using user roles for this scenario instead?
  22. Here's a link to said site profiles. Though not intending to showcase best practices or certain approaches, you can find http://processwire-recipes.com's code (almost completely) here on GitHub. As LostKobrakai said, many template approaches are possible, one of them is to use Twig, and this installation does.
  23. I see this approach is also loosely based on my GitHub Login "fork" of apeisas FB module Can you debug what is returned from... $ghUserData = json_decode(file_get_contents($access_url, false, $context)); ...and if $ghUserData contains the Google Mail address in the first place? That was the approach, to get a value (above its the GitHub Id) from the JSON and persist it on a certain user as a field value. Theoretically this should work as well with the email, which would then become $u->email. Also, this... // Add stream context $options = array('http' => array('user_agent'=> $_SERVER['HTTP_USER_AGENT'])); $context = stream_context_create($options); ...was somehow necessary for GH, but not in apeisas original module. It's quite interesting how often apeisas module appeared here lately. Screams for a generic OAuth2 module, doesn't it? // edit: It seems that the "grabs first user, changes their password, logs them in" phenomenon has its cause here: public function processLogin($ghUserData) { $id = $ghUserData->id; // (1) $u = $this->users->get("google_id=$id"); // (2) // First we create random pass to use in login $uniqid = uniqid(); $pass = sha1($uniqid . $id . $ghUserData->updated_at); // User has logged in earlier with Google id, great news let's login if ($u->id) { // (3) $u->of(false); $u->pass = $pass; // (4) $u->addRole(self::name); $u->save(); } Assumptions: (1) is empty/null (2) possibly translates as ->get() = ->first(), so returns first user (3) this is true, but the wrong user id (4) overwrite first users password // edit2: Your thread got me tweaking my GitHub Login module a little bit. I learned that I can only retrieve the (GitHub) user's email if its set to 'public'. Maybe thats similar in Google's API - either you aren't able to get the email at all, or it has to explicitly set as public. However, I think you have to solve said "phnomenon" first.
×
×
  • Create New...