Problems, need help? Have a tip or advice? Post it here.
17 posts Page 1 of 2
Hello Couchies!
I am learning Extended Users, and I got stuck following the example from the instruction page. Namely, when i add my custom regions in users/index.php I see them fine in the administration panel.

But I do not get the regions shown in the manual. Below is the image. I tried to define them all manually in users/index.php, but yet - all stays the same in the administration panel, as in the left sided image...
So, can anyone help me? What am I missing?
Thanks in advance
Tanja

Image
Hi Tanja,

Quoting from the docs on extended-users (https://www.couchcms.com/docs/extended- ... s/post.htm), once the users/index.php template is registered, following two steps are required for the new fields to appear in the native user accounts -
At this point, we have our user template ready but one last step remains before we can use to create/extend user accounts.
You'll find a file named 'config.sample.php' within 'couch/addons/extended/' folder. Rename it to 'config.php'.
Open it up in your text editor and specify the name of our user template (i.e. 'users/index.php') as value of the 'users_tpl' setting as follows


Before:
Quote:
// Names of the required templates
$t['users_tpl'] = '';
$t['login_tpl'] = '';
$t['lost_password_tpl'] = '';
$t['registration_tpl'] = '';

After:
Quote:
// Names of the required templates
$t['users_tpl'] = 'users/index.php';
$t['login_tpl'] = '';
$t['lost_password_tpl'] = '';
$t['registration_tpl'] = '';

Please note that registering all our templates (except users/profile.php) is a two-step procedure -
1. the usual registeration involving visiting the template as super-admin though the browser.
2. specifying the template in couch/addons/extended/config.php file.

V.IMP: please make sure that you specify a template's name in the config file only after the template has been registered with Couch (i.e. its name appears in the admin-panel's sidebar).

Finally it's time to see the 'extended' module in action.

Visit 'users/index.php' as super-admin one last time for it to pick up the change we made to the config file above.
Create a cloned page from our 'users/index.php' template.
You'll see that it displays some editable regions that are not defined in the template

I have highlighted the steps.
Are you sure you have done that?

Please let me know.
HI KK, yes, here is the code from couch/addson/extended/config.php

Code: Select all
    // Names of the required templates
    $t['users_tpl'] = 'users/index.php';
    $t['login_tpl'] = 'users/login.php';
    $t['lost_password_tpl'] = 'users/lost-password.php';
    $t['registration_tpl'] = 'users/register.php';


and I have completely logged in and out, and now I see, that I see these regions but in the administration-users....and the cloned users from unsers/index.php stays the same

Tanja
Just thinking now, maybe something is messed up, because this is my testing web space, where I all the time make and delete things... I will reinstall COUCH and do it all from the beginning, and will come back with the result....
Thanks again !
Tanja
Hello Couchies,

my issue persists. I reinstalled Couch freshly, did step by step : uploaded the user folder, registered first the users/index.php and and than the users/register.php within the couch/addons/extended/config.php..
Code: Select all
$t['users_tpl'] = 'users/index.php';
    $t['login_tpl'] = '';
    $t['lost_password_tpl'] = '';
    $t['registration_tpl'] = 'users/register.php';

previously I enabled addons in couch/addons/kfunctions.php
Code: Select all
require_once( K_COUCH_DIR.'addons/extended/extended-users.php' );
require_once( K_COUCH_DIR.'addons/cart/session.php' );
require_once( K_COUCH_DIR.'addons/data-bound-form/data-bound-form.php' );

and what I get is again the same:
New registered user, registers both within the clonable template of users/index.php and within the Administration Users. But only within the Admin Users I see the fields, so as they are shown in the instruction picture in previous post.
Any idea why I get that so?

Thanks in advance!
Tanja
Hi Tanja,

I had a look at your setup (thanks for the creds) and found absolutely nothing amiss.

The core fields (e.g. email. password, repeat password) are showing up in users/index.php as expected (remember, you have not defined these fields in this template).

To test the vice-versa, I took the liberty of defining an editable region (named 'test_field') in 'users/index.php'. After visiting the modified template as super-admin, this region showed up in the 'users/index.php' cloned pages - more importantly, this field also showed up in the core user accounts. You may check.

So, as far as I can see, things are working as expected.

I suppose you were expecting something else. Could you please elaborate exactly what that was?

Thanks.
Hi KK! Thanks a lot for having a look!
Obviously I do not understand something...
Well, I was expecting that new users will be registered only within the template that I named "MITGLIEDER", and that was created when I registered users/index.php with Couch...

Just now, I registered a new user thought users/register.php. And what I get is one new user within "Mitglieder" without all expected fields, as well as one new user within Administration Users...
Shouldn't a new registered user appear only once?

Or, is the users/index.php (in my example template title "MITGLIEDER") meant to be hidden, and not to be used for managing clients? meaning all the clinets should be managed through Administration Users Section, and this users/index.php just has a function to communicate something to the Couch?
If this is the case - how can one recognize on the first glance the Super-Administrators? Shouldn't they be somehow separated (at least visually) from the rest of the many users?

thanks,
Tanja

p.s. what is also confusing for me, when registering from register.php, user name looks like this "fcfbf3b89659d6d7715f2eac45a4267b"
The 'extended-users' addon uses a normal Couch template (the one you named 'MITGLIEDER') to achieve two things -

