Leaderboard
Popular Content
Showing content with the highest reputation on 07/02/2018 in all areas
-
@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.4 points
-
Hello, I still did not solve my problem about Hebrew letters. In fact, it is ok for Russian for example to have a transliteration of characters (one to one) but in languages like Hebrew, Arabic, it is better to slugify with phonetic like here : use EasySlugger\Utf8Slugger; $slug = Utf8Slugger::slugify('日本語'); // slug = ri-ben-yu $slug = Utf8Slugger::slugify('العَرَبِيةُ'); // slug = alrbyt $slug = Utf8Slugger::slugify('עברית'); // slug = bryt So I am planning to insert https://github.com/javiereguiluz/EasySlugger Should I create a module or just add a hook ? I am a PW newbie. Thanks for your help3 points
-
If you install PW in a subfolder there you have the PW htaccess so you should be able to access /thesubfolder/processwire/ just fine. If typo3 has rules to folders that exists, it would be wrong. I don't see anything in the typo3 htaccess that does that. Edit: Oh my 6666's post ?3 points
-
You could import the md5 passwords as they are and then md5 hash the entered password on the login.3 points
-
Ok, thanks for your opinions. I'll leave AOS as it is, and when things start going out of control it will support only one admin theme.3 points
-
I could be wrong but.. you are trying to modify a protected property directly and that the reason. As you know, you can't modify directly a protected property outside his class. and you have to use a setter to modify this variable. Try #2 : Generally speaking, the properties on an object will be set to protected and so attempting to access a property in this way will cause an error. So what actually happen here. The property $page->prop doesn't really exist and a magic __set() is written, and also a magic __get() function is written which will return a value when you read from this property. PHP will automatically call it for you when you try to access a property that is not one of the object’s public properties. If you try to set a property that is not accessible, the __set() magic method will be triggered. Its important to stipulate here that the return of this __get() magic function is a VALUE and not a reference (&__get()). If it was a reference that have been be returned by the function, you could modify the returned property. Assigning a variable directly to it can work if there is a corresponding magic __set(), but here you cannot modify it, since its actually a function which return value (and not a reference!) : the key is here So, basically, we can say that you are trying to do the following : $page->__get('prop')[] = ['d'], which doesn't mean anything, and PHP will trigger a notice of type : Indirect modification of overloaded property3 points
-
@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.2 points
-
I think it's probably too rare of a need to add to BatchChildEditor, but happy to have it in AdminActions. Just committed it to the latest version.2 points
-
Yeah, I guess you must be right. Maybe the ozadje_strani image field is set to return a single image which is why it can't be foreach'd? Actually, I guess it's a repeater field and bgimage is the image field - I don't know ?2 points
-
@adrian I guess if it's working, he must have a page called Home? Maybe he has a splash screen before hand. Strange one.2 points
-
On such a large site I reckon it would be worth investing in some professional advice. https://processwire.com/api/modules/profiler-pro/ Besides the tool itself there is the valuable benefit of VIP support from Ryan:2 points
-
I think several AOS features need to be in the core ? Seriously though, if we could get the most used features in the core, then perhaps the lesser used ones could remain in a trimmed down AOS. I think I'd rather see a module that works on top of a core theme, rather than you creating a separate theme that misses out on new features that Ryan adds until you have a chance to add them to your version of the theme. Does that make sense? I don't think you should being trying to maintain support for multiple themes though - I think going forward PW needs one solid flexible theme which can be restyled via CSS and functionality tweaked by hooks and js overrides. I think having multiple themes with different codebases just makes things difficult for Ryan because he often has to add new functionality to multiple themes - this is why I always stick with his default, which in my mind is UiKit these days. Anyway, I am a little OT now, but hopefully my ramblings make sense.2 points
-
1.9.5 is uploaded. I've disabled the FileCompiler because on Win localhost it was very slow, so if you have issues try to refresh the module cache. Changelog: - fix inline pagelist items if "Always show pagelist actions" was checked (reported by ottogal) - Delete and Trash action (non-superusers): skip confirmation if ctrl key is pressed - new Skip Trash? checkbox on page edit Delete tab (SuperUsers only, requested by Robin S) - fix NavItems causing JS error on "Find Files to Translate" page Search box - hotkey save: do not add blocking overlay until html5 required attribute requirements are not resolved (reported by Robin S, #95) - asmSelect searchbox: allow wider dropdown - AdminThemeUikit, percentage-based widths ON: move AsmSelect placeholder and maxlimit fields after Required field to avoid layout issues - add namespace and FileCompiler=0 to bypass PW's FileCompiler (slow compile on Win localhost, may need modules refresh)2 points
-
You are Great adrian!! No more error in admin, I´ll try it in template tomorrow - it´s time to catch some hours sleep ? Greetings from Austria!1 point
-
@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.1 point
-
This might do the trick: https://gist.github.com/Grummfy/6d4f07a86121a1477cdc1 point
-
Awesome. Thank you! I simply used now a few lines to do the same with Tracy. I guess we're getting spoiled with all the lovely tools and options here in PW land ?1 point
-
thanks for answers, I got it. It was a repeater, and had no image in it. I somehow made two of the same repeater field and somehow lost one which had no image in it. I deleted the field and it's fine now. Thank you all R1 point
-
You should always make sure you actually do have an image (except when it's a required field). Do an if() first, maybe the fields are empty?1 point
-
1 point
-
I don't really understand why it's working at all - '/home/' is not the path for the home page, it's '/' - try that and things should work without the error.1 point
-
Just to make things clear in case they aren't, you are getting the selected item - you're actually getting the full $page object for the item. The __toString() method is resulting in the ID of that being being output when you try to echo it as a string. You have to specify what field you want from the page, ->title, ->body, etc.1 point
-
No there's no way around this really, but my solution is the combination of these two modules: https://modules.processwire.com/modules/email-new-user/ With this, when a new user is created they are automatically assigned a password and this is sent to them via email. https://modules.processwire.com/modules/password-force-change/ This ensures that the next time they login they have to change their password. I think this combination is the easiest way to migrate large numbers of users to PW.1 point
-
Looks fine to me. I wouldn't worry about it if it's working. If you wanted to take the $pages->get('/home/')->ozadje_strani and put it in a variable that might fix it, but I'm not sure because it looks fine.1 point
-
@tooth-paste Just a little tip: If you wrap your HTML and PHP in double quotes and use this syntax: {$item->mp3->url} you don't need to concatenate your string with 'foo ' . $var . ' bar' etc.1 point
-
1 point
-
Maybe you are logged into admin in Safari and not the other browsers? In which case the issue probably relates to something that is accessible to a logged in user (or superuser) but not to guest.1 point
-
Yep - PHP 7 is much faster than previous versions. Some numbers: http://www.zend.com/en/resources/php7_infographic1 point
-
Use Opcache to cache raw PHP Update your PHP version Use ListerPro to customize your listings, so you will use fewer server resources to list pages for every user.1 point
-
I agree with Adrian - in the future you might get too busy or just want to take a break from developing AOS and then users wouldn't be able to get new features or bug fixes that Ryan applies to the core admin theme. I also think it might turn out to be quite a hassle for you to apply core admin theme changes to your custom theme, because once the methods have been modified you won't be able to see changes easily via a simple diff. You'd have to monitor the core diffs instead and then manually hunt through your custom methods to find the equivalent locations. But once AdminThemeUikit has been the default admin theme for some period of time then I think it would be quite reasonable to say that AOS requires AdminThemeUikit and doesn't support the older themes.1 point
-
Finally I was able to release RockGrid I decided to release it as MIT, so everybody can contribute and maybe use it for other great additions to ProcessWire. I think it's a great way of listing data and I can think of several situations where it would make the admin UI a lot better than it is now with our existing tools. For example @adrian s batch child editor could maybe benefit from such a tool? I don't know. Let's see what happens... The module is still alpha and not perfect... But it was also a lot of work and can't provide anything better than that at the moment. If anybody here can do it better: Please feel free to take over ? Thanks everybody for all the feedback here in this thread! Special thanks to @MrSnoozles for showing me agGrid and making me replace datatables ?1 point
-
ProcessWire 2.4.0 is a pretty old version at this point, so if this is a site you are still involved with development on, it'd be worthwhile to update it, regardless of FormBuilder. You'd want to upgrade it to 2.7.3, and that would be a fine version to keep it with, if you'd like. For some of the older 2.x sites that I rarely work on, I keep them running on 2.7.3. You could also update it to the 3.x version, but that would be a more major update, and you might not necessarily need it for an older site. But you'd want to update to 2.7.3 first, either way. The upgrade instructions for going from 2.4 to 2.7 are here. As always, it's a good idea to test a major update in a development environment before applying to the production site... especially in this case where you'll be jumping 3 major versions (2.4 to 2.7). However, chances are, it'll be a smooth upgrade. Another possibility—I'm not positive that the current version of FormBuilder won't work with 2.4. Just that 2.7.3 is currently the minimum version that I'm testing with. You could always try it and see. But I kind of think upgrading to 2.7.3 is a good idea regardless of what you need to do with FormBuilder.1 point
-
I chucked up a tutorial here: https://www.pwtuts.com/processwire-tutorials/making-a-custom-admin-theme-using-uikit-3-and-the-included-build-tools/ Hoping this method will become redundant though if I can get my head round building a module to change the colours etc. Something to work on in January (without distracting me from my JS which I should be doing...).1 point
-
Hi @MarcoPLY, Please confirm you are talking about the commercial Media Manager module and not another module. Media Manager does not randomly delete images ?. I seem to recall you were using other modules for your media needs?0 points