Forum

Thread tagged as: Question, Forum, Members

Perch Members

Hi all,

Is there any way for my members to login and be able to update their account details?

Can I also change the Perch Members app to allow me to store additional information on their accounts?

Cheers!

Conor Harkins

Conor Harkins 0 points

  • 4 years ago

Yes to both questions. The default templates which shipped with members app has all this functionality in them (as working example).

Have you had a look at those examples?

I can put you a couple samples together.

Are you using Perch or Runway?

Hi Robert.

Any help you can provide is greatly appreciated. I am using Perch.

Conor, Have you installed the members app, and is it working? Can you tell me what you currently have working about the app.

Did you copy the templates from the app into perch templates?

Members is a pretty powerful app, and setup while fairly easy, can sometimes be a challenge. For this reason I always setup and test with the default sample files, then once I know it's all working I build it into my own pages.

So just give me a run down on what you have so far.

Last, could you please post your diagnostics report, just so we know your setup.

I have completed the setup and everything is working great. Just looking to add some more functionality. I have copied the templates.

How do I acquire the diagnostics?

Is this what you are looking for?

Perch: 3.0.8
Production mode: Production (100)
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_events (1.9.5), perch_forms (1.9.1), perch_members (1.6.1), perch_mailchimp (3.1)
DB driver: PDO
DB tables: perch3_categories (0), perch3_category_counts (0), perch3_category_sets (2), perch3_content_index (1053), perch3_content_items (187), perch3_content_regions (12), perch3_events (1), perch3_events_categories (0), perch3_events_to_categories (0), perch3_forms (1), perch3_forms_responses (5), perch3_mailchimp_campaigns (0), perch3_mailchimp_imports (0), perch3_mailchimp_lists (1), perch3_mailchimp_subscribers (5), perch3_mailchimp_subscriptions (5), perch3_mailchimp_webhooks (1), perch3_members (2), perch3_members_forms (1), perch3_members_member_tags (2), perch3_members_sessions (1), perch3_members_tags (1), perch3_menu_items (15), perch3_navigation (0), perch3_navigation_pages (0), perch3_page_templates (1), perch3_pages (9), perch3_resource_log (48), perch3_resource_tags (0), perch3_resources (13), perch3_resources_to_tags (0), perch3_settings (33), perch3_shop_addresses (0), perch3_shop_admin_index (0), perch3_shop_brands (0), perch3_shop_cart (1), perch3_shop_cart_data (0), perch3_shop_cart_items (0), perch3_shop_countries (250), perch3_shop_currencies (152), perch3_shop_customers (0), perch3_shop_emails (1), perch3_shop_index (0), perch3_shop_option_values (0), perch3_shop_options (0), perch3_shop_order_items (0), perch3_shop_order_promotions (0), perch3_shop_order_statuses (9), perch3_shop_orders (0), perch3_shop_orders_meta (1), perch3_shop_product_files (0), perch3_shop_product_option_values (0), perch3_shop_product_options (0), perch3_shop_product_tags (0), perch3_shop_products (0), perch3_shop_promotions (0), perch3_shop_sales (0), perch3_shop_search (0), perch3_shop_shipping_zone_countries (0), perch3_shop_shipping_zones (0), perch3_shop_shippings (0), perch3_shop_tax_exhibits (0), perch3_shop_tax_group_rates (0), perch3_shop_tax_groups (0), perch3_shop_tax_locations (1), perch3_shop_tax_rates (0), perch3_shop_variants (0), perch3_user_passwords (0), perch3_user_privileges (77), perch3_user_role_privileges (2), perch3_user_roles (2), perch3_users (1)
Users: 1
App runtimes: 
<?php
    $apps_list = [ 'perch_forms', 'perch_members', 'perch_mailchimp', 'perch_events'
    ];