1. *add* custom fields to the core user accounts (e.g. the 'test_field' I mentioned in the previous post - you may add any number and types of fields).

2. make it possible to create user accounts from the front-end. Actually we create a normal cloned page but that also results in a counter-part core account being created.

So, in a way, the user/index.php's cloned pages and the core user accounts have become one - modify any of the two and the other also gets modified automatically.

If the presence of two sections showing essentially the same data is confusing you, you may make the 'users/index.php' hidden and use only the core users section for managing the accounts. However, this template (as opposed to the core users section) makes it somewhat easier to deal with the custom accounts as it displays them by their titles, allows them to be sorted, shows creation date etc (after all, these are normal cloned pages).

So, my advice would be that you simply make a mental note that for every account being shown in users/index.php, there necessarily will be an associated user account in the users section also. (trust me, those are pretty docile and not known to have bitten anyone (so far) :) ) Just ignore those in the core 'users' section and use the index template section for managing accounts created from the frontend.

For the admin/super-admin accounts, use the core 'users' section as always. Which brings me to your other question -
If this is the case - how can one recognize on the first glance the Super-Administrators? Shouldn't they be somehow separated (at least visually) from the rest of the many users?
In the core 'users' section, the super-admins would always be listed at the very top, followed by the 'admins' and then rest of the accounts. The accounts created from the frontend, in any case, would be distinguishable by their random names (e.g. 700c4df99d2419f4e2138dfb94b88697).

So this should not be a problem at all.

Hope this helps in making things a bit clearer.
HI KK, thanks a lot for clarifying that!!! Could you please clarify something more? :oops:

Why do we have the regions in cloned user pages (made of users/index.php) and in the core user accounts named differently? For hopefully my lesser :? confusion, I will name pages made of users/index.php, just "users/index.php", in the next sentences....
Why is Title in the users/index.php renamed or remapped in DisplayName in the core accounts? And why Name to Username ? Even though I find Username and what appears in the core user accounts to be more straightforward terms. I just realize that naming them differently adds to my confusion....

And, how can I explain to my clients, why we have members in two places? I can imagine they would ask me "What do I do with this one and what I do with the another listing?"...

In user/index.php email and password seem to be editable regions (extended_user_password etc)… in the core user account that seems to be a Couch variable k_email, k_password, k_password2… Are they exchangeable in the use in some other scenarios, for alert message after sending registration mail, for example?

Than, in the website I make, there are some older members who do not have e-mail address, and should be able to loggin - because there will be a member Area only for members....How would it be possible to solve this with one Login Form? And, even though I decided today, there is no need that members register themselves, how could that theoretically be solved, to login with the Username, because they are so complicated string of numbers? Or should in that case the administrator or the user be advised to change their username to an easier one, for the purpose of Logging in?

And one more question please: is it possible to have an extra Login-page for administrators and extra one for members? Because, as far as I understand, either the original Couch Login page shows up (that I would like to preserve for Administrators), either the users/loing.php - that replaces the Couch page....

:oops: It seems I have some more questions
- I am planning to use CVS importer to import the existing members list. I tried the tutorial files with cars and that was functioning perfect...Am I there on the right track? Changing headers in CVS and in couch file and making analogous changes in the car example files?

- Is there a way to export a list, something like a CVS exporter that can be done by Administrators, from Couch back end? I am thinking for using this export to import them to Mail Chimp?

- Just theoretically - I do not need that in reality now: is it possible with Couch to have some kind of alert message, every-time when a one-year membership expires, so that administrators do not have to check that manually?

Thanks in advance!!!

Tanja
- I am planning to use CVS importer to import the existing members list. I tried the tutorial files with cars and that was functioning perfect...Am I there on the right track?

Yes, mind that passwords will be reset unless you have them stored somewhere. Upon importing, set a dummy password for a new user, then in a separate loop use the code from lost-password.php to invoke password-reset procedure. Users will receive an email with a new password, generated by Couch.

- Is there a way to export a list, something like a CVS exporter that can be done by Administrators, from Couch back end? I am thinking for using this export to import them to Mail Chimp?

You can take a sample of format, accepted by 3rd party site and mimic that format by listing data with <cms:pages /> as usual. There is no need to have a special export function. <cms:template hidden='1' access_level='10' .. > would make template only for superadmin. Viewing it in browser, it may display any required data -
Code: Select all
<cms:pages masterpage=k_user_template  ><cms:show k_page_title />;<cms:show extended_user_email />;</cms:pages>


- Just theoretically - I do not need that in reality now: is it possible with Couch to have some kind of alert message, every-time when a one-year membership expires, so that administrators do not have to check that manually?

Couch can send emails. Set up a cron job in hosting's settings to access a certain template once a day/week. Upon being accessed, a simple code can filter pages which expiration date is less than certain amount of days and send an email to admins with list of such users.
Code: Select all
<cms:pages masterpage=k_user_template custom_field="expiration<='<cms:date '+1 week' format='Y-m-d H:i:s' />'' >,
where 'expiration' is your editable of type='datetime'
17 posts Page 1 of 2

Who is online

In total there are 5 users online :: 1 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: Exabot [Bot] and 4 guests