Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/24/2017 in all areas

  1. So something like the following will do the trick. users = $users->find('email*=@mail.ru');
    2 points
  2. Merry Christmas and Happy Holidays to everyone! This week and next week are shortened here due to reduced school and work schedules for the holidays (as I imagine they are in most places), so there won't be a new blog post and PW version for today. With the kids home from school all day, work shifts to building stuff with legos rather than code. But there are still several interesting PW updates in progress and I look forward to writing about them in next week's blog post. The new version (3.0.87) and related blog post will likely be a day early next week (on Thursday) rather than on Friday. Thanks for reading and I hope that you and your families have a great and relaxing holiday!
    1 point
  3. Happy holidays, merry Christmas.
    1 point
  4. There is another idea I am using on the project I am working on. Admitting its a PHP script : Put the script in a secure place on your server outside the public html Check if the script is run from CLI : if(php_sapi_name() !== ‘cli’) mylog('unauthorized access from IP xxx...'); Check the IP and allow only the script to be run from localhost: if($_SERVER['REMOTE_ADDR'] !== '127.0.0.1') mylog('unauthorized access from IP xxx...'); Use a GET "sekret" variable and generate/update it each X time: if($_GET['sekret'] !== 'mysuperlongsekretkeyupdatedfromtimetotime') mylog('unauthorized access from IP xxx...'); ForceLogin the user responsible to execute this job in PW and finalize the task Hope it help.
    1 point
  5. Best wishes to you and all your family!
    1 point
  6. Yeah, that was my idea first, too. Then I remembered the token field. But you can force login a user with the other approach. I think in this case the token is not really useful since you have to authenticate manually on every request anyway. The token is a prevention of CSRF attacks: https://de.wikipedia.org/wiki/Cross-Site-Request-Forgery. As I understand it correctly, it ensures that any potentially harmful request to the server is really made by you, the person using the website/app, and not someone else who might have tricked you to send a bad request. Any request is only executed if it includes the correct tokens. @monchu Mh, then it depends. I would not recommend this approach, because you would have to put the credentials into the script, since you cannot (don't want to) ask for name and password every time. I guess putting plain text passwords into scripts is not so cool. ;P But yes, it is “possible”. Otherwise, a simpler way would be to use a “supersecret-obfuscated-url”—while keeping in mind that this is just security by obscurity and in fact the url will be public. It might be just fine if the content is not “classified”-secret but just “it just should not be so easy to find”-secret. Make sure to exclude the pages from any sitemaps, etc. ... If you have some admin/ssh access to the server you could use scp (scp?, download file with scp) - using ssh authentication. Or any kind of secure command thing. sftp? Maybe even curl. Not sure ... I think it depends on what you want to achieve. Btw. I would like to put a little disclaimer here, that I am by no means a security expert - these are just pieces of my humble knowledge and please regard all of it just as hints for further own research! Anyone with profound knowledge is invited to complement and/or correct
    1 point
  7. $users = $pages->find("template=user, role=spammer, field=value ..."); foreach($users as $u) { // don't use $user $u->delete(); } https://processwire.com/api/ref/page/delete/
    1 point
  8. Users are also stored as pages, so most API methods/variables apply here too. See the docs: https://processwire.com/api/variables/user/ and / or the PW cheatsheet: http://cheatsheet.processwire.com/
    1 point
  9. I am trying to sort a PageArray by a Page field. Since I want the sort to be based on the Page field's Title field, I am using a subselector: $this->pages->get('template=People')->children("sort=location_select.title, limit=30"); The error I get is: Error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'example._sort_page_location_select_title.data' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /examplepath/wire/core/PageFinder.php line 384) Removing the subselector results in the same error as well, though sorting by any field that is not a Page field seems to work fine.
    1 point
  10. @desbest to start I want to create websites that are database driven like yellowpages.com. I hope that is specific enough.
    0 points
×
×
  • Create New...