kishor10d/Admin-Panel-User-Management-using-CodeIgniter

No way for users to change their email

philipmcdonnell opened this issue · 9 comments

I can see that the admin can change users email and other info, but why can't a user change it through their profile? Also admin can't change his email without going into PHPMyAdmin to do it?

@philipmcdonnell : Hello Philip, I done with the change you suggested. Please check my recent commit.

Thanks a lot for suggestion.

After updating with the new code, I can update the email address just fine, but your duplicate email check doesn't work. Looks like it is missing code somewhere, maybe controller? It should check when it updates the user either in the controller or the model to see and not just rely on javascript in case the user has it turned off.

@philipmcdonnell : Yes, you are correct. I will add server side validation for email duplication check. Still next commit, I keep this issue as open.

@philipmcdonnell : Hello Philip, Please check my latest commit. If you found this working, then we can close this issue. Let me know if you have more suggestions.

This is still not working, I will update later with what doesn't work on my end.

@philipmcdonnell : I am unable to understand, what scenario you are looking for.
I suppose following things.

  1. User cannot update email id if that email id is already exist in the database except his own.
  2. Using Client Side (JS validation)
  3. Using Server Side (CI validation - callback function)

Please following link for the committed changes in the repository:
94d650a

Just a follow up here, sorry for my delay. The update you did does in fact work, for some reason when I merged your update it didn't work on my side. Once I installed again from scratch it works fine. However, quick question is why are you adding javascript to check for things like email field, required field? It is built into bootstrap. For example a required password field can be added to the form like:

<input type="password" class="input-block-level" placeholder="Password" name="password" required />

This will cause bootstrap to check the field for you. Same with and email address, it will make sure the user enters a formatted email address.

@philipmcdonnell : I think, we cannot use bootstrap validator for custom validations. Such as checking of email exists, one text box depend on other type of validations. That's why I am using validation library. Its is also used for HTML5 editors like TinyMCE and ckEditor.

@philipmcdonnell : I think we have to close this issue because it is fixed.