Jump to content

adrian

PW-Moderators
  • Posts

    11,182
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. Hi Yannick, I am sure others will chime in, but I don't see why this is easier than: $page->image->first(); $page->image->last(); $page->image->eq(n); Are you suggesting your approach over these options, or were you simply not aware of them? EDIT: Sorry, I see that you have been around on the forums for more than six months, so I am sure you do know about first, last, eq, and you're even using eq in your method. Sorry about that
  2. Hi everyone, Added some major new functionality to the edit mode today (see revised screenshot for 3. in the first post). Edit mode now includes quick addition, sorting, and deleting of pages as well as full editing via a modal popup editor, similar to the new PageTable interface, making use of MarkupAdminDataTable. If you are using this, definitely worth updating, and if you're not using it, maybe it is now worth taking a look Enable this on your home template and you have a powerful editing alternative with the added ability to automatically overwrite page names based on changed page titles, which I think is very handy during the development phase of a new site. Please let me know if you find any bugs with this new version.
  3. Sorry for the constant updates Definitely recommended to update to the latest version as it adds better handling for users without profile-edit permission. As well as the warning, it now also unchecks the force password change checkbox if the user doesn't have profile-edit permission The Set All Users role selection is now limited to only those roles with profile-edit permission Hopefully that will be all the changes for a while, unless someone has any suggestions.
  4. Hi bryslon and welcome to PW. That is quite a detailed question but I thought I'd hopefully give you a few snippets to get started. Creating front-end forms: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ That is a great thread that should get you going. You can have your form submission create the new page and then limit the viewing of this page to users with specific roles. For the job tasks I would make use of PW's Page Fieldtype which is incredibly powerful: http://processwire.com/videos/page-fieldtype/ I would suggest your jobs parent parent page contain the form for submitting a new job, as well as the ability to search through jobs. This page might have a template: "jobs". The child pages would be created by the form submission, possibly set to unpublished until verified by an admin. The template for these pages might be: "job" I have done something quite similar before - it will be a bit of a learning curve the first time, but the PW API definitely has everything to you need to build this robustly. Not sure if that is much help, but hopefully it will get you started and you can come back to us with more specific questions as you get further into it.
  5. Sorry, yes that setting should also be able to go in an htaccess file. I have gotten in the habit of using the config file sometimes for these sorts of things, so wasn't thinking. I adjusted the post above to reflect that.
  6. Well allow_url_fopen can only be set in the php.ini file (or your apache conf file). Take a look at this list which can come in very handy: http://docs.php.net/manual/en/ini.list.php While there is some risk in having this enabled, I'd say that it is a pretty common requirement to have this available, so I wouldn't worry too much about it. If you're really concerned, it is possible to enable it via your apache conf / htaccess file instead and that way you can limit it to specific directories, eg: <Directory /var/www/wire> php_admin_flag allow_url_fopen on </Directory> You could even limit it to a specific file if you wanted, but I wouldn't get too carried away. I'd be curious to know whether your host also blocks curl and file_get_contents and whether Ryan could implement (if it isn't already in there) an alternative using these. Maybe others will chime in with their opinions too.
  7. The exact required mod (eg 755) permission is not possible to determine without knowing the user/group of the owner of the directory/file and also the apache user. Usually 755 is sufficient for directories in most web server setups, but if you tested with 777 then that should rule out any owner issues. Debug mode usually gives you more verbose error messages right in line where you are running things, but the error log is found under site/assets/logs/errors.txt - let us know if anything shows up there. I don't think this is related to your Pixlr issue as they were saving, just with a new name - correct? I wonder if the module download issue is due to the server not having file_get_contents or allow_url_fopen available? I haven't investigated properly to se how well the modules downloader checks for and reports if these are missing. Have you tried with Soma's Modules Manager to see if it works? Also, what version of PW?
  8. Another bug fix and enhancement just committed. There is now a batch "Set All Users" option which allows you to easily force existing users to change their password. Selection of users is possible via roles so you can limit the enforcement to just specific roles, or all if needed. If you mess up, there is also a simple way to clear the requirement for everyone as well. This addition was in response to teppo's comment in his ProcessWire Weekly post: "easily forcing periodic password changes for users" - now it really is easy to force periodic changes, so thanks for the suggestion The bug fix is for PW sites installed in a subdirectory - thanks also to teppo for reporting this.
  9. Is your modules directory writeable? Try turning on debug mode and see if there is a more informative error message.
  10. What about this: $np = $pages->clone($page); $np->of(false); $np->title = 'New Page'; $np->name = 'newpage'; $np->save();
  11. Great - let me know how it goes for you. Thanks for the inspiration for putting it together!
  12. The selector for counting would look like this: images.count>11
  13. @jeve, Thanks for posting the full code. I can't see anything in there that looks like it might be causing the issues you are having, although you might want to sanitize that $_GET I am curious if it ever works if you are logged out - ie are these pages all visible to guest users? Also don't forget to less us know the PW,PHP, and MySQL versions that you are running.
  14. I think this approach is reasonable: if(wire('user')->roles->has("name=".implode("|",$this->data['allowedRoles']))) { I think a little cleaner than array_intersect in this situation.
  15. I don't think that error is because of wire('roles'). If you take a look at line 730 of that file (https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessModule/ProcessModule.module#L730) it's about foreaching through all the fields in your modules config setup. I have tested that code and it works fine, so I think you are likely missing something else in your config setup. There are different ways to set up the config, but this should work: protected static $configDefaults = array( // global "allowedRoles" => "" ); protected $data = array(); public static function getModuleConfigInputfields(array $data) { foreach(self::$configDefaults as $key => $value) { if(!isset($data[$key]) || $data[$key]=='') $data[$key] = $value; } $wrapper = new InputfieldWrapper; $f = wire('modules')->get("InputfieldAsmSelect"); $f->required = true; $f->attr('name', 'allowedRoles'); $f->label = __('User roles allowed to flag'); $f->setAsmSelectOption('sortable', false); if(isset($data['allowedRoles'])) $f->value = $data['allowedRoles']; // populate with all available roles foreach(wire('roles') as $roleoption) { $f->addOption($roleoption->name); } $wrapper->add($f); return $wrapper; } Or if you are still having problems, feel free to post your entire code so we can take a look.
  16. adrian

    go hard with wp

    Not paranoid at all. This is paranoid - I have actually gone as far as renaming my .htaccess file to something else so if some script did manage to get access to the server, it would be trying to edit a file that doesn't exist BTW - Not suggesting people need to do this - it is a bit of a pain to maintain. I started doing it a long time ago after a server got hacked and I went a little overboard
  17. Here are the recent changes to the htaccess file: https://github.com/ryancramerdesign/ProcessWire/commit/30495a970e7a0efcf67610543131a8735870a9b6 But I am not suggesting that you need to use the old one - you just need to edit the new one with the correct RewriteBase setting. That's assuming that is actually the problem, which it may not be, but it is the first thing you should check when seeing that error.
  18. Force Password Change: http://mods.pw/7D | Email New User & Generate Password: http://mods.pw/7E

  19. Force Password Change: http://mods.pw/7D | Email New User: http://mods.pw/7E

  20. Hi jeve and welcome to the forums. I really don't have much advice for you, but it would be good to know what version of PW you are running and also your PHP and MySQL versions. Also are you using any PW caching options? Any change you have a isLoggedin() check in the bootstrapped file that is expiring? Could you show us all the code from your bootstrapped file. There were some selector issues in a recent dev version of PW when bootstrapped, but these have been solved in the latest version. I am sure we can figure this out with a little more information.
  21. Good luck with restoring things and with all the deadlines and please let me know when you have a chance to check the Migrator version and send me that JSON file so I can test and sort out a better solution for page fields that handles all situations.
  22. Ok, so I just tested with CustomUploadNames installed and even with it set to "Rename on Save" and it all seems to work fine after editing with Pixlr Editor, so my current theory is that you are running an old version of CustomUploadNames. Can you please try with the latest version and let me know. If you're still having trouble, I'll investigate further. @PawelGIX - on another note, you should update the module to set the status of the Pixlr Image Process page to hidden so it doesn't appear in the Pages dropdown menu which is part of PW 2.5 (you can see what I mean in recent dev versions).
  23. Looks like that might be the trouble! I haven't evert tried PixlrEditor but I'll take a look now and see if I can sort out a fix for you. What are your settings for CustomUploadNames? In particular your FileName Format and Rename on Save settings? I think it is most likely the "Rename on Save" setting that is causing the problem. Try unchecking that first. I will also test here too. Also, what version of CustomUploadNames are you using - please make sure it is up to date.
  24. Now available in the modules directory: http://modules.processwire.com/modules/password-force-change/ For anyone who might have downloaded early on, please grab the latest version. There was an important fix two days ago that now prevents users from simply navigating away from their profile page to another page in the admin. Now they can't do anything in the admin until their password has been changed.
  25. https://processwire.com/talk/topic/52-how-do-i-upgrade-processwire-to-the-latest-version/ Definitely no data loss
×
×
  • Create New...