diff --git a/swad_action.c b/swad_action.c index 5b3332aa6..4d7ca24f7 100644 --- a/swad_action.c +++ b/swad_action.c @@ -1055,6 +1055,8 @@ Users: 882. ActReqRemOldUsr Request the complete elimination of old users 883. ActRemOldUsr Eliminate completely old users + NEW. ActLstDupUsr List possible duplicate users + 884. ActLstClk List last clicks in real time Social: 885. ActSeeSocTmlGbl Show social timeline (global) @@ -2449,6 +2451,8 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqRemOldUsr */{ 590,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AskRemoveOldUsrs ,NULL}, /* ActRemOldUsr */{ 773,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemoveOldUsrs ,NULL}, + /* ActLstDupUsr */{1578,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Usr_ListDuplicateUsrs ,NULL}, + /* ActLstClk */{ 989,-1,TabUsr,ActLstCon ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Con_ShowLastClicks ,NULL}, // TabSoc ****************************************************************** @@ -4412,6 +4416,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq ActReqRemStdPho, // #1575 ActReqRemTchPho, // #1576 ActReqRemMyPho, // #1577 + ActLstDupUsr, // #1578 }; /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index bc2e75b58..7e60252bd 100644 --- a/swad_action.h +++ b/swad_action.h @@ -72,9 +72,9 @@ typedef enum typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+246+186+153+172+36+28+84) +#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+246+186+154+172+36+28+84) -#define Act_MAX_ACTION_COD 1577 +#define Act_MAX_ACTION_COD 1578 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20 @@ -1094,7 +1094,9 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica #define ActReqRemOldUsr (ActChgNumRowFooGrp+151) #define ActRemOldUsr (ActChgNumRowFooGrp+152) -#define ActLstClk (ActChgNumRowFooGrp+153) +#define ActLstDupUsr (ActChgNumRowFooGrp+153) + +#define ActLstClk (ActChgNumRowFooGrp+154) /*****************************************************************************/ /******************************** Social tab *********************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 9f7f741e0..9480c25c0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -128,13 +128,17 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.225.3 (2016-06-15)" +#define Log_PLATFORM_VERSION "SWAD 15.225.4 (2016-06-15)" #define CSS_FILE "swad15.224.3.css" #define JS_FILE "swad15.216.js" // 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 15.225.4: Jun 15, 2016 Listing possible duplicate users. Not finished. (202623 lines) + 1 change necessary in database: +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1578','es','N','Listar usuarios duplicados'); + Version 15.225.3: Jun 15, 2016 New database table to report users as possible duplicates. (202550 lines) 1 change necessary in database: CREATE TABLE IF NOT EXISTS usr_duplicated (UsrCod INT NOT NULL,InformerCod INT NOT NULL,InformTime DATETIME NOT NULL,UNIQUE INDEX(UsrCod,InformerCod),INDEX(UsrCod)); diff --git a/swad_text.c b/swad_text.c index 475e3cd35..d4f4c00f3 100644 --- a/swad_text.c +++ b/swad_text.c @@ -9559,6 +9559,27 @@ const char *Txt_downloads = // As a noun "downloads"; #endif +const char *Txt_Duplicate_USERS = +#if L==1 + "Duplicats"; +#elif L==2 + "Doppelte"; +#elif L==3 + "Duplicates"; +#elif L==4 + "Duplicados"; +#elif L==5 + "En double"; +#elif L==6 + "Duplicados"; // Okoteve traducción +#elif L==7 + "Duplicati"; +#elif L==8 + "Duplikaty"; +#elif L==9 + "Duplicados"; +#endif + const char *Txt_Edit = #if L==1 "Editar"; @@ -28456,6 +28477,27 @@ const char *Txt_Plugins = "Plugins"; #endif +const char *Txt_Possibly_duplicate_users = +#if L==1 + "Usuaris possiblement duplicats"; +#elif L==2 + "Mögliche doppelte Benutzer"; +#elif L==3 + "Possibly duplicate users"; +#elif L==4 + "Usuarios posiblemente duplicados"; +#elif L==5 + "Possibles utilisateurs en double"; +#elif L==6 + "Usuarios posiblemente duplicados"; // Okoteve traducción +#elif L==7 + "Possibili utenti duplicati"; +#elif L==8 + "Możliwe duplikaty użytkowników"; +#elif L==9 + "Usuários possivelmente duplicados"; +#endif + const char *Txt_Post_X_allowed = // Warning: it is very important to include %u in the following sentences #if L==1 "Mensaje %u permitido."; // Necessita traduccio diff --git a/swad_user.c b/swad_user.c index 63a24bf6e..e78decb59 100644 --- a/swad_user.c +++ b/swad_user.c @@ -6099,6 +6099,9 @@ void Usr_ListDataAdms (void) /* Put link to go to admin one user */ Enr_PutLinkToAdminOneUsr (ActReqMdfOneOth); + /* Put link to list possible duplicate users */ + Usr_PutLinkToListDupUsrs (); + /* Put link to remove old users */ Enr_PutLinkToRemOldUsrs (); @@ -6132,7 +6135,7 @@ void Usr_ListDataAdms (void) /***** Get and order list of administrators *****/ Usr_GetAdmsLst (Gbl.Scope.Current); - /***** Start table with list of administrators *****/ + /***** Start frame with list of administrators *****/ Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_DEG_ADM][Usr_SEX_UNKNOWN],NULL); /***** Form to select range of administrators *****/ @@ -6193,7 +6196,7 @@ void Usr_ListDataAdms (void) else // Gbl.Usrs.LstAdms.NumUsrs == 0 Lay_ShowAlert (Lay_INFO,Txt_No_users_found[Rol_DEG_ADM]); - /***** End of frame *****/ + /***** End frame *****/ Lay_EndRoundFrame (); /***** Free memory for teachers list *****/ @@ -7877,3 +7880,33 @@ void Usr_ReportUsrAsPossibleDuplicate (void) else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); } + +/*****************************************************************************/ +/************ Put a link (form) to list possible duplicate users *************/ +/*****************************************************************************/ + +void Usr_PutLinkToListDupUsrs (void) + { + extern const char *Txt_Duplicate_USERS; + + /***** Put form to remove old users *****/ + Lay_PutContextualLink (ActLstDupUsr,NULL,"usrs64x64.gif", + Txt_Duplicate_USERS,Txt_Duplicate_USERS); + } + +/*****************************************************************************/ +/*********************** List possible duplicate users ***********************/ +/*****************************************************************************/ + +void Usr_ListDuplicateUsrs (void) + { + extern const char *Txt_Possibly_duplicate_users; + + /***** Start frame with list of possible duplicate users *****/ + Lay_StartRoundFrame (NULL,Txt_Possibly_duplicate_users,NULL); + + Lay_ShowAlert (Lay_INFO,"Option under development."); // TODO: Write listing of users + + /***** End frame *****/ + Lay_EndRoundFrame (); + } diff --git a/swad_user.h b/swad_user.h index be6b56779..a3aee1bfe 100644 --- a/swad_user.h +++ b/swad_user.h @@ -351,5 +351,7 @@ bool Usr_CheckIfUsrBanned (long UsrCod); void Usr_RemoveUsrFromUsrBanned (long UsrCod); void Usr_ReportUsrAsPossibleDuplicate (void); +void Usr_PutLinkToListDupUsrs (void); +void Usr_ListDuplicateUsrs (void); #endif