Jump to content

flydev

Members
  • Posts

    1,366
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. 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 ?
  2. 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); // :) } } }
  3. I will try to do it, I never played with modules and multilanguage
  4. 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
  5. 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. ???
  6. Please post the relevant errors here.
  7. Working on it @adrian
  8. 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
  9. hi, check this thread :
  10. 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.
  11. I can bundle the vendor dir too but this solution do not enchant me. @horst check this post from Ivan : I know that '\' is a char on Unix system and thus the extracted files are not parsed as a directory tree. also i know I have a working version somewhere, I just can't put my hand on it
  12. The problem of those php libs is that they have some dependencies and most of them require the deps installed trough composer.
  13. Hello guys, just to let you know that I am working on the module. @Karl_T As i need the module working on windows ASAP, I tested your fix on my Windows 2008 r2 server / PHP 7.0.28 and it throw error on $zip->close(); with an error : "No Error" ? Which version of Windows and PHP you are working on please ?
  14. Your parent page is not assigned in a correct way. $form->parent = $page('template=contact-form'); // optional, saves form as page should be $form->parent = $pages->get('template=contact-form')->id; // optional, saves form as page
  15. Did you checked the browser's console to see if there an error ? Did you call the $modules->get("MarkupGoogleRecaptcha")->getScript() somewhere ? its required.
  16. hi @strandoo thanks you. I never used the module you are talking about but I read the module code on Github and it look like you can insert the ReCaptcha before the submit button by hooking into the function ___buildForm(). Please try the following (not tested) and let me know. In ready.php put : wire()->addHookAfter('FormTemplateProcessor::buildForm', function ($event) { /* @var $form InputfieldForm */ $form = $event->return; $f = new InputfieldMarkup(); $f->markupText = wire('modules')->get("MarkupGoogleRecaptcha")->render(); foreach ($form->children as $field) { if ($field instanceof InputfieldSubmit) { // find the submit button $form->insertBefore($f, $field); // insert reCAPTCHA before the submit button } } $event->return = $form; });
  17. What bernhard said - also please tell us which output strategy you use, and which profile did you installed to play with the tutorial (if there is one..) ?
  18. No problem dude, feel free to ask, it will be benefit for other people too. And you was close ? Try this : wire()->addHookBefore('LoginRegister::createdUser', function($event) { $u = $event->arguments[0]; // get user object $mail = WireMail(); // no keyword 'new' $mail->subject('Welcome to our website'); $mail->to($u->email); $body = "<p>" . "Welcome to our website " . $u->name . "</p>"; $mail->body(strip_tags($body)); $mail->bodyHTML($body . "<p><a href='$this->page->url?profile=1'>" . $this->_('Your Account') . "</a></p>"); $mail->send(); });
  19. Yes it was planned to be done in first instance trough FTP protocol. Horst had give me some code to work with but since 2 months I am so busy with my works that I didn't found the time to try it. But this feature is definitely on the top of the todo list.
  20. Hi @Ivan Gretsky Sound good to me, look like I have some work to be done! Tables are simply dropped if they exist.
  21. Yes, do not hesitate to share your result, try to make your best and we will try to send a Pull Request on Github ✨ PS: I forgot to send my post. I modified the module to bypass confirmation, if you wanna try and report back, rename your LoginRegister folder to .LoginRegister, then extract the zip in place of the original one in site/modules, refresh modules and check the box in the module's admin. File : LoginRegister.zip
  22. Nope, it's not possible in the current state of the module.
  23. Anyone already tried the module with admin page/Process modules ? I can get it working, but only by hacking the module. Not surprised here, did you tried with another var name ? ($page is a reserved word in ProcessWire) @Wanze With PHP-7.0.10 I get those warning : Edit: fixed by replacing mpdf with the version 6.1
  24. @MarcoPLY You have to call the module by using an ajax request in order to avoid the redirection when the user click. In the following example, I am using jQuery (I'm lazy) and the modal script from w3c and a new template LoginRegister.php for the example : Code of the template : JavaScript code :
  25. Sorry I can't understand all the post ?, can you please post some code or explain "better" what you are trying to achieve ? You can use LiceCap to show us a screencast of what happen on your page.
×
×
  • Create New...