Scheduled tasks for perch_mailchimp: import_data (1 mins)
Editor plug-ins: 
H1: 4c0316e3f909ad1bce2c2bc264fd593a
L1: 0e8ea16a30d89f5f84bb04532e039dc5
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7 
headerColour: #b9e1e9
content_singlePageEdit: 1
helpURL: 
perch_members_update: 1.4
hideBranding: 1
content_collapseList: 1
lang: en-gb
installedAt: 3.0.8
update_3.0.8: done
latest_version: 
on_sale_version: 3.0.9
headerScheme: light
siteURL: /
dashboard: 1
hide_pwd_reset: 1
keyboardShortcuts: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
content_skip_region_list: 0
logoPath: /perch/resources/a-care-logo-1.jpg
perch_mailchimp_campaign_url: /mailchimp/campaign/{campaignSlug}
perch_events_update: 1.8
perch_mailchimp_api_key: 06abffa6459ec6853c95e5bc49d49324-us16
perch_mailchimp_secret: 6cebc66
perch_events_detail_url: 
perch_shop_price_tax_mode: inc
perch_shop_product_url: /shop/products/{slug}
perch_shop_default_currency: 47
perch_shop_reporting_currency: 47
perch_shop_invoice_number_format: Invoice%d
perch_shop_update: 1.2.3
perch_members_login_page: /acnew/login
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: fz2d7e2l
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: fz2d7e2l_CMS
PERCH_DB_PREFIX: perch3_
PERCH_TZ: UTC
PERCH_EMAIL_FROM_NAME: Conor Harkins
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/fz2d7e2l/public_html/perch
PERCH_CORE: /home/fz2d7e2l/public_html/perch/core
PERCH_RESFILEPATH: /home/fz2d7e2l/public_html/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_DEBUG: 1
PERCH_DEFAULT_BUCKET: ../../uploads
PERCH_MEMBERS_SESSION_TIME: 1 HOUR
PERCH_RUNWAY: 
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED: 
PERCH_STRONG_PASSWORDS: 
PERCH_ASSET_VERSION: 5163d57ff611b3cf853b
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/fz2d7e2l/public_html/perch/templates
PERCH_TEMPLATE_FILTERS: 
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_XHTML_MARKUP: 
PERCH_RWD: 1
PERCH_HTML_ENTITIES: 
PERCH_SSL: 
PERCH_STRIPSLASHES: 
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID: 
PERCH_FORCE_SECURE_COOKIES: 
PERCH_TRANSLATION_ASSIST: 
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS: 
PERCH_PRIV_ASSIST: 
PERCH_CUSTOM_EDITOR_CONFIGS: 
PERCH_AUTH_PLUGIN: 
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT: 
PERCH_DB_SOCKET: 
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown
Hosting settings
PHP: 5.6.31
Zend: 2.6.0
OS: Linux
SAPI: litespeed
Safe mode: not detected
MySQL client: 5.6.35
MySQL server: 5.6.35-cll-lve
Free disk space: 1.31 TB 
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, litespeed, bcmath, dom, gd, imap, json, exif, mcrypt, mysql, mysqli, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, soap, sockets, xmlreader, xmlwriter, zip, mhash
GD: Yes 
ImageMagick: No
PHP max upload size: 128M
PHP max form post size: 128M
PHP memory limit: 128M
Total max uploadable file size: 128M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
PATH: /usr/local/bin:/usr/bin:/bin
HTTP_ACCEPT: text/html, application/xhtml+xml, image/jxr, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-GB
HTTP_CONNECTION: Keep-Alive
HTTP_COOKIE: PHPSESSID=6fuko3dquc862fe6hok3enhte0; cmsa=1
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393
UNIQUE_ID: WaCCnLkCBHAAAyrjfIUAAAAy
SCRIPT_URL: /perch/core/settings/diagnostics/
SERVER_SOFTWARE: Apache
SERVER_PORT: 80
REMOTE_ADDR: 31.53.217.199
DOCUMENT_ROOT: /home/fz2d7e2l/public_html
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /home/fz2d7e2l/public_html
SCRIPT_FILENAME: /home/fz2d7e2l/public_html/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 60520
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1503691420.3373
REQUEST_TIME: 1503691420

