-
Posts
2,190 -
Joined
-
Last visited
-
Days Won
45
netcarver last won the day on May 6
netcarver had the most liked content!
Profile Information
-
Gender
Male
-
Location
UK
netcarver's Achievements
-
Hi @bernhard I just tried adding the following tweak to the tweaks/ directory, and am getting an error from RockMigrations when the admin reloads. If I remove my attempted tweak, everything works again. I think this is in RM, rather than the tweak file. Thanks for the module, BTW. PageListShowExtras.php
-
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
netcarver replied to ryan's topic in Modules/Plugins
@d'Hinnisdaël Thank you. As an example with trailing hexadecimal video_id: https://vimeo.com/553329597/04c306a466 I've closed my PR for the time being. -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
netcarver replied to ryan's topic in Modules/Plugins
Hmm. Anyone know of a canonical list of valid Vimeo url formats? -
netcarver started following $config->sessionExpireSeconds does not work , RockShell - a ProcessWire Commandline Companion ⌨️ , Forum Post Minimal URLs and 4 others
-
RockShell - a ProcessWire Commandline Companion ⌨️
netcarver replied to bernhard's topic in Modules/Plugins
Thanks for the updates, Bernhard. Seems like I somewhat monopolised things this month :) -
Nice - I'll be able to make use of that at PWGeeks next time I update it. Thank you for the tip.
-
I guess I'm just becomming really lazy as I age, and this tutorial can be taken as a sign of my growing sloth. I have a Yubikey that I use as my 2nd factor on a localy hosted PW site. And I've become tired of typing my admin username + password and hitting enter/clicking Submit + then having to tap the Yubikey to log in. I know, it's a local install, and I could just turn off my 2FA, but then I'd still have to type the username and password, and I'm too lazy even for that now (plus, I've started to hate passwords.) I'd really rather just tap the yubikey to be logged in! As PW's so hookable, I figured it would be pretty easy to modify the login process to allow me to do this, just for this site (well, maybe not just this one). Sure enough, it turned out to be pretty simple - though I do not recommend trying this on any sites hosted in the cloud. Firstly, you'll need the TfaWebAuthn module installed on the site, and have configured it on your superuser account. Once you are logging in successfully with that, add the following to site/templates/admin.php... /** * If there is only 1 superuser with TfaWebAuthn set up on the site, * and if the username is empty on login submission, we change the login_name * to the superuser's account name, and the login_pass to a dummy value to * allow the Session::authenticate hook to be called. * * Although the Session::authenticate method will fail we will hookAfter it * and pretend that it didn't. That will start 2FA credential collection * allowing us to proceed with just that protecting the account. * * For local installs where I have a YubiKey, this will be good enough. */ wire()->addHookAfter("ProcessLogin::loginFormProcessReady", function($event) { $uname = wire()->input->post->login_name ?? ''; if ('' === $uname) { $super_role_id = wire()->config->superUserRolePageID; $supers = wire()->users->find("roles=$super_role_id, tfa_type=TfaWebAuthn"); $num = count($supers); if (1 === $num) { $super = $supers->eq(0); wire()->input->post->login_name = $super->name; wire()->input->post->login_pass = 'dummy_password'; } } }); wire()->addHookAfter("Session::authenticate", function($event) { $super_role_id = wire()->config->superUserRolePageID; $supers = wire()->users->find("roles=$super_role_id, tfa_type=TfaWebAuthn"); $num = count($supers); if (1 === $num) { $user = $event->arguments(0); $super = $supers->eq(0); if ($user->id === $super->id && 'TfaWebAuthn' === $user->hasTfa()) { $event->return = true; // Override earlier failed authentication for this user } } }); As long as you leave the initial login details blank, all you need to do now is hit enter (or click Submit) and then tap the Yubikey to be logged in. Nice :)
-
Add general information to specific template pages in admin
netcarver replied to TomPich's topic in General Support
In addition to the great suggestion from @Nicolas, you can also do it by prepending a Markup textfield to the edit form for just that particular template. Here's more code - I'd put this in site/templates/admin.php as this is only an admin feature. $pages->addHookAfter("ProcessPageEdit::buildForm", function($event) { $form = $event->return; $id = (int) wire("input")->get("id"); if (!$id) { return; } $editedPage = wire("pages")->get($id); if ($editedPage->template->name === "home") { // CHANGE TEMPLATE NAME HERE $f = wire()->modules->get('InputfieldMarkup'); $f->label = "Notes"; $f->value = "<p>Your HTML Notes in here.</p>"; $form->prepend($f); } }); -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
netcarver replied to ryan's topic in Modules/Plugins
@Robin S @Mats @Marty Walker @ryan Pull request is in for this fix. -
Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)
netcarver replied to ryan's topic in Modules/Plugins
@Marty Walker @Robin S @Mats Could you try the attached version of the module and see if it helps with your issues with Vimeo URL formats? Robin, Mats (I hope I got the right one), I've included you both as you have a similar issue open on the repo. TextformatterVideoEmbed.module -
$config->sessionExpireSeconds does not work
netcarver replied to helmut2509's topic in General Support
Ok, other things that come to mind are... session.gc_maxlifetime is set to something low. You are using php-fpm and it has a different php.ini file with different settings to the one you looked at before (maybe) -
Yay! Thank you, @FireWire looking forward to trying this out later.
- 5 replies
-
- 1
-
- formbuilder
- ajax
-
(and 2 more)
Tagged with:
-
$config->sessionExpireSeconds does not work
netcarver replied to helmut2509's topic in General Support
@Leftfield Got to run now, but can you check what your session.cookie_lifetime setting is (just in case it's this for you?)