Jump to content

flydev

Members
  • Posts

    1,355
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by flydev

  1. I was also thinking to add a new feature from where we could monitor 302/404 HTTP code and redirect the "guest" into the blackhole. For example, all those try : /phpMyAdmin/scripts/_setup.php /w00tw00t.at.ISC.SANS.DFind:) /blog/wp-login.php /wp-login.php etc. will be banned. I still don't know if I code all the feature or if I should hook into Jumplinks from @Mike Rockett.
  2. Hi @Juergen I completely agree. Even better, there will be a Process module to manage/view the blackhole data.
  3. You can simply do this : Form submit => POST request => verify($input->name, $input->email); Then in the verify function, you parse the name and check if it already exist in your system. If it exist, your return an error, else you create an new entry. Which difficulty are you encountering ?
  4. @Peter Knight this issue is known and fixed in the next version. The cause is that the ProcessModule try to load the log file but the file does not exist (the file is created on the first backup).
  5. Try to make a pw module for it ? ? I read their login widget page and I like the idea behind the bots ? Could be something pretty cool, and a cool use-case could be re-transmitting the live logs of the LoginHistory module from @teppo trough a telegram bot. Really it's exciting! If you wanna start it, I will be glad to help you !
  6. This message just to let people knowing that Google Invisible ReCaptcha is implemented and can be used in your form by checking the right feature in the module's options without modifying any code line. Now your beautiful formular design won't "break"
  7. from @Robin S $this->addHookAfter('FieldtypeRepeater::wakeupValue', function($event) { $field = $event->arguments('field'); if($field->name !== 'myrepeater') return; // repeater field name $pa = $event->return; $pa->sort("-created"); // or whatever sort you want $event->return = $pa; }); Will return : 2018 2017 2016 ...
  8. Okay, thanks @kongondo, you put me on the right track. The zip file can be extracted on Windows and Unix, but the "extension feature" doesn't work. Will find a workaround. Thanks again
  9. Yes, but there is a feature to exclude files by extension - not tested a wildcard in the core function - which can't work "as is" with this function. Maybe I should return an array of all files (from an extension provided) and passing this array to the function. This should work.
  10. yes, and I know I can exclude files directly in WireZipFile() but I can't apply a filter on the iterator. Now, writing this post, I have an idea which could work.
  11. Thanks @kongondo, from what I remember, the main reason I didn't used this function is because it doesn't work with the exclude feature. Maybe I am wrong, I will look more closer at the function's code.
  12. So, after multiple tries to code a function which could zip a folder and could lead to be extracted on both platforms (win/unix) failed. The function I built (which I think can work on both platforms) lead to a ZipArchive error: NO ERROR on Windows and thus the zip file is not finalized ?? it irks me, if someone has a function which work on both platform please post it here ✌️
  13. Hi and welcome, In the following thread you can also find 3 nice videos to get started :
  14. Just a small idea as I didn't understood all the post but it sound like something I have done recently. Access to the admin, with roles and permission set correctly, there is no issue (from my point of view). But, if you are giving them only the right to edit a page / their profile, I would build a frontend form and a module, but the job can be done in the backend easily too - if this is what you want- with a ProcessModule without the need to give the user the right to access the page tree/tabs or the rest of the backend. What I mean is, when the user log in to the backend, they will only see a form to edit their page and the profile menu; The rest is "blocked"/"denied"/"not visible". Anyway, you can keep the things simple, for the profile, you could just use the LoginRegister module. Add a page reference field to the User system template and be sure to remove this field from the editable fields list in the module configuration. The page reference field will be filled on the user creation with the page id created at the same time as the new user. Then to edit the page, just loop trough the fields of the page, pulling out the "confidential" fields and build a frontend form which will update the page associated with the user. How/when the user are created ? Who create them ? If it is on self-registration, its even more simpler and everything could be done by hooking the LoginRegister module for assigning the roles and creating the user associated page. Why ? When you will have more technical details, ping me on the forum :).
  15. Hi, check the doc : https://processwire.com/api/ref/pagefile/ https://processwire.com/api/ref/pagefile/url/ Your link markup should be something like that : <a href="{$page->myfilesfield->first->url}" download>download</a> A tutorial :
  16. Hi, As far as your webserver has write permission on a given folder outside the web directory, you can write your logic in a module which handle your upload thing - everything is possible inside ProcessWire. I personnaly would go with pages. Make a parent page "newsletters-upload" in your page tree then create a child page for each "year", then create a child page inside "year" for each uploaded newsletter. Each newsletter page have a fieldtype-secure-file field which give you the possibility to store your uploaded files outside the webfolder. In the process module, the author could create/select a "year" page (folder) and upload file by drag&drop in the admin. You can also pull files from an FTP server where authors create their folder tree, then do the logic in the module. This is just an idea from what I understand, more details needed ?
  17. Good and funny ! For example, on the site I deployed the module, it is a custom dashboard with sensible informations, I had to take care of hand crafted request which could retrieve data from other users. When this behavior is detected, the user is logged out, the role login-disabled is assigned and then the user is redirected into the blackhole to be banned. public function SecureParks() { if($this->input->post->park) { $ids = explode('-', $this->sanitizer->pageName($this->input->post->park)); $userroles = $this->getParkRoles(); $userhaveright = $this->searchForParkId($ids[2], $userroles); if ($userhaveright === null) { $this->user->addRole('login-disabled'); $this->user->save(); $this->session->logout(); $this->session->redirect($this->pages->get('/blackhole/')->url); // :) } } }
  18. I will try to do it, I never played with modules and multilanguage
  19. Module updated to version 1.0.2. The Whois information request is triggered accordingly to the module's option Thanks for the bug report @Juergen
  20. Hi everyone, [edit: do not loose your time reading this post, I solved it by disabling cache in the Pages2Pdf module... sorry ?] I do not know if I should post on the Pages2Pdf thread or here. Mods, feel free to move the post. Since three days I am scratching my head to understand a weird thing happening with $session and $config->debug used in conjunction with Pages2Pdf module. For information, I tested it on a fresh install of ProcessWire 3.0.96 with PHP-7.0.28 and Pages2Pdf-1.1.7 (domain: http://session.sites.sek/). I will try to explain what is going on. What I am trying to achieve : In a template, I need to set some sessions variables which are then echo'd in the PDF document. (on the test installation, the basic-page template (page /about/?pages2pdf) serve the PDF, the home and sitemap template set the session variable.) The problem : From the template sitemap, I set a variable: $session->setFor('pdf', 'myvar', 'Session set from Sitemap template'); From the template home, I set a variable: $session->setFor('pdf', 'myvar', 'Session set from Home template'); Then in the PDF default template, I echo the session variable: <p>Session: <?= $session->getFor('pdf', 'myvar'); ?></p> Now I turn ON debug mode ($config->debug = true) : Then I navigate to "http://session.sites.sek/home/" and the session variable "myvar" is set to "Session set from Home template". Then I navigate to "http://session.sites.sek/sitemap/" and the session variable "myvar" is set to "Session set from Sitemap template". Now I want my PDF document, so I navigate to "http://session.sites.sek/about/?pages2pdf=1" and I get my PDF document with the right session var : "Session set from Sitemap template" For the moment, nothing special happen. Everything work great. We are in debug mode. Now I turn OFF debug mode ($config->debug = false) : Then I navigate to "http://session.sites.sek/home/" and the session variable "myvar" is set to "Session set from Home template". Then I navigate to "http://session.sites.sek/sitemap/" and the session variable "myvar" is set to "Session set from Sitemap template". Then I navigate back to "http://session.sites.sek/home/" and the session variable "myvar" is set back to "Session set from Home template". Now I want my PDF document - as expected, the "myvar" should be set to "Session set from Home template" - so I navigate to "http://session.sites.sek/about/?pages2pdf=1" and here the problem happen. Instead of echoing "Session set from Home template" in the PDF document, the phrase "Session set from sitemap" is echo'd (the last value recorded before switching from debug ON). I made two small screencasts to show the issue : DEBUG ON (Everything is OK) DEBUG OFF I am missing something ? EDIT: YES, you are dumb! Why it is working with debug mode ON and not vice-versa ? Is there someone who already spotted this strange behavior ? Is there a PHP settings which should be modified ? ==================================================== Edit: I needed to post just to figure myself that Pages2Pdf cache the document when $config->debug is false. ???
  21. Please post the relevant errors here.
  22. I see, thanks for your input. At this moment, Its working in the way : unix to unix ok unix to windows ok windows to unix, testing it right now
  23. Thanks you @Juergen . About the port 43, its common that this port is blocked by default and - depending on the hosting provider - can be configured trough the panel provided. Will look at it this afternoon as I am deploying this module a on a production site. Stay tuned, thanks again mate.
×
×
  • Create New...