diff --git a/swad_ID.c b/swad_ID.c index 1490b3272..cb5dced98 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -361,20 +361,14 @@ void ID_WriteUsrIDs (struct UsrData *UsrDat,bool ICanSeeUsrID) void ID_PutLinkToChangeUsrIDs (void) { extern const char *Txt_Change_IDs; - extern const char *Txt_User_not_found_or_you_do_not_have_permission_; /***** Link for changing the password *****/ - if (Pwd_CheckIfICanChangeOtherUsrPassword (Gbl.Usrs.Other.UsrDat.UsrCod)) - { - if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me - Act_PutContextualLink (ActFrmUsrAcc,NULL, - "arroba",Txt_Change_IDs); - else // Not me - Act_PutContextualLink (ActFrmIDsOthUsr,Usr_PutParamOtherUsrCodEncrypted, - "arroba",Txt_Change_IDs); - } - else - Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); + if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me + Act_PutContextualLink (ActFrmUsrAcc,NULL, + "arroba",Txt_Change_IDs); + else // Not me + Act_PutContextualLink (ActFrmIDsOthUsr,Usr_PutParamOtherUsrCodEncrypted, + "arroba",Txt_Change_IDs); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index c4fe2434b..bd5a6021f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.107.3 (2015/04/02)" +#define Log_PLATFORM_VERSION "SWAD 14.107.4 (2015/04/03)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 14.107.4: Apr 03, 2015 Fixed bugs when changing user's ID, password and photo. (183699 lines) Version 14.107.3: Apr 02, 2015 Changes in icons in attendance events. Fixed bug in assignments. (183702 lines) Version 14.107.2: Apr 02, 2015 Changes in icons in surveys. (183717 lines) diff --git a/swad_enrollment.c b/swad_enrollment.c index 5a59f1391..10f11e51d 100644 --- a/swad_enrollment.c +++ b/swad_enrollment.c @@ -2833,7 +2833,7 @@ static void Enr_ShowFormToEditOtherUsr (void) fprintf (Gbl.F.Out,"
"); if (Pwd_CheckIfICanChangeOtherUsrPassword (Gbl.Usrs.Other.UsrDat.UsrCod)) { - ID_PutLinkToChangeUsrIDs (); // Put link (form) to change user's IDs + ID_PutLinkToChangeUsrIDs (); // Put link (form) to change user's IDs Pwd_PutLinkToChangeOtherUsrPassword (); // Put link (form) to change user's password } if (Pho_CheckIfICanChangeOtherUsrPhoto (Gbl.Usrs.Other.UsrDat.UsrCod)) diff --git a/swad_password.c b/swad_password.c index 58468e4b0..9857914ab 100644 --- a/swad_password.c +++ b/swad_password.c @@ -814,14 +814,13 @@ void Pwd_PutLinkToChangeMyPassword (void) void Pwd_PutLinkToChangeOtherUsrPassword (void) { extern const char *Txt_Change_password; - extern const char *Txt_User_not_found_or_you_do_not_have_permission_; /***** Link for changing the password *****/ - if (Pwd_CheckIfICanChangeOtherUsrPassword (Gbl.Usrs.Other.UsrDat.UsrCod)) + if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me + Pwd_PutLinkToChangeMyPassword (); + else // Not me Act_PutContextualLink (ActFrmPwdOthUsr,Usr_PutParamOtherUsrCodEncrypted, "key",Txt_Change_password); - else - Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); } /*****************************************************************************/ diff --git a/swad_photo.c b/swad_photo.c index af6caf3bd..febec6a4e 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -152,13 +152,11 @@ void Pho_PutLinkToChangeMyPhoto (void) { extern const char *Txt_Change_photo; extern const char *Txt_Upload_photo; - bool PhotoExists; /***** Link for changing / uploading the photo *****/ - PhotoExists = Gbl.Usrs.Me.MyPhotoExists; Act_PutContextualLink (ActReqMyPho,NULL, - "photo",PhotoExists ? Txt_Change_photo : - Txt_Upload_photo); + "photo",Gbl.Usrs.Me.MyPhotoExists ? Txt_Change_photo : + Txt_Upload_photo); } /*****************************************************************************/ @@ -173,10 +171,15 @@ void Pho_PutLinkToChangeOtherUsrPhoto (void) char PhotoURL[PATH_MAX+1]; /***** Link for changing / uploading the photo *****/ - PhotoExists = Pho_BuildLinkToPhoto (&Gbl.Usrs.Other.UsrDat,PhotoURL,true); - Act_PutContextualLink (ActReqUsrPho,Usr_PutParamOtherUsrCodEncrypted, - "photo",PhotoExists ? Txt_Change_photo : - Txt_Upload_photo); + if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me + Pho_PutLinkToChangeMyPhoto (); + else // Not me + { + PhotoExists = Pho_BuildLinkToPhoto (&Gbl.Usrs.Other.UsrDat,PhotoURL,true); + Act_PutContextualLink (ActReqUsrPho,Usr_PutParamOtherUsrCodEncrypted, + "photo",PhotoExists ? Txt_Change_photo : + Txt_Upload_photo); + } } /*****************************************************************************/