In upper right of admin is "settings" then on left is a tab "diagnostics" copy and paste the resulting report.

Got it!

perch_member_form('profile.html')

Will allow you to update a profile

Any new fields you want to add to a member will have to be added to:

perch/templates/members/member.html

Awesome! Do you have any specific examples for this purpose? I wouldn't even know how to use perch_member_form('profile.html').

Do I need to modify any databases or does it perform this automatically?

Did you copy the "members" directory from the downloaded app to /perch/members?

As all the examples are in that directory. If you go to domain.com/members/index.php you should see the example page.

Ok, so...

I found the template for updating the profile..

<perch:form id="profile" method="post" app="perch_members">

    <div>
        <perch:label for="first_name">First name</perch:label>
        <perch:input type="text" id="first_name" required="true" label="First name" />
        <perch:error for="first_name" type="required">Please add a your name</perch:error>
    </div>

    <div>
        <perch:label for="last_name">Last name</perch:label>
        <perch:input type="text" id="last_name" required="true" label="Last name" />
        <perch:error for="last_name" type="required">Please add a your name</perch:error>
    </div>

    <div>
        <perch:label for="email">Email</perch:label>
        <perch:input type="email" id="email" required="true" placeholder="you@company.com" />
        <perch:error for="email" type="required">Please add a your email address</perch:error>
        <perch:error for="email" type="format">Please check a your email address</perch:error>
    </div>

    <div>
        <perch:input type="submit" value="Save" />
        <perch:input type="hidden" id="token" />
    </div>

    <perch:success>
        <p>Your details have been updated.</p>
    </perch:success>

</perch:form>

Although this doesn't seem to do anything with me. This is the debug

Debug Message - Perch 3.0.8 
[1]
SELECT * FROM perch3_members_sessions WHERE sessionID='4a59d5aa9fa761d6dd81b84eda88105c63ab4e9d' AND sessionHttpFootprint='b427fd106abd012bfb000f2d8f22520e41102d6d' AND sessionExpires>'2017-08-25 20:42:55' LIMIT 1
User is logged in
[1]
SELECT * FROM perch3_pages WHERE pagePath='/acnew/staff-portal.php' LIMIT 1
[33]
SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
------------------------------ here mem ------------------------------
Array
(
    [all] => profile
)
[2]
SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/acnew/staff-portal.php' OR regionPage='*' ORDER BY regionPage DESC

On another note would anyone know of a way for me to allow members to login using their date of birth and email address initially? They would then be forced to set a password. Then they would sign in as normal using email and password. I would like to create accounts for them all but not have to set a password for them but rather have them do this themselves after they receive an automated email from the system.

Conor Harkins said:

On another note would anyone know of a way for me to allow members to login using their date of birth and email address initially? They would then be forced to set a password. Then they would sign in as normal using email and password. I would like to create accounts for them all but not have to set a password for them but rather have them do this themselves after they receive an automated email from the system.

You will not be able to change to anything other then email for username. You can have them register password less, but to then to get back in the next time they will have to do a password reset. In password less registration perch sets up the user with a blank password and logs the user in, once the session ends the user would need to reset password to login again. (If I remember correctly)

Just have a registration form that replicates your requirements.

Your members can set the password themselves when they register. You can then make the new member require approval by admin before they can do anything else.

Ok. Scrap that. It was just an idea.

Anyone know why my profile update form doesn't appear to work? Debug is above with the form template.

Drew McLellan

Drew McLellan 2638 points
Perch Support

[all] => profile

You're hitting a validation error on the form.

What do you mean by a validation error? I just copied and pasted the form as it is in the template..

Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like either the member isn't logged in when this form is processed, or the CSRF tokens don't match. So the form isn't being processed.

Ok. So I know that the user is logged in because the user is me. So, how would I go about solving the other thing you mentioned?

Drew,

I am having the same problem ([all] => profile) How do you know this is a validation error?

Regards, Patricia