diff --git a/sql/cambios.sql b/sql/cambios.sql index 2ebfbbcbf..b395e4475 100644 --- a/sql/cambios.sql +++ b/sql/cambios.sql @@ -11590,7 +11590,8 @@ UPDATE notif SET NotifyEvent=4 WHERE NotifyEvent=3; UPDATE notif SET NotifyEvent=3 WHERE NotifyEvent=2; - - +----- SWAD 15.225.3 (2016/06/15) ----- + +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/sql/swad.sql b/sql/swad.sql index f5abbc5f0..dee84b271 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -1250,6 +1250,15 @@ CREATE TABLE IF NOT EXISTS usr_data ( INDEX(Menu), INDEX(SideCols)); -- +-- Table usr_duplicated: stores informs of users possibly duplicated +-- +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)); +-- -- Table usr_emails: stores the users' e-mails -- CREATE TABLE IF NOT EXISTS usr_emails ( diff --git a/swad_changelog.h b/swad_changelog.h index c01c39609..9f7f741e0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -128,14 +128,18 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.225.2 (2016-06-15)" +#define Log_PLATFORM_VERSION "SWAD 15.225.3 (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.2: Jun 15, 2016 New option in user administration to report a user as possible duplicate. Not finished. (? lines) + 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)); + + Version 15.225.2: Jun 15, 2016 New option in user administration to report a user as possible duplicate. Not finished. (202497 lines) Version 15.225.1: Jun 14, 2016 New option in user administration to report a user as possible duplicate. Not finished. (202468 lines) Version 15.225: Jun 14, 2016 Removing a user's photo now requires confirmation. (202425 lines) 5 changes necessary in database: diff --git a/swad_database.c b/swad_database.c index d363932dd..7f4f62236 100644 --- a/swad_database.c +++ b/swad_database.c @@ -2631,6 +2631,25 @@ mysql> DESCRIBE usr_data; "INDEX(Menu)," "INDEX(SideCols))"); + /***** Table usr_duplicated *****/ +/* +mysql> DESCRIBE usr_duplicated; ++-------------+----------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------------+----------+------+-----+---------+-------+ +| UsrCod | int(11) | NO | PRI | NULL | | +| InformerCod | int(11) | NO | PRI | NULL | | +| InformTime | datetime | NO | | NULL | | ++-------------+----------+------+-----+---------+-------+ +3 rows in set (0.00 sec) +*/ + DB_CreateTable ("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))"); + /***** Table usr_emails *****/ /* mysql> DESCRIBE usr_emails; diff --git a/swad_text.c b/swad_text.c index e02aa6ab6..475e3cd35 100644 --- a/swad_text.c +++ b/swad_text.c @@ -40941,6 +40941,27 @@ const char *Txt_TEXT_plain = "plano"; #endif +const char *Txt_Thank_you_for_reporting_a_possible_duplicate_user = +#if L==1 + "Gràcies per informar d'un usuari possiblement duplicat."; +#elif L==2 + "Vielen Dank für eine mögliche doppelte Benutzer berichten."; +#elif L==3 + "Thank you for reporting a possible duplicate user."; +#elif L==4 + "Gracias por informar de un usuario posiblemente duplicado."; +#elif L==5 + "Merci d'avoir signalé un éventuel utilisateur en double."; +#elif L==6 + "Gracias por informar de un usuario posiblemente duplicado."; // Okoteve traducción +#elif L==7 + "Grazie per aver segnalato un possibile utente duplicato."; +#elif L==8 + "Dziękujemy za zgłoszenie ewentualnego duplikat użytkownika."; +#elif L==9 + "Obrigado por relatar um possível usuário duplicado."; +#endif + const char *Txt_Thanks_for_answering_the_survey = #if L==1 "Gracias por responder la encuesta."; // Necessita traduccio diff --git a/swad_user.c b/swad_user.c index fc744ed7e..63a24bf6e 100644 --- a/swad_user.c +++ b/swad_user.c @@ -7849,6 +7849,7 @@ void Usr_RemoveUsrFromUsrBanned (long UsrCod) void Usr_ReportUsrAsPossibleDuplicate (void) { + extern const char *Txt_Thank_you_for_reporting_a_possible_duplicate_user; extern const char *Txt_User_not_found_or_you_do_not_have_permission_; char Query[256]; bool ItsMe; @@ -7860,12 +7861,15 @@ void Usr_ReportUsrAsPossibleDuplicate (void) ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); if (!ItsMe && Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER) { - sprintf (Query,"REPLACE INTO usr_dup (UsrCod,UsrWhoReported,TimeReport)" + /***** Insert possible duplicate into database *****/ + sprintf (Query,"REPLACE INTO usr_duplicated (UsrCod,InformerCod,InformTime)" " VALUES ('%ld','%ld',NOW())", Gbl.Usrs.Other.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod); - Lay_ShowAlert (Lay_INFO,Query); // TODO: Remove this line, written only for debug purposes - // DB_QueryINSERT (Query,"can not report duplicate"); + DB_QueryINSERT (Query,"can not report duplicate"); + + /***** Show feedback message *****/ + Lay_ShowAlert (Lay_SUCCESS,Txt_Thank_you_for_reporting_a_possible_duplicate_user); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);