Comments (15)
I've added ajax validation support. You may check it now
from user-management.
I also already did it. But thanks anyway!
from user-management.
AJAX validation breaks CAPTCHA. It always incorrect. See yiisoft/yii2#6115
from user-management.
I fixed it, you may check it now.
Thank you for details on this issue
from user-management.
hmmm, don't worked. AJAX response always empty JSON []
from user-management.
You are submitting a list of attributes is wrong in ActiveForm::validate($model, $validateAttributes);
from user-management.
replace
$validateAttributes = $model->attributes;
unset($validateAttributes['captcha']);
with
$validateAttributes = $model->activeAttributes();
$key = array_search('captcha', $validateAttributes);
array_splice($validateAttributes, $key, 1);
AJAX validation be fixed!!! But in registration form after submit mark login red and show error _Something went wrong_
from user-management.
hmmm, registration worked with my changes. but you have error with check email when insert DB record. I'll see it tomorrow if you do not get better.
TIP: may be in form validation you check email as email confirmed? But in insert check email in excisting email and does not check for this mail confirmed? In form check validation ok, on insert error.
P.S. Sorry for my english:)
from user-management.
see activerecord insert function. in if !$this->validate($attributes) always true. see model validate function it execute function hasErrors and problem here.
from user-management.
i found problem.
how to reproduce:
- register user
- try register another user but with the same email
You got message "Something went wrong". if debug you see E-mail "[email protected]" has already been taken
Model use yii\validators\UniqueValidator for email. It's wrong. While email is not confirmed, you can register any number of users with the same email.
And I forgot to say, i make registration form with email, but without confirmation. How to make after registration sent email with confirmation?
Hacker could register a user with a victim email. Owner (victim) with this email no longer be able to register on the site.
from user-management.
I don't know how you implement it in your custom registration form, but you can check how I implemented email validation in User class.
/**
* Check that there is no such confirmed E-mail in the system
*/
public function validateEmailConfirmedUnique()
{
if ( $this->email )
{
$exists = User::findOne([
'email' => $this->email,
'email_confirmed' => 1,
]);
if ( $exists AND $exists->id != $this->id )
{
$this->addError('email', UserManagementModule::t('front', 'This E-mail already exists'));
}
}
}
from user-management.
Maybe i make reg form wrong. Please make exmaple (i ask it in #12)
from user-management.
I find solution. In User model you set
['email', 'unique'],
['email', 'validateEmailConfirmedUnique'],
first validation (unique) is not necessary (wrong)!
from user-management.
I've also started making example in https://github.com/webvimark/user-management/wiki/Registration-with-E-mail-as-login-and-required-confirmation (in progress - don't use as example yet).
So I'm closing issue and will leave feedback in in #12 when it's ready
from user-management.
Hi, I just had my first encounter with the captcha issue in webvimark user management module. @TomskDiver, you're right. the validation keeps returning []. Workaround is this
$validateAttributes = $model->attributes;
unset($validateAttributes['captcha']);
return ActiveForm::validate($model,$validateAttributes);
Change last line above to
return ActiveForm::validate($model,array_keys($validateAttributes));
from user-management.
Related Issues (20)
- access based on time HOT 1
- Model overwriting HOT 1
- how to stop auto logout? HOT 3
- Is this repository discontinued? HOT 2
- migration failed... HOT 4
- PHP 7.3 compact() issues an E_NOTICE level error HOT 1
- only one login per device can active in one time
- mySQL errors
- DB error when overwriting table names
- How to disable captcha on user registration?
- Migration not working for OCI HOT 2
- hasRole() function doesnt work with children roles
- GhostAccessControl::rules does not exist
- How to combine ghost-access with custom permissions
- $throwException is missing HOT 2
- Issue with Unchecked Routes in Permissions
- PHP Notice on permissions save for PHP 7.4 HOT 3
- Broken Link in FAQs section HOT 1
- Password recovery HOT 1
- compact(): Undefined variable: throwException while saving permission
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from user-management.