Important announcements from CouchCMS team
148 posts Page 8 of 15
Previous 1 ... 5, 6, 7, 8, 9, 10, 11 ... 15 Next
I want members to be able to stay logged in for future sessions (a 'remember me' or 'stay logged in' feature) using cookies. Is it possible to set the user's login state and level aftef a querying a cookie, without forcing the user to log in on every visit?

David
Hello David,

The 'login.php' template (in the zip attached to the first post of this thread) already has a 'Remember me' option that does what you mentioned.

Hope this helps.
I am currently working on one website that should have both members module and couch cart incorporated. Basically the buying functionality should only be given to loged in users.

Design is done, my next step was to do the members module(I've done couch cart a few times in the past).

Then I saw @musman comment on the sixth page of this thread, that says that the module is not working well with couch cart?

Can anyone confrm this?


Edit: Also, why when visiting the register.php template I get "ERROR! Unknown tag: "get_flash""?
Shouldn't the registration form be displayed?

Damn me and my designer brain, I can't even figure out these simple things :)
@madebym,
I can't see why members module wouldn't work with CouchCart (musman is right about it not working with comments, though).

As for the missing 'get_flash' error - please enable either of the following two in addons/kfunctions.php (i.e. remove the leading double-slash)
Code: Select all
//require_once( K_COUCH_DIR.'addons/cart/session.php' ); 
//require_once( K_COUCH_DIR.'addons/cart/cart.php' ); // automatically includes session
Thanks KK. Guess I misunderstood @musman's comment :)

Just one thing please, after this I believe I will be good on my own. I want to display the products only if the user is loged in, else I want to display login/register box.

Is this the correct setup, have I maybe omitted something?

Code: Select all
      <cms:member_check_login />
      <cms:if k_member_logged_out >
         <div class="please-login">
              <cms:form method="post" anchor='0'>
            <cms:if k_success >
                <!--
                    The 'member_process_login_form' tag below expects fields named
                    'member_name', 'member_password' and (optionally) 'member_remember'
                -->
                <cms:member_process_login_form />
               
            </cms:if>
           
            <cms:if k_error >
                <h3><font color='red'><cms:show k_error /></font></h3>
            </cms:if>
           
           
            Username (your email): <br/>
            <cms:input type='text' name='member_name' /> <br/>
           
            Password: <br />
            <cms:input type='password' name='member_password' /> <br/>
           
            <!-- if 'remember me' function is not required, the following checkbox can be omitted -->
            <cms:input type='checkbox' name="member_remember" opt_values='Remember me=1' /> <br/>
           
            <input type="submit" value="Login" name="submit"/>
        </cms:form>
       
        <!-- optionally display links for 'Create account' and 'Lost password' -->
        Not signed up yet? <a href="<cms:link k_member_registration_template />" />Create an account here.</a> <br>
        Forgot your password? <a href="<cms:link k_member_lost_password_template />" />Click here.</a>
       </div>
      </cms:if>
<cms:if k_member_logged_in >
<!-- Here I am listing the products -->
</cms:if>
It'd be better if you use a separate template for login.
Your code then will become simply as follows -
Code: Select all
<cms:member_check_login />

<cms:if k_member_logged_out >
     <cms:redirect "<cms:member_login_link />" />
</cms:if>

<!-- List the products here as only logged-in users would reach this line of code -->
Thanks, that makes more sense. I'll buy the licence for the domain tomorrow, in case I would need more support :)
I have two things I need to make this addon perfect:

    - When an admin creates a new member, the member should be emailed saying that an account has been created and list their login details. The password they are provided would ideally be an auto generated password, or at the very least be a random password that the admin manually typed in.
    - Next, the first time the member logins in, they should be forced to change their password.

Is this at all possible? Thanks for the awesome script by the way!
Hi KK

I am using this module and it help me a lot & works fine.

But I have two questions

can I move members/login.php to couch/snippets folder, so I can use login form on the specific page like Index.php, about.php etc. Is there any another way to do this?

I edit addons/member/config.php as
Code: Select all
  // Names of the required templates
    $t['members_tpl'] = 'portfolio.php';
$t['login_tpl'] = 'couch/snippets/login.php';
$t['lost_password_tpl'] = 'members/lost-password.php';
$t['registration_tpl'] = 'members/register.php';


and also move and edit couch/snippets/login.php first line like this
Code: Select all
<?php require_once( '../couch/cms.php' ); ?>


But it not working.

My 2nd question is that, is there any way to stop member registration with same email id ? if possible please guide me .
@BlueCaret - points noted. Thank you.

@Subhamoy - please don't confuse 'snippets' with 'templates'. Templates are what appear in the admin-panel sidebar and what can be accessed via browser by using their names in URL e.g. http://www.yoursite.com/login.php

Think about it - you wouldn't want it to be http://www.yoursite.com/couch/snippets/login.php

I think what you want is to show a login box as part of a different page (e.g. in the sidebar of index.php etc.). Is that right? Please let me know.

My 2nd question is that, is there any way to stop member registration with same email id ?
This is enforced by default. Emails are unique and the addon will refuse to create an account for an existing email.
Previous 1 ... 5, 6, 7, 8, 9, 10, 11 ... 15 Next
148 posts Page 8 of 15

Who is online

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

Users browsing this forum: No registered users and 2 guests

cron