Project

General

Profile

Bug #5543

Teacher and student can't change e-mail

Added by Stijn Michels almost 7 years ago. Updated almost 7 years ago.

Status:
Bug resolved
Priority:
Urgent
Assignee:
-
Category:
Users/Groups
Target version:
Start date:
27/09/2012
Due date:
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

In Chamilo 1.9 the user and the teacher can't change the e-mail. It says it saves, but it doesn't change in the database.
It's allowed in the Chamilo settings.


Files

Schermafbeelding 2012-09-27 om 23.40.03.jpg (24.2 KB) Schermafbeelding 2012-09-27 om 23.40.03.jpg Stijn Michels, 27/09/2012 23:42
Schermafbeelding 2012-09-27 om 23.40.13.jpg (17.4 KB) Schermafbeelding 2012-09-27 om 23.40.13.jpg Stijn Michels, 27/09/2012 23:42
profile.php (28.5 KB) profile.php Yoselyn Castillo, 28/09/2012 06:05

Associated revisions

Revision 279df974 (diff)
Added by Yannick Warnier almost 7 years ago

Restored changes from previous commit, merging with fix for refs #5543

History

#1

Updated by Yoselyn Castillo almost 7 years ago

I am verifying right now...

#2

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Yoselyn Castillo
#3

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Assigned to Needs more info
  • Assignee changed from Yoselyn Castillo to Julio Montoya

I confirm the bug, but I can't modify the email(it always appears unavailable) as a teacher even if i put the "allow users to change email with out password" to yes. Is this the administration option correct or i have to configure something else in order to edit the email?

#4

Updated by Yannick Warnier almost 7 years ago

  • Status changed from Needs more info to Assigned
  • Assignee changed from Julio Montoya to Yoselyn Castillo

There's another option (the first one in the administation panel > Configuration settings > Users) that asks which fields a user can modify in his own profile.
You have to enable the "e-mail" field there to make it available for update.
I sent a patch yesterday night about the same problem with the official code, but the e-mail field seemed to be managed well, so it's not exactly the same problem.

#5

Updated by Yoselyn Castillo almost 7 years ago

Well, i have tested several times with the administration settings you have talked to me and it works fine, it changes the email and ask user for password (depending on setting)in order to let user change the email.
I have tested in my local pc not in stable.chamilo.org
I will try it in stable.chamilo.org

#6

Updated by Stijn Michels almost 7 years ago

The options are set as described above.
The e-mail is not a required field.
There is one final option that needs attention 'Allow users to change email with out password' is set to 'yes'.
See also attachment.

#7

Updated by Yoselyn Castillo almost 7 years ago

I see... the bug happens when email is not a required field, otherwise it works fine. Checking..

#8

Updated by Yoselyn Castillo almost 7 years ago

  • File profile.php profile.php added
  • Assignee changed from Yoselyn Castillo to Julio Montoya
  • % Done changed from 0 to 80

It was a verification before changing email.Upload this file. It should be fixed

#9

Updated by Yannick Warnier almost 7 years ago

Yoselyn, please take more care not to delete someone else's changes with a commit:



hg diff -w profile.php 
diff -r f926c8c0320c main/auth/profile.php
--- a/main/auth/profile.php    Fri Sep 28 00:24:50 2012 +0200
+++ b/main/auth/profile.php    Fri Sep 28 01:56:02 2012 -0500
@@ -447,7 +447,7 @@
     $changeemail = '';

     //If user is sending the email to be changed (input is available and is not freeze )
-    if (api_get_setting('registration', 'email') == 'true' &&  api_get_setting('profile', 'email') == 'true') {        
+    if (api_get_setting('profile', 'email') == 'true') {        

         if ($allow_users_to_change_email_with_no_password) {            
             if (!check_user_email($user_data['email'])) {
@@ -606,9 +606,6 @@
             $sql = rtrim($sql, ',');
         }        
     }
// HERE THIS IS SOMETHING I ADDED YESTERDAY!! (removed by your commit)
-    if (api_get_setting('profile', 'officialcode') == 'true' && isset($user_data['official_code'])) {
-        $sql .= ", official_code = '".Database::escape_string($user_data['official_code'])."'";
-    }
     $sql .= " WHERE user_id  = '".api_get_user_id()."'";
     Database::query($sql);

It is very important to always do hg pull + hg update BEFORE you check a bug and apply new changes.

#10

Updated by Yannick Warnier almost 7 years ago

  • Status changed from Assigned to Bug resolved
  • % Done changed from 80 to 100

Also, Yoselyn, following coding standards (Coding conventions), you should really not use tabs, but rather 4 spaces (which I had done in this file, but obviously as you didn't have a synchronized version, you couldn't see it).

#11

Updated by Julio Montoya almost 7 years ago

  • Assignee deleted (Julio Montoya)

Also available in: Atom PDF