Jump to content

User Management


ocr_b
 Share

Recommended Posts

Hi,

i will build a small site with around ~100 users.
they will have an account page with details like address etc and are able to edit pages like change text and do uploads etc.
i want to use the  formbuilder pro module for all kind of editing they have to do.
i wonder: how do you manage the users in processwire?
• would you modify the user template so it can hold the information? — or make a new page called accounts, with children-pages for each user, which are then connected to the pw-user?
• the users should never see the processwire backend, would you then use the pw-login and redirect them, or build your own login?
• any other advices, best practises?

looking forward to read your thoughts! thanks!

Link to comment
Share on other sites

First of all, I would recommend reconsidering your approach. ProcessWire's built-in admin is quite user-friendly, and building essentially the same thing on your own sounds like a lot of effort that you could use for something more beneficial. Not to mention that you'll have to be pretty careful to avoid any permission related issues etc. – all in all not something I would recommend unless you've got a really good reason for it.

The answers to your questions, if you still choose to go this route, would depend on your needs: do you have multiple types of users with different fields, or are they all the same? What will these users edit – their own profile page, or something else? If it's their profile page, should it be publicly viewable? If not, how are you planning to control access – on a page by page basis, or based on groups, or something else entirely?

ProcessWire supports multiple parents/templates for user pages, so that might be something you could look into: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users.

Hope this helps a bit.

  • Like 3
Link to comment
Share on other sites

Thanks for the feedback.

I wasn't quiet clear about what the user has to do, because I didn't want to give too much unnecessary information and bother with your time ?
The website is more like an application, where there are 3 types of users, and everything is hidden behind a login (or create account): reseller, admin and production. the reseller is able to order assets. the admin is able to upload assets and the production will receive those assets. also there will be email notifications after successful actions.
pages will have a different output to which user-role is visiting it. e.g. "orders" page: reseller – sees only what he ordered, admin – sees all, production – sees all, and also can change the production status.
Also dedicated designs for every page.

— so i thoughts its easier to build a frontside site and use the formbuilder, rather then redesigning and hooking with modules into the backend. 

thanks also for the link, i must have missed this update and will have a look.

any more feedback is welcome.

 

Link to comment
Share on other sites

1 hour ago, ocr_b said:

— so i thoughts its easier to build a frontside site and use the formbuilder, rather then redesigning and hooking with modules into the backend. 

I think you are wrong ?

Bringing custom functionality into your PW backend is simpler than you might think:

The benefit is that you have ALL the features of PW built in, as @teppo already mentioned. You can build things like this:

You should also have a look at RockGrid, if you want to show tabular data:

 

PW is great for building backend applications. The only part that is not so clean/easy is how you handle migrations/upgrades. But that would not be different if you chose to build a custom frontend GUI for your users rather than using PW's backend.

I had the same desicion to take before I started with my CRM and I'm really, really happy that I chose to stay in the PW backend.

  • Like 2
Link to comment
Share on other sites

thanks for you reply.
i really do consider working with the backend.

i didn't think its hard to bring in the functionality, i am concerned about the outcome dealing with my custom design.
what i loved about processwire, when i changed some years ago, was that you do not have to strike down code you didn't wrote, but can modularly build up your own template, simple and easy. your crm looks really powerful, but the design is mostly the one from the pw-backend.
my design doesn't look like this at all, so i would have to tweak the complete admintheme(uikit), which doesn't even have a css preprocessor (does it?), going into code i didn't wrote. if i would decide for a frontend application i would just have to write the ui for what i have there, while tweaking the admintheme may break something, because css classes overlap. (what i hate is to get a template [for example wordpress] and have to change some "minor" things, these sometimes taking much longer then just rebuild everything with pw)

hard to tell for me how this turns out, maybe i am wrong, maybe right. i think i will follow your lead and do it with the backend.

 

Link to comment
Share on other sites

1 hour ago, ocr_b said:

i didn't think its hard to bring in the functionality, i am concerned about the outcome dealing with my custom design.

That's a different topic then, so you might be right ?? 

You can see this thread how @Noel Boss developed his theme and a new question that I asked right now: 

 

It might also be possible to build a custom theme easily by replacing the _main.php file of the uikit admin file. You can try that out by copying the AdminThemeUikit folder to the /site/modules folder, then refresh your modules und tell PW to take the /site/modules version of the uikit admin theme. Then you can use a _main.php file like this:

<body class='<?php echo $adminTheme->getBodyClass(); ?>'>

	<div class="uk-text-center uk-padding" style="border: 5px solid red;">
		this is a demo header
	</div>
	<div uk-grid>
		<div class="uk-width-auto uk-padding" style="outline: 5px solid green;">
			this is a demo sidebar
		</div>
		<div>

			<!-- MAIN CONTENT -->
			<main id='main' class='pw-container uk-container uk-container-expand uk-margin uk-margin-large-bottom'>
				<div class='pw-content' id='content'>
					
					
					<div id='pw-content-body'>
						<?php
						echo $page->get('body');
						echo $content;
						echo $adminTheme->renderExtraMarkup('content');
						?>
					</div>	
					
				</div>
			</main>

		</div>
	</div>

	<?php
	echo $adminTheme->renderExtraMarkup('body');
	?>
</body>

screencapture-themeboss-test-admin-page-edit-2019-01-04-11_07_59.thumb.png.80c7ad23ac91399ef7c2526f89690ba0.png

So I still think that building a wrapper around the pw admin will be a lot easier than building a GUI for the frontend on your own. Think of repeater inputs, file inputs with AJAX, security, CSRF and multi-post prevention, session handling, tabs, sidebar panel / modals, input validation and and and...

PS: Just tried the upgrades process module, it looks like this:

yobKILC.png

And the hello world process module:

J4tKB6S.png

It does not show the warning and error messages - so this approach needs some tweaking, but it's a good first step and I'd be happy to see what you come up with!

  • Like 1
Link to comment
Share on other sites

you really know every post in this forum. i am so impressed ? 
no really, i am impressed...
thanks for another good hint.

i will take your advice and after i finished the work i will come back here and tell you how it went and what i did, maybe somebody else will find a solution in this too.
:) thanks!

Link to comment
Share on other sites

2 hours ago, ocr_b said:

i am concerned about the outcome dealing with my custom design.

 

2 hours ago, ocr_b said:

so i would have to tweak the complete admintheme(uikit), which doesn't even have a css preprocessor (does it?)

 

You can mod everything from your taste using LESS or SASS. You can also make a complete new theme (I am for example building one based on the Bulma Framework).

 

1078722488_Capturedecran2019-01-04a11_40_34.thumb.png.c0c3f039c9cfa33369b5c846492b8a4c.png

 

Another screen of an actual AdminTheme based on UiKit and Boss

1156523513_Capturedecran2019-01-04a11_57_13.thumb.png.f5a7cca12f2ceb4eedaba8c4bbed23c4.png

 

Check this theme/thread and readme :  

https://github.com/ryancramerdesign/AdminThemeUikit

 

 

 

edit: beaten by @bernhard ?

ping @Pixrael ?

Edited by flydev
screenshot / ping
  • Like 1
Link to comment
Share on other sites

14 minutes ago, ocr_b said:

you really know every post in this forum. i am so impressed ? 

5fDM6Ug.png

? 

6 minutes ago, flydev said:

You can mod everything from your taste using LESS or SASS. You can also make a complete new theme (I am for example building one based on the Bulma Framework).

6 minutes ago, flydev said:

edit: beaten by @bernhard ?

Not really, your approach seems to be a bit different? Would love to get some more insights ? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...