Jump to content
Kai

Can ProcessWire do this? (User Management, Profiles, Search)

Recommended Posts

Hi everyone, I want to start a new project that is community-based and would like to use PW for that. 

Some of the requirements: 

User management

  1. User sign up by email, google, linkedin, facebook
  2. User management by admin
  3. each user gets a profile page
  4. each user can define his own custom URL for his profile page
  5. users can password protect their profiles
  6. anti-spam: Flag button for profiles, track number of login attempts then block
  7. users can specify arbitrary user fields (!) (self-defined) - I did this once in another framework by a meta-table: "userid | title | value" 

Search

  1. users can find other users,
  2. search must index all user fields 

Misc

  1. Logging of all users events (e.g. user A accessed profile of user B, user C logged in, user D got blocked by admin, etc.)
  2. all pages via https 
  3. Let's imagine there would be 100 000 users - Will it still be fast enough?

 

Can ProcessWire fulfill all those requirements?

 

Share this post


Link to post
Share on other sites

Hi Kai, I don't see any requirements here that is not manageable by ProcessWire, the only limit will be knowledge of PHP.

 

4 hours ago, Kai said:

User management

  1. User sign up by email, google, linkedin, facebook
  2. User management by admin
  3. each user gets a profile page
  4. each user can define his own custom URL for his profile page
  5. users can password protect their profiles
  6. anti-spam: Flag button for profiles, track number of login attempts then block
  7. users can specify arbitrary user fields (!) (self-defined) - I did this once in another framework by a meta-table: "userid | title | value" 

1. You could implement OAuth easily with 3rd party libraries or integrate each provider's API into ProcessWire.

2. You can manage users by using API and/or by playing with roles, permissions into ProcessWire backend.

3. Yes - very easy, for example, you can just use "pages" and page filedtype for relations.

4. Yes - by playing with urlSegments.

5. Yes - you can implement this feature easily + there are one or two modules which might help you to achieve that.

6. Yes - you have to implement it.

7. Yes - by using the API .

 

Quote

Search

  1. users can find other users,
  2. search must index all user fields

1. Yes

2. Yes

 

4 hours ago, Kai said:

Misc

  1. Logging of all users events (e.g. user A accessed profile of user B, user C logged in, user D got blocked by admin, etc.)
  2. all pages via https 
  3. Let's imagine there would be 100 000 users - Will it still be fast enough?

1. Yes (hooks come to my mind).

2. No problem at all.

3. From what I've read on the forum, I want to say : superfast. (ProCache)

 

Quote

Can ProcessWire fulfill all those requirements?

O0

  • Like 8
  • Thanks 1

Share this post


Link to post
Share on other sites

Is Admin > Access > Users really able to handle potentially hundreds of users? It seems designed for a small number of site admins and editors - you can't sort them by name or last registered etc.

Is there a way to separate members/newsletter subscribers from the small team of site admin/editor users? Store members under a separate page maybe? But how would you then manage roles and access etc.?

 

 

Share this post


Link to post
Share on other sites

This is directly from demo.processwire.com, I'm sure the lister filters are enough to manage not only a small number of users.

screencapture-demo-processwire-admin-access-users-1488968165361.png

  • Like 1
  • Sad 1

Share this post


Link to post
Share on other sites
2 hours ago, modifiedcontent said:

It seems designed for a small number of site admins and editors - you can't sort them by name or last registered etc.

Quite the contrary - the lister can handle virtually any number of users with ease. Click column headers to sort, add new columns on the "Columns" tab.

Share this post


Link to post
Share on other sites

We have ListerPro's with 10.000's of pages (some up to 80.000 pages and counting) displaying 25 fields. Just make sure to limit/paginate around 50 or 100. Still quite fast (around 3 seconds loading time). This includes all kinds of Markup changes. So I would say: yes ^_^

  • Like 7

Share this post


Link to post
Share on other sites

OK, I didn't get you can sort by column headers. And what about separating roles? Is it possible to get a list of only 'members', without admins, guests and editors mixed in?

Share this post


Link to post
Share on other sites
5 hours ago, modifiedcontent said:

