2016-06-16 14:34:17 +02:00
|
|
|
|
// swad_duplicate.c: duplicate users
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2024-02-07 00:40:28 +01:00
|
|
|
|
Copyright (C) 1999-2024 Antonio Ca<EFBFBD>as Vargas
|
2016-06-16 14:34:17 +02:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General 3 License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*********************************** Headers *********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2016-06-17 23:38:32 +02:00
|
|
|
|
#include "swad_account.h"
|
2022-11-06 18:11:10 +01:00
|
|
|
|
#include "swad_action_list.h"
|
2022-10-19 18:07:49 +02:00
|
|
|
|
#include "swad_alert.h"
|
2017-06-10 21:38:10 +02:00
|
|
|
|
#include "swad_box.h"
|
2016-06-16 14:34:17 +02:00
|
|
|
|
#include "swad_database.h"
|
2016-06-16 19:30:29 +02:00
|
|
|
|
#include "swad_duplicate.h"
|
2021-06-09 19:59:00 +02:00
|
|
|
|
#include "swad_duplicate_database.h"
|
2017-03-30 11:20:06 +02:00
|
|
|
|
#include "swad_enrolment.h"
|
2021-11-03 21:31:16 +01:00
|
|
|
|
#include "swad_enrolment_database.h"
|
2021-04-26 15:27:27 +02:00
|
|
|
|
#include "swad_error.h"
|
2018-11-09 20:47:39 +01:00
|
|
|
|
#include "swad_form.h"
|
2016-06-16 14:34:17 +02:00
|
|
|
|
#include "swad_global.h"
|
2019-10-23 19:05:05 +02:00
|
|
|
|
#include "swad_HTML.h"
|
2016-06-16 14:34:17 +02:00
|
|
|
|
#include "swad_layout.h"
|
2022-10-19 18:07:49 +02:00
|
|
|
|
#include "swad_parameter.h"
|
2016-06-17 11:13:11 +02:00
|
|
|
|
#include "swad_profile.h"
|
2016-12-13 13:32:19 +01:00
|
|
|
|
#include "swad_role_type.h"
|
2016-06-16 14:34:17 +02:00
|
|
|
|
#include "swad_user.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************** External global variables from others modules ****************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
extern struct Globals Gbl;
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Private prototypes ****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2016-06-18 00:28:59 +02:00
|
|
|
|
static void Dup_ListSimilarUsrs (void);
|
2016-06-17 20:59:48 +02:00
|
|
|
|
|
2022-09-24 18:30:26 +02:00
|
|
|
|
static void Dup_PutButtonToViewSimilarUsrs (const struct Usr_Data *UsrDat);
|
|
|
|
|
static void Dup_PutButtonToEliminateUsrAccount (const struct Usr_Data *UsrDat);
|
|
|
|
|
static void Dup_PutButtonToRemoveFromListOfDupUsrs (const struct Usr_Data *UsrDat);
|
2016-06-18 00:28:59 +02:00
|
|
|
|
|
2016-06-16 14:34:17 +02:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/******************** Report a user as possible duplicate ********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void Dup_ReportUsrAsPossibleDuplicate (void)
|
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Thank_you_for_reporting_a_possible_duplicate_user;
|
|
|
|
|
|
|
|
|
|
/***** Get user to be reported as possible duplicate *****/
|
2023-03-10 00:13:55 +01:00
|
|
|
|
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
2016-06-16 14:34:17 +02:00
|
|
|
|
{
|
|
|
|
|
/* Check if it's allowed to me to report users as possible duplicatedr */
|
2021-06-09 19:59:00 +02:00
|
|
|
|
if (Gbl.Usrs.Me.Role.Logged >= Rol_TCH &&
|
2023-04-04 13:46:51 +02:00
|
|
|
|
Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod) == Usr_OTHER)
|
2016-06-16 14:34:17 +02:00
|
|
|
|
{
|
|
|
|
|
/***** Insert possible duplicate into database *****/
|
2021-06-09 19:59:00 +02:00
|
|
|
|
Dup_DB_AddUsrToDuplicated (Gbl.Usrs.Other.UsrDat.UsrCod);
|
2016-06-16 14:34:17 +02:00
|
|
|
|
|
|
|
|
|
/***** Show feedback message *****/
|
2019-02-16 14:37:34 +01:00
|
|
|
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Thank_you_for_reporting_a_possible_duplicate_user);
|
2016-06-16 14:34:17 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2019-03-09 20:12:44 +01:00
|
|
|
|
Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission ();
|
2016-06-16 14:34:17 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2019-03-09 20:12:44 +01:00
|
|
|
|
Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission ();
|
2016-06-16 14:34:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************ Put a link (form) to list possible duplicate users *************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void Dup_PutLinkToListDupUsrs (void)
|
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Duplicate_USERS;
|
|
|
|
|
|
|
|
|
|
/***** Put form to remove old users *****/
|
2020-03-26 02:54:30 +01:00
|
|
|
|
Lay_PutContextualLinkIconText (ActLstDupUsr,NULL,
|
|
|
|
|
NULL,NULL,
|
2021-12-22 00:20:06 +01:00
|
|
|
|
"user-friends.svg",Ico_BLACK,
|
2021-12-22 18:54:43 +01:00
|
|
|
|
Txt_Duplicate_USERS,NULL);
|
2016-06-16 14:34:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*********************** List possible duplicate users ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void Dup_ListDuplicateUsrs (void)
|
|
|
|
|
{
|
2016-11-20 21:15:31 +01:00
|
|
|
|
extern const char *Hlp_USERS_Duplicates_possibly_duplicate_users;
|
2016-06-16 14:34:17 +02:00
|
|
|
|
extern const char *Txt_Possibly_duplicate_users;
|
|
|
|
|
extern const char *Txt_Informants;
|
|
|
|
|
MYSQL_RES *mysql_res;
|
|
|
|
|
MYSQL_ROW row;
|
|
|
|
|
unsigned NumUsrs;
|
|
|
|
|
unsigned NumUsr;
|
2022-09-24 18:30:26 +02:00
|
|
|
|
struct Usr_Data UsrDat;
|
2016-06-16 14:34:17 +02:00
|
|
|
|
unsigned NumInformants;
|
|
|
|
|
|
2019-10-26 02:19:42 +02:00
|
|
|
|
/***** Begin box with list of possible duplicate users *****/
|
2024-01-29 09:45:28 +01:00
|
|
|
|
Box_BoxBegin (Txt_Possibly_duplicate_users,NULL,NULL,
|
2017-06-12 15:03:29 +02:00
|
|
|
|
Hlp_USERS_Duplicates_possibly_duplicate_users,Box_NOT_CLOSABLE);
|
2016-06-16 14:34:17 +02:00
|
|
|
|
|
2021-06-09 19:59:00 +02:00
|
|
|
|
/***** List possible duplicated users *****/
|
|
|
|
|
if ((NumUsrs = Dup_DB_GetListDuplicateUsrs (&mysql_res)))
|
|
|
|
|
{
|
|
|
|
|
/***** Initialize field names *****/
|
|
|
|
|
Usr_SetUsrDatMainFieldNames ();
|
|
|
|
|
|
|
|
|
|
/***** Initialize structure with user's data *****/
|
|
|
|
|
Usr_UsrDataConstructor (&UsrDat);
|
|
|
|
|
|
|
|
|
|
/***** Begin table *****/
|
|
|
|
|
HTM_TABLE_BeginCenterPadding (2);
|
|
|
|
|
|
|
|
|
|
/***** Heading row with column names *****/
|
|
|
|
|
Gbl.Usrs.Listing.WithPhotos = true;
|
|
|
|
|
Usr_WriteHeaderFieldsUsrDat (false); // Columns for the data
|
|
|
|
|
|
|
|
|
|
/***** List users *****/
|
2022-09-02 23:57:38 +02:00
|
|
|
|
for (NumUsr = 0, The_ResetRowColor ();
|
2021-06-09 19:59:00 +02:00
|
|
|
|
NumUsr < NumUsrs;
|
|
|
|
|
NumUsr++)
|
|
|
|
|
{
|
|
|
|
|
row = mysql_fetch_row (mysql_res);
|
|
|
|
|
|
|
|
|
|
/* Get user code (row[0]) */
|
|
|
|
|
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
|
|
|
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
|
|
|
|
Usr_DONT_GET_PREFS,
|
2023-10-27 13:54:14 +02:00
|
|
|
|
Usr_DONT_GET_ROLE_IN_CRS))
|
2021-06-09 19:59:00 +02:00
|
|
|
|
{
|
|
|
|
|
/* Get if user has accepted all his/her courses */
|
2021-11-03 21:31:16 +01:00
|
|
|
|
if (Enr_DB_GetNumCrssOfUsr (UsrDat.UsrCod) != 0)
|
|
|
|
|
UsrDat.Accepted = (Enr_DB_GetNumCrssOfUsrNotAccepted (UsrDat.UsrCod) == 0);
|
2021-06-09 19:59:00 +02:00
|
|
|
|
else
|
|
|
|
|
UsrDat.Accepted = false;
|
|
|
|
|
|
|
|
|
|
/* Write data of this user */
|
|
|
|
|
Usr_WriteRowUsrMainData (NumUsrs - NumUsr,&UsrDat,false,Rol_UNK,
|
|
|
|
|
&Gbl.Usrs.Selected);
|
|
|
|
|
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-12-20 22:43:32 +01:00
|
|
|
|
HTM_TD_Begin ("colspan=\"2\" class=\"%s\"",
|
2022-03-19 02:05:53 +01:00
|
|
|
|
The_GetColorRows ());
|
2021-06-09 19:59:00 +02:00
|
|
|
|
HTM_TD_End ();
|
|
|
|
|
|
2022-03-28 22:50:37 +02:00
|
|
|
|
HTM_TD_Begin ("colspan=\"%u\" class=\"LM DAT_%s %s\"",
|
2021-12-15 00:47:29 +01:00
|
|
|
|
Usr_NUM_MAIN_FIELDS_DATA_USR - 2,
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix (),
|
2022-03-19 02:05:53 +01:00
|
|
|
|
The_GetColorRows ());
|
2021-06-09 19:59:00 +02:00
|
|
|
|
|
|
|
|
|
/* Write number of informants (row[1]) if greater than 1 */
|
|
|
|
|
if (sscanf (row[1],"%u",&NumInformants) != 1)
|
|
|
|
|
Err_ShowErrorAndExit ("Wrong number of informants.");
|
|
|
|
|
if (NumInformants > 1)
|
|
|
|
|
{
|
|
|
|
|
HTM_TxtColonNBSP (Txt_Informants);
|
|
|
|
|
HTM_Unsigned (NumInformants);
|
|
|
|
|
HTM_BR ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Button to view users similar to this */
|
|
|
|
|
Dup_PutButtonToViewSimilarUsrs (&UsrDat);
|
|
|
|
|
|
|
|
|
|
/* Button to remove from list of possible duplicate users */
|
|
|
|
|
Dup_PutButtonToRemoveFromListOfDupUsrs (&UsrDat);
|
|
|
|
|
|
|
|
|
|
HTM_TD_End ();
|
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
|
2022-03-24 01:18:19 +01:00
|
|
|
|
The_ChangeRowColor ();
|
2021-06-09 19:59:00 +02:00
|
|
|
|
}
|
|
|
|
|
else // User does not exists ==>
|
|
|
|
|
// remove user from table of possible duplicate users
|
|
|
|
|
Dup_DB_RemoveUsrFromDuplicated (UsrDat.UsrCod);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***** End table *****/
|
|
|
|
|
HTM_TABLE_End ();
|
|
|
|
|
|
|
|
|
|
/***** Free memory used for user's data *****/
|
|
|
|
|
Usr_UsrDataDestructor (&UsrDat);
|
|
|
|
|
}
|
|
|
|
|
else // There are no duplicated users
|
|
|
|
|
/***** Show warning indicating no users found *****/
|
|
|
|
|
Usr_ShowWarningNoUsersFound (Rol_UNK);
|
2016-06-16 19:30:29 +02:00
|
|
|
|
|
2021-06-09 19:59:00 +02:00
|
|
|
|
/***** Free structure that stores the query result *****/
|
|
|
|
|
DB_FreeMySQLResult (&mysql_res);
|
2018-10-20 21:19:30 +02:00
|
|
|
|
|
2017-06-12 14:16:33 +02:00
|
|
|
|
/***** End box *****/
|
2019-10-25 22:48:34 +02:00
|
|
|
|
Box_BoxEnd ();
|
2016-06-16 19:30:29 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************* List similar users to a given one *********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2016-06-18 00:28:59 +02:00
|
|
|
|
void Dup_GetUsrCodAndListSimilarUsrs (void)
|
2016-06-17 20:59:48 +02:00
|
|
|
|
{
|
|
|
|
|
/***** Get user to be removed from list of possible duplicates *****/
|
2023-03-10 00:13:55 +01:00
|
|
|
|
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
2016-06-18 00:28:59 +02:00
|
|
|
|
Dup_ListSimilarUsrs ();
|
2016-06-17 20:59:48 +02:00
|
|
|
|
else
|
2019-03-09 20:12:44 +01:00
|
|
|
|
Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission ();
|
2016-06-17 20:59:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-18 00:28:59 +02:00
|
|
|
|
static void Dup_ListSimilarUsrs (void)
|
2016-06-16 19:30:29 +02:00
|
|
|
|
{
|
2017-03-23 11:55:27 +01:00
|
|
|
|
extern const char *Hlp_USERS_Duplicates_similar_users;
|
2016-11-20 21:15:31 +01:00
|
|
|
|
extern const char *Txt_Similar_users;
|
2022-09-24 18:30:26 +02:00
|
|
|
|
struct Usr_Data UsrDat;
|
2016-06-16 19:30:29 +02:00
|
|
|
|
MYSQL_RES *mysql_res;
|
|
|
|
|
unsigned NumUsrs;
|
|
|
|
|
unsigned NumUsr;
|
2016-06-17 01:05:50 +02:00
|
|
|
|
|
2019-10-26 02:19:42 +02:00
|
|
|
|
/***** Begin box with list of possible duplicate users *****/
|
2024-01-29 09:45:28 +01:00
|
|
|
|
Box_BoxBegin (Txt_Similar_users,NULL,NULL,
|
2017-06-12 15:03:29 +02:00
|
|
|
|
Hlp_USERS_Duplicates_similar_users,Box_NOT_CLOSABLE);
|
2016-06-16 19:30:29 +02:00
|
|
|
|
|
2017-05-29 21:34:43 +02:00
|
|
|
|
/***** List possible similar users *****/
|
2021-06-09 19:59:00 +02:00
|
|
|
|
if ((NumUsrs = Dup_DB_GetUsrsSimilarTo (&mysql_res,&Gbl.Usrs.Other.UsrDat)))
|
2016-06-16 19:30:29 +02:00
|
|
|
|
{
|
|
|
|
|
/***** Initialize field names *****/
|
|
|
|
|
Usr_SetUsrDatMainFieldNames ();
|
|
|
|
|
|
|
|
|
|
/***** Initialize structure with user's data *****/
|
|
|
|
|
Usr_UsrDataConstructor (&UsrDat);
|
|
|
|
|
|
2019-10-20 22:00:28 +02:00
|
|
|
|
/***** Begin table *****/
|
2019-10-24 18:23:26 +02:00
|
|
|
|
HTM_TABLE_BeginCenterPadding (5);
|
2016-06-16 19:30:29 +02:00
|
|
|
|
|
2021-06-09 19:59:00 +02:00
|
|
|
|
/***** Heading row with column names *****/
|
|
|
|
|
Gbl.Usrs.Listing.WithPhotos = true;
|
|
|
|
|
Usr_WriteHeaderFieldsUsrDat (false); // Columns for the data
|
|
|
|
|
|
|
|
|
|
/***** List users *****/
|
2022-09-02 23:57:38 +02:00
|
|
|
|
for (NumUsr = 0, The_ResetRowColor ();
|
2021-06-09 19:59:00 +02:00
|
|
|
|
NumUsr < NumUsrs;
|
|
|
|
|
NumUsr++)
|
|
|
|
|
{
|
|
|
|
|
/* Get user code */
|
|
|
|
|
UsrDat.UsrCod = DB_GetNextCode (mysql_res);
|
|
|
|
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
|
|
|
|
Usr_DONT_GET_PREFS,
|
2023-10-27 13:54:14 +02:00
|
|
|
|
Usr_DONT_GET_ROLE_IN_CRS))
|
2021-06-09 19:59:00 +02:00
|
|
|
|
{
|
|
|
|
|
/* Get if user has accepted all his/her courses */
|
2021-11-03 21:31:16 +01:00
|
|
|
|
if (Enr_DB_GetNumCrssOfUsr (UsrDat.UsrCod) != 0)
|
|
|
|
|
UsrDat.Accepted = (Enr_DB_GetNumCrssOfUsrNotAccepted (UsrDat.UsrCod) == 0);
|
2021-06-09 19:59:00 +02:00
|
|
|
|
else
|
|
|
|
|
UsrDat.Accepted = false;
|
|
|
|
|
|
|
|
|
|
/***** Write data of this user *****/
|
|
|
|
|
Usr_WriteRowUsrMainData (NumUsrs - NumUsr,&UsrDat,false,Rol_UNK,
|
|
|
|
|
&Gbl.Usrs.Selected);
|
|
|
|
|
|
|
|
|
|
/***** Write user's profile and user's courses *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-12-20 22:43:32 +01:00
|
|
|
|
HTM_TD_Begin ("colspan=\"2\" class=\"%s\"",
|
2022-03-19 02:05:53 +01:00
|
|
|
|
The_GetColorRows ());
|
2021-06-09 19:59:00 +02:00
|
|
|
|
HTM_TD_End ();
|
|
|
|
|
|
2021-12-20 22:43:32 +01:00
|
|
|
|
HTM_TD_Begin ("colspan=\"%u\" class=\"%s\"",
|
2021-06-09 19:59:00 +02:00
|
|
|
|
Usr_NUM_MAIN_FIELDS_DATA_USR-2,
|
2022-03-19 02:05:53 +01:00
|
|
|
|
The_GetColorRows ());
|
2021-06-09 19:59:00 +02:00
|
|
|
|
/* Show details of user's profile */
|
|
|
|
|
Prf_ShowDetailsUserProfile (&UsrDat);
|
2021-10-30 13:28:48 +02:00
|
|
|
|
/* Write all courses this user belongs to */
|
2021-06-09 19:59:00 +02:00
|
|
|
|
Crs_GetAndWriteCrssOfAUsr (&UsrDat,Rol_TCH);
|
|
|
|
|
Crs_GetAndWriteCrssOfAUsr (&UsrDat,Rol_NET);
|
|
|
|
|
Crs_GetAndWriteCrssOfAUsr (&UsrDat,Rol_STD);
|
|
|
|
|
HTM_TD_End ();
|
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
|
|
|
|
|
/***** Buttons to remove user / mark as not dubplicated *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-12-20 22:43:32 +01:00
|
|
|
|
HTM_TD_Begin ("colspan=\"2\" class=\"%s\"",
|
2022-03-19 02:05:53 +01:00
|
|
|
|
The_GetColorRows ());
|
2021-06-09 19:59:00 +02:00
|
|
|
|
HTM_TD_End ();
|
|
|
|
|
|
2021-12-20 22:43:32 +01:00
|
|
|
|
HTM_TD_Begin ("colspan=\"%u\" class=\"LT %s\"",
|
2021-06-09 19:59:00 +02:00
|
|
|
|
Usr_NUM_MAIN_FIELDS_DATA_USR-2,
|
2022-03-19 02:05:53 +01:00
|
|
|
|
The_GetColorRows ());
|
2021-06-09 19:59:00 +02:00
|
|
|
|
/* Button to remove this user */
|
|
|
|
|
if (Acc_CheckIfICanEliminateAccount (UsrDat.UsrCod))
|
|
|
|
|
Dup_PutButtonToEliminateUsrAccount (&UsrDat);
|
|
|
|
|
/* Button to remove from list of possible duplicate users */
|
|
|
|
|
if (Dup_DB_CheckIfUsrIsDup (UsrDat.UsrCod))
|
|
|
|
|
Dup_PutButtonToRemoveFromListOfDupUsrs (&UsrDat);
|
|
|
|
|
HTM_TD_End ();
|
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
|
2022-03-24 01:18:19 +01:00
|
|
|
|
The_ChangeRowColor ();
|
2021-06-09 19:59:00 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-06-16 14:34:17 +02:00
|
|
|
|
|
|
|
|
|
/***** End table *****/
|
2019-10-23 19:05:05 +02:00
|
|
|
|
HTM_TABLE_End ();
|
2016-06-16 14:34:17 +02:00
|
|
|
|
|
|
|
|
|
/***** Free memory used for user's data *****/
|
|
|
|
|
Usr_UsrDataDestructor (&UsrDat);
|
|
|
|
|
}
|
2017-05-29 21:34:43 +02:00
|
|
|
|
else // There are no similar users
|
2017-02-09 19:27:18 +01:00
|
|
|
|
/***** Show warning indicating no users found *****/
|
2017-05-18 19:13:41 +02:00
|
|
|
|
Usr_ShowWarningNoUsersFound (Rol_UNK);
|
2016-06-16 14:34:17 +02:00
|
|
|
|
|
2018-10-20 21:19:30 +02:00
|
|
|
|
/***** Free structure that stores the query result *****/
|
|
|
|
|
DB_FreeMySQLResult (&mysql_res);
|
|
|
|
|
|
2017-06-12 14:16:33 +02:00
|
|
|
|
/***** End box *****/
|
2019-10-25 22:48:34 +02:00
|
|
|
|
Box_BoxEnd ();
|
2016-06-16 14:34:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-18 00:28:59 +02:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************* Put button to view similar users **********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2022-09-24 18:30:26 +02:00
|
|
|
|
static void Dup_PutButtonToViewSimilarUsrs (const struct Usr_Data *UsrDat)
|
2016-06-18 00:28:59 +02:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Similar_users;
|
|
|
|
|
|
2021-03-02 00:54:26 +01:00
|
|
|
|
Frm_BeginForm (ActLstSimUsr);
|
2023-03-10 00:13:55 +01:00
|
|
|
|
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
2021-06-09 19:59:00 +02:00
|
|
|
|
Btn_PutConfirmButtonInline (Txt_Similar_users);
|
2018-11-09 20:47:39 +01:00
|
|
|
|
Frm_EndForm ();
|
2016-06-18 00:28:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********* Put button to request the elimination of a user's account *********/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2022-09-24 18:30:26 +02:00
|
|
|
|
static void Dup_PutButtonToEliminateUsrAccount (const struct Usr_Data *UsrDat)
|
2016-06-18 00:28:59 +02:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Eliminate_user_account;
|
|
|
|
|
|
2021-03-02 00:54:26 +01:00
|
|
|
|
Frm_BeginForm (ActUpdOth);
|
2023-03-10 00:13:55 +01:00
|
|
|
|
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
2023-03-07 09:55:39 +01:00
|
|
|
|
Par_PutParUnsigned (NULL,"RegRemAction",(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM);
|
2021-06-09 19:59:00 +02:00
|
|
|
|
Btn_PutRemoveButtonInline (Txt_Eliminate_user_account);
|
2018-11-09 20:47:39 +01:00
|
|
|
|
Frm_EndForm ();
|
2016-06-18 00:28:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/****** Put button to remove user from list of possible duplicate users ******/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2022-09-24 18:30:26 +02:00
|
|
|
|
static void Dup_PutButtonToRemoveFromListOfDupUsrs (const struct Usr_Data *UsrDat)
|
2016-06-18 00:28:59 +02:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Not_duplicated;
|
|
|
|
|
|
2021-03-02 00:54:26 +01:00
|
|
|
|
Frm_BeginForm (ActRemDupUsr);
|
2023-03-10 00:13:55 +01:00
|
|
|
|
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
2021-06-09 19:59:00 +02:00
|
|
|
|
Btn_PutConfirmButtonInline (Txt_Not_duplicated);
|
2018-11-09 20:47:39 +01:00
|
|
|
|
Frm_EndForm ();
|
2016-06-18 00:28:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 14:34:17 +02:00
|
|
|
|
/*****************************************************************************/
|
2016-06-17 20:59:48 +02:00
|
|
|
|
/*********** Remove user from list of possible duplicate users ***************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void Dup_RemoveUsrFromListDupUsrs (void)
|
|
|
|
|
{
|
|
|
|
|
/***** Get user to be removed from list of possible duplicates *****/
|
2023-03-10 00:13:55 +01:00
|
|
|
|
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
2016-06-17 20:59:48 +02:00
|
|
|
|
{
|
|
|
|
|
/* Remove entry from database */
|
2021-05-10 21:10:06 +02:00
|
|
|
|
Dup_DB_RemoveUsrFromDuplicated (Gbl.Usrs.Other.UsrDat.UsrCod);
|
2016-06-17 20:59:48 +02:00
|
|
|
|
|
2016-06-18 00:28:59 +02:00
|
|
|
|
/* Show list of possible duplicated users again */
|
|
|
|
|
Dup_ListDuplicateUsrs ();
|
2016-06-17 20:59:48 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2019-03-09 20:12:44 +01:00
|
|
|
|
Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission ();
|
2016-06-17 20:59:48 +02:00
|
|
|
|
}
|