hberg539
Members-
Posts
12 -
Joined
-
Last visited
Everything posted by hberg539
-
Oh, you are right. I really had an error of thought with my example of iteration over 100.000 posts. The unique identifier (email address) reduces the selection to only one entry, so the ->matches() method really is no problem here. It seems i had a dangerously low level of coffeine while writing this. Thanks for the explanation.
-
Let's assume there are 100.000 entries and each login, you have to call the ->matches() method for each of the 100.000 entries. Wouldn't it be faster to just search the database with the correct hash? However, it is working the way you mentioned it. Thanks!
-
Maybe i don't get it, but the user input isn't stored in a page. My user input comes from $input->post, and this value needs to be hashed/salted. Then the hashed/salted user input is put into the selector. Like: $hashed_password = magic_hash_function($input->post->password); $res = $pages->find("template=xxx,email=$sanitized_user,password=$hashed_password"); if ($res->count() >= 1) { echo "user/pass combination found, valid login"; }... Or do you mean i should store the user input from $input->post temporarly in a page just to receive the hash/salt? Thanks :-)
-
Yes, i don't use the user template or any user management from processwire. How do i generate the hash of the password? ? When in the admin panel, the hash generation is done by the field itself: Thank you.
-
Thanks. It works this way, but i need to iterate over all the pages and compare each with the user input (using the ->match() method). In the good old sql way, i would do something like "select * from pages where user = 'xxx' and password = '<hashed_password>'"; In the Find-Page of the admin interface, the password-field is detected as "subfield" and i can choose between the field itself or "salt". Have a look here: It doesn't find the result, although the password is correct. I need some way to generate the "data" or the salted version of the password, but i just don't know how.
-
Thanks flydev, but your link handles the password with the processwire user management (as far as i see it), which i don't want to use. I just have a template with a password field which i would like to compare against a plaintext user input.
-
Hello, how can i compare a stored password (InputfieldPassword) with a selector? E.g.: $pages->find("template=test,user=abc,password=<hash>"); How can i create that hash from the user input? Or should i just put the plain-text password here? PS: I don't want to use the processwire user module (would be overkill for my usage). Thanks. Best regards, Kevin
-
There are really many options with processwire I will try / go with the simplest version (just a page for each door access) and see how it works out. Thank you for all the recommendations!
-
The actual size of the database doesn't matter that much, but the speed in how the data can be accessed matters. Zeka, is there any difference in speed with option 1. and 2.? wbmnfktr, i try to answer some of the questions you mentioned: The data is for history reasons (who opened the door where and at what time) and the data should be stored at least half a year. After that, the data can be truncated or be archived to an csv file. I project around 120.000 logging entries per month. Charts should be created (e.g. door access activitiy in the last 30 minutes). Processwire will provide an API to the door access system, so each door access request will be controlled by processwire. I'm currently a beginner in processwire (but really do like it), so a simple solution which doesn't result in a bad bottleneck one or two months later would be great. Thank you for your help.
-
Hello, i'm currently building an access control system where people can physically authenticate at a door with a dongle. If the user has access to a specific door, the door can be opened. Every access to a door should be logged with information about time, user and dongle. Normally, i would just create a mysql table and put the data in there. Of course the table can get quite large over time. Are there any best-cases for handling this type of data in processwire? Should i just create a template with fields like user, dongle, time and create pages for each authentication? And then search / select with proccesswire selectors? Thanks! Best regards, Kevin
-
Pagination create different markup for active link
hberg539 replied to hberg539's topic in General Support
Thanks, works like a charm. (The "currentLinkMarkup" Parameter is missing in the documentation: https://processwire.com/api/modules/markup-pager-nav/) -
Hello, i'm currently using this setup for my pagination: $results = $baustelle->children("limit=2"); $pagination = $results->renderPager(array( 'nextItemLabel' => "Next", 'previousItemLabel' => "Prev", 'listMarkup' => "<ul class='pagination mg-b-0'>{out}</ul>", 'itemMarkup' => "<li class='page-item {class}'>{out}</li>", 'linkMarkup' => "<a class='page-link' href='{url}'>{out}</a>", 'currentItemClass' => "active" )); echo $pagination; PW generates the following output (see the html-comment <!-- -->): <li class="active MarkupPagerNavFirst MarkupPagerNavFirstNum"> <a href="/test/"> <!-- different markup as in linkMarkup specified --> <span> 1 </span> </a> </li> <li class="MarkupPagerNavLastNum"> <a class="page-link" href="/test/page2"> 2 </a> </li> <li class="MarkupPagerNavNext MarkupPagerNavLast"> <a class="page-link" href="/test/page2"> Next </a> </li> </ul> Is this expected behaivor? How can i add the class "page-link" in the a-tag in the current active page? Thanks! Best regards, Kevin