Jump to content

ryan

Administrators
  • Posts

    16,715
  • Joined

  • Last visited

  • Days Won

    1,516

Everything posted by ryan

  1. I agree with AnotherAndrew. The indicated error line is the mysqli_connect function, which means it attempted to connect to the MySQL server and was denied. I don't see how the scope of this could go beyond your web host and their MySQL server. If it's only occurring to certain people, chances are they are seeing an error message that was cached somehow or another (perhaps via a proxy). I wouldn't look past the web host, the problem has got to be there.
  2. Tina your example also has an extra '$' before the session variable: $this->$session->redirect($pages->get(1)->url); that should be: $this->session->redirect($this->pages->get(1)->url); Make sure that you've got $config->debug=true; in your /site/config.php during development so that you get more verbose error messages, which should highlight these things rather than giving you a 500 error. I also recommend replacing your "init()" method with "ready()". Technically either should work here, but since $page isn't yet available at init() time, anything that inquires $page would be non-functional. There doesn't appear to be anything here that needs $page, but since you are making a $pages call, I think it's just a little safer to use ready() rather than init(). Note however that you'll want to keep the init() method around, since it is required. But just leave the implementation for it blank, while moving your code to a ready() method. Lastly, since this has to do with front-end, you might just want to make your own login form for the front-end. PW's login form is for login to the admin, but it wasn't intended to be used as a front-end login form (even if you can technically do it). You may find it a lot simpler and more flexible just to have a separate form for your front-end login: Here's a couple examples: http://processwire.com/talk/topic/2937-creating-a-front-end-admin/?p=28954 http://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919
  3. Template permissions can be inherited to other pages via their template, whereas family settings can't. So there can be a situation where you are dealing with a template that already has children, you change it to "no" to prevent further children, but existing children using inherited permissions should still have the "add children" permission.
  4. I don't think that particular setting requires advanced mode? It is on the 'advanced' tab of the Template editor though. But that tab is unrelated to $config->advanced (despite the name). Regarding advanced mode: I never use it, except when developing ProcessWire itself. I recommend people stay out of advanced mode unless temporarily needing to access some specific setting. The need for advanced mode never comes up in my own sites, at least. It can be dangerous to leave it on, just because some of the things you can "enable" (like 'system' status) are not easily reversible.
  5. That's correct. But it also allows it to be changed in the page editor. Here is the description field that goes along with it: "When checked, pages using this template will have an option to change the 'created by user' (for superusers only). It will also enable the $page->createdUser or $page->created_users_id fields to be saved via the API." Note that in order to access this setting, $config->advanced=true; has to be set in /site/config.php
  6. It looks good to me. I would probably compare the $user's id rather than name, but I don't think it matters here.
  7. I tried to reproduce that here, but it seems to be returning the expected result for me: $items = $pages->find("title|body|parent.title%=France"); Here's the results I got. The "title" matches the first item, and "parent.title" matches the rest of the items (which don't include "France" in any of their fields). They all have a blank 'body' field. /regions/europe/france/ /regions/europe/france/arles/ /regions/europe/france/avignon/ /regions/europe/france/beaune/ /regions/europe/france/blaye/ /regions/europe/france/bordeaux/ /regions/europe/france/cadillac/ /regions/europe/france/chalon/ /regions/europe/france/conflans/ /regions/europe/france/giverny/ /regions/europe/france/les-andelys/ /regions/europe/france/lyon/ /regions/europe/france/normandy-beaches/ /regions/europe/france/paris/ /regions/europe/france/pauillac/ /regions/europe/france/rouen/ /regions/europe/france/saint-emilion/ /regions/europe/france/strasbourg/ /regions/europe/france/tournon/ /regions/europe/france/vernon/ /regions/europe/france/vienne/ /regions/europe/france/viviers/
  8. The skyscrapers profile is available for download so you can see how it's put together. But for the most part, you would build these things the same way as if ProcessWire wasn't there. Then once working, take advantage of the fact that you can pull the data to populate these things from PW. This is not something PW will do on the front-end for you, since it's not generating markup. But this is something you can do very easily on your own… again set it up as if PW wasn't there, then modify it to pull the data to populate from PW. While we're probably not big enough to be a target, I feel good about the security of the core product and have always made security the first priority in development. But security is a factor that goes well beyond the core product. First, PW will only be as secure as the modules you have installed to it. I do my best to keep up-to-date with modules that go into the directory and notify the author if I find any potential security issues. However, this isn't guaranteed as I can't always keep up with everything. Secondly, PW is about as secure as PHP. Meaning, it can be very secure, or not secure at all, depending on how you code your own templates and use PHP. So if you get into handling user input, as you would with processing forms, search engines, etc., then you yourself have to follow PHP best practices towards maintaining good security. ProcessWire does provide several helper functions via the $sanitizer API variable, and I recommend using them when handling user input.
  9. Templates are the recommend way to manage access. While you can accomplish almost anything with this access control, sometimes you can find a more specific way better for your own needs by using PW's access control hooks. The most common being: Page::editable and Page::viewable. However, if you really are talking about only 4 section pages, I would save yourself the trouble and use the built-in recommend method with access control templates. Locking the section pages for edits (like Soma mentioned) is also a good way to keep them from modifying them outside of template access control. If the user doesn't have page-lock permission, then they won't be able to unlock the locked pages. If you ultimately decide you want the fine-grained control of access control hooks, let us know and we can post an example or two to get you started.
  10. I don't think we can do that because a parse error generated as a result of wrong PHP version will occur before ProcessWire can even perform a getModuleInfo() call on it. Module info would have to be stored in a separate file in order for PW to identify and prevent that sort of thing. Even that, or PW would have to file_get_contents() the PHP file and manually parse it looking for that info (which doesn't seem worth it). Though adding support for optional external module info files is something I would like to add at some point.
  11. I think the main value/intention of template labels is for language support. In this manner, you can have something that makes sense with the editor's language, even if different from the developers language. Most of the time, I do not use template labels, as I prefer to just have the template name. Though if I was doing a lot more multi-language sites, I would probably prefer template labels.
  12. I'm not sure that I follow exactly what you are trying to do. But one thing to keep in mind is that a Page can literally be mapped to anything. So while your form field may involve a page selection, you could then say "this page maps to this form" and "that page maps to that form". You could even make the template for that page load a specific form. In Form Builder, you can also specify defined lists of selectable items outside of Pages. So you might just enter each of your selectable items to be the same as the name of a form.
  13. You saw this when first starting the installer, or after completing the database config screen?
  14. How much do you need to know about the portal.domain.com authenticated user on client1.domain.com? Do you just need to know that they are logged in, or do you need to connect them with another account on client1.domain.com? I'm just trying to better understand the extend of access control needs at client1 and whether this is a simple authenticated "yes or no", or broader in scope.
  15. @chim77richalds do you have access to the Form Builder support board? If not, let me know your order number so I can update your access. Also, please post the exact text that you are pasting in the success box.
  16. (Topic moved from Getting Started to Dev Talk) Looks like a good setup! I'm not totally clear about exactly what Homebrew is, but I love the name.
  17. If you need to retrieve a bunch of pages by ID, then getById() is much better than a foreach with get() simply because getById() does its primary work with one query, whereas get() does at least one query per call. But getById is also one of those things that most people will probably never use (it's largely an internal use thing). As a result, it probably just belongs in the 'advanced' API section.
  18. I would really avoid using the h4 title as a URL segment as it seems like a potentially very fragile solution. Page numbers would probably be a little less fragile. If the editor really can't handle repeaters, I'd suggest using <hr> (or something else nice and direct like this) as the page delimiter rather than an <h4>, and sticking to page numbers rather than URL segments.
  19. We have always used ASCII on fields within tables that are for page names (or other names that can't ever contain anything UTF8). Though the tables themselves are always UTF8, even if an individual field within might be defined as ASCII collation. Can you see any potential problems with doing that? Maybe some MySQL version or setting doesn't like this? The "/?/" means the error occurred before PW determined what the current $page was going to be. Everything is UTF8, except for "name" fields. They certainly could be UTF8 too, but figured it would be a better practice and more efficient to enforce ASCII on a field where only ASCII characters allowed. But it sounds like maybe there are issues with doing that I'm not aware of? Though if that were the case, I would also wonder why MySQL would let you change the character set on a field-by-field basis if it wasn't okay to do. This is the first "Illegal mix of collations" error I've heard of in PW.
  20. Thanks Soma, I can reproduce that. I was not using a segment for my default language, so hadn't noticed. It should be fixed on the dev branch.
  21. Big thanks to Mats for the alltpaoland.com example and his clustering updates to my RCDMap class. With these available, I was able to learn enough (and admittedly copy enough!) to make the map project come together: http://www.synbioproject.org/library/inventories/map/ ... my code is a little messy, but it all works for the deadline, and I can go clean it up later. Beyond Google Maps, tools used here are jQuery Mobile, ProcessWire 2.3, ImportPagesCSV module, and ProcessWire Form Builder (for the add/edit map submissions). Thanks again Mats! I don't think I could have made much progress without your alltpaoland site as an example/guide.
  22. No the session should still be active even if they close the browser. Now if they completely quit the browser, that might be different.
  23. It sounds like what you want is instead the MySQL login info? If so, you can put it in a .my.cnf file in your home directory: /home/samuel/.my.cnf [client] user=your_mysql_username pass=your_mysql_password Following that you can access the mysql/mysqldump clients without specifying a username or password. This is helpful for automated backups or [i'm guessing] git based workflow.
  24. Don't worry, I understand. No need to explain, we're all on the same $page. Just trying to make sure I follow up good questions with good answers.
  25. When/where are you guys seeing the 'guest role required' message? Just wondering if this is something that should be fixed in the core ProcessUser module? I guess I haven't noticed this before.
×
×
  • Create New...