-
Posts
2,236 -
Joined
-
Last visited
-
Days Won
47
Everything posted by netcarver
-
Hi @adrian, Very useful module (as always.) Question though, is there any reason to use Inputfield::collapsedYes rather than collapsedHidden for the _pw_page_name field when removing the settings tab? (Reference line 114 of module code.) I'd have thought it would be more natural to hide all the fields from the settings tab if the module were setup to hide the Settings tab, not just move the _pw_page_name field into the start of the content tab.
-
@guenter55 I've no idea, about rewriting to remove this, I'm not familiar with the code. However, if on a linux system (or mac) it's probably much easier to upgrade the installed version of PHP than it is to rewrite the code to remove its use of that class. You are also well behind the curve in terms of supported (and potentially more secure) versions of PHP. Edited to add: Or wait until @adrian finds a shim ? @thuijzer sounds like you need to add a 'requires' =>'php>=5.5.0' line to your module config.
-
You need to upgrade your PHP installation - that class was only added in version 5.5.0 (ref: PHP page for the class)
-
@cb2004 I did this many years ago for a Textpattern site when I wanted to migrate the passwords from old style hashes to newer ones. I haven't got anything for PW, sorry. The methodology is pretty much what I laid out in the post above yours. Maybe others could advise you about the best hooks to use, but I'd guess at doing a before hook on session::authenticate(). Something like this in site/ready.php would be a start (totally untested)... wire('session')->addHookBefore('authenticate', function($event) { $user = $event->arguments(0); $pass = $event->arguments(1); $imported_md5_password_hash = trim($user->md5_field); // Is there a value for the imported md5 field? if ('' !== $imported_md5_password_hash) { // Yes! then create the md5 of what the user just typed in. // NB: You need to change this code so that the value generated here follows the algorithm for the generation of // the password set you imported. $md5 = md5($pass); // and see if it matches the stored value for this user if ($md5 === $imported_md5_password_hash) { // it does, so create and store the PW version of the $pass the user just typed in... $user->of(false); $user->pass = $pass; // @see https://github.com/processwire/processwire/blob/master/wire/core/User.php#L23 $user->md5_field = ''; // Clear the md5 field so this path is bypassed on next login. $user->save(); } } }); If the match on the MD5 hash works, it stores the PW-hashed version of the user's password and saves. As this is a before hook, and the password compare and replace happens here, I think that's all that should be needed. Of course, you still need to import those hashes into the "md5_field" above (rename as needed.) Adding an md5_field to the user template allows you to easily locate which users have updated and which haven't using normal PW selectors. YMMV - but I hope that starts you off in the right direction.
-
@cb2004 You could import the md5 hashed passwords into a different field in the User template, then use a custom login hook that checks if the md5 hash field is not empty. If it is not empty, then it hashes what they typed in and compares it to the md5 hash. If they are equal, then use PWs hashing algorithm to store the password in the regular field and delete the md5 hash. Back up your DB and make sure you test this on some example accounts first ,as you'll need to exactly recreate the way the original hashes were calculated - including the use of a salt or other hardening method like hash iteration. Ah, Soma got in ahead of me.
-
Images from nested repeaters don't load with pagefileSecure turned on
netcarver replied to Pablos's topic in General Support
@Pablos I've added to your issue as even avatar images under the Reno theme fail to display when pagefileSecure is true. -
ProcessWire ApiGen (dynamic + up to date + all branches)
netcarver replied to kongondo's topic in API & Templates
Hah, I stand corrected. Missed clicking on that one. Thanks Adrian. -
ProcessWire ApiGen (dynamic + up to date + all branches)
netcarver replied to kongondo's topic in API & Templates
Hi @kongondo I've just tried revisiting your nifty project pages and can see the document here. However, if I click on any of the links, they go to a 404 page. -
@adrian Great - thank you!
-
@Macrura Thanks for this useful module - I've recently started using it. Any updates on using this in the new UIKit admin theme?
-
Sublime PW - a Styleshout template based site profile
netcarver replied to wbmnfktr's topic in Themes and Profiles
Very nice - thank you! Small pull request submitted regarding the readme file. -
That would be very nice, hope you can get the machine working soon.
-
@thetuningspoon I think you are on target here. There's a lot to be said for the InnoDB engine, and the row level locking vs table level should reduce contention and decrease latency with it. Redis, despite being single threaded, is writing to an in-memory key value store - so it's blindingly fast. I would be interested in seeing your updated code for the Redis session handler - if that's what you mean, as I need to update that module.
-
@Thomas108 Like Teppo said, you need to add this formatter to the field you want it applied against. If you've already done that and configured the module settings to add the classes you want then it should be working. However: are you trying to combine Lazyload with CKEditor embedded images? If so, you are right, the current version of this Textformatter doesn't support LazyLoading - but I do have a version that does.
-
@adrian Thanks for the feedback - I like the idea. It needs a take account of the chosen time format (that's just one of the ones on offer), but this should be possible. Will see what I can do.
-
Hi @cosmicsafari Just look in the cache directory for a file called LazyCronLock.cache. If it is there for more than half a minute (or however long you estimate your code should run for) then delete it to unjam LazyCron. If this keeps happening, then there could be something in your hook method that is timing out and leaving the lock file there. Here's some code to return the location of the file if you want to do it programmatically... function getLazyCronLockfileName() { return wire('config')->paths->cache . "LazyCronLock.cache"; }
-
LazyCron is driven by user visits. Are you sure the site is being visited regularly? If you need to guarantee a run, you need to setup a cron job to visit a page on your site, or simply use cron itself to drive your tasks. Another possibility is that the cron script is timing out behind the scenes and leaving the LC script jammed.
-
Oops, I stand corrected.
-
@owzim Great to hear from you in the forums again. I think Bernhard already opened a PR for you.
-
What does your initial research/googling suggest? What do you want to achieve?
-
Hi @adrian Thanks for the idea - I'll give it a try locally and see how it goes.
- 38 replies
-
- hosting integration
- preview
-
(and 2 more)
Tagged with:
-
Update page list based on JSON endpoint response
netcarver replied to a-ok's topic in General Support
The easy way to do this is to compare the current JSON reply to the previous one. If an entry exists in the previous JSON reply that doesn't exist in the current JSON then you know that you need to delete the corresponding entry in PW. Storage is easy - just write the JSON to disk. Compare is easy - convert the two JSON feeds to arrays and just do an array diff. Delete is easy, as long as there is a unique field in the JSON that maps through to a unique field value in PW. Once you've processed the current deletions, just store the JSON ready for the next cycle. -
@joshuag Early on in the thread you mentioned a work-in-progress fix for the 2800 event limit, and also about a more elegant update feature when adding exclusions. Any update on this? I've scanned the posts in the rest of the thread but might have missed it. Have these issues been addressed in the current version?
-
Hi Simon, Please make sure that the field is not set up to do HTML Entity Encoding. To do this, edit the field for which you setup the CKEditor and go to the "Details" Tab and then remove the HTML Entity Encoder from the list of Text Formatters to be applied to that field. Just hit the little trashcan/dustbin icon at the right. This will be applied when you save the field. You should also make sure that the content type further down the page is setup for Markup/HTML. Hope that helps!