pwFoo
Members-
Posts
708 -
Joined
-
Last visited
Everything posted by pwFoo
-
I had some problems with templateFile class as template system inside a module. Tried it that way: $tpl->filename = $feu->getTpl('profile'); Works fine at PW template files, but doesn't work inside a module/ class. Get it working with setFilename in the end... $tpl->setFilename($this->getTpl('profile')); So I think setFilename should be the way to do it (right)?
-
Ok, link to the first lines of code... But be patient with me! I'm a newbie and without any development experience I know code have to be cleaned up and commented soon... Module tested to login, logout and register users with basic forms / templates. https://bitbucket.org/pwFoo/frontendusers/src
-
Update Module FrontendUsers to handle login, logout, register and user profiles. backend related methods moved to the driver FrontendUsersPW (PW local users) so could be replaced with other user backends in the future... default templates/ views within the module directory overwrite default templates with custom code by place in templates/FrontendUsers/ (login.tpl.php, register.tpl.php) use form api and CSRF to build form fields use templateFile class to work with templates and render them ToDo optimize code add comments to code... add profile features user activation via email / activation code (https://processwire.com/talk/topic/4066-activate-user-account-via-email/) password reset via email (https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919) First try to build a module... work in progress
-
Modified my solution. So I need one module and a driver (first: local PW users). So backend could be changed with a new driver (for example to use forum users or ldap auth). I use forum snippets to build login / register / logout and also a user profile is planned. The PW template is used as controller and I start with default templates inside the module directory. If templates exist at PW template subfolder <MODULE NAME> that will be used. At the moment there isn't much code to share, but I'll need to build it for a own project. After base features are useable and a little code cleanup I can share it as module...
-
@Martijn Also thanks (and like) to you Your hint was correct, but I missed the second place to change it to Name ... my bad
-
Thanks Soma!!! Get it work with your screenshots, but one additional change needed... I have to add "name" to "Field to query for autocomplete", but also remove title! Found it at your third screenshot. "title name" doesn't work, but only "name" does it!
-
Hi Martijn, ok, good point. But not the solution PageListSelectMultiple works fine with title (default). PageAutocomplete input field type doesn't work with title, name or path...
-
Here my tested code which seems to work so far... $pages->find("id={$page->GroupRef}, template=Group")->find("UserRef={$user->id}")->count(); GroupRef = page field reference groups to the current page UserRef = page field reference pw users to groups (sadly PageAutocomple not supported for pw users?!) page tree page - content (GroupRef field) - group -- group1 (UserRef field) -- group2 (UserRef field) - admin -- access --- users ---- testUser Result: 0 = no reference chain 1+ one or more references If it works as expected it could be used to check access for current user to the current page (0 = denied, 1+ = allowed).
-
I set up a page field with parent of Admin -> Access -> Users but it doesn't work... Field saved successfully, but no match with page autocomplete module. Any idea why? Update Seems to be a PageAutocomplete bug. Works with PageListSelectMultiple. Any chance to get it Work with PageAutocomplete?
-
My first idea was something like that (pseudo code). $pages->get("$currentPage.groupRef, template = group")->find("$group.userRef = $currentUser", limit = 1) Get current page group references. Chained find() to select only groups with current user referenced. If true = access allowed. Good night
-
But I think also about frontend user managed groups. For example to build a G+ or FB like share feature. reference based access should be more flexible and simpler to use by frontend users.
-
Maybe I build a access control based on references Could be used in backend and also frontend via page references. Instead of add users to content I try to group users. That's why I need to check the reference chain . content -> group(s) -> user
-
Hi at all What's the best way to check a page reference chain like this: content (page) -> category/ group (page) <- user (page) It should be a simple access check. Users added to groups via page reference field. the groups added to content pages also with a page reference field. So far it's simple. How should a check the reference chain (also with a critical look at the performance...). In words: Is the user referenced to the content via one (or maybe more) group(s)? I think it should be possible with selectors, but don't know what's the best/ simplest way to do it. Regards pwFoo
-
Have found my way to try it Created two modules. A "proxy class" which loads an "driver class". The proxy pass-through method calls via __call() to the selected driver. The first driver will work with local PW users. Additional drivers could use another user backend to perform frontend register, login, logout... actions . So I wrap all actions into a driver to make it changeable.
-
Hello, I found some code examples to build a frontend user login. I thinking about a little module/ extension for it... but after some searching I've the question what could be the best way to do it... Login and logout already buildin with the following methods $session->login() $session->logout() API pages: http://processwire.com/api/variables/user/ http://processwire.com/api/variables/session/ How to create a new user or set a password found here http://processwire.com/api/variables/user/ So I need custum methods to register a new user, update password/ profile and reset a password. The needed code could be found here at the forum https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/page-2?hl=%2Bregister+%2Bconfirm#entry50183 https://processwire.com/talk/topic/4066-activate-user-account-via-email/ https://processwire.com/talk/topic/107-custom-login/?p=11290 ... But I think it's not needed to create a new class with all methods and so duplicate/ wrap already existing functions... Should I hook into session or user to add "missing" methods? How to addHook found here: http://processwire.com/api/hooks/#add_new_method https://processwire.com/talk/topic/1186-how-do-i-extend-user/?p=10507 It's my first try to build a pw / php module... so be forgiving my stupid questions
-
I'm interested in both Thinking about a way to notify users/ roles about changes. But maybe I use the example from adrian as starting point @adrian Thanks, I take a look at it.
-
Nice module Could you also implement page change notifications? So users could get a notification at each page update?
-
I don't know how much work it would be... Could You update your module to accept a page selector as parameter? Default should be the current page. So every page could be generated as pdf everywhere? Don't get me wrong! I like it as it is! But generate a pdf of a given page would be awesome
-
Hello, field type was float. It was a problem with the data import. Modified CSV, imported again and works fine with your hint, Roope! Thanks
-
@Roope But 8,80 or also 8.80 will be saved as 8... Like a integer instead of a float value... Any configuration problem? Would be great to store and get it like 8,80 or also 8,00. Because no calculation needed, I could use a text field. But it will be good to know for the future
-
Hi Wanze, thanks for your really fast reply That's what I thought und tried before my post Add "?pdf=1" to the wanted page link simple redirect me to that page, but not generate/ download the PDF... Also added code to both pages echo $modules->get('Pages2Pdf')->render(); and a link equal to your example. Quoted code (generate PDF from current page) works fine, but the custom link not... Maybe I miss something... or it doesn't work.
-
I need to save/ show prizes in Euro (€) input/ output format should be "11,90€" or "5,00€", but imported values (for example "8,8" or 8.8) are rounded integers ("9")? Should I convert it to a text field instead of float? Or what I've done wrong?
-
Hi Wanze, is it possible to generate a PDF from page A at page B? I try to build a download block with a page as pdf. To get the link also page A have to enabled as template which can create PDF files, but a modified link (path to page B) works only as redirect to the page and doesn't create the PDF download. Would be nice to set a page/ selector to create the PDF from Regards pwFoo
-
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
pwFoo replied to David Karich's topic in Modules/Plugins
Thanks David