Jump to content

flydev

Members
  • Posts

    1,355
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by flydev

  1. Ok @matjazp , with your fix it works! I modified the module.
  2. Thanks for the idea, I tested with and without UAC, same thing happen. And I can confirm that permission are OK as the files are copied by the script only if the dir already exist. Directories and files in regular site/assets are created/written successfully. This drive me crazzy and I can't live with a modified core file ?
  3. Same thing here with Firefox or Chrome. Not so much annoying but it happen ?
  4. I do not think so either. The thing is that I don't have any issue on Linux or Mac. Lets ping @Wanze
  5. I just tested with an Office365 account with these settings, it works well. WireMailSMTP 0.3.0 here. Look like its your credentials that are incorrect ? Double check
  6. Hi @nikoka I was struggling with an other Microsoft service yesterday and make me think that your issue is with your entered information. Try : SMTP port: 587 SMTP user: yourmail@provider.com Check START-SSL Uncheck use SSL
  7. You can disable the WHOIS lookup in the module's config.
  8. Ok thanks, then probably a firewall issue. Which type of webhosting you are trying the module on ?
  9. Hi @Tyssen What I usually do is : 1. Edit the getModuleInfo()'s module [...] 'page' => array( 'name' => 'general_settings', 'parent' => 'setup', 'title' => 'General settings', ), 'permission' => 'global-site-settings', 'permissions' => array( 'global-site-settings' => 'Access to Global Site Settings.' ), [...] 2. Uninstall / re-install the module 3. Add a new role : site-settings 4. Add to this role the permission : global-site-settings 5. Add the site-settings role to the user 6. Logoff / login the user No extra steps required.
  10. I just edited the core file Pagefile.php and added on line 157 (pw version 3.0.89) this code : //if(!copy($filename, $destination)) throw new WireException("Unable to copy: $filename => $destination"); $fileTools = new WireFileTools(); if(!$fileTools->copy($filename, $destination)) throw new WireException("Unable to copy: $filename => $destination"); And... it works... Should I report something on Github ?
  11. Today I ran into an issue while using FieldtypeSecureFile on a Windows 2008 R2 server with an Apache web server, PHP 7.2.1 and ProcessWire 3.0.89 (I am posting here as I think its not an issue with the module itself). Issue description: I have a script which save a file into a file field (SecureFile) outside the web directory as mentioned in the module readme. The problem is that the directory - the one which has the name of the page ID - isn't created automatically and thus the file can't be copied. If I create the dir manually, the file is copied successfully. Lets say I have a page ID 723153 which contain a SecureFile field which is configured to save files under this path: C:\DATA When you add a file then save the page, the following directory/path should be created : C:\DATA\723153\sekretfile.csv Instead, I get a warning : Apache is running under an user which have the right permissions to write to the storage dir. As I said, if I create the "intermediate" directory manually, the file is copied. Note: everything is working fine on MAMP. - I just tested now to upload the file directly trough the backend, the file isn't saved and there are no error or warning. I am out of idea, and you ?
  12. @dragan As @horst said, you can check your logs for bots. There are a small tips in the module admin for that : @Juergen what say <?php echo ini_get('allow_url_fopen'); ?> ? Sorry I don't understand what is saying the warning thing in German
  13. Presentation Originaly developped by Jeff Starr, Blackhole is a security plugin which trap bad bots, crawlers and spiders in a virtual black hole. Once the bots (or any virtual user!) visit the black hole page, they are blocked and denied access for your entire site. This helps to keep nonsense spammers, scrapers, scanners, and other malicious hacking tools away from your site, so you can save precious server resources and bandwith for your good visitors. How It Works You add a rule to your robots.txt that instructs bots to stay away. Good bots will obey the rule, but bad bots will ignore it and follow the link... right into the black hole trap. Once trapped, bad bots are blocked and denied access to your entire site. The main benefits of Blackhole include: Bots have one chance to obey your site’s robots.txt rules. Failure to comply results in immediate banishment. Features Disable Blackhole for logged in users Optionally redirect all logged-in users Send alert email message Customize email message Choose a custom warning message for bad bots Show a WHOIS Lookup informations Choose a custom blocked message for bad bots Choose a custom HTTP Status Code for blocked bots Choose which bots are whitelisted or not Instructions Install the module Create a new page and assign to this page the template "blackhole" Create a new template file "blackhole.php" and call the module $modules->get('Blackhole')->blackhole(); Add the rule to your robot.txt Call the module from your home.php template $modules->get('Blackhole')->blackhole(); Bye bye bad bots! Downloads https://github.com/flydev-fr/Blackhole http://modules.processwire.com/modules/blackhole/ Screen Enjoy
  14. Yes, its called MySQL Query Cache To disable it for a connection : SET SESSION query_cache_type = OFF; More details there : https://www.dbrnd.com/2015/08/mysql-query-cache/ https://www.dbrnd.com/2015/08/mysql-query-cache-configuration/
  15. Hi, you can hook into createdUser : wire()->addHookBefore('LoginRegister::createdUser', function($event) { $u = $event->arguments[0]; $u->roles->add(wire('roles')->get("custom-role")); $u->save(); });
  16. Just logout then redirect the user : $session->logout(); $session->redirect("./"); And you could write a GET variable ?logout=1 in your link then check this var to logout the user. if($input->get->logout) { $session->logout(); $session->redirect('./'); } else { $out = "<p>You are logged in. <a href='./?logout=1'>Logout</a></p>"; }
  17. Thanks you very much. FYI the problem you will encounter with a modified core module, its all the modified code will be ripped off when updating the site.
  18. I am highly interested to see how in term of code you manage this. Did you hardcoded the login name in a hook or something like that ? As you say that you are monitoring a login for a specific username, you could prevent a login by hiding deeper the admin by naming the page with something complex you only know, eg. an url based on a HASH.
  19. Thank you - I will check, as now, I don't know why isn't working
  20. Did the challenge work ? I mean, the reCapatcha widget is "green-checked" ? To be sure that the problem is not in the code I give you (I am currently using the same snippet on a website) , you should try to get the challenge working on a regular module call in a regular form. Can you test it and report back ?
  21. Good, now I think that your google challenge is not successful. Be sure that you saved the changes in your list of supported domains once you added the localhost. Anything in the developer console ?
  22. Yes it is. Read my last edit in my previous post. Localhost for testing is fine, no problem with that.
  23. Sorry, I totally missed it ! Will try to find the time asap
  24. Hi @LAPS try the following : In ready.php put the following code : $captchaobj = null; wire()->addHookProperty('LoginRegister::captcha', function ($event) { $event->return = wire('modules')->get("MarkupGoogleRecaptcha"); }); wire()->addHookAfter('LoginRegister::buildLoginForm', function ($event) { /* @var $form InputfieldForm */ $obj = $event->object; $form = $event->return; $form->description = false; // remove the description $f = new InputfieldMarkup(); $f->markupText = $obj->captcha->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; }); wire()->addHookBefore('LoginRegister::processLoginForm', function ($event) use (&$captchaobj) { $obj = $event->object; $captchaobj = $obj->captcha; }); wire()->addHookBefore('Session::login', function ($event) use (&$captchaobj) { if (!is_null($captchaobj) && $captchaobj->verifyResponse() == false) { $event->arguments(0, ''); $event->arguments(1, ''); $event->arguments(2, false); $event->return = false; } }); Just one thing, I couldn't get the invisible mode to work with LoginRegister, only the reCAPTCHA v2. edit: a small hint about the getScript() : you should call it from the main file, I mean, your "index.php" and only if the user isn't loggedin. if(!$user->isLoggedin()) { echo $modules->get("MarkupGoogleRecaptcha")->getScript(); }
  25. Hi @sebr You have to install the Process module called ProcessDuplicator. You can find it in the menu Modules > Install > ProcessDuplicator then once installed, you will find the module under Setup > Duplicator or click the link <eye-icon> Package Manager in Duplicator.
×
×
  • Create New...