"
- "",
- ItsMe ? Txt_Remove_me_as_an_administrator :
- Txt_Remove_user_as_an_administrator);
- }
- else
- Lay_ShowErrorAndExit ("User doesn't exist.");
- }
-
-/*****************************************************************************/
-/*********** Remove an administrator from current institution ****************/
-/*****************************************************************************/
-
-static void Enr_EffectivelyRemAdmFromIns (struct UsrData *UsrDat)
- {
- extern const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_the_institution_Y;
- extern const char *Txt_THE_USER_X_is_not_an_administrator_of_the_institution_Y;
+ extern const char *Sco_ScopeAdminDB[Sco_NUM_SCOPES];
+ extern const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_Y;
+ extern const char *Txt_THE_USER_X_is_not_an_administrator_of_Y;
char Query[1024];
- if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,
- Sco_SCOPE_INSTITUTION,
- Gbl.CurrentIns.Ins.InsCod)) // User is administrator of current institution
+ if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,Scope,Cod)) // User is administrator of current institution/centre/degree
{
/***** Remove user from the table of admins *****/
sprintf (Query,"DELETE FROM admin"
- " WHERE UsrCod='%ld' AND Scope='Ins' AND Cod='%ld'",
- UsrDat->UsrCod,Gbl.CurrentIns.Ins.InsCod);
- DB_QueryDELETE (Query,"can not remove an administrator from an institution");
+ " WHERE UsrCod='%ld' AND Scope='%s' AND Cod='%ld'",
+ UsrDat->UsrCod,Sco_ScopeAdminDB[Scope],Cod);
+ DB_QueryDELETE (Query,"can not remove an administrator");
- sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator_of_the_institution_Y,
- UsrDat->FullName,Gbl.CurrentIns.Ins.FullName);
+ sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator_of_Y,
+ UsrDat->FullName,InsCtrDegName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
}
- else // User is not an administrator of the current institution
+ else // User is not an administrator of the current institution/centre/degree
{
- sprintf (Gbl.Message,Txt_THE_USER_X_is_not_an_administrator_of_the_institution_Y,
- UsrDat->FullName,Gbl.CurrentIns.Ins.FullName);
- Lay_ShowAlert (Lay_ERROR,Gbl.Message);
- }
- }
-
-/*****************************************************************************/
-/************* Remove an administrator from current centre *******************/
-/*****************************************************************************/
-
-static void Enr_EffectivelyRemAdmFromCtr (struct UsrData *UsrDat)
- {
- extern const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_the_centre_Y;
- extern const char *Txt_THE_USER_X_is_not_an_administrator_of_the_centre_Y;
- char Query[1024];
-
- if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,
- Sco_SCOPE_CENTRE,
- Gbl.CurrentCtr.Ctr.CtrCod)) // User is administrator of current centre
- {
- /***** Remove user from the table of admins *****/
- sprintf (Query,"DELETE FROM admin"
- " WHERE UsrCod='%ld' AND Scope='Ctr' AND Cod='%ld'",
- UsrDat->UsrCod,Gbl.CurrentCtr.Ctr.CtrCod);
- DB_QueryDELETE (Query,"can not remove an administrator from a centre");
-
- sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator_of_the_centre_Y,
- UsrDat->FullName,Gbl.CurrentCtr.Ctr.FullName);
- Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
- }
- else // User is not an administrator of the current centre
- {
- sprintf (Gbl.Message,Txt_THE_USER_X_is_not_an_administrator_of_the_centre_Y,
- UsrDat->FullName,Gbl.CurrentCtr.Ctr.FullName);
- Lay_ShowAlert (Lay_ERROR,Gbl.Message);
- }
- }
-
-/*****************************************************************************/
-/************* Remove an administrator from current degree *******************/
-/*****************************************************************************/
-
-static void Enr_EffectivelyRemAdmFromDeg (struct UsrData *UsrDat)
- {
- extern const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_the_degree_Y;
- extern const char *Txt_THE_USER_X_is_not_an_administrator_of_the_degree_Y;
- char Query[1024];
-
- if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,
- Sco_SCOPE_DEGREE,
- Gbl.CurrentDeg.Deg.DegCod)) // User is administrator of current degree
- {
- /***** Remove user from the table of admins *****/
- sprintf (Query,"DELETE FROM admin"
- " WHERE UsrCod='%ld' AND Scope='Deg' AND Cod='%ld'",
- UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod);
- DB_QueryDELETE (Query,"can not remove an administrator from a degree");
-
- sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator_of_the_degree_Y,
- UsrDat->FullName,Gbl.CurrentDeg.Deg.FullName);
- Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
- }
- else // User is not an administrator of the current degree
- {
- sprintf (Gbl.Message,Txt_THE_USER_X_is_not_an_administrator_of_the_degree_Y,
- UsrDat->FullName,Gbl.CurrentDeg.Deg.FullName);
+ sprintf (Gbl.Message,Txt_THE_USER_X_is_not_an_administrator_of_Y,
+ UsrDat->FullName,InsCtrDegName);
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
}
}
diff --git a/swad_text.c b/swad_text.c
index 47b2346d4..97e0852c0 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -7980,67 +7980,34 @@ const char *Txt_Do_not_show_again =
"Não mostrar novamente";
#endif
-const char *Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_the_centre_X = // Warning: it is very important to include %s in the following sentences
+const char *Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_X = // Warning: it is very important to include %s in the following sentences
#if L==0
- "¿Realmente desea dejar de ser administrador/a del centro %s?"; // Necessita traduccio
+ "¿Realmente desea dejar de ser administrador/a"
+ " de %s?"; // Necessita traduccio
#elif L==1
- "Do you really want to be removed as an administrator of the centre %s?"; // Need Übersetzung
+ "Do you really want to be removed as an administrator"
+ " of %s?"; // Need Übersetzung
#elif L==2
- "Do you really want to be removed as an administrator of the centre %s?";
+ "Do you really want to be removed as an administrator"
+ " of %s?";
#elif L==3
- "¿Realmente desea dejar de ser administrador/a del centro %s?";
+ "¿Realmente desea dejar de ser administrador/a"
+ " de %s?";
#elif L==4
- "Do you really want to be removed as an administrator of the centre %s?"; // Besoin de traduction
+ "Do you really want to be removed as an administrator"
+ " of %s?"; // Besoin de traduction
#elif L==5
- "¿Realmente desea dejar de ser administrador/a del centro %s?"; // Okoteve traducción
+ "¿Realmente desea dejar de ser administrador/a"
+ " de %s?"; // Okoteve traducción
#elif L==6
- "Vuole realmente essere rimosso come amministratore del centro %s?";
+ "Vuole realmente essere rimosso come amministratore"
+ " de %s?";
#elif L==7
- "Czy naprawde chcesz byc usuniety jako administrator centrum %s?";
+ "Czy naprawde chcesz byc usuniety jako administrator"
+ " %s?";
#elif L==8
- "Do you really want to be removed as an administrator of the centre %s?"; // Necessita de tradução
-#endif
-
-const char *Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_the_degree_X = // Warning: it is very important to include %s in the following sentences
-#if L==0
- "¿Realmente desea dejar de ser administrador/a de la titulación %s?"; // Necessita traduccio
-#elif L==1
- "Do you really want to be removed as an administrator of the degree %s?"; // Need Übersetzung
-#elif L==2
- "Do you really want to be removed as an administrator of the degree %s?";
-#elif L==3
- "¿Realmente desea dejar de ser administrador/a de la titulación %s?";
-#elif L==4
- "Do you really want to be removed as an administrator of the degree %s?"; // Besoin de traduction
-#elif L==5
- "¿Realmente desea dejar de ser administrador/a de la titulación %s?"; // Okoteve traducción
-#elif L==6
- "Vuole realmente essere rimosso come amministratore della laurea %s?";
-#elif L==7
- "Czy naprawde chcesz byc usuniety jako administrator stopnia %s?";
-#elif L==8
- "Do you really want to be removed as an administrator of the degree %s?"; // Necessita de tradução
-#endif
-
-const char *Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_the_institution_X = // Warning: it is very important to include %s in the following sentences
-#if L==0
- "¿Realmente desea dejar de ser administrador/a de la institución %s?"; // Necessita traduccio
-#elif L==1
- "Do you really want to be removed as an administrator of the institution %s?"; // Need Übersetzung
-#elif L==2
- "Do you really want to be removed as an administrator of the institution %s?";
-#elif L==3
- "¿Realmente desea dejar de ser administrador/a de la institución %s?";
-#elif L==4
- "Do you really want to be removed as an administrator of the institution %s?"; // Besoin de traduction
-#elif L==5
- "¿Realmente desea dejar de ser administrador/a de la institución %s?"; // Okoteve traducción
-#elif L==6
- "Vuole realmente essere rimosso come amministratore della istituzione %s?";
-#elif L==7
- "Czy naprawde chcesz byc usuniety jako administrator instytucji %s?";
-#elif L==8
- "Do you really want to be removed as an administrator of the institution %s?"; // Necessita de tradução
+ "Do you really want to be removed as an administrator"
+ " %s?"; // Necessita de tradução
#endif
const char *Txt_Do_you_really_want_to_be_removed_from_the_course_X = // Warning: it is very important to include %s in the following sentences
@@ -8691,34 +8658,34 @@ const char *Txt_Do_you_really_want_to_remove_the_following_user_as_an_administra
" as an administrator of the degree %s?"; // Necessita de tradução
#endif
-const char *Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_the_institution_X = // Warning: it is very important to include %s in the following sentences
+const char *Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_X = // Warning: it is very important to include %s in the following sentences
#if L==0
"¿Realmente desea eliminar el siguiente usuario"
- " como administrador de la institución %s?"; // Necessita traduccio
+ " como administrador de %s?"; // Necessita traduccio
#elif L==1
"Do you really want to remove the following user"
- " as an administrator of the institution %s?"; // Need Übersetzung
+ " as an administrator of %s?"; // Need Übersetzung
#elif L==2
"Do you really want to remove the following user"
- " as an administrator of the institution %s?";
+ " as an administrator of %s?";
#elif L==3
"¿Realmente desea eliminar el siguiente usuario"
- " como administrador de la institución %s?";
+ " como administrador de %s?";
#elif L==4
"Do you really want to remove the following user"
- " as an administrator of the degree %s?"; // Besoin de traduction
+ " as an administrator of %s?"; // Besoin de traduction
#elif L==5
"¿Realmente desea eliminar el siguiente usuario"
- " como administrador de la institución %s?"; // Okoteve traducción
+ " como administrador de %s?"; // Okoteve traducción
#elif L==6
"Vuoi realmente rimuovere il seguente utente"
- " come amministratore della istituzione %s?";
+ " come amministratore de %s?";
#elif L==7
"Czy na pewno chcesz usunac nastepujace użytkownika"
- " jako administratora instytucji %s?";
+ " jako administratora %s?";
#elif L==8
"Do you really want to remove the following user"
- " as an administrator of the institution %s?"; // Necessita de tradução
+ " as an administrator of %s?"; // Necessita de tradução
#endif
const char *Txt_Do_you_really_want_to_remove_the_following_user_from_the_course_X = // Warning: it is very important to include %s in the following sentences
@@ -42199,94 +42166,34 @@ const char *Txt_THE_USER_X_has_been_removed_from_the_course_Y = // Warning: it i
" from the course %s."; // Necessita de tradução
#endif
-const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_the_centre_Y = // Warning: it is very important to include two %s in the following sentences
+const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_Y = // Warning: it is very important to include two %s in the following sentences
#if L==0
"%s ha sido eliminado/a como administrador"
- " del centro %s."; // Necessita traduccio
+ " de %s."; // Necessita traduccio
#elif L==1
"%s has been removed as administrator"
- " of the centre %s."; // Übersetzung notwendig
+ " of %s."; // Übersetzung notwendig
#elif L==2
"%s has been removed as administrator"
- " of the centre %s.";
+ " of %s.";
#elif L==3
"%s ha sido eliminado/a como administrador"
- " del centro %s.";
+ " de %s.";
#elif L==4
"%s has been removed as administrator"
- " of the centre %s."; // Besoin de traduction
+ " of %s."; // Besoin de traduction
#elif L==5
"%s ha sido eliminado/a como administrador"
- " del centro %s."; // Okoteve traducción
+ " de %s."; // Okoteve traducción
#elif L==6
"%s è stato rimosso come amministratore"
- " del centro %s.";
+ " de %s.";
#elif L==7
"%s has been removed as administrator"
- " of the centre %s."; // Potrzebujesz tlumaczenie
+ " of %s."; // Potrzebujesz tlumaczenie
#elif L==8
"%s has been removed as administrator"
- " of the centre %s."; // Necessita de tradução
-#endif
-
-const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_the_degree_Y = // Warning: it is very important to include two %s in the following sentences
-#if L==0
- "%s ha sido eliminado/a como administrador"
- " de la titulación %s."; // Necessita traduccio
-#elif L==1
- "%s has been removed as administrator"
- " of the degree %s."; // Übersetzung notwendig
-#elif L==2
- "%s has been removed as administrator"
- " of the degree %s.";
-#elif L==3
- "%s ha sido eliminado/a como administrador"
- " de la titulación %s.";
-#elif L==4
- "%s has been removed as administrator"
- " of the degree %s."; // Besoin de traduction
-#elif L==5
- "%s ha sido eliminado/a como administrador"
- " de la titulación %s."; // Okoteve traducción
-#elif L==6
- "%s è stato rimosso come amministratore"
- " della laurea %s.";
-#elif L==7
- "%s has been removed as administrator"
- " of the degree %s."; // Potrzebujesz tlumaczenie
-#elif L==8
- "%s has been removed as administrator"
- " of the degree %s."; // Necessita de tradução
-#endif
-
-const char *Txt_THE_USER_X_has_been_removed_as_administrator_of_the_institution_Y = // Warning: it is very important to include two %s in the following sentences
-#if L==0
- "%s ha sido eliminado/a como administrador"
- " de la institución %s."; // Necessita traduccio
-#elif L==1
- "%s has been removed as administrator"
- " of the institution %s."; // Übersetzung notwendig
-#elif L==2
- "%s has been removed as administrator"
- " of the institution %s.";
-#elif L==3
- "%s ha sido eliminado/a como administrador"
- " de la institución %s.";
-#elif L==4
- "%s has been removed as administrator"
- " of the institution %s."; // Besoin de traduction
-#elif L==5
- "%s ha sido eliminado/a como administrador"
- " de la institución %s."; // Okoteve traducción
-#elif L==6
- "%s è stato rimosso come amministratore"
- " della istituzione %s.";
-#elif L==7
- "%s has been removed as administrator"
- " of the institution %s."; // Potrzebujesz tlumaczenie
-#elif L==8
- "%s has been removed as administrator"
- " of the institution %s."; // Necessita de tradução
+ " of %s."; // Necessita de tradução
#endif
const char *Txt_THE_USER_X_has_been_removed_from_the_group_of_type_Y_to_which_it_belonged = // Warning: it is very important to include two %s in the following sentences
@@ -42529,94 +42436,25 @@ const char *Txt_The_user_is_new_does_not_exists_yet_in_X = // Warning: it is ver
"The user is new, does not exist yet in %s."; // Necessita de tradução
#endif
-const char *Txt_THE_USER_X_is_not_an_administrator_of_the_centre_Y = // Warning: it is very important to include two %s in the following sentences
+const char *Txt_THE_USER_X_is_not_an_administrator_of_Y = // Warning: it is very important to include two %s in the following sentences
#if L==0
- "%s no es administrador/a"
- " del centro %s."; // Necessita traduccio
+ "%s no es administrador/a de %s."; // Necessita traduccio
#elif L==1
- "%s is not an administrator"
- " of the centre %s."; // Übersetzung notwendig
+ "%s is not an administrator of %s."; // Übersetzung notwendig
#elif L==2
- "%s is not an administrator"
- " of the centre %s.";
+ "%s is not an administrator of %s.";
#elif L==3
- "%s no es administrador/a"
- " del centro %s.";
+ "%s no es administrador/a de %s.";
#elif L==4
- "%s is not an administrator"
- " of the centre %s."; // Besoin de traduction
+ "%s is not an administrator of %s."; // Besoin de traduction
#elif L==5
- "%s no es administrador/a"
- " del centro %s."; // Okoteve traducción
+ "%s no es administrador/a de %s."; // Okoteve traducción
#elif L==6
- "%s non è un amministratore"
- " del centro %s.";
+ "%s non è un amministratore de %s.";
#elif L==7
- "%s is not an administrator"
- " of the centre %s."; // Potrzebujesz tlumaczenie
+ "%s is not an administrator of %s."; // Potrzebujesz tlumaczenie
#elif L==8
- "%s is not an administrator"
- " of the centre %s."; // Necessita de tradução
-#endif
-
-const char *Txt_THE_USER_X_is_not_an_administrator_of_the_degree_Y = // Warning: it is very important to include two %s in the following sentences
-#if L==0
- "%s no es administrador/a"
- " de la titulación %s."; // Necessita traduccio
-#elif L==1
- "%s is not an administrator"
- " of the degree %s."; // Übersetzung notwendig
-#elif L==2
- "%s is not an administrator"
- " of the degree %s.";
-#elif L==3
- "%s no es administrador/a"
- " de la titulación %s.";
-#elif L==4
- "%s is not an administrator"
- " of the degree %s."; // Besoin de traduction
-#elif L==5
- "%s no es administrador/a"
- " de la titulación %s."; // Okoteve traducción
-#elif L==6
- "%s non è un amministratore"
- " della laurea %s.";
-#elif L==7
- "%s is not an administrator"
- " of the degree %s."; // Potrzebujesz tlumaczenie
-#elif L==8
- "%s is not an administrator"
- " of the degree %s."; // Necessita de tradução
-#endif
-
-const char *Txt_THE_USER_X_is_not_an_administrator_of_the_institution_Y = // Warning: it is very important to include two %s in the following sentences
-#if L==0
- "%s no es administrador/a"
- " de la institución %s."; // Necessita traduccio
-#elif L==1
- "%s is not an administrator"
- " of the institution %s."; // Übersetzung notwendig
-#elif L==2
- "%s is not an administrator"
- " of the institution %s.";
-#elif L==3
- "%s no es administrador/a"
- " de la institución %s.";
-#elif L==4
- "%s is not an administrator"
- " of the institution %s."; // Besoin de traduction
-#elif L==5
- "%s no es administrador/a"
- " de la institución %s."; // Okoteve traducción
-#elif L==6
- "%s non è un amministratore"
- " della istituzione %s.";
-#elif L==7
- "%s is not an administrator"
- " of the institution %s."; // Potrzebujesz tlumaczenie
-#elif L==8
- "%s is not an administrator"
- " of the institution %s."; // Necessita de tradução
+ "%s is not an administrator of %s."; // Necessita de tradução
#endif
const char *Txt_THE_USER_X_is_not_found_in_the_file_of_marks = // Warning: it is very important to include %s in the following sentences