Jump to content

LostKobrakai

PW-Moderators
  • Posts

    4,956
  • Joined

  • Last visited

  • Days Won

    100

Everything posted by LostKobrakai

  1. I think it's "saver" in the db. File contents can easily be leaked by incorrect webserver settings, which does not happen as easily for something like module configuration. For anyone gaining access to your server it probably won't matter anyways.
  2. The url issue should probably be doable by a .htaccess rewrite.
  3. You could. It would need to be a two-way encryption so you can unhash the password for the curl request. This would need an potential attacker to hack the db and the filesystem to recover the password. But I'm not very knowledgeable on what to use for that.
  4. Basically go to http://modules.pw/, tick some boxes, put in your code and change the things up, which should be configurable. But this code is not too great to begin with as it'll require anyone using it to store the cpanel password unencrypted in the database or the file itself. ProcessHostingInfo.zip
  5. This does also have a side-by-side view (at-least in fullscreen mode). I think it's even configurable.
  6. There's a (node-based) clone of just the editor, so it could be created/added: https://github.com/durgesh-priyaranjan/ghosditor But one would need to strip out all the express(?) parts of it and replace it with php/pw code.
  7. Take a look at those: Mysql 5.7 changed the default value options for date fields.
  8. var_dump(get_class($treeMenu));
  9. Could you check if $treeMenu actually is an instance of the module? Also you probably should avoid using <? instead of <?php, because short_tags are often disabled.
  10. There are basically four different environments to talk about. TemplateFile TemplateFile is core class, which does include your template files, but does also power things like $page->render(), wireRenderFile(), wireIncludeFile() and others. This class will automatically make all API Variables available as local variables. Meaning all those included files can directly use $pages, $page, … . It won't work inside any functions defined in those files, because of the way PHP does scope variables. Classes extending Wire Every class, which is extending the Wire class will have access to API variables via $this->pages, $this->page, if the properties or __get() are not overwritten. Also there's $this->wire('pages'), which is less likely to be overwritten (even some core classes need to use $this->wire()). Anonymous functions There are some methods in the processwire code, which accept anonymous functions as parameters (e.g. WireCache). Those anonymous functions can retrieve api variables as parameters, even though I'm not sure how exactly this is working or if that's often used. Everywhere else Outside of wire classes, template files and special anonymous functions there's the wire() function, which is basically the same as $this->wire() in wire classes, but as a global function, which is accessable anywhere after pw is started. With PW 3.0 and multi-instance this is the option to avoid. Places, which technically are number 2, but it may not be apparent to everybody: Custom PHP code for fields like FieldtypePage or FieldtypeMarkup: As those PHP code is evaluated/run inside those (input)field classes there's (besides manually available local api variables) always the option to use $this->pages or $this->wire('pages'). All those template files included by the TemplateFile class: For the same reason as above there's not only $pages available in those template files, but also $this->pages, $this->wire('pages').
  11. status=unpublished or include=unpublished
  12. For anyone interested, there will be a (german) introduction hangout today about what that slack channel / community is all about and a little bit of craft talk (even though pw is also quite well represented).
  13. Yeah, just write something to the log in your method. I'm on mobile, so no example unforunately. You could even simply die(); the whole thing. Is your module autoloaded?
  14. Can you post the relevant code lines in your menu-inc file? The callstack looks quite normal besides maybe the last line, which I'm not sure about.
  15. You're not supplying the page to your publish method?! Also is the updating of the integer working or are both things not triggering?
  16. What's $this->publish()? Shouldn't it publish the page? Edit: Also try compareing the checkbox to 1 instead of true.
  17. The custom php code is executes as part of InputfieldPage and therefore all api variables are accessable as $this->… . Only $pages as $page are available as local variables.
  18. I don't think there was a question, but it's rather a mini-tutorial.
  19. $matches->setStart($input->pageNum * $limit); $matches->setTotal($matches->count); $matches->setLimit($limit); $matches = $matches->slice(0, $limit);
  20. $matches->slice(0, $limit);
  21. Then happy birthday @diogo
  22. Just change the xdebug max_nesting config to something higher. Also in production xdebug shouldn't be installed anyways.
  23. "./" is the current page. "/" would the the root page.
  24. Just use the same hook and test (if it's a post request and) if your button was clicked – it's name is present in the post data. If so execute something. If not go one without it.
  25. If you're not to experienced I'd really suggest you to take a look at the nette/forms library. It has lot's of the security traps already covered and you can configure validation rules once and they'll happend in php as well as in js (if you include it's js file). The values coming out of the library are already sanitized and will conform to your rules and you can concentrate on implementing the hard stuff.
×
×
  • Create New...