And what about separating roles? Is it possible to get a list of only 'members', without admins, guests and editors mixed in?

It's all right there if you look...

2017-03-11_103629.png.b6465d43dbaabf32b1b0ce13601e5fac.png

Share this post


Link to post
Share on other sites
14 hours ago, modifiedcontent said:

Is it possible to get a list of only 'members', without admins, guests and editors mixed in?

You can filter users out by all sorts of rules, but you cannot easily create additional user listers like you could for plain pages with ListerPro. Sadly there aren't any bookmarks for the users lister as well, where one could save often used filters. I hope Ryan will add those some time.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, LostKobrakai said:

you cannot easily create additional user listers like you could for plain pages with ListerPro

@LostKobrakai, you can create custom user listers with ListerPro. They appear under "Pages" by default but you can move the page to be under "Access" and it seems to work fine there. You can also create bookmarks for that custom user lister, but not bookmarks for the built-in users lister (which would be nice).

 

Share this post


Link to post
Share on other sites

You can certainly create your own custom user listers with ListerPro, but it's neither adviced nor praticable, because the ProcessUser module does handle a lot of the permission issues regarding user pages, which those custom lister pages of ListerPro won't handle. 

Share this post


Link to post
Share on other sites
46 minutes ago, LostKobrakai said:

You can certainly create your own custom user listers with ListerPro, but it's neither adviced nor praticable, because the ProcessUser module does handle a lot of the permission issues regarding user pages, which those custom lister pages of ListerPro won't handle.

You mean if you are giving roles other than superuser access to to user management? I haven't looked into that a lot, but with a quick test it seems like once you give your "user manager" role edit access to the user template and configure the user-admin permissions for the role, the access to edit user pages is the same through the custom lister as through the default users lister (i.e. they cannot edit users they do not have the permission for). But you have probably investigated this more thoroughly.

Share this post


Link to post
Share on other sites
User management
  1) each user gets a profile page
  2) each user can define his own custom URL for his profile page

Sorry to hijack, but this is something I'm interested in but can't see how this works in PW. When they log in, they go to a profile page rather than the admin tree page? How is it done? Whenever I create a new user in testing, when I log in with their, the admin page is always the destination.

Share this post


Link to post
Share on other sites
On 3/11/2017 at 1:26 PM, SamC said:

Sorry to hijack, but this is something I'm interested in but can't see how this works in PW. When they log in, they go to a profile page rather than the admin tree page? How is it done? Whenever I create a new user in testing, when I log in with their, the admin page is always the destination.

