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

Admin Panel User Management Demo - CodeIgniter + AdminLTE Theme
http://cias.codeinsect.com
GNU General Public License v3.0
337 stars 240 forks source link

No way for users to change their email #58

Closed philipmcdonnell closed 5 years ago

philipmcdonnell commented 5 years ago

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?

kishor10d commented 5 years ago

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

Thanks a lot for suggestion.

philipmcdonnell commented 5 years ago

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.

kishor10d commented 5 years ago

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

kishor10d commented 5 years ago

@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.

philipmcdonnell commented 5 years ago

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

kishor10d commented 5 years ago

@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: https://github.com/kishor10d/Admin-Panel-User-Management-using-CodeIgniter/commit/94d650a8ac6c2c2efa4521128bab2adeca35c294

philipmcdonnell commented 5 years ago

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.

kishor10d commented 5 years ago

@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.

kishor10d commented 5 years ago

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