-
Posts
289 -
Joined
-
Last visited
-
Days Won
8
Posts posted by marcus
-
-
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. -
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.
- 2
-
Here's a recipe to do that (haven't tested it thoroughly, but should work here): https://processwire-recipes.com/recipes/activate-all-languages/
-
Yay: Glad to hear people using this!
- 1
-
To kind of return back to topic, here's a little write-up on ProcessWire and ProcessWire Recipes: http://bigger-on-the-inside.net/articles/processwire-recipes (again shameless plug™)
- 11
-
@n0sleeves have to look into the tunneling thing, sounds great.
My recommendation: http://usefinch.com. Using it primarily for checking local virtual hosts on devices and inside Parallel VMs (with own hostname and no subfolders) but should be suitable for n0sleeves' use case as well.
- 3
-
@marcus sure, please do
- 2
-
Amazing approach. Can I add this as a recipe?
- 8
-
One really great if found today to collect:
Soma - Using Imagetags like a Boss....
https://gist.github.com/somatonic/5808897
saved the evening for me - searching this forum is better than to talk with 100 experts while every second forumentry is a hidden treasure sometimes!!
Best regards have a nice weekend - mr-fan
Thanks! Nice find. Has now found its way to PWR.
- 2
-
Than it would be nice to at least include a link to the rss feed on the actual site. That's where I looked for it.
Implemented!
- 1
-
See two posts above, such a feed already exists https://processwire-recipes.com/feed
edit: Regarding sidebar implementation: We'd by honored, but of course this is Ryan's decision to make.
- 1
-
Thanks for your contribution, mr fan, we'll include in after we finished small adjustments in the recipes structure.
In other news, you can now subscribe to new recipes via RSS or Twitter.
- 2
-
So, let's launch this finally!
› https://processwire-recipes.com/ ‹
As you can see, it's a work in progress. The design is going to change, Nico at the helm, and once we got a "critical mass" of recipes, another way of structuring recipes (the "table of contents") will also go online.
To contribute, you can post your recipes either in this thread and we'll pick it up, or - codey - via Pull Request on GitHub of this repo here. Frankly, that's the favoured way, simple and a good start dive in to GitHub and this form of Open Source contribution.
As always, feedback (and of course, contribution) is really welcome. We're always eager to learn - and helping to learn new stuff and create a place to spread some PW knowledge, that's what PWR was about in the first place
Big big thanks to my partner in crime owzim who, among other things, contributed the - imho - heart of this tiny project: a textfile-to-page-importer. Finding an elegant way to contribute was one of the reasons this took so long, and during Beyond Tellerrand conference, it finally clicked into place.
- 20
-
Fixed module versioning after feedback here, tested under 2.5, added small improvements.
- 4
-
Thanks for the heads up regarding module versioning. I learned that the modules not showing up as being updated have one thing in common: Version numbers below 1.0.0 (like for example, my FlagPages module). I just installed FlagPages on a PW 2.5.10 system, and though its version is set as 022 (0.2.2) ProcessWire somehow understands it as 0.1.8 and offers an update to 0.2.2. I'll test FP's ability to run under 2.5+ (it totally should), and will then bump both version number and compatible PW version.
- 1
-
We plan to launch in a few days. If you'd like to help us having a proper starter set of recipes, please contribute via adding to this GitHub repo:
https://github.com/processwire-recipes/ProcessWireRecipes (the recipe files themselves can be found at /site/recipe-txt-files)Recipe files are plain text files written in markdown (here is an example of their intended structure). Owzim's awesome RecipeInstaller module makes it possible to easily convert them into ProcessWire pages.
edit: recipe txt files will be outsourced in a separate repo to simplify things, here is said repo: https://github.com/processwire-recipes/Recipes
- 2
-
lisandi,
just a piece of advice: continuing in behaving like you do at the moment, always and kind of aggressively advising the same service, and to talk smack to moderators won't make you any friends here.
- 3
-
Do I have to attend the Conference to be allowed to go to the Warm Up? Otherwise I would go there, too
It's independent. https://twitter.com/btconf/status/524853122834120704
- 1
-
Let's bump this thread since Beyond Tellerrand Berlin is less than one week away - any PW Forum members attending? If so, wanna meet Monday night at the warm up?
- 2
-
No necessity for a module in this case. Use field type "Page" instead.
In your tree in the ProcessWire admin, add a (hidden, if you want) page called, for example "Currencies". Afterwards add children to them: e.g. USD, EUR, GBP.
Next step: create a field of type "Page" (this will reference pages), limit it to a single value ("Details" tab in the fields properties). On tab "Input", set the "Parent of selectable pages" to the aforementioned, newly created "Currencies" site.
Now you got the functionality you're aiming for. This "page field" can now be assigned to another template.
Advantage of this approach: When you need to add options (a new currency) to your set of currencies, you can just add a page and all the "page field selects" implemented elsewhere will notice that there's a new option.
If this description is too quick and shallow, just give a notice.
This whole approach is one of ProcessWire's strength and I'd be happy to explain it in more detail
- 2
-
Installed Yosemite minutes ago, but updated to MAMP PRO 3.0.7.1 before that. Everything is runs smoothly as before. Haven't studied their versions change logs in detail, but it appears that they have possibly fixed this issue as Peter Knight pointed out.
-
Amazing fun fact! I didn't knew that.
But back to topic: I must confess, a pirate naming scheme for ProcessWire appears *even more* stringent
-
- Goldfinger
Let's wait until PW 3.007 for this.
- 2
-
Resurrecting a brilliant topic.
Working on it. Want it online asap, but can't assign enough time to it at the moment. But hoping for the coming weekend to make a huge step forward.
- 1
User as a child of a user
in General Support
Posted
What about using user roles for this scenario instead?