That is what happens in the backend (you're logging in to the admin), but you can create your own frontend login procedure as well (completely from scratch or with the FrontendUser module). In that case, you control where the user gets redirected to.

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, BitPoet said:

That is what happens in the backend (you're logging in to the admin), but you can create your own frontend login procedure as well (completely from scratch or with the FrontendUser module). In that case, you control where the user gets redirected to.

Ok, I see now, so people who register on a site never get to see the admin area. This part was confusing me, I thought people always went to the page tree after login. Guess I've still got a lot to learn.

 

 

Share this post


Link to post
Share on other sites

@SamC, I usually do what @BitPoet suggests and create custom login and profile edit forms for the front-end if the user only needs to edit their profile (or some other single page). But there are a few modules and snippets around that take the approach of creating a custom dashboard in the PW admin for users with non-superuser roles and redirecting them to that when they log in rather than the page tree. Here are a couple of links, and just search for "dashboard" to find more:

http://modules.processwire.com/modules/process-dashboard/

 

  • Like 1

Share this post


Link to post
Share on other sites

It depends. I'm actually regretting going that path for an application of mine, because it pushes so many if/else conditionals in your controllers/view layer, which could otherwise be handled by a single user class as part of the application domain. But it really depends on how separated your user types are in the application.

Edit: Also different user templates don't allow users to be of multiple of those user types.

  • Like 2

Share this post


Link to post
Share on other sites

check out my module subscriber for some implementation of how you might add users and profiles but without giving them access to the PW "admin". Also note that I'm looking to give this module an overhale soon as it presumes ALOT of the developer using it currently.

Share this post


Link to post
Share on other sites
On 9/19/2016 at 12:59 PM, flydev said:

Hi Kai, I don't see any requirements here that is not manageable by ProcessWire, the only limit will be knowledge of PHP.

 

1. You could implement OAuth easily with 3rd party libraries or integrate each provider's API into ProcessWire.

2. You can manage users by using API and/or by playing with roles, permissions into ProcessWire backend.

3. Yes - very easy, for example, you can just use "pages" and page filedtype for relations.

4. Yes - by playing with urlSegments.

5. Yes - you can implement this feature easily + there are one or two modules which might help you to achieve that.

6. Yes - you have to implement it.

7. Yes - by using the API .

 

1. Yes

2. Yes

 

1. Yes (hooks come to my mind).

2. No problem at all.

3. From what I've read on the forum, I want to say : superfast. (ProCache)

 

O0

Awesome Reply...  @flydev

Just wanted to add a side-query to OP. Below is a situation :-
#. Once a new user logged in, this user can see list of current Online Users.  ( I have seen this feature mainly in Forums websites / Social N/W sites )
Can we do this in PW ?

  • Thanks 1

Share this post


Link to post
Share on other sites

You can do it to the degree forums do it. Like track users activity somewhere in a database whenever communication happens and take some amount of timeout at which you consider a person without activity offline. What you cannot easily do is online users to the degree you would expect it from e.g. a chat platform, where you actually want to detect if someone is leaving without waiting 15 minutes and without them needing to communicate to your server constantly. This is the realm of websockets. I may be biased, but if you want a really proper (and scalable) solution for that problem take a look at: https://dockyard.com/blog/2016/03/25/what-makes-phoenix-presence-special-sneak-peek

  • Like 3

Share this post


Link to post
Share on other sites
On 1/30/2019 at 3:15 AM, jmartsch said:

@JeevanisM Please take a look at https://processwire.com/docs/security/sessions/. With Database-driven sessions you can monitor live traffic on your site.

thanks a lot bro

On 1/29/2019 at 10:22 PM, LostKobrakai said:

You can do it to the degree forums do it. Like track users activity somewhere in a database whenever communication happens and take some amount of timeout at which you consider a person without activity offline. What you cannot easily do is online users to the degree you would expect it from e.g. a chat platform, where you actually want to detect if someone is leaving without waiting 15 minutes and without them needing to communicate to your server constantly. This is the realm of websockets. I may be biased, but if you want a really proper (and scalable) solution for that problem take a look at: https://dockyard.com/blog/2016/03/25/what-makes-phoenix-presence-special-sneak-peek

thanks a lot bro

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MateThemes
      Hello everyone!
      I am trying to add my repeater matrix fields to the search selector, but unfortunately nothing seems to work for me.
      I have following search code in my search.php:
      <?php namespace ProcessWire; // look for a GET variable named 'q' and sanitize it $q = input()->get('q'); // sanitize to text, which removes markup, newlines, too long, etc. $q = sanitizer()->text($q); // did $q have anything in it after sanitizing to text? if($q) { // Make the search query appear in the top-right search box. // Always entity encode any user input that also gets output echo '<input id="search-query" value="' . sanitizer()->entities($q) . '">'; // Sanitize for placement within a selector string. This is important for any // values that you plan to bundle in a selector string like we are doing here. // It quotes them when necessary, and removes characters that might cause issues. $q = sanitizer()->selectorValue($q); // Search the title and body fields for our query text. // Limit the results to 50 pages. The has_parent!=2 excludes irrelevant admin // pages from the search, for when an admin user performs a search. $selector = "title|body~=$q, limit=50, has_parent!=2"; // Find pages that match the selector $matches = pages()->find($selector); } else { $matches = array(); } // unset the variable that we no longer need, since it can contain user input unset($q); ?> <main pw-replace='main'> <?php include('./includes/_pageheadersearch.php'); ?> <div id='content-body' class='uk-section uk-section-large uk-section-large'> <div class='uk-container uk-container-small'> <?php // did we find any matches? if(count($matches)) { // yes we did, render them echo ukAlert(sprintf(_n('Found %d page', 'Found %d pages', $matches->count), $matches->count), "default", "check"); echo ukDescriptionListPages($matches); } else { // we didn't find any echo ukAlert(__('Sorry, no results were found'), "danger", "warning"); } ?> </div> </div> </main> I have tried to add my fields to the selector code (repeater_matrix.aboutsblock_repeaters.mytextfield) . But I didn't get any results.
      What I am doing wrong?
      Thanks for your help!
    • By Violet
      I've been trying to figure this out... It seems like I'm probably missing something really simple, but I'm still puzzled as to how to move forward with this. I'd appreciate any help or suggestions anyone can give.
      Aim: I'm trying to modify the default search template so that my search results come out sorted firstly with those which contain the search term in the title and secondly with those that contain it in the body.
      The basic code where I made sure everything was working first was:
       
      $selector = "title|body~=$q, template=BN-article|BN-infopage, sort=-published, limit=15"; // Find pages that match the selector $matches = $pages->find($selector); // did we find any matches? if($matches->count) { // yes we did $entries = $matches; include("./INC-main-blogroll-panels.html"); } It gave me the search results sorted by publication date, as I expected.
      Next I modified the first portion of the code by using the following to generate the matches as follows:
      $matchest = $pages->find("title~=$q, template=BN-article|BN-infopage"); $matchesb = $pages->find("body~=$q, template=BN-article|BN-infopage"); $entries = $matchest->and($matchesb); However, the problem is that $entries in my resultant displayed list did NOT start with those matches that were in the title first from $matchest. It seemed like $matchest->and($matchesb) sorted the resultant list its own way. This is even without the added complication of trying to use unique() afterward to remove duplicates - which appears to have its own default sort.
      Would anyone please point me in the right direction for what what I'm seeking to do? Thank you so much!
    • By Marcel
      Hey,
      I am about to use the tool Create Users Batcher. We have 450 users. When I tryed it with like 20 test users it worked but it took a while. Now my concerns are that 450 might be to stressful? Does anyone have experience with several hundreds of users? My thoughts are to split it in smaller goups and upload them one group after another.
      best wishes
      marcel
    • By BFD Calendar
      I'm getting an error from sending a search in the search box:
      "Notice: Trying to get property of non-object in /home/mekanoinsa/www/site/assets/cache/FileCompiler/site/templates/_func.php on line 45

      Fatal error: Uncaught Error: Call to a member function each() on null in /home/mekanoinsa/www/site/assets/cache/FileCompiler/site/templates/_func.php:49 Stack trace: #0 /home/mekanoinsa/www/site/assets/cache/FileCompiler/site/templates/search.php(42): renderNav(Object(ProcessWire\PageArray)) #1 /home/mekanoinsa/www/wire/core/TemplateFile.php(287): require('/home/mekanoins...') #2 /home/mekanoinsa/www/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #3 /home/mekanoinsa/www/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___render', Array) #4 /home/mekanoinsa/www/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #5 /home/mekanoinsa/www/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #6 /home/mekanoinsa/www/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #7 /home/mekanoinsa/www/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___renderPage', Array) #8 /h in /home/mekanoinsa/www/site/assets/cache/FileCompiler/site/templates/_func.php on line 49
      This is the code part in _func.php
      // markup for the text $programme = "{$item->stu_programme->title}"; $out .= "<div class='list'><div class='listtext'><span class='verdana_18_bold'><a href='$item->url'>$item->title</a></span><br><br><span class='verdana'><b>$programme</b><br>"; $out .= $item->workshops_list->each( "<font color='green'>| {title}</font>" ); // if the item has summary text, include that too if($item->summary) $out .= "<br><br>$item->summary"; // end markup for the text $out .= "</div>"; Weird, it doesn't happen all the time and I can't figure out what makes the difference....
    • By joe_ma
      Hello
      I tryed to modify the search template so as to search also descriptions of an upload field.
      $selector = "title|body|upload->description~=$q, include=hidden, limit=50"; That throws the following exception:
      Exception: Unknown Selector operator: '' -- was your selector value properly escaped?
      So how is this correctly done?
      Thanks.
×
×
  • Create New...