Jump to content

adrian

PW-Moderators
  • Posts

    10,912
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Assuming you are using TinyMCE and not the CKEditor module, take a look at some of these links: http://www.imathas.com/editordemo/demo.html http://www.tinymce.com/forum/viewtopic.php?id=13917 http://www.fmath.info/plugins/TinyMCE/demo.jsp https://github.com/rochecompaan/tinymce-asciimath-plugin http://mathmlflash.blogspot.com/2010/08/plugin-for-mathematics-for-tinymce.html I haven't used any of these, so no recommendations as to what is better, but hopefully should get you going. EDIT: You might also be able to achieve what you want by editing the valid elements on the field's input tab > tinymce advanced settings.
  2. Hi Pete - that is exactly what I do with my front-end registration script, but this module is designed for backend creation of admin users. I have never facilitated user signup for admin accounts, but perhaps that is not a bad idea - a module that allows a user to signup for an account with their own details and then after email activation, the superuser gets an email with the new user's account edit link and then they go and make sure they are a valid user and then assign them the appropriate roles/permissions. Is that basically what you are suggesting?
  3. This module allows you to automatically send an email to a newly created user with their username and password. It also has the option to automatically generate a password for the user upon creation. http://modules.processwire.com/modules/email-new-user/ https://github.com/adrianbj/EmailNewUser The following things are configurable: Whether Send Email option should be automatically checked when creating new user - also affects new users created via API From email address (if left blank it will use the admin email set in the config/php file Email subject Email body - includes the ability to use any fields from the user template using {field_name} codes so these can be put into the body wherever you want. It's your choice if you want to include the password in the email or not. Whether to automatically generate a password. This can be toggled on/off, but even if it is on, you can override it by simply entering a password manually when creating the new user. Ability to control the length and character sets used to make up the automatically generated password. Option to send a test email to yourself to make sure it is configured the way you expect. Because it is generally not a good idea to email passwords, it is highly recommended to use the new Password Force Change module in conjunction with this module. That way the user has to change their password the first time they login which will somewhat reduce the vulnerability of emailing the password. It can also be used for API generated users: $modules->get("EmailNewUser"); // call the module since it is not autoload on the front end $newuser = new User(); $newuser->name = 'newuser'; $newuser->email = 'newuser@gmail.com'; $newuser->sendEmail = true; // only needed if Automatic Email Send is unchecked $newuser->save(); Please let me know if you have any ideas for improvements. PS Thanks to everyone in this post: https://processwire.com/talk/topic/2981-new-user-welcome-message/ for their thoughts and ideas on how to do this.
  4. Just discovered a bit of a gotcha - if the new user does not have "profile-edit (User can update profile/password)" permission they obviously won't be able to change their password, so just committed an update that checks for this permission and warns that it needs adding.
  5. Just make sure $page->created is returning the format needed by the function by doing: date("Y-m-d H:i:s", $page->created);
  6. I have had some personal communication with Ryan about this and it seems to be an issue with MySQL 5.6 (although arjen does debunk that is one of his posts), but I had the problem on a server with 5.6, but as soon as I rolled back to 5.5 it went away. Regardless this is something that does need to be fixed sooner than later because 5.6 will start getting more common. Can's fix is the current best option though and works perfectly.
  7. Not really sure if this helps your problem or not (I think maybe not), but is your server in a timezone 14 hours away from QLD? If you need to convert from that to QLD time, you can use a function like this: function convert_time_zone($date_time, $from_tz, $to_tz){ $time_object = new DateTime($date_time, new DateTimeZone($from_tz)); $time_object->setTimezone(new DateTimeZone($to_tz)); return $time_object->format('Y-m-d H:i:s'); } then call like this: $qld_time = convert_time_zone($page->created, 'Other/Timezone', 'Australia/Queensland');
  8. Hey teppo, Thanks for the thoughts on the checkbox issue. I agree that unchecking "password changed" does sound weird My reasoning for going this way was because I was wanting to avoid the need for an additional step (checking the checkbox) when creating a new user. I thought, maybe incorrectly, that anyone using this module would want to ensure that all new users are required to change their password when they first login. My approach to setting up admin users is to send them all the same initial password and ask them to change it immediately. I wonder if a better approach might be to use a dropdown select that is a required field when setting up a new user. It could be called "force password change" and have a blank default and then "yes" and "no" options. It's still an extra step when setting up a user, but at least this way I can ensure the superuser doesn't forget to do it. Any thoughts on whether this would be a more logical setup? Thanks for the reminder on the license - I actually haven't been good with that for any of my modules - mostly because of ignorance/trust with these sorts of things. I'll take care of it shortly and also check my other modules and do the same. PS Minor fix committed this morning - I woke up realizing that I had hardcoded the path to the profile page EDIT: Do you, or anyone else, know why I can't set the collapsed state of the pass field via the API? I can do it with other system fields, but not this one. You'll see in my code two commented blocks where I try to set it to open before the redirect and then set it to collapsed after they have changed their password.
  9. Hi everyone, Here's a little module that allows you to force users to change their password on their first login, or at any time if you manually force it. http://modules.processwire.com/modules/password-force-change/ https://github.com/adrianbj/PasswordForceChange Key Features During install it creates a new checkbox field in the user template, "force_passwd_change". Automatic checking of this checkbox when creating a new user is determined by the "Automatic Force Change" module config setting. When a user logs in for the first time (or if you have manually checked that field for an existing user), they will be warned that they have to change their password and they'll be automatically redirected to their profile page. They must change their password to something new - they are not allowed to re-enter their existing password. Bulk "Set All Users" option to at any time, force all users (by selected roles) to change their password. Hopefully some of you will find it useful and please let me know if you have any suggested changes/enhancements. PS I used the new info.json way of defining the module details, so it requires PW 2.4.3+
  10. It already strips out all html tags except <br><br /><p><strong><b><a><img> Although looking at this, it should probably be expanded to include <em> and maybe even <b> and <i> Does this take care of your request, or is it something else I am not understanding? Or is the stripping of tags not working for you?
  11. @mr-fan - thanks for testing. I am not sure this module is getting a lot of use, so I am not expecting many others to test so maybe I'll just submit a PR to Pete to get this new version committed to Github and available from the modules directory.
  12. Or you can use SQL directly as per Ryan's suggestion to a similar question I had: https://processwire.com/talk/topic/3053-possible-to-select-modifiedcreated/?p=30093 It always feels dirty to me to query and then truncate
  13. There is this mention: https://processwire.com/talk/topic/5281-paypal-payment-method-for-processwire-shop/?p=67668 So long as whatever payment system you are using (Paypal in the example mentioned above) has some way of securely confirming that the user's payment has been received, you can easily make the download available based on whether a "paid" flag has been set for their order.
  14. Glad you worked it out. Just a small note on PHP syntax: date(Y) will work, but will throw a: Notice: Use of undefined constant Y - assumed 'Y' error It should be: date("Y")
  15. Ok, here is my forked version that lets you choose the images and body fields for each email category: https://github.com/adrianbj/ProcessEmailToPage Please let me know how it goes for you.
  16. @mr-fan, It looks like you are using my latest version of this module - I was playing around with attachments and embedding them into RTE fields. I think the error is coming from the images field. Does your page have an images field? Is it named "images"?
  17. Just to explain the difference between what diogo and I wrote. His is simpler, but mine is more descriptive. child on it's own will always be the first child. With children, you can further select last(), or use eq(n) to choose the exact one in the list of children by its numerical order index. Hope that helps.
  18. Hi Tramvai and welcome to PW. This can be accomplished easily with a redirect. Place this in the template file that is connected to your Cars page: $session->redirect($page->children->first()->url); Of course you could also be more specific about the page that it redirects to, but in this example it will always go to the first child of the parent page.
  19. I am not sure where $name is initially defined, but your: $name = $event->arguments('$name'); doesn't look right. If you are wanting to get an event argument by name, you need something like: $event->argumentsByName("page"); Also, this: $person = $this->wire('users')->get("name=$name"); can be simplified to: $person = wire('users')->get($name);
  20. If you're putting that in a module you need to either use: $this->user or wire('user') $user is not available from modules (inside the module class) or inside functions due to variable scope
  21. This is how I have done it in the past: https://processwire.com/talk/topic/5534-new-articles-to-users-with-cookie/?p=53935 Ignore the title of the first post - this option does not use cookies. Note that this is not just about storing the last login, but rather the datetime of the last page they viewed, which may or may not be what you are looking for
  22. I think you should take a look at PayPal's IPN (https://developer.paypal.com/webapps/developer/docs/classic/products/instant-payment-notification/) Setting this up will allow you to set a field in PW to confirm that the user has definitely paid, then you could safely make use of their order-id by sending them an email with the order-id as a get variable in the URL. Your download script would then check the order-id and make sure the paid flag was set before initiating the download. I use this script as a starting point for my ipn.php file https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php Just add: include("./index.php"); at the top to bootstrap in PW and then inside: if (strcmp ($res, "VERIFIED") == 0) { you can use the PW API to set the paid flag to true etc.
  23. Absolutely possible and no problems! One thing you might want to check out is Soma's Soft Lock: http://modules.processwire.com/modules/page-edit-soft-lock/ This warns (or optionally prevents) users from editing the same page at the same time which could otherwise result in data loss. EDIT: You might have issues with multiple superusers changing field/template config settings.
  24. Hi Ioquan and welcome to PW! I am really surprised to see those failures as they should both be on by default in your version of PHP. Is it a default MAMP installation? Can you perhaps check your phpinfo results to figure out if it is in fact not available, or if it is a detection problem with PW. Let us know if you need help getting that info.
×
×
  • Create New...