Important announcements from CouchCMS team
80 posts Page 2 of 8
Previous 1, 2, 3, 4, 5 ... 8 Next
Thanks for the new Couch goodies, KK! Maybe you can help with a problem I'm having. When a user is updating their profile, I want to show error messages inline. Like so:
Code: Select all
<label>E-mail 
    <cms:if k_error_extended_user_email ><span class="error_msg"><cms:show k_error_extended_user_email /></span></cms:if>
    <cms:input name='extended_user_email' type='bound' />
</label>

When I do a variable dump in the form, the variable 'k_error_extended_user_email' doesn't exist, although the error itself is listed in the 'k_error' variable.

Is there a reason that variable can't be accessed in the normal way? And is there a method for showing extended user errors in line?
@Tim,

That seems to be a corner-case with DataBound Form addon.

I am attaching a modified file. Please overwrite the existing file of the same name with this version in couch/addons/data-bound-form

Do let me know if this helps.

Thanks for reporting the problem.

Attachments

Yes, the patch fixed the issue. Thanks, Tim
Hi KK,

Looks very neat !

Still one question comes to mind ... how about Redactor Editor ?

Thanks again !
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Hi Tom :)
.. how about Redactor Editor ?
Coming up in part 2 of this release.
About the separate handling of errors I confirm that they are not working in 'login.php'. So,
Code: Select all
<cms:if k_error ><cms:show k_error /></cms:if>

works but
Code: Select all
<cms:if k_error_k_user_name >Wrong login for auth</cms:if>

doesn't. I usually use not error messages but classes like
Code: Select all
<cms:input type="text" name="message" required="1" class="<cms:if k_error_message>mistake</cms:if>" />

But this time it doesn't work... The patch haven't helped. Some ideas would be appretiated,
Thanks

UPD: After some thinking I realized that that was made for compitibility with old login screen, so no need to modificate module, I'll just use
Code: Select all
<cms:if k_error >
<script>
var loginInput = document.getElementById("k_user_name"),
passwordInput = document.getElementById("k_user_pwd");
loginInput.className = loginInput.className + " error";
passwordInput.className = passwordInput.className + " error";
</script>
<div class="error"><cms:show k_error /></div>
</cms:if>
Hi Musman,

The patch won't work as it was concerned with DataBound Form - something that login-form does not make use of.

The cms:process_login tag used by the login-form piggybacks on the native login procedure and behaves exactly like that. It is by design that the login procedure reports a single very generic error message "Invalid username or password" on login failure instead of specifying whether it was the 'name' or the 'password' that was wrong. This is following standard security guidelines to confound intruders.

The error messages are configurable from the lang file in use (by default couch/lang/EN.php)
Following is a complete list of error messages that can be thrown on login failure
Code: Select all
$t['prompt_cookies'] = 'Cookies must be enabled to use this CMS';
$t['prompt_username'] = 'Please enter your username';
$t['prompt_password'] = 'Please enter your password';
$t['invalid_credentials'] = 'Invalid username or password';
$t['account_disabled'] = 'Account disabled';

Only one error message gets reported at a time, so the best way is to have a single error DIV somewhere above the login form to show the error.

Hope this helps.
Thanks, I see, it's better for security. Anyway, ExtMembers gives us so much possibilities that my head is full of new ideas, thank you for this great contribution!
Just tried to upgrade and followed the steps. However, keep getting an

Could not successfully run query: Duplicate column name 'creation_ip' error.


Any way to sort this? Would like to upgrade really :)
@Steve, that is very strange and unexpected.

Could you please grant me FTP+Couch admin access to your site? I'd like to get to the bottom of this.

Thanks.
Previous 1, 2, 3, 4, 5 ... 8 Next
80 posts Page 2 of 8

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