Jump to content

flydev

Members
  • Posts

    1,366
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. The module in the PW version 2.7.2 create a table with a TEXT (64Kb) field and in PW version 3.0.x it use a MEDIUMTEXT (16Mb) field. @gebeer your are trying to insert 23,536 bytes which could be fine if the string was composed with single-byte characters. But in your case it look like your string is encoded in UTF-8/Multi-byte, so we can assume that each character in your string take 1 to 4 bytes of space and thus the database server truncate your string because the TEXT field can only contain 65 535 chars (using single-byte characters) and your string contain (assuming here) 94 144 bytes (multi-byte characters). It could explain your issue. For testing, you could try to disable SQL STRICT MODE. I hope it make sense.
  2. The reason, after the upgrade of Plesk and PHP, by default the PHP setting session.save_path point to /var/lib/php/session and not /var/tmp where before he got r/w permissions (I don't know if Plesk was already installed or not before the upgrade). The final problem was not MySQL.
  3. I think it could be checked on the installation process, checking if these path are writable or not and thus sending a warning that potential session issue could arise. I can't tell you, I think nothing, but I never tried to install this CMS ?
  4. It was a server issue and not a ProcessWire one - the reason behind the message "This request was aborted because it appears to be forged" on this case was because the PHP session path was not writable. The website is back online with backend working like a charm ?
  5. Hi, there you can find some discussions/links :
  6. I also delegate this task to gulp v4 (and I am far to be a gulp guru). Basically, each process is divided in tasks, some to clean, minify and/or obfuscate. The final task is : gulp.task('build', gulp.series('clean-dist', gulp.series('minify-fontello', 'minify-css', 'minify-css-login', 'vendors-js', 'vendors-css', 'minify-js-login', 'minify-js-main', 'hash', 'main-tpl-css', 'main-tpl-js'))); The best tasks are 'hash', 'main-tpl-css' and 'main-tpl-js'. The 'hash' task generate filename with this pattern : {name}.{hash}.{size}{ext} and the last two tasks automatically parse the _main.tpl (_main.php in the intermediate site-profile) and replace the existing css/js call with the newly generated files : <html> <head></head> <body> [...] echo "<script id='main' src='{$assets_url}dist/mywebsite.main.min.7defab4250a4d9009987b26c8f68d50b.1337.js'></script>\n"; [...] </body> </html> If someone is interested I can paste the gulpfile.js here.
  7. Just an idea, is mysqli extension enabled ? Also, on your newly upgraded server, you could run the ProcessWire installer to check if everything required is installed. If you are tired, you can run the first step of the standalone Duplicator installer. You can delete folders in sites/assets, just keep the file and session folders, and empty the session folder manually.
  8. Another way if you would like to load arbitrary JavaScript file in your module is : Define an array with the files defined in it : protected $jsfiles = array( 'js/MyScript.js' ); Then in ready(), write : foreach ($this->jsfiles as $jsfile) { $this->config->scripts->add($this->config->urls->MyModule . $jsfile); } And, the question "Why my JS file are loaded before Jquery ? Should I call my script in init(), ready() or execute() ? @ryan answer :
  9. Ok guys, I get what you mean, so what about a module with this flow ? monitor and log HTTP error code for a period if an entry / request is superior of N then backup .htaccess file (versioning it) add new entries to the .htaccess file Does it make sense or I should let the user manage their .htaccess file manually with a FAQ or something ?
  10. hi try : $mail = WireMail(); $mail->header('Reply-To', 'foobar@example.com'); [...] https://processwire.com/api/ref/wire-mail/
  11. 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.
  12. Hi @Juergen I completely agree. Even better, there will be a Process module to manage/view the blackhole data.
  13. 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 ?
  14. @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).
  15. 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 !
  16. 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"
  17. 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 ...
  18. 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
  19. 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.
  20. 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.
  21. 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.
  22. 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 ✌️
  23. Hi and welcome, In the following thread you can also find 3 nice videos to get started :
  24. 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 :).
  25. 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 :
×
×
  • Create New...