Version 18.6

This commit is contained in:
Antonio Cañas Vargas 2018-10-16 21:56:01 +02:00
parent 863b6e3677
commit 7c83401c26
49 changed files with 1637 additions and 1105 deletions

View File

@ -810,7 +810,9 @@ static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe)
/***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_ID_X_removed,UsrID);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_ID_X_removed,
UsrID);
}
else
{
@ -950,7 +952,8 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_matches_one_of_the_existing,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_X_matches_one_of_the_existing,
NewID);
}
else // It's not me && !Confirmed
@ -960,7 +963,8 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_X_has_been_confirmed,
NewID);
}
}
@ -968,7 +972,8 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_A_user_can_not_have_more_than_X_IDs,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_A_user_can_not_have_more_than_X_IDs,
ID_MAX_IDS_PER_USER);
}
else // OK ==> add this new ID to my list of IDs
@ -980,7 +985,8 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_registered_successfully,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_X_has_been_registered_successfully,
NewID);
}
}
@ -988,7 +994,9 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid,NewID);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_X_is_not_valid,
NewID);
}
}
else
@ -1074,7 +1082,8 @@ void ID_ConfirmOtherUsrID (void)
/***** ID found and already confirmed *****/
Gbl.Alert.Type = Ale_INFO;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_ID_X_had_already_been_confirmed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_ID_X_had_already_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
}
else
@ -1087,7 +1096,8 @@ void ID_ConfirmOtherUsrID (void)
/***** Write success message *****/
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = ID_ID_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_X_has_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
}
}

View File

@ -247,7 +247,8 @@ void Acc_CheckIfEmptyAccountExists (void)
}
else
{
sprintf (Gbl.Alert.Txt,Txt_There_is_no_empty_account_associated_with_your_ID_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_is_no_empty_account_associated_with_your_ID_X,
ID);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -630,7 +631,8 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
if (DB_QueryCOUNT (Query,"can not check if nickname already existed")) // A nickname of another user is the same that this nickname
{
Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -638,7 +640,8 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
else // New nickname is not valid
{
Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_nickname_entered_X_is_not_valid_,
NewNicknameWithArroba,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);
@ -658,7 +661,8 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
if (DB_QueryCOUNT (Query,"can not check if email already existed")) // An email of another user is the same that my email
{
Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -666,7 +670,8 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
else // New email is not valid
{
Error = true;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -836,7 +841,8 @@ void Acc_AfterCreationNewAccount (void)
if (Gbl.Usrs.Me.Logged) // If account has been created without problem, I am logged
{
/***** Show message of success *****/
sprintf (Gbl.Alert.Txt,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
Gbl.Usrs.Me.UsrDat.Nickname,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1038,7 +1044,8 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1050,7 +1057,8 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_as_administrator,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1065,7 +1073,8 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Acc_RemoveUsrBriefcase (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Alert.Txt,Txt_Briefcase_of_THE_USER_X_has_been_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Briefcase_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1081,7 +1090,8 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Msg_DelAllRecAndSntMsgsUsr (UsrDat->UsrCod);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Alert.Txt,Txt_Messages_of_THE_USER_X_have_been_deleted,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Messages_of_THE_USER_X_have_been_deleted,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1128,7 +1138,8 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
PhotoRemoved = Pho_RemovePhoto (UsrDat);
if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Alert.Txt,Txt_Photo_of_THE_USER_X_has_been_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Photo_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1137,7 +1148,8 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Acc_RemoveUsr (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Alert.Txt,Txt_Record_card_of_THE_USER_X_has_been_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Record_card_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -1299,7 +1299,8 @@ void Agd_AskRemEvent (void)
/***** Show question and button to remove event *****/
Gbl.Agenda.AgdCodToEdit = AgdEvent.AgdCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_event_X,
AgdEvent.Event);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemEvtMyAgd,NULL,NULL,
@ -1335,7 +1336,9 @@ void Agd_RemoveEvent (void)
DB_QueryDELETE (Query,"can not remove event");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,AgdEvent.Event);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_removed,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
@ -1367,7 +1370,9 @@ void Agd_HideEvent (void)
DB_QueryUPDATE (Query,"can not hide event");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden,AgdEvent.Event);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_hidden,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
@ -1399,7 +1404,8 @@ void Agd_UnhideEvent (void)
DB_QueryUPDATE (Query,"can not show event");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_visible,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1432,7 +1438,9 @@ void Agd_MakeEventPrivate (void)
DB_QueryUPDATE (Query,"can not make event private");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_private,AgdEvent.Event);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_private,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show events again *****/
@ -1464,7 +1472,8 @@ void Agd_MakeEventPublic (void)
DB_QueryUPDATE (Query,"can not make event public");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible_to_users_of_your_courses,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_visible_to_users_of_your_courses,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1664,7 +1673,9 @@ void Agd_RecFormEvent (void)
Agd_CreateEvent (&AgdEvent,Txt); // Add new event to database
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,AgdEvent.Event);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_event_X,
AgdEvent.Event);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else

View File

@ -972,7 +972,8 @@ void Asg_ReqRemAssignment (void)
/***** Show question and button to remove the assignment *****/
Gbl.Asgs.AsgCodToEdit = Asg.AsgCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_assignment_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_assignment_X,
Asg.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemAsg,NULL,NULL,Asg_PutParams,
@ -1016,7 +1017,8 @@ void Asg_RemoveAssignment (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Assignment_X_removed,
Asg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1048,7 +1050,8 @@ void Asg_HideAssignment (void)
DB_QueryUPDATE (Query,"can not hide assignment");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_hidden,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Assignment_X_is_now_hidden,
Asg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1080,7 +1083,8 @@ void Asg_ShowAssignment (void)
DB_QueryUPDATE (Query,"can not show assignment");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Assignment_X_is_now_visible,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Assignment_X_is_now_visible,
Asg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1368,7 +1372,8 @@ void Asg_RecFormAssignment (void)
if (Asg_CheckIfSimilarAssignmentExists ("Title",NewAsg.Title,NewAsg.AsgCod))
{
NewAssignmentIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_title_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Already_existed_an_assignment_with_the_title_X,
NewAsg.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1381,7 +1386,8 @@ void Asg_RecFormAssignment (void)
if (Asg_CheckIfSimilarAssignmentExists ("Folder",NewAsg.Folder,NewAsg.AsgCod)) // If folder of assignment was in database...
{
NewAssignmentIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_assignment_with_the_folder_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Already_existed_an_assignment_with_the_folder_X,
NewAsg.Folder);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1422,7 +1428,9 @@ void Asg_RecFormAssignment (void)
Asg_CreateAssignment (&NewAsg,Txt); // Add new assignment to database
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_assignment_X,NewAsg.Title);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_assignment_X,
NewAsg.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else

View File

@ -887,7 +887,8 @@ void Att_AskRemAttEvent (void)
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Gbl.AttEvents.CurrentPage);
/***** Ask for confirmation of removing *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_event_X,
Att.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Btn_PutRemoveButton (Txt_Remove_event);
@ -918,7 +919,9 @@ void Att_GetAndRemAttEvent (void)
Att_RemoveAttEventFromDB (Att.AttCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,Att.Title);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_removed,
Att.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show attendance events again *****/
@ -965,7 +968,8 @@ void Att_HideAttEvent (void)
DB_QueryUPDATE (Query,"can not hide attendance event");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_hidden,
Att.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -997,7 +1001,8 @@ void Att_ShowAttEvent (void)
DB_QueryUPDATE (Query,"can not show attendance event");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Event_X_is_now_visible,
Att.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1282,7 +1287,8 @@ void Att_RecFormAttEvent (void)
if (Att_CheckIfSimilarAttEventExists ("Title",ReceivedAtt.Title,ReceivedAtt.AttCod))
{
ReceivedAttEventIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_an_event_with_the_title_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Already_existed_an_event_with_the_title_X,
ReceivedAtt.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1305,7 +1311,9 @@ void Att_RecFormAttEvent (void)
Att_CreateAttEvent (&ReceivedAtt,Txt); // Add new attendance event to database
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,ReceivedAtt.Title);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_event_X,
ReceivedAtt.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else
@ -2396,7 +2404,8 @@ void Att_RegisterStudentsInAttEvent (void)
/***** Write final message *****/
sprintf (Format,"%s: %%u<br />%s: %%u",Txt_Presents,Txt_Absents);
sprintf (Gbl.Alert.Txt,Format,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Format,
NumStdsPresent,NumStdsAbsent);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}

View File

@ -521,7 +521,8 @@ void Ban_RemoveBanner (void)
DB_QueryDELETE (Query,"can not remove a banner");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Banner_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Banner_X_removed,
Ban.ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -579,7 +580,8 @@ static void Ban_ShowOrHideBanner (bool Hide)
}
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Hide ? Txt_The_banner_X_is_now_hidden :
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Hide ? Txt_The_banner_X_is_now_hidden :
Txt_The_banner_X_is_now_visible,
Ban.ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -654,7 +656,8 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewBanName[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_banner_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_banner_X_empty,
CurrentBanName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -666,7 +669,8 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If banner was in database... *****/
if (Ban_CheckIfBannerNameExists (ParamName,NewBanName,Ban->BanCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_banner_X_already_exists,
NewBanName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -676,14 +680,16 @@ static void Ban_RenameBanner (Cns_ShrtOrFullName_t ShrtOrFullName)
Ban_UpdateBanNameDB (Ban->BanCod,FieldName,NewBanName);
/* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_banner_X_has_been_renamed_as_Y,
CurrentBanName,NewBanName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_banner_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_banner_X_has_not_changed,
CurrentBanName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -755,7 +761,8 @@ void Ban_ChangeBannerImg (void)
DB_QueryUPDATE (Query,"can not update the image of a banner");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_image_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_image_is_X,
NewImg);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -800,7 +807,8 @@ void Ban_ChangeBannerWWW (void)
DB_QueryUPDATE (Query,"can not update the web of a banner");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -946,13 +954,15 @@ void Ban_RecFormNewBanner (void)
/***** If name of banner was in database... *****/
if (Ban_CheckIfBannerNameExists ("ShortName",Ban->ShrtName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_banner_X_already_exists,
Ban->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Ban_CheckIfBannerNameExists ("FullName",Ban->FullName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_banner_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_banner_X_already_exists,
Ban->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -988,7 +998,8 @@ static void Ban_CreateBanner (struct Banner *Ban)
DB_QueryINSERT (Query,"can not create banner");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_banner_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_banner_X,
Ban->ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -1775,7 +1775,8 @@ void Ctr_RemoveCentre (void)
DB_QueryDELETE (Query,"can not remove a centre");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Centre_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Centre_X_removed,
Ctr.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1810,7 +1811,8 @@ void Ctr_ChangeCtrInsInConfig (void)
NewIns.InsCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.ShrtName);
}
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",
@ -1819,7 +1821,8 @@ void Ctr_ChangeCtrInsInConfig (void)
NewIns.InsCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.FullName);
}
else
@ -1834,7 +1837,8 @@ void Ctr_ChangeCtrInsInConfig (void)
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_moved_to_the_institution_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_has_been_moved_to_the_institution_Y,
Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName);
}
}
@ -2005,7 +2009,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
if (!NewCtrName[0])
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
CurrentCtrName);
}
else
@ -2017,7 +2022,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,NewCtrName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_already_exists,NewCtrName);
}
else
{
@ -2026,7 +2032,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_has_been_renamed_as_Y,
CurrentCtrName,NewCtrName);
/* Change current centre name in order to display it properly */
@ -2037,7 +2044,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
else // The same name
{
Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_centre_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_centre_X_has_not_changed,
CurrentCtrName);
}
}
@ -2102,7 +2110,9 @@ void Ctr_ChangeCtrWWW (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ctr_ShowAlertAndButtonToGoToCtr ();
}
else
@ -2131,7 +2141,9 @@ void Ctr_ChangeCtrWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else
@ -2193,7 +2205,8 @@ void Ctr_ChangeCtrStatus (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_centre_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_status_of_the_centre_X_has_changed,
Gbl.Ctrs.EditingCtr.ShrtName);
Ctr_ShowAlertAndButtonToGoToCtr ();
@ -2293,7 +2306,8 @@ void Ctr_RequestPhoto (void)
NULL,Box_NOT_CLOSABLE);
/***** Write help message *****/
sprintf (Gbl.Alert.Txt,"%s: %s<br />"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %s<br />"
"%s: %u&times;%u %s",
Txt_Recommended_aspect_ratio,
Ctr_RECOMMENDED_ASPECT_RATIO,
@ -2428,7 +2442,8 @@ void Ctr_ReceivePhoto (void)
ReturnCode = WEXITSTATUS(ReturnCode);
if (ReturnCode != 0)
{
sprintf (Gbl.Alert.Txt,"Image could not be processed successfully.<br />"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Image could not be processed successfully.<br />"
"Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
@ -2756,13 +2771,15 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
/***** If name of centre was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Gbl.Ctrs.EditingCtr.FullName,-1L,Gbl.CurrentIns.Ins.InsCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_centre_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -2811,7 +2828,8 @@ static void Ctr_CreateCentre (unsigned Status)
/***** Write message to show the change made
and put button to go to centre created *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_centre_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_centre_X,
Gbl.Ctrs.EditingCtr.FullName);
Ctr_ShowAlertAndButtonToGoToCtr ();
}

View File

@ -355,10 +355,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.5.3 (2018-10-16)"
#define Log_PLATFORM_VERSION "SWAD 18.6 (2018-10-16)"
#define CSS_FILE "swad18.4.css"
#define JS_FILE "swad17.17.1.js"
/*
Version 18.6: Oct 16, 2018 sprintf changed by snprintf in alerts. (235730 lines)
Version 18.5.3: Oct 16, 2018 sprintf changed by safe string copy in some alerts. (235198 lines)
Version 18.5.2: Oct 16, 2018 Code refactoring related to password change. (235170 lines)
Version 18.5.1: Oct 16, 2018 Code refactoring related to edition of another user's account. (235212 lines)

View File

@ -80,7 +80,8 @@ void Cht_ShowChatRooms (void)
extern const char *Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_;
/***** Help message about software needed to use the whiteboard/chat *****/
sprintf (Gbl.Alert.Txt,Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
Cfg_JAVA_URL,Cfg_JAVA_NAME,
Cfg_PLATFORM_SERVER);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);

View File

@ -1709,7 +1709,8 @@ void Cty_RemoveCountry (void)
Cty_FlushCacheCountryName ();
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Country_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Country_X_removed,
Cty.Name[Gbl.Prefs.Language]);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1751,7 +1752,8 @@ void Cty_RenameCountry (void)
/***** Check if new name is empty *****/
if (!NewCtyName[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_country_X_empty,
Cty->Name[Language]);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1763,7 +1765,8 @@ void Cty_RenameCountry (void)
/***** If country was in database... *****/
if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_country_X_already_exists,
NewCtyName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1774,7 +1777,8 @@ void Cty_RenameCountry (void)
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
/* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_country_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_country_X_has_been_renamed_as_Y,
Cty->Name[Language],NewCtyName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1785,7 +1789,8 @@ void Cty_RenameCountry (void)
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_country_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_country_X_has_not_changed,
Cty->Name[Language]);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -1892,7 +1897,9 @@ void Cty_ChangeCtyWWW (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show the form again *****/
@ -2102,7 +2109,8 @@ void Cty_RecFormNewCountry (void)
}
else if (Cty_CheckIfNumericCountryCodeExists (Cty->CtyCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_numerical_code_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_numerical_code_X_already_exists,
Cty->CtyCod);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
@ -2118,7 +2126,8 @@ void Cty_RecFormNewCountry (void)
if (Cty->Alpha2[i] < 'A' ||
Cty->Alpha2[i] > 'Z')
{
sprintf (Gbl.Alert.Txt,Txt_The_alphabetical_code_X_is_not_correct,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_alphabetical_code_X_is_not_correct,
Cty->Alpha2);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
@ -2127,7 +2136,8 @@ void Cty_RecFormNewCountry (void)
{
if (Cty_CheckIfAlpha2CountryCodeExists (Cty->Alpha2))
{
sprintf (Gbl.Alert.Txt,Txt_The_alphabetical_code_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_alphabetical_code_X_already_exists,
Cty->Alpha2);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
@ -2147,7 +2157,8 @@ void Cty_RecFormNewCountry (void)
/***** If name of country was in database... *****/
if (Cty_CheckIfCountryNameExists (Lan,Cty->Name[Lan],-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_country_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_country_X_already_exists,
Cty->Name[Lan]);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CreateCountry = false;
@ -2238,7 +2249,8 @@ static void Cty_CreateCountry (struct Country *Cty)
DB_QueryINSERT (Query,"can not create country");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_country_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_country_X,
Cty->Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -1336,7 +1336,9 @@ void Crs_EditCourses (void)
Deg_GetListDegsOfCurrentCtr ();
/***** Start box *****/
sprintf (Gbl.Alert.Txt,Txt_Courses_of_DEGREE_X,Gbl.CurrentDeg.Deg.ShrtName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Courses_of_DEGREE_X,
Gbl.CurrentDeg.Deg.ShrtName);
Box_StartBox (NULL,Gbl.Alert.Txt,Crs_PutIconToViewCourses,
Hlp_DEGREE_Courses,Box_NOT_CLOSABLE);
@ -1864,14 +1866,16 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status)
Gbl.Degs.EditingCrs.DegCod,Gbl.Degs.EditingCrs.Year))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_already_exists,
Gbl.Degs.EditingCrs.ShrtName);
}
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.Degs.EditingCrs.FullName,-1L,
Gbl.Degs.EditingCrs.DegCod,Gbl.Degs.EditingCrs.Year))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_already_exists,
Gbl.Degs.EditingCrs.FullName);
}
else // Add new requested course to database
@ -1887,7 +1891,8 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status)
else // Year not valid
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_year_X_is_not_allowed,
Gbl.Degs.EditingCrs.Year);
}
}
@ -1941,7 +1946,8 @@ static void Crs_CreateCourse (unsigned Status)
/***** Create success message *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_course_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_course_X,
Gbl.Degs.EditingCrs.FullName);
}
@ -1973,7 +1979,8 @@ void Crs_RemoveCourse (void)
Crs_RemoveCourseCompletely (Crs.CrsCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Course_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Course_X_removed,
Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -2295,11 +2302,13 @@ void Crs_ChangeInsCrsCodInConfig (void)
{
Crs_UpdateInstitutionalCrsCod (&Gbl.CurrentCrs.Crs,NewInstitutionalCrsCod);
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
Gbl.CurrentCrs.Crs.ShrtName,NewInstitutionalCrsCod);
}
else // The same institutional code
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institutional_code_of_the_course_X_has_not_changed,
Gbl.CurrentCrs.Crs.ShrtName);
}
@ -2331,13 +2340,15 @@ void Crs_ChangeInsCrsCod (void)
{
Crs_UpdateInstitutionalCrsCod (&Gbl.Degs.EditingCrs,NewInstitutionalCrsCod);
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institutional_code_of_the_course_X_has_changed_to_Y,
Gbl.Degs.EditingCrs.ShrtName,NewInstitutionalCrsCod);
}
else // The same institutional code
{
Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_institutional_code_of_the_course_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institutional_code_of_the_course_X_has_not_changed,
Gbl.Degs.EditingCrs.ShrtName);
}
}
@ -2374,15 +2385,19 @@ void Crs_ChangeCrsDegInConfig (void)
NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,Gbl.CurrentCrs.Crs.ShrtName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,
Gbl.CurrentCrs.Crs.ShrtName);
}
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.CurrentCrs.Crs.FullName,-1L,
NewDeg.DegCod,Gbl.CurrentCrs.Crs.Year))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,Gbl.CurrentCrs.Crs.FullName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Txt_YEAR_OF_DEGREE[Gbl.CurrentCrs.Crs.Year],NewDeg.FullName,
Gbl.CurrentCrs.Crs.FullName);
}
else // Update degree in database
{
@ -2396,7 +2411,8 @@ void Crs_ChangeCrsDegInConfig (void)
/***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_has_been_moved_to_the_degree_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_has_been_moved_to_the_degree_Y,
Gbl.CurrentCrs.Crs.FullName,
Gbl.CurrentDeg.Deg.FullName);
}
@ -2454,14 +2470,16 @@ void Crs_ChangeCrsYearInConfig (void)
Gbl.CurrentCrs.Crs.DegCod,NewYear))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_already_exists_in_year_Y,
Gbl.CurrentCrs.Crs.ShrtName,Txt_YEAR_OF_DEGREE[NewYear]);
}
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.CurrentCrs.Crs.FullName,-1L,
Gbl.CurrentCrs.Crs.DegCod,NewYear))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_already_exists_in_year_Y,
Gbl.CurrentCrs.Crs.FullName,Txt_YEAR_OF_DEGREE[NewYear]);
}
else // Update year in database
@ -2471,14 +2489,17 @@ void Crs_ChangeCrsYearInConfig (void)
/***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_year_of_the_course_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_year_of_the_course_X_has_changed,
Gbl.CurrentCrs.Crs.ShrtName);
}
}
else // Year not valid
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,NewYear);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_year_X_is_not_allowed,
NewYear);
}
}
@ -2519,14 +2540,16 @@ void Crs_ChangeCrsYear (void)
Gbl.Degs.EditingCrs.DegCod,NewYear))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_already_exists_in_year_Y,
Gbl.Degs.EditingCrs.ShrtName,Txt_YEAR_OF_DEGREE[NewYear]);
}
else if (Crs_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.Degs.EditingCrs.FullName,-1L,
Gbl.Degs.EditingCrs.DegCod,NewYear))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists_in_year_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_already_exists_in_year_Y,
Gbl.Degs.EditingCrs.FullName,Txt_YEAR_OF_DEGREE[NewYear]);
}
else // Update year in database
@ -2536,14 +2559,17 @@ void Crs_ChangeCrsYear (void)
/***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_year_of_the_course_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_year_of_the_course_X_has_changed,
Gbl.Degs.EditingCrs.ShrtName);
}
}
else // Year not valid
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_year_X_is_not_allowed,NewYear);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_year_X_is_not_allowed,
NewYear);
}
}
else
@ -2665,7 +2691,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
if (!NewCrsName[0])
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_course_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_course_X_empty,
CurrentCrsName);
}
else
@ -2678,7 +2705,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
Crs->DegCod,Crs->Year))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_course_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_course_X_already_exists,
NewCrsName);
}
else
@ -2688,7 +2716,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
/* Create message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_course_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_course_X_has_changed_to_Y,
CurrentCrsName,NewCrsName);
/* Change current course name in order to display it properly */
@ -2699,7 +2728,8 @@ static void Crs_RenameCourse (struct Course *Crs,Cns_ShrtOrFullName_t ShrtOrFull
else // The same name
{
Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_course_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_course_X_has_not_changed,
CurrentCrsName);
}
}
@ -2780,7 +2810,8 @@ void Crs_ChangeCrsStatus (void)
/***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_course_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_status_of_the_course_X_has_changed,
Gbl.Degs.EditingCrs.ShrtName);
}
@ -3426,7 +3457,8 @@ void Crs_RemoveOldCrss (void)
SecondsWithoutAccess);
if ((NumCrss = DB_QuerySELECT (Query,&mysql_res,"can not get old users")))
{
sprintf (Gbl.Alert.Txt,Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
NumCrss,
MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
@ -3448,7 +3480,8 @@ void Crs_RemoveOldCrss (void)
}
/***** Write end message *****/
sprintf (Gbl.Alert.Txt,Txt_X_courses_have_been_eliminated,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_courses_have_been_eliminated,
NumCrssRemoved);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -1153,7 +1153,8 @@ static void Deg_CreateDegree (unsigned Status)
/***** Write message to show the change made
and put button to go to degree created *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_degree_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_degree_X,
Gbl.Degs.EditingDeg.FullName);
Deg_ShowAlertAndButtonToGoToDeg ();
}
@ -1560,13 +1561,15 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status)
/***** If name of degree was in database... *****/
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.Degs.EditingDeg.ShrtName,-1L,Gbl.Degs.EditingDeg.CtrCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_degree_X_already_exists,
Gbl.Degs.EditingDeg.ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Deg_CheckIfDegNameExistsInCtr ("FullName",Gbl.Degs.EditingDeg.FullName,-1L,Gbl.Degs.EditingDeg.CtrCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_degree_X_already_exists,
Gbl.Degs.EditingDeg.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1608,7 +1611,8 @@ void Deg_RemoveDegree (void)
Deg_RemoveDegreeCompletely (Deg.DegCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Degree_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Degree_X_removed,
Deg.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1966,7 +1970,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
if (!NewDegName[0])
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_degree_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_degree_X_empty,
CurrentDegName);
}
else
@ -1978,7 +1983,9 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
if (Deg_CheckIfDegNameExistsInCtr (ParamName,NewDegName,Deg->DegCod,Deg->CtrCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,NewDegName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_degree_X_already_exists,
NewDegName);
}
else
{
@ -1987,7 +1994,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
/* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_degree_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_degree_X_has_changed_to_Y,
CurrentDegName,NewDegName);
/* Change current degree name in order to display it properly */
@ -1998,7 +2006,8 @@ static void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFull
else // The same name
{
Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_degree_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_degree_X_has_not_changed,
CurrentDegName);
}
}
@ -2056,13 +2065,15 @@ void Deg_ChangeDegCtrInConfig (void)
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.CurrentDeg.Deg.ShrtName,Gbl.CurrentDeg.Deg.DegCod,NewCtr.CtrCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_degree_X_already_exists,
Gbl.CurrentDeg.Deg.ShrtName);
}
else if (Deg_CheckIfDegNameExistsInCtr ("FullName",Gbl.CurrentDeg.Deg.FullName,Gbl.CurrentDeg.Deg.DegCod,NewCtr.CtrCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_degree_X_already_exists,
Gbl.CurrentDeg.Deg.FullName);
}
else
@ -2077,7 +2088,8 @@ void Deg_ChangeDegCtrInConfig (void)
/***** Create message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_degree_X_has_been_moved_to_the_centre_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_degree_X_has_been_moved_to_the_centre_Y,
Gbl.CurrentDeg.Deg.FullName,
Gbl.CurrentCtr.Ctr.FullName);
}
@ -2142,7 +2154,9 @@ void Deg_ChangeDegWWW (void)
/***** Write message to show the change made
and put button to go to degree changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Deg_ShowAlertAndButtonToGoToDeg ();
}
else
@ -2171,7 +2185,9 @@ void Deg_ChangeDegWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else
@ -2234,7 +2250,8 @@ void Deg_ChangeDegStatus (void)
/***** Write message to show the change made
and put button to go to degree changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_degree_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_status_of_the_degree_X_has_changed,
Gbl.Degs.EditingDeg.ShrtName);
Deg_ShowAlertAndButtonToGoToDeg ();

View File

@ -551,7 +551,8 @@ static void DT_CreateDegreeType (struct DegreeType *DegTyp)
DB_QueryINSERT (Query,"can not create a new type of degree");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_type_of_degree_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_type_of_degree_X,
DegTyp->DegTypName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -720,7 +721,8 @@ void DT_RecFormNewDegreeType (void)
/***** If name of degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (DegTyp->DegTypName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_degree_X_already_exists,
DegTyp->DegTypName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -760,7 +762,8 @@ void DT_RemoveDegreeType (void)
DT_RemoveDegreeTypeCompletely (DegTyp.DegTypCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Type_of_degree_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Type_of_degree_X_removed,
DegTyp.DegTypName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -934,7 +937,8 @@ void DT_RenameDegreeType (void)
/***** Check if new name is empty *****/
if (!NewNameDegTyp[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty,
DegTyp->DegTypName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -946,7 +950,8 @@ void DT_RenameDegreeType (void)
/***** If degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (NewNameDegTyp,DegTyp->DegTypCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_degree_X_already_exists,
NewNameDegTyp);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -959,14 +964,16 @@ void DT_RenameDegreeType (void)
DB_QueryUPDATE (Query,"can not update the type of a degree");
/* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_degree_X_has_been_renamed_as_Y,
DegTyp->DegTypName,NewNameDegTyp);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_type_of_degree_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_type_of_degree_X_has_not_changed,
NewNameDegTyp);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -1021,7 +1028,8 @@ void DT_ChangeDegreeType (void)
/***** Write message to show the change made
and put button to go to degree changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_degree_of_the_degree_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_degree_of_the_degree_X_has_changed,
Gbl.Degs.EditingDeg.FullName);
Deg_ShowAlertAndButtonToGoToDeg ();

View File

@ -628,7 +628,9 @@ void Dpt_RemoveDepartment (void)
DB_QueryDELETE (Query,"can not remove a department");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Department_X_removed,Dpt.FullName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Department_X_removed,
Dpt.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -732,7 +734,8 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewDptName[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_department_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_department_X_empty,
CurrentDptName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -744,7 +747,8 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If degree was in database... *****/
if (Dpt_CheckIfDepartmentNameExists (ParamName,NewDptName,Dpt->DptCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_department_X_already_exists,
NewDptName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -754,14 +758,16 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
Dpt_UpdateDegNameDB (Dpt->DptCod,FieldName,NewDptName);
/* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_department_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_department_X_has_been_renamed_as_Y,
CurrentDptName,NewDptName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_department_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_department_X_has_not_changed,
CurrentDptName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -832,7 +838,8 @@ void Dpt_ChangeDptWWW (void)
DB_QueryUPDATE (Query,"can not update the web of a department");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1021,13 +1028,15 @@ void Dpt_RecFormNewDpt (void)
/***** If name of department was in database... *****/
if (Dpt_CheckIfDepartmentNameExists ("ShortName",Dpt->ShrtName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_department_X_already_exists,
Dpt->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Dpt_CheckIfDepartmentNameExists ("FullName",Dpt->FullName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_department_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_department_X_already_exists,
Dpt->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1065,7 +1074,8 @@ static void Dpt_CreateDepartment (struct Department *Dpt)
DB_QueryINSERT (Query,"can not create a new department");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_department_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_department_X,
Dpt->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -360,12 +360,13 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncParams)
Act_StartForm (NextAction);
if (FuncParams)
FuncParams ();
fprintf (Gbl.F.Out,"<label class=\"%s RIGHT_MIDDLE\">"
fprintf (Gbl.F.Out,"<label for=\"OtherUsrIDNickOrEMail\""
" class=\"%s RIGHT_MIDDLE\">"
"%s:&nbsp;"
"<input type=\"text\" name=\"OtherUsrIDNickOrEMail\""
" size=\"18\" maxlength=\"%u\""
" required=\"required\" />"
"</label>",
"</label>"
"<input type=\"text\" id=\"OtherUsrIDNickOrEMail\""
" name=\"OtherUsrIDNickOrEMail\""
" size=\"18\" maxlength=\"%u\" required=\"required\" />",
The_ClassForm[Gbl.Prefs.Theme],
Txt_nick_email_or_ID,
Cns_MAX_CHARS_EMAIL_ADDRESS);
@ -394,7 +395,8 @@ void Enr_ReqAcceptRegisterInCrs (void)
Hlp_USERS_SignUp_confirm_enrolment,Box_NOT_CLOSABLE);
/***** Show message *****/
sprintf (Gbl.Alert.Txt,Txt_A_teacher_or_administrator_has_enroled_you_as_X_into_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_A_teacher_or_administrator_has_enroled_you_as_X_into_the_course_Y,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -772,7 +774,8 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
else
{
/* Write help message */
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X_Therefore_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_No_groups_have_been_created_in_the_course_X_Therefore_,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -895,7 +898,8 @@ void Enr_RemoveOldUsrs (void)
(unsigned long) SecondsWithoutAccess);
if ((NumUsrs = DB_QuerySELECT (Query,&mysql_res,"can not get old users")))
{
sprintf (Gbl.Alert.Txt,Txt_Eliminating_X_users_who_were_not_enroled_in_any_course_and_with_more_than_Y_months_without_access_to_Z,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Eliminating_X_users_who_were_not_enroled_in_any_course_and_with_more_than_Y_months_without_access_to_Z,
NumUsrs,
MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
@ -929,7 +933,8 @@ void Enr_RemoveOldUsrs (void)
}
/***** Write end message *****/
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_eliminated,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_users_have_been_eliminated,
NumUsrsEliminated);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1027,15 +1032,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
Gbl.Usrs.Me.Role.Logged >= Rol_STD)
{
sprintf (Gbl.Alert.Txt,UsrBelongsToCrs ? (ItsMe ? Txt_Modify_me_in_the_course_X :
Txt_Modify_user_in_the_course_X) :
(ItsMe ? Txt_Register_me_in_X :
Txt_Register_USER_in_the_course_X),
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REGISTER_MODIFY_ONE_USR_IN_CRS,
(unsigned) Enr_REGISTER_MODIFY_ONE_USR_IN_CRS);
if (!OptionChecked)
{
@ -1043,10 +1043,16 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REGISTER_MODIFY_ONE_USR_IN_CRS);
fprintf (Gbl.F.Out,
UsrBelongsToCrs ? (ItsMe ? Txt_Modify_me_in_the_course_X :
Txt_Modify_user_in_the_course_X) :
(ItsMe ? Txt_Register_me_in_X :
Txt_Register_USER_in_the_course_X),
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1060,12 +1066,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsDegAdmin &&
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
{
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REGISTER_ONE_DEGREE_ADMIN,
(unsigned) Enr_REGISTER_ONE_DEGREE_ADMIN);
if (!OptionChecked)
{
@ -1073,10 +1077,13 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REGISTER_ONE_DEGREE_ADMIN);
fprintf (Gbl.F.Out,
Txt_Register_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1085,12 +1092,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsCtrAdmin &&
Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM)
{
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REGISTER_ONE_CENTRE_ADMIN,
(unsigned) Enr_REGISTER_ONE_CENTRE_ADMIN);
if (!OptionChecked)
{
@ -1098,10 +1103,13 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REGISTER_ONE_CENTRE_ADMIN);
fprintf (Gbl.F.Out,
Txt_Register_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1111,12 +1119,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!UsrIsInsAdmin &&
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
{
sprintf (Gbl.Alert.Txt,Txt_Register_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REGISTER_ONE_INSTITUTION_ADMIN,
(unsigned) Enr_REGISTER_ONE_INSTITUTION_ADMIN);
if (!OptionChecked)
{
@ -1124,10 +1130,12 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REGISTER_ONE_INSTITUTION_ADMIN);
fprintf (Gbl.F.Out,Txt_Register_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1137,9 +1145,9 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (!ItsMe && Gbl.Usrs.Me.Role.Logged >= Rol_TCH)
{
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE,
(unsigned) Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE);
if (!OptionChecked)
{
@ -1147,9 +1155,11 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"<label for=\"RegRemAction%u\">"
"%s"
"</label>"
"</li>",
(unsigned) Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE,
Txt_Report_possible_duplicate_user);
NumOptionsShown++;
@ -1158,14 +1168,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
/***** Remove user from the course *****/
if (UsrBelongsToCrs)
{
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_from_THE_COURSE_X :
Txt_Remove_USER_from_THE_COURSE_X,
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\%u\"",
(unsigned) Enr_REMOVE_ONE_USR_FROM_CRS,
(unsigned) Enr_REMOVE_ONE_USR_FROM_CRS);
if (!OptionChecked)
{
@ -1173,10 +1179,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REMOVE_ONE_USR_FROM_CRS);
fprintf (Gbl.F.Out,
ItsMe ? Txt_Remove_me_from_THE_COURSE_X :
Txt_Remove_USER_from_THE_COURSE_X,
Gbl.CurrentCrs.Crs.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1190,14 +1200,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsDegAdmin &&
(ItsMe || Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM))
{
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_degree_X :
Txt_Remove_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\" "
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REMOVE_ONE_DEGREE_ADMIN,
(unsigned) Enr_REMOVE_ONE_DEGREE_ADMIN);
if (!OptionChecked)
{
@ -1205,10 +1211,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REMOVE_ONE_DEGREE_ADMIN);
fprintf (Gbl.F.Out,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_degree_X :
Txt_Remove_USER_as_an_administrator_of_the_degree_X,
Gbl.CurrentDeg.Deg.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1217,14 +1227,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsCtrAdmin &&
(ItsMe || Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM))
{
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_centre_X :
Txt_Remove_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REMOVE_ONE_CENTRE_ADMIN,
(unsigned) Enr_REMOVE_ONE_CENTRE_ADMIN);
if (!OptionChecked)
{
@ -1232,10 +1238,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REMOVE_ONE_CENTRE_ADMIN);
fprintf (Gbl.F.Out,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_centre_X :
Txt_Remove_USER_as_an_administrator_of_the_centre_X,
Gbl.CurrentCtr.Ctr.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1245,14 +1255,10 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (UsrIsInsAdmin &&
(ItsMe || Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM))
{
sprintf (Gbl.Alert.Txt,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_institution_X :
Txt_Remove_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_REMOVE_ONE_INSTITUTION_ADMIN,
(unsigned) Enr_REMOVE_ONE_INSTITUTION_ADMIN);
if (!OptionChecked)
{
@ -1260,10 +1266,14 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
OptionChecked = true;
}
fprintf (Gbl.F.Out," />"
"%s"
"</label>"
"</li>",
Gbl.Alert.Txt);
"<label for=\"RegRemAction%u\">",
(unsigned) Enr_REMOVE_ONE_INSTITUTION_ADMIN);
fprintf (Gbl.F.Out,
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_institution_X :
Txt_Remove_USER_as_an_administrator_of_the_institution_X,
Gbl.CurrentIns.Ins.ShrtName);
fprintf (Gbl.F.Out,"</label>"
"</li>");
NumOptionsShown++;
}
@ -1273,16 +1283,18 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
if (Acc_CheckIfICanEliminateAccount (Gbl.Usrs.Other.UsrDat.UsrCod))
{
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\"",
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"",
(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM,
(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM);
if (!OptionChecked)
fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />"
"<label for=\"RegRemAction%u\">"
"%s"
"</label>"
"</li>",
(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM,
ItsMe ? Txt_Eliminate_my_user_account :
Txt_Eliminate_user_account);
@ -1316,52 +1328,62 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
/***** Register / remove users listed or not listed *****/
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\" checked=\"checked\" />"
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" checked=\"checked\" />"
"<label for=\"RegRemAction%u\">"
"%s"
"</label>"
"</li>"
"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\" />"
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">"
"%s"
"</label>"
"</li>"
"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\" />"
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">"
"%s"
"</label>"
"</li>"
"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\" />"
"<input id=\"RegRemAction%u\" type=\"radio\""
" name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">"
"%s"
"</label>"
"</li>",
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
Txt_Register_the_users_indicated_in_step_1,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_indicated_in_step_1,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_not_indicated_in_step_1,
(unsigned) Enr_UPDATE_USRS_IN_CRS,
(unsigned) Enr_UPDATE_USRS_IN_CRS,
(unsigned) Enr_UPDATE_USRS_IN_CRS,
Txt_Register_the_users_indicated_in_step_1_and_remove_the_users_not_indicated);
/***** Only for superusers *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
fprintf (Gbl.F.Out,"<li>"
"<label>"
"<input type=\"radio\" name=\"RegRemAction\""
" value=\"%u\" />"
"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">"
"%s"
"</label>"
"</li>",
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
Txt_Eliminate_from_the_platform_the_users_indicated_in_step_1);
/***** End list of options *****/
@ -1757,7 +1779,8 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_eliminated);
break;
default:
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_eliminated,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_users_have_been_eliminated,
NumUsrsEliminated);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
break;
@ -1772,7 +1795,8 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_removed);
break;
default:
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_users_have_been_removed,
NumUsrsRemoved);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
break;
@ -1788,7 +1812,8 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_user_has_been_enroled);
break;
default:
sprintf (Gbl.Alert.Txt,Txt_X_users_have_been_enroled_including_possible_repetitions,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_users_have_been_enroled_including_possible_repetitions,
NumUsrsRegistered);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
break;
@ -1886,7 +1911,8 @@ void Enr_AskRemAllStdsThisCrs (void)
{
/***** Show question and button to remove students *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_X_students_from_the_course_Y_,
Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
@ -1922,7 +1948,8 @@ void Enr_RemAllStdsThisCrs (void)
{
if ((NumStdsInCrs = Enr_RemAllStdsInCrs (&Gbl.CurrentCrs.Crs)))
{
sprintf (Gbl.Alert.Txt,Txt_The_X_students_who_belonged_to_the_course_Y_have_been_removed_from_it,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_X_students_who_belonged_to_the_course_Y_have_been_removed_from_it,
NumStdsInCrs,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1975,7 +2002,8 @@ void Enr_ReqSignUpInCrs (void)
/***** Check if I already belong to course *****/
if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role >= Rol_STD)
{
sprintf (Gbl.Alert.Txt,Txt_You_were_already_enroled_as_X_in_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_were_already_enroled_as_X_in_the_course_Y,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
@ -2006,7 +2034,8 @@ void Enr_SignUpInCrs (void)
/***** Check if I already belong to course *****/
if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role >= Rol_STD)
{
sprintf (Gbl.Alert.Txt,Txt_You_were_already_enroled_as_X_in_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_were_already_enroled_as_X_in_the_course_Y,
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
@ -2064,7 +2093,8 @@ void Enr_SignUpInCrs (void)
}
/***** Show confirmation message *****/
sprintf (Gbl.Alert.Txt,Txt_Your_request_for_enrolment_as_X_in_the_course_Y_has_been_accepted_for_processing,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Your_request_for_enrolment_as_X_in_the_course_Y_has_been_accepted_for_processing,
Txt_ROLES_SINGUL_abc[RoleFromForm][Gbl.Usrs.Me.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -2159,7 +2189,8 @@ void Enr_AskIfRejectSignUp (void)
if (Usr_CheckIfUsrBelongsToCurrentCrs (&Gbl.Usrs.Other.UsrDat))
{
/* User already belongs to this course */
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -2176,7 +2207,8 @@ void Enr_AskIfRejectSignUp (void)
{
/***** Show question and button to reject user's enrolment request *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reject_the_enrolment_request_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_reject_the_enrolment_request_,
Gbl.Usrs.Other.UsrDat.FullName,
Txt_ROLES_SINGUL_abc[Role][Gbl.Usrs.Other.UsrDat.Sex],
Gbl.CurrentCrs.Crs.FullName);
@ -2216,7 +2248,8 @@ void Enr_RejectSignUp (void)
if (Usr_CheckIfUsrBelongsToCurrentCrs (&Gbl.Usrs.Other.UsrDat))
{
/* User already belongs to this course */
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -2226,7 +2259,8 @@ void Enr_RejectSignUp (void)
Enr_RemoveEnrolmentRequest (Gbl.CurrentCrs.Crs.CrsCod,Gbl.Usrs.Other.UsrDat.UsrCod);
/* Confirmation message */
sprintf (Gbl.Alert.Txt,Txt_Enrolment_of_X_rejected,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Enrolment_of_X_rejected,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -3254,7 +3288,8 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
/***** Warning if more than one user found *****/
if (ListUsrCods->NumUsrs > 1)
{
sprintf (Gbl.Alert.Txt,Txt_There_are_X_users_with_the_ID_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_are_X_users_with_the_ID_Y,
ListUsrCods->NumUsrs,Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -3275,10 +3310,12 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
{
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&Gbl.Usrs.Other.UsrDat);
if (Gbl.Usrs.Other.UsrDat.Accepted)
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_already_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
else // Enrolment not yet accepted
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_in_the_course_Y_but_has_not_yet_accepted_the_enrolment,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_already_in_the_course_Y_but_has_not_yet_accepted_the_enrolment,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -3286,8 +3323,10 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
}
else // User does not belong to the current course
{
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_already_exists_in_Y_but_is_not_yet_enroled_in_the_course_Z,
Gbl.Usrs.Other.UsrDat.FullName,Cfg_PLATFORM_SHORT_NAME,Gbl.CurrentCrs.Crs.FullName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_already_exists_in_Y_but_is_not_yet_enroled_in_the_course_Z,
Gbl.Usrs.Other.UsrDat.FullName,
Cfg_PLATFORM_SHORT_NAME,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Enr_ShowFormToEditOtherUsr ();
@ -3295,7 +3334,8 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
}
else // No course selected
{
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_already_exists_in_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_already_exists_in_Y,
Gbl.Usrs.Other.UsrDat.FullName,Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -3318,7 +3358,8 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
if (NewUsrIDValid)
{
/***** Show form to enter the data of a new user *****/
sprintf (Gbl.Alert.Txt,Txt_The_user_is_new_not_yet_in_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_user_is_new_not_yet_in_X,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Rec_ShowFormOtherNewSharedRecord (&Gbl.Usrs.Other.UsrDat,Role);
@ -3326,7 +3367,8 @@ static void Enr_AskIfRegRemUsr (struct ListUsrCods *ListUsrCods,Rol_Role_t Role)
else // User's ID is not valid
{
/* Write message and request a new user's ID */
sprintf (Gbl.Alert.Txt,Txt_If_this_is_a_new_user_in_X_you_should_indicate_her_his_ID,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_If_this_is_a_new_user_in_X_you_should_indicate_her_his_ID,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Enr_ReqRegRemUsr (Role);
@ -3420,7 +3462,8 @@ static void Enr_RegisterAdmin (struct UsrData *UsrDat,Sco_Scope_t Scope,long Cod
/***** Check if user was and administrator of current institution/centre/degree *****/
if (Usr_CheckIfUsrIsAdm (UsrDat->UsrCod,Scope,Cod))
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_an_administrator_of_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_already_an_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
else // User was not administrator of current institution/centre/degree
{
@ -3432,7 +3475,8 @@ static void Enr_RegisterAdmin (struct UsrData *UsrDat,Sco_Scope_t Scope,long Cod
UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod);
DB_QueryREPLACE (Query,"can not create administrator");
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_as_administrator_of_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_enroled_as_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
}
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -3632,7 +3676,8 @@ static void Enr_ReqRemOrRemAdm (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr,Sco_Scope_t
}
else // The other user is not an administrator of current institution
{
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_an_administrator_of_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_not_an_administrator_of_Y,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -3680,7 +3725,8 @@ static void Enr_ReqAddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName)
{
if (Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,Scope,Cod)) // User is already an administrator of current institution/centre/degree
{
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_already_an_administrator_of_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_already_an_administrator_of_Y,
Gbl.Usrs.Other.UsrDat.FullName,InsCtrDegName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
Rec_ShowSharedRecordUnmodifiable (&Gbl.Usrs.Other.UsrDat);
@ -3689,7 +3735,8 @@ static void Enr_ReqAddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName)
{
/***** Show question and button to register user as administrator *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_register_the_following_user_as_an_administrator_of_X,
InsCtrDegName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
@ -3729,7 +3776,8 @@ void Enr_AcceptRegisterMeInCrs (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Confirmation message *****/
sprintf (Gbl.Alert.Txt,Txt_You_have_confirmed_your_enrolment_in_the_course_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_have_confirmed_your_enrolment_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -3781,8 +3829,10 @@ void Enr_CreateNewUsr1 (void)
/* Success message */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Usrs.Other.UsrDat.FullName,
Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]);
}
@ -3795,8 +3845,10 @@ void Enr_CreateNewUsr1 (void)
/* Success message */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,
Gbl.CurrentCrs.Crs.FullName);
}
/***** Change user's groups *****/
@ -3829,7 +3881,8 @@ void Enr_CreateNewUsr1 (void)
{
/***** Error message *****/
Gbl.Alert.Type = Ale_ERROR;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_X_is_not_valid,
Gbl.Usrs.Other.UsrDat.IDs.List[0].ID);
}
}
@ -3904,8 +3957,10 @@ void Enr_ModifyUsr1 (void)
/* Set success message */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_role_of_THE_USER_X_in_the_course_Y_has_changed_from_A_to_B,
Gbl.Usrs.Other.UsrDat.FullName,
Gbl.CurrentCrs.Crs.FullName,
Txt_ROLES_SINGUL_abc[OldRole][Gbl.Usrs.Other.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[NewRole][Gbl.Usrs.Other.UsrDat.Sex]);
}
@ -3918,7 +3973,8 @@ void Enr_ModifyUsr1 (void)
/* Set success message */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_enroled_in_the_course_Y,
Gbl.Usrs.Other.UsrDat.FullName,Gbl.CurrentCrs.Crs.FullName);
}
@ -4097,7 +4153,7 @@ static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat)
/***** Show question and button to remove user as administrator *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ItsMe ? Txt_Do_you_really_want_to_be_removed_from_the_course_X :
Txt_Do_you_really_want_to_remove_the_following_user_from_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
@ -4216,7 +4272,8 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,struct Course *
if (QuietOrVerbose == Cns_VERBOSE)
{
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_the_course_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_from_the_course_Y,
UsrDat->FullName,Crs->FullName);
}
}
@ -4255,7 +4312,7 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,
{
/***** Show question and button to remove user as administrator *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ItsMe ? Txt_Do_you_really_want_to_be_removed_as_an_administrator_of_X :
Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_X,
InsCtrDegName);
@ -4295,13 +4352,15 @@ static void Enr_EffectivelyRemAdm (struct UsrData *UsrDat,Sco_Scope_t Scope,
UsrDat->UsrCod,Sco_ScopeDB[Scope],Cod);
DB_QueryDELETE (Query,"can not remove an administrator");
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator_of_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_as_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else // User is not an administrator of the current institution/centre/degree
{
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_an_administrator_of_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_not_an_administrator_of_Y,
UsrDat->FullName,InsCtrDegName);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}

View File

@ -658,7 +658,8 @@ static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewEx
/***** The result of the query may be empty *****/
if (!NumExaAnns)
{
sprintf (Gbl.Alert.Txt,Txt_No_announcements_of_exams_of_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_No_announcements_of_exams_of_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}

View File

@ -141,10 +141,12 @@ bool Fil_ReadStdinIntoTmpFile (void)
{
Fil_EndOfReadingStdin (); // If stdin were not fully read, there will be problems with buffers
if (FileIsTooBig)
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_File_too_large_maximum_X_MiB_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_File_too_large_maximum_X_MiB_NO_HTML,
(unsigned long) (Fil_MAX_FILE_SIZE / (1024ULL * 1024ULL)));
else
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_Upload_time_too_long_maximum_X_minutes_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_Upload_time_too_long_maximum_X_minutes_NO_HTML,
(unsigned long) (Cfg_TIME_TO_ABORT_FILE_UPLOAD / 60UL));
/* Don't write HTML at all */
@ -341,7 +343,9 @@ void Fil_CreateUpdateFile (const char CurrentName[PATH_MAX + 1],
/* Open the new file */
if ((*NewFile = fopen (NewName,"wb")) == NULL)
{
sprintf (Gbl.Alert.Txt,"Can not create file <strong>%s</strong>.",NewName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not create file <strong>%s</strong>.",
NewName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
}
@ -358,13 +362,15 @@ void Fil_CloseUpdateFile (const char *CurrentName,const char *OldName,const char
/* Rename the old file and the new file */
if (rename (CurrentName,OldName)) // mv CurrentName OldName Ej: mv file.html file.old
{
sprintf (Gbl.Alert.Txt,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
CurrentName,OldName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
if (rename (NewName,CurrentName)) // mv NewName CurrentName Ej: mv file.new file.html
{
sprintf (Gbl.Alert.Txt,"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not rename the file <strong>%s</strong> as <strong>%s</strong>.",
NewName,CurrentName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
@ -386,11 +392,13 @@ bool Fil_RenameFileOrDir (const char *PathOld,const char *PathNew)
{
case ENOTEMPTY:
case EEXIST:
sprintf (Gbl.Alert.Txt,Txt_There_is_already_a_non_empty_folder_named_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_is_already_a_non_empty_folder_named_X,
PathNew);
break;
case ENOTDIR:
sprintf (Gbl.Alert.Txt,Txt_There_is_already_a_file_named_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_is_already_a_file_named_X,
PathNew);
break;
case EACCES:
@ -426,7 +434,9 @@ void Fil_CreateDirIfNotExists (const char *Path)
if (!Fil_CheckIfPathExists (Path))
if (mkdir (Path,(mode_t) 0xFFF) != 0)
{
sprintf (Gbl.Alert.Txt,"Can not create folder <strong>%s</strong>.",Path);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not create folder <strong>%s</strong>.",
Path);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
}
@ -485,7 +495,9 @@ void Fil_RemoveTree (const char *Path)
Error = true;
if (Error)
{
sprintf (Gbl.Alert.Txt,"Can not remove folder %s.",Path);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Can not remove folder %s.",
Path);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
}

View File

@ -3124,7 +3124,8 @@ bool Brw_UpdateFoldersAssigmentsIfExistForAllUsrs (const char *OldFolderName,con
}
/***** Summary message *****/
sprintf (Gbl.Alert.Txt,"%s: %u<br />"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %u<br />"
"%s: %u<br />"
"%s: %u.",
Txt_Users,NumUsrs,
@ -3816,7 +3817,8 @@ void Brw_ShowAgainFileBrowserOrWorks (void)
}
/***** Legal notice *****/
sprintf (Gbl.Alert.Txt,Txt_Disclaimer_the_files_hosted_here_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Disclaimer_the_files_hosted_here_,
Cfg_PLATFORM_SHORT_NAME,
Cfg_PLATFORM_RESPONSIBLE_EMAIL);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -7027,7 +7029,8 @@ void Brw_AskRemFileFromTree (void)
Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName,
FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_FILE_OR_LINK_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_FILE_OR_LINK_X,
FileNameToShow);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
Brw_ActRemoveFile[Gbl.FileBrowser.Type],NULL,NULL,
@ -7096,7 +7099,9 @@ void Brw_RemFileFromTree (void)
Gbl.Usrs.Other.UsrDat.UsrCod);
/* Message of confirmation of removing */
sprintf (Gbl.Alert.Txt,Txt_FILE_X_removed,FileNameToShow);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_FILE_X_removed,
FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else // File / link not found
@ -7152,7 +7157,8 @@ void Brw_RemFolderFromTree (void)
Gbl.Usrs.Other.UsrDat.UsrCod);
/* Message of confirmation of successfull removing */
sprintf (Gbl.Alert.Txt,Txt_Folder_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Folder_X_removed,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -7176,7 +7182,8 @@ static void Brw_AskConfirmRemoveFolderNotEmpty (void)
extern const char *Txt_Remove_folder;
/***** Show question and button to remove not empty folder *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_folder_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_folder_X,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
Brw_ActRemoveFolderNotEmpty[Gbl.FileBrowser.Type],NULL,NULL,
@ -7230,7 +7237,8 @@ void Brw_RemSubtreeInFileBrowser (void)
Brw_RemoveAffectedExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree);
/***** Write message of confirmation *****/
sprintf (Gbl.Alert.Txt,Txt_Folder_X_and_all_its_contents_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Folder_X_and_all_its_contents_removed,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -7523,14 +7531,16 @@ static void Brw_WriteCurrentClipboard (void)
Gbl.FileBrowser.Clipboard.FileName,
FileNameToShow);
sprintf (Gbl.Alert.Txt,"%s: %s, %s <strong>%s</strong>.",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %s, %s <strong>%s</strong>.",
Txt_Copy_source,TxtClipboardZone,
TxtFileType[Gbl.FileBrowser.Clipboard.FileType],
FileNameToShow);
}
else
// The root folder
sprintf (Gbl.Alert.Txt,"%s: %s, %s.",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %s, %s.",
Txt_Copy_source,TxtClipboardZone,
Txt_all_files_inside_the_root_folder);
@ -8434,7 +8444,8 @@ static void Brw_PasteClipboard (void)
&FirstFilCod))
{
/***** Write message of success *****/
sprintf (Gbl.Alert.Txt,"%s<br />"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s<br />"
"%s: %u<br />"
"%s: %u<br />"
"%s: %u",
@ -8582,15 +8593,18 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
switch (FileType)
{
case Brw_IS_FILE:
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
FileNameToShow);
break;
case Brw_IS_FOLDER:
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
FileNameToShow);
break;
case Brw_IS_LINK:
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_maximum_allowed_number_of_levels,
FileNameToShow);
break;
default:
@ -8608,7 +8622,7 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
/***** Check if exists the destination file */
if (Fil_CheckIfPathExists (PathDstWithFile))
{
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_there_is_already_an_object_with_that_name :
Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_there_is_already_an_object_with_that_name,
FileNameToShow);
@ -8627,7 +8641,8 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Mrk_CheckFileOfMarks (PathOrg,&Marks); // Gbl.Alert.Txt contains feedback text
else
{
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_you_can_not_paste_a_file_here_of_a_type_other_than_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_you_can_not_paste_a_file_here_of_a_type_other_than_HTML,
FileNameToShow);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false;
@ -8641,7 +8656,8 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size;
if (Brw_CheckIfQuotaExceded ())
{
sprintf (Gbl.Alert.Txt,FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_disk_quota :
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
FileType == Brw_IS_FILE ? Txt_The_copy_has_stopped_when_trying_to_paste_the_file_X_because_it_would_exceed_the_disk_quota :
Txt_The_copy_has_stopped_when_trying_to_paste_the_link_X_because_it_would_exceed_the_disk_quota,
FileNameToShow);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
@ -8684,7 +8700,8 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
Gbl.FileBrowser.Size.TotalSiz += (unsigned long long) FileStatus.st_size;
if (Brw_CheckIfQuotaExceded ())
{
sprintf (Gbl.Alert.Txt,Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_disk_quota,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_copy_has_stopped_when_trying_to_paste_the_folder_X_because_it_would_exceed_the_disk_quota,
FileNameToShow);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
CopyIsGoingSuccessful = false;
@ -8811,7 +8828,8 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1])
/***** Start box *****/
Box_StartBox (NULL,Txt_Create_folder,NULL,
NULL,Box_NOT_CLOSABLE);
sprintf (Gbl.Alert.Txt,Txt_You_can_create_a_new_folder_inside_the_folder_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_create_a_new_folder_inside_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -8850,7 +8868,8 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE);
/***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_upload_new_files_to_the_folder_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_or_you_can_upload_new_files_to_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -8912,7 +8931,8 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE);
/***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_upload_a_new_file_to_the_folder_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_or_you_can_upload_a_new_file_to_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -8955,7 +8975,8 @@ static void Brw_PutFormToPasteAFileOrFolder (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE);
/***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_make_a_file_copy_to_the_folder_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_or_you_can_make_a_file_copy_to_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -8991,7 +9012,8 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow)
NULL,Box_NOT_CLOSABLE);
/***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_or_you_can_create_a_new_link_inside_the_folder_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_or_you_can_create_a_new_link_inside_the_folder_X,
FileNameToShow);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -9080,7 +9102,8 @@ void Brw_RecFolderFileBrowser (void)
if (Brw_CheckIfQuotaExceded ())
{
Fil_RemoveTree (Path);
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_folder_X_because_it_would_exceed_the_disk_quota,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Can_not_create_the_folder_X_because_it_would_exceed_the_disk_quota,
Gbl.FileBrowser.NewFilFolLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -9107,7 +9130,8 @@ void Brw_RecFolderFileBrowser (void)
Brw_IS_FOLDER,
Gbl.FileBrowser.FilFolLnkName,
FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_The_folder_X_has_been_created_inside_the_folder_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_folder_X_has_been_created_inside_the_folder_Y,
Gbl.FileBrowser.NewFilFolLnkName,FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -9117,7 +9141,8 @@ void Brw_RecFolderFileBrowser (void)
switch (errno)
{
case EEXIST:
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_folder_X_because_there_is_already_a_folder_or_a_file_with_that_name,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Can_not_create_the_folder_X_because_there_is_already_a_folder_or_a_file_with_that_name,
Gbl.FileBrowser.NewFilFolLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
break;
@ -9195,7 +9220,8 @@ void Brw_RenFolderFileBrowser (void)
case ENOTEMPTY:
case EEXIST:
case ENOTDIR:
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_not_changed_because_there_is_already_a_folder_or_a_file_with_the_name_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_folder_name_X_has_not_changed_because_there_is_already_a_folder_or_a_file_with_the_name_Y,
Gbl.FileBrowser.FilFolLnkName,Gbl.FileBrowser.NewFilFolLnkName);
break;
case EACCES:
@ -9230,7 +9256,8 @@ void Brw_RenFolderFileBrowser (void)
NewPathInTree);
/* Write message of confirmation */
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_folder_name_X_has_changed_to_Y,
Gbl.FileBrowser.FilFolLnkName,
Gbl.FileBrowser.NewFilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -9239,7 +9266,8 @@ void Brw_RenFolderFileBrowser (void)
}
else // Names are equal. This may happens if we have press INTRO without changing the name
{
sprintf (Gbl.Alert.Txt,Txt_The_folder_name_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_folder_name_X_has_not_changed,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -9366,7 +9394,8 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
if (Fil_CheckIfPathExists (Path))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_file_already_exists_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_X_file_already_exists_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
}
else // Destination file does not exist
@ -9388,7 +9417,8 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
{
Fil_RemoveTree (PathTmp);
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_could_not_create_file_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_could_not_create_file_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
}
else // Success
@ -9400,7 +9430,8 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
{
Fil_RemoveTree (Path);
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_quota_exceeded_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_X_quota_exceeded_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
}
else
@ -9429,7 +9460,8 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
Gbl.FileBrowser.FilFolLnkName,
FileNameToShow);
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_file_X_has_been_placed_inside_the_folder_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_X_has_been_placed_inside_the_folder_Y,
Gbl.FileBrowser.NewFilFolLnkName,
FileNameToShow);
}
@ -9572,7 +9604,8 @@ void Brw_RecLinkFileBrowser (void)
/* Check if the URL file exists */
if (Fil_CheckIfPathExists (Path))
{
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_link_X_because_there_is_already_a_folder_or_a_link_with_that_name,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Can_not_create_the_link_X_because_there_is_already_a_folder_or_a_link_with_that_name,
FileName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -9593,7 +9626,8 @@ void Brw_RecLinkFileBrowser (void)
if (Brw_CheckIfQuotaExceded ())
{
Fil_RemoveTree (Path);
sprintf (Gbl.Alert.Txt,Txt_Can_not_create_the_link_X_because_it_would_exceed_the_disk_quota,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Can_not_create_the_link_X_because_it_would_exceed_the_disk_quota,
FileName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -9620,7 +9654,8 @@ void Brw_RecLinkFileBrowser (void)
Brw_IS_FOLDER,
Gbl.FileBrowser.FilFolLnkName,
FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_The_link_X_has_been_placed_inside_the_folder_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_link_X_has_been_placed_inside_the_folder_Y,
FileName,FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -9695,14 +9730,16 @@ static bool Brw_CheckIfUploadIsAllowed (const char *MIMEType)
if (strcmp (MIMEType,"application/octetstream"))
if (strcmp (MIMEType,"application/octet"))
{ // MIME type forbidden
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType);
return false;
}
}
else
{
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_not_HTML_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_X_not_HTML_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
return false;
}
@ -9730,14 +9767,16 @@ static bool Brw_CheckIfUploadIsAllowed (const char *MIMEType)
}
if (!MIMETypeIsAllowed)
{
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_X_MIME_type_Y_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName,MIMEType);
return false;
}
}
else
{
sprintf (Gbl.Alert.Txt,Txt_UPLOAD_FILE_X_extension_not_allowed_NO_HTML,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_UPLOAD_FILE_X_extension_not_allowed_NO_HTML,
Gbl.FileBrowser.NewFilFolLnkName);
return false;
}
@ -9775,7 +9814,8 @@ void Brw_SetDocumentAsVisible (void)
Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName,
FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_FILE_FOLDER_OR_LINK_X_is_now_visible,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_FILE_FOLDER_OR_LINK_X_is_now_visible,
FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -9812,7 +9852,9 @@ void Brw_SetDocumentAsHidden (void)
Gbl.FileBrowser.FileType,
Gbl.FileBrowser.FilFolLnkName,
FileNameToShow);
sprintf (Gbl.Alert.Txt,Txt_FILE_FOLDER_OR_LINK_X_is_now_hidden,FileNameToShow);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_FILE_FOLDER_OR_LINK_X_is_now_hidden,
FileNameToShow);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Show again the file browser *****/
@ -10777,14 +10819,16 @@ void Brw_ChgFileMetadata (void)
}
/***** Write message of confirmation *****/
sprintf (Gbl.Alert.Txt,Txt_The_properties_of_file_X_have_been_saved,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_properties_of_file_X_have_been_saved,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else
{
/***** Write message of error *****/
sprintf (Gbl.Alert.Txt,Txt_You_dont_have_permission_to_change_the_properties_of_file_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_dont_have_permission_to_change_the_properties_of_file_X,
Gbl.FileBrowser.FilFolLnkName);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}
@ -12793,7 +12837,8 @@ void Brw_RemoveOldFilesBriefcase (void)
Brw_RemoveOldFilesInBrowser (Months,&Removed);
/***** Success message *****/
sprintf (Gbl.Alert.Txt,"%s: %u<br />"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s: %u<br />"
"%s: %u<br />"
"%s: %u",
Txt_Files_removed ,Removed.NumFiles,

View File

@ -4162,7 +4162,8 @@ void For_RequestRemoveThread (void)
/***** Show question and button to remove the thread *****/
Lay_StartSection (For_REMOVE_THREAD_SECTION_ID);
if (Subject[0])
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_entire_thread_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_entire_thread_X,
Subject);
else
Str_Copy (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_entire_thread,
@ -4218,7 +4219,8 @@ void For_RemoveThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Alert.Txt,Txt_Thread_X_removed,Subject);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Thread_X_removed,Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -4255,7 +4257,8 @@ void For_CutThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Alert.Txt,Txt_Thread_X_marked_to_be_moved,Subject);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Thread_X_marked_to_be_moved,Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -4292,7 +4295,8 @@ void For_PasteThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Alert.Txt,Txt_The_thread_X_is_already_in_this_forum,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_thread_X_is_already_in_this_forum,
Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_WARNING,Gbl.Alert.Txt);
@ -4312,7 +4316,8 @@ void For_PasteThread (void)
/***** Show the threads again *****/
if (Subject[0])
{
sprintf (Gbl.Alert.Txt,Txt_Thread_X_moved_to_this_forum,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Thread_X_moved_to_this_forum,
Subject);
For_ShowForumThreadsHighlightingOneThread (Gbl.Forum.ForumSelected.ThrCod,
Ale_SUCCESS,Gbl.Alert.Txt);

View File

@ -1495,7 +1495,8 @@ void Gam_AskRemGame (void)
/***** Show question and button to remove game *****/
Gbl.Games.CurrentGamCod = Game.GamCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_game_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_game_X,
Game.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGam,NULL,NULL,Gam_PutParams,
@ -1544,7 +1545,8 @@ void Gam_RemoveGame (void)
DB_QueryDELETE (Query,"can not remove game");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Game_X_removed,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1576,7 +1578,8 @@ void Gam_AskResetGame (void)
Lay_ShowErrorAndExit ("You can not reset this game.");
/***** Ask for confirmation of reset *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reset_the_game_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_reset_the_game_X,
Game.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
@ -1634,7 +1637,8 @@ void Gam_ResetGame (void)
DB_QueryUPDATE (Query,"can not reset answers of a game");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_reset,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Game_X_reset,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1667,7 +1671,8 @@ void Gam_HideGame (void)
DB_QueryUPDATE (Query,"can not hide game");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_is_now_hidden,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Game_X_is_now_hidden,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1700,7 +1705,8 @@ void Gam_UnhideGame (void)
DB_QueryUPDATE (Query,"can not show game");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Game_X_is_now_visible,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Game_X_is_now_visible,
Game.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -2143,7 +2149,8 @@ void Gam_RecFormGame (void)
if (Gam_CheckIfSimilarGameExists (&NewGame))
{
NewGameIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_a_game_with_the_title_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Already_existed_a_game_with_the_title_X,
NewGame.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -2208,7 +2215,8 @@ static void Gam_CreateGame (struct Game *Game,const char *Txt)
Gam_CreateGrps (Game->GamCod);
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_game_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_game_X,
Game->Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -3272,7 +3280,8 @@ void Gam_RequestRemoveQst (void)
/***** Show question and button to remove question *****/
Gbl.Games.CurrentGamCod = Game.GamCod;
Gbl.Games.CurrentQstCod = QstCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) (QstInd + 1));
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGamQst,NULL,NULL,Gam_PutParamsOneQst,

View File

@ -281,7 +281,8 @@ static void Grp_EditGroupTypes (void)
Grp_ListGroupTypesForEdition ();
else // No group types found in this course
{
sprintf (Gbl.Alert.Txt,Txt_There_are_no_types_of_group_in_the_course_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_are_no_types_of_group_in_the_course_X,
Gbl.CurrentCrs.Crs.ShrtName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -312,7 +313,8 @@ static void Grp_EditGroups (void)
Grp_ListGroupsForEdition ();
else // There are group types, but there aren't groups
{
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_No_groups_have_been_created_in_the_course_X,
Gbl.CurrentCrs.Crs.ShrtName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -1103,7 +1105,8 @@ void Grp_RegisterUsrIntoGroups (struct UsrData *UsrDat,struct ListCodGrps *LstGr
/* If the enrolment is single and the group to which the user belongs is different from the selected ==>
remove user from the group to which he belongs */
Grp_RemoveUsrFromGroup (UsrDat->UsrCod,LstGrpsHeBelongs.GrpCods[NumGrpHeBelongs]);
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_the_group_of_type_Y_to_which_it_belonged,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_from_the_group_of_type_Y_to_which_it_belonged,
UsrDat->FullName,Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1111,7 +1114,8 @@ void Grp_RegisterUsrIntoGroups (struct UsrData *UsrDat,struct ListCodGrps *LstGr
if (!AlreadyRegisteredInGrp) // If the user does not belong to the selected group
{
Grp_AddUsrToGroup (UsrDat,LstGrps->GrpCods[NumGrpSel]);
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_in_the_group_of_type_Y_Z,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_enroled_in_the_group_of_type_Y_Z,
UsrDat->FullName,Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName,
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].LstGrps[NumGrpThisType].GrpName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1162,13 +1166,16 @@ unsigned Grp_RemoveUsrFromGroups (struct UsrData *UsrDat,struct ListCodGrps *Lst
/***** Write message to inform about how many groups the student has been removed from *****/
if (NumGrpsHeIsRemoved == 0)
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_not_been_removed_from_any_group,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_not_been_removed_from_any_group,
UsrDat->FullName);
else if (NumGrpsHeIsRemoved == 1)
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_one_group,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_from_one_group,
UsrDat->FullName);
else // NumGrpsHeIsRemoved > 1
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_Y_groups,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_from_Y_groups,
UsrDat->FullName,NumGrpsHeIsRemoved);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1800,7 +1807,8 @@ void Grp_ShowLstGrpsToChgMyGrps (void)
}
else // This course has no groups
{
sprintf (Gbl.Alert.Txt,Txt_No_groups_have_been_created_in_the_course_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_No_groups_have_been_created_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -1854,7 +1862,7 @@ static void Grp_ShowWarningToStdsToChangeGrps (void)
{
if (GrpTyp->MandatoryEnrolment)
{
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpTyp->MultipleEnrolment ? Txt_You_have_to_register_compulsorily_at_least_in_one_group_of_type_X :
Txt_You_have_to_register_compulsorily_in_one_group_of_type_X,
GrpTyp->GrpTypName);
@ -1862,7 +1870,7 @@ static void Grp_ShowWarningToStdsToChangeGrps (void)
}
else
{
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
GrpTyp->MultipleEnrolment ? Txt_You_can_register_voluntarily_in_one_or_more_groups_of_type_X :
Txt_You_can_register_voluntarily_in_one_group_of_type_X,
GrpTyp->GrpTypName);
@ -3678,7 +3686,8 @@ void Grp_RecFormNewGrpTyp (void)
if (Grp_CheckIfGroupTypeNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,-1L))
{
AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_group_X_already_exists,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else // Add new group type to database
@ -3686,7 +3695,8 @@ void Grp_RecFormNewGrpTyp (void)
Grp_CreateGroupType ();
AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_type_of_group_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_type_of_group_X,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
}
@ -3747,7 +3757,8 @@ void Grp_RecFormNewGrp (void)
if (Grp_CheckIfGroupNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod,Gbl.CurrentCrs.Grps.GrpName,-1L))
{
AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_already_exists,
Gbl.CurrentCrs.Grps.GrpName);
}
else // Add new group to database
@ -3756,7 +3767,8 @@ void Grp_RecFormNewGrp (void)
/* Write success message */
AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_group_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_group_X,
Gbl.CurrentCrs.Grps.GrpName);
}
}
@ -3904,10 +3916,12 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps)
/***** Show question and button to remove type of group *****/
if (NumGrps == 1)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NumGrps);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,NULL,
@ -3954,13 +3968,16 @@ static void Grp_AskConfirmRemGrp (void)
/***** Show question and button to remove group *****/
if (NumStds == 0)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_group_X,
GrpDat.GrpName);
else if (NumStds == 1)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X_1_student_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_group_X_1_student_,
GrpDat.GrpName);
else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_group_X_Y_students_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_group_X_Y_students_,
GrpDat.GrpName,NumStds);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemGrp,Grp_GROUPS_SECTION_ID,NULL,
@ -4055,8 +4072,9 @@ static void Grp_RemoveGroupTypeCompletely (void)
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod);
DB_QueryDELETE (Query,"can not remove a type of group");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Type_of_group_X_removed,
/***** Create message to show the change made *****/
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Type_of_group_X_removed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
/***** Show the form again *****/
@ -4105,8 +4123,10 @@ static void Grp_RemoveGroupCompletely (void)
Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryDELETE (Query,"can not remove a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Group_X_removed,GrpDat.GrpName);
/***** Create message to show the change made *****/
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Group_X_removed,
GrpDat.GrpName);
/***** Show the form again *****/
Grp_ReqEditGroupsInternal (Ale_INFO,NULL,
@ -4136,8 +4156,10 @@ void Grp_OpenGroup (void)
Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not open a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_group_X_is_now_open,GrpDat.GrpName);
/***** Create message to show the change made *****/
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_is_now_open,
GrpDat.GrpName);
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.Open = true;
@ -4168,8 +4190,10 @@ void Grp_CloseGroup (void)
Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not close a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_group_X_is_now_closed,GrpDat.GrpName);
/***** Create message to show the change made *****/
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_is_now_closed,
GrpDat.GrpName);
/***** Show the form again *****/
Gbl.CurrentCrs.Grps.Open = false;
@ -4200,8 +4224,9 @@ void Grp_EnableFileZonesGrp (void)
Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not enable file zones of a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_File_zones_of_the_group_X_are_now_enabled,
/***** Create message to show the change made *****/
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_File_zones_of_the_group_X_are_now_enabled,
GrpDat.GrpName);
/***** Show the form again *****/
@ -4233,8 +4258,9 @@ void Grp_DisableFileZonesGrp (void)
Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not disable file zones of a group");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_File_zones_of_the_group_X_are_now_disabled,
/***** Create message to show the change made *****/
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_File_zones_of_the_group_X_are_now_disabled,
GrpDat.GrpName);
/***** Show the form again *****/
@ -4271,19 +4297,23 @@ void Grp_ChangeGroupType (void)
/***** If group was in database... *****/
if (Grp_CheckIfGroupNameExists (NewGrpTypCod,GrpDat.GrpName,-1L))
{
/* Create warning message */
AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,GrpDat.GrpName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_already_exists,
GrpDat.GrpName);
}
else
else // Group is not in database
{
/* Update the table of groups changing old type by new type */
sprintf (Query,"UPDATE crs_grp SET GrpTypCod=%ld WHERE GrpCod=%ld",
NewGrpTypCod,Gbl.CurrentCrs.Grps.GrpCod);
DB_QueryUPDATE (Query,"can not update the type of a group");
/***** Write message to show the change made *****/
/* Create message to show the change made */
AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_of_the_group_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_group_of_the_group_X_has_changed,
GrpDat.GrpName);
}
@ -4322,7 +4352,8 @@ void Grp_ChangeMandatGrpTyp (void)
if (Gbl.CurrentCrs.Grps.GrpTyp.MandatoryEnrolment == NewMandatoryEnrolment)
{
AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else
@ -4336,7 +4367,7 @@ void Grp_ChangeMandatGrpTyp (void)
/***** Write message to show the change made *****/
AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewMandatoryEnrolment ? Txt_The_enrolment_of_students_into_groups_of_type_X_is_now_mandatory :
Txt_The_enrolment_of_students_into_groups_of_type_X_is_now_voluntary,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
@ -4377,7 +4408,8 @@ void Grp_ChangeMultiGrpTyp (void)
if (Gbl.CurrentCrs.Grps.GrpTyp.MultipleEnrolment == NewMultipleEnrolment)
{
AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_enrolment_of_the_type_of_group_X_has_not_changed,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else
@ -4392,7 +4424,7 @@ void Grp_ChangeMultiGrpTyp (void)
/***** Write message to show the change made *****/
AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NewMultipleEnrolment ? Txt_Now_each_student_can_belong_to_multiple_groups_of_type_X :
Txt_Now_each_student_can_only_belong_to_a_group_of_type_X,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
@ -4477,7 +4509,8 @@ void Grp_ChangeMaxStdsGrp (void)
if (GrpDat.MaxStudents == NewMaxStds)
{
AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_maximum_number_of_students_in_the_group_X_has_not_changed,
GrpDat.GrpName);
}
else
@ -4490,10 +4523,12 @@ void Grp_ChangeMaxStdsGrp (void)
/***** Write message to show the change made *****/
AlertType = Ale_SUCCESS;
if (NewMaxStds > Grp_MAX_STUDENTS_IN_A_GROUP)
sprintf (Gbl.Alert.Txt,Txt_The_group_X_now_has_no_limit_of_students,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_now_has_no_limit_of_students,
GrpDat.GrpName);
else
sprintf (Gbl.Alert.Txt,Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_maximum_number_of_students_in_the_group_X_is_now_Y,
GrpDat.GrpName,NewMaxStds);
}
@ -4557,7 +4592,8 @@ void Grp_RenameGroupType (void)
if (!NewNameGrpTyp[0])
{
AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_type_of_group_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_type_of_group_X_empty,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName);
}
else
@ -4569,7 +4605,8 @@ void Grp_RenameGroupType (void)
if (Grp_CheckIfGroupTypeNameExists (NewNameGrpTyp,Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod))
{
AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_group_X_already_exists,
NewNameGrpTyp);
}
else
@ -4583,14 +4620,16 @@ void Grp_RenameGroupType (void)
/***** Write message to show the change made *****/
AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_group_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_group_X_has_been_renamed_as_Y,
Gbl.CurrentCrs.Grps.GrpTyp.GrpTypName,NewNameGrpTyp);
}
}
else // The same name
{
AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_type_of_group_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_type_of_group_X_has_not_changed,
NewNameGrpTyp);
}
}
@ -4633,7 +4672,8 @@ void Grp_RenameGroup (void)
if (!NewNameGrp[0])
{
AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_group_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_group_X_empty,
GrpDat.GrpName);
}
else
@ -4645,7 +4685,9 @@ void Grp_RenameGroup (void)
if (Grp_CheckIfGroupNameExists (GrpDat.GrpTypCod,NewNameGrp,Gbl.CurrentCrs.Grps.GrpCod))
{
AlertType = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_already_exists,NewNameGrp);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_already_exists,
NewNameGrp);
}
else
{
@ -4656,14 +4698,16 @@ void Grp_RenameGroup (void)
/***** Write message to show the change made *****/
AlertType = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_group_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_group_X_has_been_renamed_as_Y,
GrpDat.GrpName,NewNameGrp);
}
}
else // The same name
{
AlertType = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_group_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_group_X_has_not_changed,
NewNameGrp);
}
}

View File

@ -121,7 +121,8 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
if (Gbl.Usrs.Me.Logged &&
!Gbl.Usrs.Me.MyCrss.Num)
{
sprintf (Gbl.Alert.Txt,"%s<br />%s<br />%s",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s<br />%s<br />%s",
Txt_You_are_not_enroled_in_any_course[Gbl.Usrs.Me.UsrDat.Sex],
Txt_You_can_search_for_courses_select_them_and_request_your_enrolment_in_them,
Txt_If_you_can_not_find_your_institution_your_centre_your_degree_or_your_courses_you_can_create_them);

View File

@ -656,7 +656,9 @@ void Hld_RemoveHoliday1 (void)
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Holiday_X_removed,Hld.Name);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Holiday_X_removed,
Hld.Name);
}
@ -706,7 +708,8 @@ void Hld_ChangeHolidayPlace1 (void)
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_place_of_the_holiday_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_place_of_the_holiday_X_has_changed_to_Y,
Hld->Name,NewPlace.FullName);
}
@ -750,7 +753,8 @@ void Hld_ChangeHolidayType1 (void)
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_type_of_the_holiday_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_type_of_the_holiday_X_has_changed,
Hld->Name);
}
@ -850,7 +854,8 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
Dat_ConvDateToDateStr (&NewDate,StrDate);
sprintf (Gbl.Alert.Txt,Txt_The_date_of_the_holiday_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_date_of_the_holiday_X_has_changed_to_Y,
Hld->Name,StrDate);
}
@ -897,7 +902,8 @@ void Hld_RenameHoliday1 (void)
if (!NewHldName[0])
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_holiday_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_holiday_X_empty,
Hld->Name);
}
else
@ -915,13 +921,15 @@ void Hld_RenameHoliday1 (void)
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_holiday_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_holiday_X_has_changed_to_Y,
Hld->Name,NewHldName);
}
else // The same name
{
Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_holiday_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_holiday_X_has_not_changed,
Hld->Name);
}
}
@ -1152,7 +1160,9 @@ void Hld_RecFormNewHoliday1 (void)
/* Success message */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_holiday_X,Hld->Name);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_holiday_X,
Hld->Name);
}
else // If there is not a holiday name
{

View File

@ -489,7 +489,8 @@ static void Img_ProcessImage (struct Image *Image,
ReturnCode = WEXITSTATUS(ReturnCode);
if (ReturnCode != 0)
{
sprintf (Gbl.Alert.Txt,"Image could not be processed successfully.<br />"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Image could not be processed successfully.<br />"
"Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);

View File

@ -529,7 +529,8 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss)
extern const char *Txt_Show_anyway;
/***** Show alert and button to confirm that I want to see the big list *****/
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_courses_is_too_large_to_be_displayed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_list_of_X_courses_is_too_large_to_be_displayed,
NumCrss);
Ale_ShowAlertAndButton (Ale_WARNING,Gbl.Alert.Txt,
Gbl.Action.Act,NULL,NULL,

View File

@ -2234,7 +2234,8 @@ void Inf_ReceiveURLInfo (void)
fclose (FileURL);
/***** Write message *****/
sprintf (Gbl.Alert.Txt,Txt_The_URL_X_has_been_updated,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_URL_X_has_been_updated,
Gbl.CurrentCrs.Info.URL);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
URLIsOK = true;
@ -2303,7 +2304,8 @@ void Inf_ReceivePagInfo (void)
WrongType = true;
if (WrongType)
{
sprintf (Gbl.Alert.Txt,Txt_The_file_type_is_X_and_should_be_HTML_or_ZIP,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_type_is_X_and_should_be_HTML_or_ZIP,
MIMEType);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}

View File

@ -1727,7 +1727,8 @@ void Ins_RemoveInstitution (void)
Ins_FlushCacheFullNameAndCtyOfInstitution ();
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Institution_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Institution_X_removed,
Ins.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1808,7 +1809,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
if (!NewInsName[0])
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_institution_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_institution_X_empty,
CurrentInsName);
}
else
@ -1820,7 +1822,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
if (Ins_CheckIfInsNameExistsInCty (ParamName,NewInsName,Ins->InsCod,Gbl.CurrentCty.Cty.CtyCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institution_X_already_exists,
NewInsName);
}
else
@ -1830,7 +1833,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
/* Create message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institution_X_has_been_renamed_as_Y,
CurrentInsName,NewInsName);
/* Change current institution name in order to display it properly */
@ -1841,7 +1845,8 @@ static void Ins_RenameInstitution (struct Instit *Ins,Cns_ShrtOrFullName_t ShrtO
else // The same name
{
Gbl.Alert.Type = Ale_INFO;
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_institution_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_institution_X_has_not_changed,
CurrentInsName);
}
}
@ -1903,13 +1908,15 @@ void Ins_ChangeInsCtyInConfig (void)
if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.CurrentIns.Ins.ShrtName,-1L,NewCty.CtyCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institution_X_already_exists,
Gbl.CurrentIns.Ins.ShrtName);
}
else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.CurrentIns.Ins.FullName,-1L,NewCty.CtyCod))
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institution_X_already_exists,
Gbl.CurrentIns.Ins.FullName);
}
else
@ -1924,7 +1931,8 @@ void Ins_ChangeInsCtyInConfig (void)
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_country_of_the_institution_X_has_changed_to_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_country_of_the_institution_X_has_changed_to_Y,
Gbl.CurrentIns.Ins.FullName,NewCty.Name[Gbl.Prefs.Language]);
}
}
@ -1988,7 +1996,9 @@ void Ins_ChangeInsWWW (void)
/***** Write message to show the change made
and put button to go to institution changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ins_ShowAlertAndButtonToGoToIns ();
}
else
@ -2017,7 +2027,9 @@ void Ins_ChangeInsWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,NewWWW);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else
@ -2079,7 +2091,8 @@ void Ins_ChangeInsStatus (void)
/***** Write message to show the change made
and put button to go to institution changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_status_of_the_institution_X_has_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_status_of_the_institution_X_has_changed,
Gbl.Inss.EditingIns.ShrtName);
Ins_ShowAlertAndButtonToGoToIns ();
@ -2358,13 +2371,15 @@ static void Ins_RecFormRequestOrCreateIns (unsigned Status)
/***** If name of institution was in database... *****/
if (Ins_CheckIfInsNameExistsInCty ("ShortName",Gbl.Inss.EditingIns.ShrtName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institution_X_already_exists,
Gbl.Inss.EditingIns.ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Ins_CheckIfInsNameExistsInCty ("FullName",Gbl.Inss.EditingIns.FullName,-1L,Gbl.CurrentCty.Cty.CtyCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_institution_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_institution_X_already_exists,
Gbl.Inss.EditingIns.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -2410,7 +2425,8 @@ static void Ins_CreateInstitution (unsigned Status)
/***** Write message to show the change made
and put button to go to institution created *****/
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_Created_new_institution_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_institution_X,
Gbl.Inss.EditingIns.FullName);
Ins_ShowAlertAndButtonToGoToIns ();
}

View File

@ -503,7 +503,8 @@ void Lnk_RemoveLink (void)
DB_QueryDELETE (Query,"can not remove an institutional link");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Link_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Link_X_removed,
Lnk.ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -577,7 +578,8 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewLnkName[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_link_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_link_X_empty,
CurrentLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -589,7 +591,8 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If link was in database... *****/
if (Lnk_CheckIfLinkNameExists (ParamName,NewLnkName,Lnk->LnkCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_link_X_already_exists,
NewLnkName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -599,14 +602,16 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
Lnk_UpdateLnkNameDB (Lnk->LnkCod,FieldName,NewLnkName);
/* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_link_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_link_X_has_been_renamed_as_Y,
CurrentLnkName,NewLnkName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_link_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_link_X_has_not_changed,
CurrentLnkName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -677,7 +682,8 @@ void Lnk_ChangeLinkWWW (void)
DB_QueryUPDATE (Query,"can not update the web of an institutional link");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_web_address_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -813,13 +819,15 @@ void Lnk_RecFormNewLink (void)
/***** If name of link was in database... *****/
if (Lnk_CheckIfLinkNameExists ("ShortName",Lnk->ShrtName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_link_X_already_exists,
Lnk->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Lnk_CheckIfLinkNameExists ("FullName",Lnk->FullName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_link_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_link_X_already_exists,
Lnk->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -856,7 +864,8 @@ static void Lnk_CreateLink (struct Link *Lnk)
DB_QueryINSERT (Query,"can not create institutional link");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_link_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_link_X,
Lnk->ShrtName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -288,7 +288,8 @@ void Log_RequestLogo (Sco_Scope_t Scope)
NULL,Box_NOT_CLOSABLE);
/***** Write help message *****/
sprintf (Gbl.Alert.Txt,Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_send_a_file_with_an_image_in_PNG_format_transparent_background_and_size_X_Y,
64,64);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
@ -377,7 +378,9 @@ void Log_ReceiveLogo (Sco_Scope_t Scope)
WrongType = true;
if (WrongType)
{
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"png");
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_is_not_X,
"png");
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else

View File

@ -376,7 +376,8 @@ void Mai_WriteWarningEmailNotifications (void)
Tab_Tab_t TabMyAccount = Act_GetTab (ActFrmMyAcc );
Tab_Tab_t TabMailDomains = Act_GetTab (ActSeeMai);
sprintf (Gbl.Alert.Txt,Txt_You_can_only_receive_email_notifications_if_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_only_receive_email_notifications_if_,
Txt_TABS_TXT [TabMyAccount ],
Txt_MENU_TITLE[TabMyAccount ][Act_GetIndexInMenu (ActFrmMyAcc)],
Txt_TABS_TXT [TabMailDomains],
@ -559,7 +560,8 @@ void Mai_RemoveMailDomain (void)
DB_QueryDELETE (Query,"can not remove a mail domain");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Email_domain_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Email_domain_X_removed,
Mai.Domain);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -635,7 +637,8 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_email_domain_X_empty,
CurrentMaiName);
}
else
@ -648,7 +651,8 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_domain_X_already_exists,
NewMaiName);
}
else
@ -659,7 +663,8 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
/* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_domain_X_has_been_renamed_as_Y,
CurrentMaiName,NewMaiName);
}
}
@ -667,7 +672,8 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
{
Gbl.Alert.Type = Ale_INFO;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_domain_X_has_not_changed,
CurrentMaiName);
}
}
@ -821,13 +827,15 @@ void Mai_RecFormNewMailDomain (void)
/***** If name of mail was in database... *****/
if (Mai_CheckIfMailDomainNameExists ("Domain",Mai->Domain,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_domain_X_already_exists,
Mai->Domain);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Mai_CheckIfMailDomainNameExists ("Info",Mai->Info,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_email_domain_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_domain_X_already_exists,
Mai->Info);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -861,7 +869,8 @@ static void Mai_CreateMailDomain (struct Mail *Mai)
DB_QueryINSERT (Query,"can not create mail domain");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_email_domain_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_email_domain_X,
Mai->Domain);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1462,7 +1471,9 @@ static void Mai_RemoveEmail (struct UsrData *UsrDat)
/***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_Email_X_removed,Email);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Email_X_removed,
Email);
/***** Update list of emails *****/
Mai_GetEmailFromUsrCod (UsrDat);
@ -1558,7 +1569,8 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_matches_one_previously_registered,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_address_X_matches_one_previously_registered,
NewEmail);
}
else
@ -1568,7 +1580,8 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
/***** Email updated sucessfully *****/
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_has_been_registered_successfully,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_address_X_has_been_registered_successfully,
NewEmail);
/***** Update list of emails *****/
@ -1583,7 +1596,8 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
}
}
@ -1592,7 +1606,8 @@ static void Mai_NewUsrEmail (struct UsrData *UsrDat,bool ItsMe)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
}
}
@ -1731,7 +1746,8 @@ bool Mai_SendMailMsgToConfirmEmail (void)
Gbl.Usrs.Me.ConfirmEmailJustSent = true;
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_A_message_has_been_sent_to_email_address_X_to_confirm_that_address,
Gbl.Usrs.Me.UsrDat.Email);
return true;
case 1:
@ -1743,7 +1759,8 @@ bool Mai_SendMailMsgToConfirmEmail (void)
default:
Gbl.Alert.Type = Ale_ERROR;
Gbl.Alert.Section = Mai_EMAIL_SECTION_ID;
sprintf (Gbl.Alert.Txt,"Internal error: an email message has not been sent successfully."
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Internal error: an email message has not been sent successfully."
" Error code returned by the script: %d",
ReturnCode);
return false;
@ -1841,7 +1858,8 @@ void Mai_ConfirmEmail (void)
/***** Confirm email *****/
if (Confirmed)
sprintf (Gbl.Alert.Txt,Txt_Email_X_has_already_been_confirmed_before,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Email_X_has_already_been_confirmed_before,
Email);
else
{
@ -1851,7 +1869,9 @@ void Mai_ConfirmEmail (void)
UsrCod,Email);
DB_QueryUPDATE (Query,"can not confirm email");
sprintf (Gbl.Alert.Txt,Txt_The_email_X_has_been_confirmed,Email);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_email_X_has_been_confirmed,
Email);
}
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -281,7 +281,8 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
DB_QueryUPDATE (Query,"can not update properties of marks");
/***** Write message of success *****/
sprintf (Gbl.Alert.Txt,Txt_The_number_of_rows_is_now_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_number_of_rows_is_now_X,
NumRows);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -399,7 +400,8 @@ bool Mrk_CheckFileOfMarks (const char *Path,struct MarksProperties *Marks)
}
/*
if (FileIsCorrect)
sprintf (Gbl.Alert.Txt,Txt_X_header_rows_Y_student_rows_and_Z_footer_rows_found,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_header_rows_Y_student_rows_and_Z_footer_rows_found,
Marks->Header,NumRowsStds,Marks->Footer);
*/
@ -599,7 +601,8 @@ static bool Mrk_GetUsrMarks (FILE *FileUsrMarks,struct UsrData *UsrDat,
/***** User's ID not found in table *****/
fclose (FileAllMarks);
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_is_not_found_in_the_file_of_marks,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_is_not_found_in_the_file_of_marks,
UsrDat->FullName);
return false;
}

View File

@ -750,7 +750,9 @@ void Msg_RecMsgFromUsr (void)
if (RecipientHasBannedMe)
{
/***** Show an alert indicating that the message has not been sent successfully *****/
sprintf (Gbl.Alert.Txt,Txt_message_not_sent_to_X,UsrDstData.FullName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_message_not_sent_to_X,
UsrDstData.FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else
@ -786,7 +788,8 @@ void Msg_RecMsgFromUsr (void)
0));
/***** Show an alert indicating that the message has been sent successfully *****/
sprintf (Gbl.Alert.Txt,NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
NotifyByEmail ? Txt_message_sent_to_X_notified_by_email :
Txt_message_sent_to_X_not_notified_by_email,
UsrDstData.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -826,7 +829,8 @@ void Msg_RecMsgFromUsr (void)
Ale_ShowAlert (Ale_SUCCESS,Txt_The_message_has_been_sent_to_1_recipient);
else
{
sprintf (Gbl.Alert.Txt,Txt_The_message_has_been_sent_to_X_recipients,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_message_has_been_sent_to_X_recipients,
(unsigned) NumRecipients);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -837,7 +841,8 @@ void Msg_RecMsgFromUsr (void)
/***** Show alert about errors on sending message *****/
if (NumErrors > 1)
{
sprintf (Gbl.Alert.Txt,Txt_There_have_been_X_errors_in_sending_the_message,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_have_been_X_errors_in_sending_the_message,
(unsigned) NumErrors);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}
@ -867,12 +872,14 @@ void Msg_ReqDelAllRecMsgs (void)
if (Gbl.Msg.FilterContent[0])
{
if (Gbl.Msg.ShowOnlyUnreadMsgs)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
@ -880,12 +887,14 @@ void Msg_ReqDelAllRecMsgs (void)
else
{
if (Gbl.Msg.ShowOnlyUnreadMsgs)
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_delete_the_unread_messages_received_from_USER_X_from_COURSE_Y,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_delete_all_messages_received_from_USER_X_from_COURSE_Y,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
@ -921,12 +930,14 @@ void Msg_ReqDelAllSntMsgs (void)
/***** Show question and button to remove messages received *****/
/* Start alert */
if (Gbl.Msg.FilterContent[0])
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y_related_to_CONTENT_Z,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName,Gbl.Msg.FilterContent);
else
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_delete_all_messages_sent_to_USER_X_from_COURSE_Y,
Gbl.Msg.FilterFromTo[0] ? Gbl.Msg.FilterFromTo :
Txt_any_user,
Gbl.Msg.FilterCrsShrtName);
@ -998,7 +1009,8 @@ static void Msg_ShowNumMsgsDeleted (unsigned NumMsgs)
Ale_ShowAlert (Ale_SUCCESS,Txt_One_message_has_been_deleted);
else
{
sprintf (Gbl.Alert.Txt,Txt_X_messages_have_been_deleted,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_messages_have_been_deleted,
NumMsgs);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -3645,7 +3657,8 @@ void Msg_BanSenderWhenShowingMsgs (void)
DB_QueryREPLACE (Query,"can not ban sender");
/***** Show alert with the change made *****/
sprintf (Gbl.Alert.Txt,Txt_From_this_time_you_will_not_receive_messages_from_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_From_this_time_you_will_not_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -3702,7 +3715,8 @@ static void Msg_UnbanSender (void)
DB_QueryDELETE (Query,"can not ban sender");
/***** Show alert with the change made *****/
sprintf (Gbl.Alert.Txt,Txt_From_this_time_you_can_receive_messages_from_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_From_this_time_you_can_receive_messages_from_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -441,7 +441,9 @@ void Nck_RemoveMyNick (void)
/***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_Nickname_X_removed,NicknameWithoutArroba);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Nickname_X_removed,
NicknameWithoutArroba);
}
else
{
@ -480,7 +482,9 @@ void Nck_RemoveOtherUsrNick (void)
/***** Show message *****/
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_Nickname_X_removed,NicknameWithoutArroba);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Nickname_X_removed,
NicknameWithoutArroba);
/***** Show user's account again *****/
Acc_ShowFormChgOtherUsrAccount ();
@ -575,7 +579,8 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_matches_the_one_you_had_previously_registered,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_nickname_X_matches_the_one_you_had_previously_registered,
NewNicknameWithoutArroba);
}
else if (strcasecmp (UsrDat->Nickname,NewNicknameWithoutArroba)) // User's nickname does not match, not even case insensitive, the new nickname
@ -594,7 +599,8 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
}
}
@ -609,7 +615,8 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat)
Gbl.Alert.Type = Ale_SUCCESS;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_has_been_registered_successfully,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_nickname_X_has_been_registered_successfully,
NewNicknameWithoutArroba);
}
}
@ -617,7 +624,8 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Nck_NICKNAME_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_nickname_entered_X_is_not_valid_,
NewNicknameWithArroba,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);

View File

@ -95,7 +95,8 @@ void Not_ShowFormNotice (void)
extern const char *Txt_Create_notice;
/***** Help message *****/
sprintf (Gbl.Alert.Txt,Txt_The_notice_will_appear_as_a_yellow_note_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_notice_will_appear_as_a_yellow_note_,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);

View File

@ -555,7 +555,8 @@ unsigned Par_GetParameter (tParamType ParamType,const char *ParamName,
/* Check if there is space to copy separator */
if (BytesAlreadyCopied + 1 > MaxBytes)
{
sprintf (Gbl.Alert.Txt,"Multiple parameter <strong>%s</strong> too large,"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Multiple parameter <strong>%s</strong> too large,"
" it exceed the maximum allowed size (%lu bytes).",
ParamName,(unsigned long) MaxBytes);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
@ -573,7 +574,8 @@ unsigned Par_GetParameter (tParamType ParamType,const char *ParamName,
/* Check if there is space to copy the parameter value */
if (BytesAlreadyCopied + Param->Value.Length > MaxBytes)
{
sprintf (Gbl.Alert.Txt,"Parameter <strong>%s</strong> too large,"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Parameter <strong>%s</strong> too large,"
" it exceed the maximum allowed size (%lu bytes).",
ParamName,(unsigned long) MaxBytes);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);

View File

@ -403,7 +403,8 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
Ale_ShowAlert (Ale_WARNING,Txt_There_was_a_problem_sending_an_email_automatically);
break;
default:
sprintf (Gbl.Alert.Txt,"Internal error: an email message has not been sent successfully."
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Internal error: an email message has not been sent successfully."
" Error code returned by the script: %d",
ReturnCode);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
@ -418,7 +419,8 @@ void Pwd_ChkIdLoginAndSendNewPwd (void)
/***** Help message *****/
// TODO: This message allows to know if a ID exists in database (when no unique).
// This should be hidden!
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
Gbl.Usrs.Me.UsrIdLogin);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
@ -629,7 +631,8 @@ bool Pwd_FastCheckIfPasswordSeemsGood (const char *PlainPassword)
{
Gbl.Alert.Type = Ale_WARNING;
Gbl.Alert.Section = Pwd_PASSWORD_SECTION_ID;
sprintf (Gbl.Alert.Txt,Txt_The_password_must_be_at_least_X_characters,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_password_must_be_at_least_X_characters,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
return false;
}
@ -729,7 +732,8 @@ void Pwd_ShowFormChgMyPwd (void)
/***** Help message *****/
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\">");
sprintf (Gbl.Alert.Txt,Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Your_password_must_be_at_least_X_characters_and_can_not_contain_spaces_,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
fprintf (Gbl.F.Out,"</td>"
@ -760,7 +764,9 @@ void Pwd_PutFormToGetNewPasswordOnce (void)
extern const char *Txt_Password;
extern const char *Txt_HELP_password;
sprintf (Gbl.Alert.Txt,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_HELP_password,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_MIDDLE\">"
"<label for=\"Passwd\" class=\"%s\">%s:</label>"
@ -788,7 +794,9 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
extern const char *Txt_HELP_password;
extern const char *Txt_Retype_new_password;
sprintf (Gbl.Alert.Txt,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_HELP_password,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"REC_C1_BOT RIGHT_MIDDLE\">"
"<label for=\"Paswd1\" class=\"%s\">%s:</label>"

View File

@ -501,7 +501,8 @@ void Pho_ReqRemoveUsrPhoto (void)
{
/***** Show question and button to remove user's photo *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_photo_of_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_photo_of_X,
Gbl.Usrs.Other.UsrDat.FullName);
Ale_ShowAlertAndButton1 (Ale_QUESTION,Gbl.Alert.Txt);
@ -644,7 +645,9 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
WrongType = true;
if (WrongType)
{
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"jpg");
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_is_not_X,
"jpg");
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
return false;
}
@ -726,7 +729,8 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
NumFacesTotal = NumFacesGreen = NumFacesRed = 0;
break;
default: // Error
sprintf (Gbl.Alert.Txt,"Photo could not be processed successfully.<br />"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Photo could not be processed successfully.<br />"
"Error code returned by the program of processing: %d",
ReturnCode);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
@ -760,23 +764,27 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
if (NumFacesRed == 0)
{
Gbl.Alert.Type = Ale_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_X_faces_marked_in_green_have_been_detected_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_faces_marked_in_green_have_been_detected_,
NumFacesGreen);
}
else if (NumFacesGreen == 0)
{
Gbl.Alert.Type = Ale_WARNING;
sprintf (Gbl.Alert.Txt,Txt_X_faces_marked_in_red_have_been_detected_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_faces_marked_in_red_have_been_detected_,
NumFacesRed);
}
else // NumFacesGreen > 0
{
Gbl.Alert.Type = Ale_SUCCESS;
if (NumFacesGreen == 1)
sprintf (Gbl.Alert.Txt,Txt_X_faces_have_been_detected_in_front_position_1_Z_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_faces_have_been_detected_in_front_position_1_Z_,
NumFacesTotal,NumFacesRed);
else
sprintf (Gbl.Alert.Txt,Txt_X_faces_have_been_detected_in_front_position_Y_Z_,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_X_faces_have_been_detected_in_front_position_Y_Z_,
NumFacesTotal,NumFacesGreen,NumFacesRed);
}
}

View File

@ -577,7 +577,8 @@ void Plc_RemovePlace (void)
DB_QueryDELETE (Query,"can not remove a place");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Place_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Place_X_removed,
Plc.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -652,7 +653,8 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewPlcName[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_place_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_place_X_empty,
CurrentPlcName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -664,7 +666,8 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** If place was in database... *****/
if (Plc_CheckIfPlaceNameExists (ParamName,NewPlcName,Plc->PlcCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_place_X_already_exists,
NewPlcName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -674,14 +677,16 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
Plc_UpdatePlcNameDB (Plc->PlcCod,FieldName,NewPlcName);
/* Write message to show the change made */
sprintf (Gbl.Alert.Txt,Txt_The_place_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_place_X_has_been_renamed_as_Y,
CurrentPlcName,NewPlcName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_place_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_place_X_has_not_changed,
CurrentPlcName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -839,13 +844,15 @@ void Plc_RecFormNewPlace (void)
/***** If name of place was in database... *****/
if (Plc_CheckIfPlaceNameExists ("ShortName",Plc->ShrtName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_place_X_already_exists,
Plc->ShrtName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else if (Plc_CheckIfPlaceNameExists ("FullName",Plc->FullName,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_place_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_place_X_already_exists,
Plc->FullName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -879,7 +886,8 @@ static void Plc_CreatePlace (struct Place *Plc)
DB_QueryINSERT (Query,"can not create place");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_place_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_place_X,
Plc->FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -501,7 +501,8 @@ void Plg_RemovePlugin (void)
DB_QueryDELETE (Query,"can not remove a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Plugin_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Plugin_X_removed,
Plg.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -539,7 +540,8 @@ void Plg_RenamePlugin (void)
/***** Check if new name is empty *****/
if (!NewPlgName[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_plugin_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_plugin_X_empty,
Plg->Name);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -551,7 +553,8 @@ void Plg_RenamePlugin (void)
/***** If plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (NewPlgName,Plg->PlgCod))
{
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_plugin_X_already_exists,
NewPlgName);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -563,14 +566,16 @@ void Plg_RenamePlugin (void)
DB_QueryUPDATE (Query,"can not update the name of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_plugin_X_has_been_renamed_as_Y,
Plg->Name,NewPlgName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_plugin_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_plugin_X_has_not_changed,
Plg->Name);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -628,7 +633,8 @@ void Plg_ChangePlgDescription (void)
DB_QueryUPDATE (Query,"can not update the description of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_description_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_description_is_X,
NewDescription);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -672,7 +678,8 @@ void Plg_ChangePlgLogo (void)
DB_QueryUPDATE (Query,"can not update the logo of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_logo_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_logo_is_X,
NewLogo);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -716,7 +723,8 @@ void Plg_ChangePlgAppKey (void)
DB_QueryUPDATE (Query,"can not update the application key of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_logo_is_X, // TODO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NewAppKey);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -760,7 +768,8 @@ void Plg_ChangePlgURL (void)
DB_QueryUPDATE (Query,"can not update the URL of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_URL_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_URL_is_X,
NewURL);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -804,7 +813,8 @@ void Plg_ChangePlgIP (void)
DB_QueryUPDATE (Query,"can not update the IP address of a plugin");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_new_IP_address_is_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_new_IP_address_is_X,
NewIP);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -1013,7 +1023,8 @@ void Plg_RecFormNewPlg (void)
/***** If name of plugin was in database... *****/
if (Plg_CheckIfPluginNameExists (Plg->Name,-1L))
{
sprintf (Gbl.Alert.Txt,Txt_The_plugin_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_plugin_X_already_exists,
Plg->Name);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1053,7 +1064,8 @@ static void Plg_CreatePlugin (struct Plugin *Plg)
DB_QueryINSERT (Query,"can not create plugin");
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_plugin_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_plugin_X,
Plg->Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -1981,7 +1981,8 @@ static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject)
Prj_FlushCacheMyRoleInProject ();
/* Show success alert */
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_enroled_as_a_Y_in_the_project,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_enroled_as_a_Y_in_the_project,
Gbl.Usrs.Other.UsrDat.FullName,
Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject]);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -2054,7 +2055,7 @@ static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject)
/***** Show question and button to remove user as administrator *****/
/* Start alert */
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
ItsMe ? Txt_Do_you_really_want_to_be_removed_as_a_X_from_the_project_Y :
Txt_Do_you_really_want_to_remove_the_following_user_as_a_X_from_the_project_Y,
Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject],
@ -2146,7 +2147,8 @@ static void Prj_RemUsrFromPrj (Prj_RoleInProject_t RoleInProject)
Prj_FlushCacheMyRoleInProject ();
/***** Show success alert *****/
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_a_Y_from_the_project_Z,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_THE_USER_X_has_been_removed_as_a_Y_from_the_project_Z,
Gbl.Usrs.Other.UsrDat.FullName,
Txt_PROJECT_ROLES_SINGUL_abc[RoleInProject],
Prj.Title);
@ -2731,7 +2733,8 @@ void Prj_ReqRemProject (void)
{
/***** Show question and button to remove the project *****/
Gbl.Prjs.PrjCod = Prj.PrjCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_project_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_project_X,
Prj.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemPrj,NULL,NULL,Prj_PutCurrentParams,
@ -2797,7 +2800,8 @@ void Prj_RemoveProject (void)
Fil_RemoveTree (PathRelPrj);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Project_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Project_X_removed,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -2841,7 +2845,8 @@ void Prj_HideProject (void)
DB_QueryUPDATE (Query,"can not hide project");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Project_X_is_now_hidden,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Project_X_is_now_hidden,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -2885,7 +2890,8 @@ void Prj_ShowProject (void)
DB_QueryUPDATE (Query,"can not show project");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Project_X_is_now_visible,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Project_X_is_now_visible,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -3305,7 +3311,9 @@ void Prj_RecFormProject (void)
Prj_CreateProject (&Prj); // Add new project to database
/* Write success message */
sprintf (Gbl.Alert.Txt,Txt_Created_new_project_X,Prj.Title);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_project_X,
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else if (NewProjectIsCorrect)

View File

@ -202,7 +202,8 @@ void Rec_ReqEditRecordFields (void)
}
else // No fields of records found for current course in the database
{
sprintf (Gbl.Alert.Txt,Txt_There_are_no_record_fields_in_the_course_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_are_no_record_fields_in_the_course_X,
Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -482,7 +483,8 @@ void Rec_ReceiveFormField (void)
/***** If the field already was in the database... *****/
if (Rec_CheckIfRecordFieldIsRepeated (Gbl.CurrentCrs.Records.Field.Name))
{
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_record_field_X_already_exists,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}
@ -586,7 +588,8 @@ void Rec_CreateRecordField (void)
DB_QueryINSERT (Query,"can not create field of record");
/***** Write message of success *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_record_field_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_record_field_X,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -655,7 +658,8 @@ void Rec_AskConfirmRemFieldWithRecords (unsigned NumRecords)
&Gbl.CurrentCrs.Records.Field.Visibility);
/***** Show question and button to remove my photo *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_field_X_from_the_records_of_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_field_X_from_the_records_of_X,
Gbl.CurrentCrs.Records.Field.Name,Gbl.CurrentCrs.Crs.FullName);
if (NumRecords == 1)
Str_Concat (Gbl.Alert.Txt,Txt_this_field_is_filled_in_the_record_of_one_student,
@ -701,7 +705,8 @@ void Rec_RemoveFieldFromDB (void)
DB_QueryDELETE (Query,"can not remove field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Record_field_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Record_field_X_removed,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -807,7 +812,8 @@ void Rec_RenameField (void)
/***** Check if new name is empty *****/
if (!NewFieldName[0])
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_field_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_field_X_empty,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}
@ -820,7 +826,8 @@ void Rec_RenameField (void)
/***** If the group ya estaba in the database... *****/
if (Rec_CheckIfRecordFieldIsRepeated (NewFieldName))
{
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_already_exists,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_record_field_X_already_exists,
NewFieldName);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}
@ -833,14 +840,16 @@ void Rec_RenameField (void)
DB_QueryUPDATE (Query,"can not update name of field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_record_field_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_record_field_X_has_been_renamed_as_Y,
Gbl.CurrentCrs.Records.Field.Name,NewFieldName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
}
else // The same name
{
sprintf (Gbl.Alert.Txt,Txt_The_name_of_the_field_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_name_of_the_field_X_has_not_changed,
NewFieldName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -882,7 +891,8 @@ void Rec_ChangeLinesField (void)
(this happens when return is pressed without changes) *****/
if (Gbl.CurrentCrs.Records.Field.NumLines == NewNumLines)
{
sprintf (Gbl.Alert.Txt,Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_number_of_editing_lines_in_the_record_field_X_has_not_changed,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -895,7 +905,8 @@ void Rec_ChangeLinesField (void)
DB_QueryUPDATE (Query,"can not update the number of lines of a field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_From_now_on_the_number_of_editing_lines_of_the_field_X_is_Y,
Gbl.CurrentCrs.Records.Field.Name,NewNumLines);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -935,7 +946,8 @@ void Rec_ChangeVisibilityField (void)
(this happens whe return is pressed without changes in the form) *****/
if (Gbl.CurrentCrs.Records.Field.Visibility == NewVisibility)
{
sprintf (Gbl.Alert.Txt,Txt_The_visibility_of_the_record_field_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_visibility_of_the_record_field_X_has_not_changed,
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -948,7 +960,8 @@ void Rec_ChangeVisibilityField (void)
DB_QueryUPDATE (Query,"can not update the visibility of a field of record");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility],
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_RECORD_FIELD_VISIBILITY_MSG[NewVisibility],
Gbl.CurrentCrs.Records.Field.Name);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}

View File

@ -485,7 +485,8 @@ unsigned Ses_GetHiddenParFromDB (Act_Action_t NextAction,
if (ParameterIsTooBig)
{
sprintf (Gbl.Alert.Txt,"Hidden parameter <strong>%s</strong> too large,"
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Hidden parameter <strong>%s</strong> too large,"
" it exceed the maximum allowed size (%lu bytes).",
ParamName,(unsigned long) MaxBytes);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);

View File

@ -1041,7 +1041,8 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
if (!ICanQueryWholeRange && NumDays > Cfg_DAYS_IN_RECENT_LOG)
{
sprintf (Gbl.Alert.Txt,Txt_The_date_range_must_be_less_than_or_equal_to_X_days,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_date_range_must_be_less_than_or_equal_to_X_days,
Cfg_DAYS_IN_RECENT_LOG);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt); // ...write warning message and show the form again
return;

View File

@ -1038,7 +1038,9 @@ void Str_ChangeFormat (Str_ChangeFrom_t ChangeFrom,Str_ChangeTo_t ChangeTo,
/*
if (Gbl.Usrs.Me.Roles.LoggedRole == Rol_SYS_ADM)
{
sprintf (Gbl.Alert.Txt,"Str_ChangeFormat (&quot;%s&quot;)",Str);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Str_ChangeFormat (&quot;%s&quot;)",
Str);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
*/
@ -2880,7 +2882,8 @@ void Str_Copy (char *Dst,const char *Src,size_t DstSize)
/***** Check if buffer has enough space for source *****/
if (LengthSrc > DstSize)
{
sprintf (Gbl.Alert.Txt,"Trying to copy %lu chars into a %lu-chars buffer.",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Trying to copy %lu chars into a %lu-chars buffer.",
LengthSrc,DstSize);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
@ -2903,7 +2906,8 @@ void Str_Concat (char *Dst,const char *Src,size_t DstSize)
LengthDst = strlen (Dst);
if (LengthDst > DstSize)
{
sprintf (Gbl.Alert.Txt,"%lu-chars buffer has %lu chars!",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%lu-chars buffer has %lu chars!",
DstSize,LengthDst);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
@ -2914,7 +2918,8 @@ void Str_Concat (char *Dst,const char *Src,size_t DstSize)
LengthSrc = strlen (Src);
if (FreeSpace < LengthSrc)
{
sprintf (Gbl.Alert.Txt,"Trying to concatenate %lu chars to a %lu-chars buffer with free space for only %lu chars!",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Trying to concatenate %lu chars to a %lu-chars buffer with free space for only %lu chars!",
LengthSrc,DstSize,FreeSpace);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}

View File

@ -1508,7 +1508,8 @@ void Svy_AskRemSurvey (void)
/***** Show question and button to remove survey *****/
Gbl.Svys.SvyCodToEdit = Svy.SvyCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_survey_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_survey_X,
Svy.Title);
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemSvy,NULL,NULL,Svy_PutParams,
@ -1571,7 +1572,8 @@ void Svy_RemoveSurvey (void)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_SURVEY,Svy.SvyCod);
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_removed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Survey_X_removed,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1607,7 +1609,8 @@ void Svy_AskResetSurvey (void)
Lay_ShowErrorAndExit ("You can not reset this survey.");
/***** Ask for confirmation of reset *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_reset_the_survey_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_reset_the_survey_X,
Svy.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
@ -1669,7 +1672,8 @@ void Svy_ResetSurvey (void)
DB_QueryUPDATE (Query,"can not reset answers of a survey");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_reset,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Survey_X_reset,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1706,7 +1710,8 @@ void Svy_HideSurvey (void)
DB_QueryUPDATE (Query,"can not hide survey");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_is_now_hidden,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Survey_X_is_now_hidden,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -1743,7 +1748,8 @@ void Svy_UnhideSurvey (void)
DB_QueryUPDATE (Query,"can not show survey");
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_Survey_X_is_now_visible,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Survey_X_is_now_visible,
Svy.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -2195,7 +2201,8 @@ void Svy_RecFormSurvey (void)
if (Svy_CheckIfSimilarSurveyExists (&NewSvy))
{
NewSurveyIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_a_survey_with_the_title_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Already_existed_a_survey_with_the_title_X,
NewSvy.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -2281,7 +2288,8 @@ static void Svy_CreateSurvey (struct Survey *Svy,const char *Txt)
Svy_CreateGrps (Svy->SvyCod);
/***** Write success message *****/
sprintf (Gbl.Alert.Txt,Txt_Created_new_survey_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Created_new_survey_X,
Svy->Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -2915,7 +2923,8 @@ static bool Svy_AllocateTextChoiceAnswer (struct SurveyQuestion *SvyQst,
Svy_FreeTextChoiceAnswer (SvyQst,NumAns);
if ((SvyQst->AnsChoice[NumAns].Text = (char *) malloc (Svy_MAX_BYTES_ANSWER + 1)) == NULL)
{
sprintf (Gbl.Alert.Txt,"Not enough memory to store answer.");
Str_Copy (Gbl.Alert.Txt,"Not enough memory to store answer.",
Ale_MAX_BYTES_ALERT);
return false;
}
SvyQst->AnsChoice[NumAns].Text[0] = '\0';
@ -3586,7 +3595,8 @@ void Svy_RequestRemoveQst (void)
/***** Show question and button to remove question *****/
Gbl.Svys.SvyCodToEdit = SvyCod;
Gbl.Svys.SvyQstCodToEdit = SvyQst.QstCod;
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) (SvyQst.QstInd + 1));
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
ActRemSvyQst,NULL,NULL,Svy_PutParamsRemoveOneQst,

View File

@ -584,12 +584,14 @@ void Tst_AssessTest (void)
Tst_SetTstStatus (NumTst,Tst_STATUS_ASSESSED);
break;
case Tst_STATUS_ASSESSED:
sprintf (Gbl.Alert.Txt,Txt_The_test_X_has_already_been_assessed_previously,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_test_X_has_already_been_assessed_previously,
NumTst);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
break;
case Tst_STATUS_ERROR:
sprintf (Gbl.Alert.Txt,Txt_There_was_an_error_in_assessing_the_test_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_was_an_error_in_assessing_the_test_X,
NumTst);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
break;
@ -698,7 +700,8 @@ static bool Tst_CheckIfNextTstAllowed (void)
if (NumSecondsFromNowToNextAccTst > 0)
{
/***** Write warning *****/
sprintf (Gbl.Alert.Txt,"%s:<br /><span id=\"date_next_test\"></span>."
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"%s:<br /><span id=\"date_next_test\"></span>."
"<script type=\"text/javascript\">"
"writeLocalDateHMSFromUTC('date_next_test',%ld,"
"%u,',&nbsp;','%s',true,true,0x7);"
@ -1552,7 +1555,8 @@ void Tst_RenameTag (void)
/***** Check that the new tag is not empty *****/
if (!NewTagTxt[0]) // New tag empty
{
sprintf (Gbl.Alert.Txt,Txt_You_can_not_leave_the_name_of_the_tag_X_empty,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_can_not_leave_the_name_of_the_tag_X_empty,
OldTagTxt);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -1564,7 +1568,8 @@ void Tst_RenameTag (void)
// This happens when user press INTRO
// without changing anything in the form.
{
sprintf (Gbl.Alert.Txt,Txt_The_tag_X_has_not_changed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_tag_X_has_not_changed,
NewTagTxt);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -1648,7 +1653,8 @@ void Tst_RenameTag (void)
}
/***** Write message to show the change made *****/
sprintf (Gbl.Alert.Txt,Txt_The_tag_X_has_been_renamed_as_Y,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_tag_X_has_been_renamed_as_Y,
OldTagTxt,NewTagTxt);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
@ -4760,7 +4766,8 @@ static bool Tst_GetParamsTst (Tst_ActionToDoWithQuestions_t ActionToDoWithQuesti
if (Gbl.Test.NumQsts < Gbl.Test.Config.Min ||
Gbl.Test.NumQsts > Gbl.Test.Config.Max)
{
sprintf (Gbl.Alert.Txt,Txt_The_number_of_questions_must_be_in_the_interval_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_number_of_questions_must_be_in_the_interval_X,
Gbl.Test.Config.Min,Gbl.Test.Config.Max);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Error = true;
@ -5419,13 +5426,15 @@ int Tst_AllocateTextChoiceAnswer (unsigned NumOpt)
if ((Gbl.Test.Answer.Options[NumOpt].Text =
(char *) malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL)
{
sprintf (Gbl.Alert.Txt,"Not enough memory to store answer.");
Str_Copy (Gbl.Alert.Txt,"Not enough memory to store answer.",
Ale_MAX_BYTES_ALERT);
return 0;
}
if ((Gbl.Test.Answer.Options[NumOpt].Feedback =
(char *) malloc (Tst_MAX_BYTES_ANSWER_OR_FEEDBACK + 1)) == NULL)
{
sprintf (Gbl.Alert.Txt,"Not enough memory to store feedback.");
Str_Copy (Gbl.Alert.Txt,"Not enough memory to store feedback.",
Ale_MAX_BYTES_ALERT);
return 0;
}
@ -6325,7 +6334,8 @@ void Tst_RequestRemoveQst (void)
Lay_ShowErrorAndExit ("Wrong test parameters.");
/***** Show question and button to remove question *****/
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_question_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Do_you_really_want_to_remove_the_question_X,
(unsigned long) Gbl.Test.QstCod);
if (EditingOnlyThisQst)
Ale_ShowAlertAndButton (Ale_QUESTION,Gbl.Alert.Txt,
@ -6448,7 +6458,7 @@ void Tst_ChangeShuffleQst (void)
DB_QueryUPDATE (Query,"can not update the shuffle type of a question");
/***** Write message *****/
sprintf (Gbl.Alert.Txt,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Shuffle ? Txt_The_answers_of_the_question_with_code_X_will_appear_shuffled :
Txt_The_answers_of_the_question_with_code_X_will_appear_without_shuffling,
Gbl.Test.QstCod);

View File

@ -426,7 +426,9 @@ void TsI_ImportQstsFromXML (void)
if (WrongType)
{
sprintf (Gbl.Alert.Txt,Txt_The_file_is_not_X,"xml");
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_file_is_not_X,
"xml");
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
else

View File

@ -2473,11 +2473,13 @@ void Usr_WelcomeUsr (void)
Gbl.Prefs.PathIconSet,Cfg_ICON_128x128,
Txt_Happy_birthday,
Txt_Happy_birthday);
sprintf (Gbl.Alert.Txt,Txt_Welcome_X_and_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex],
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Welcome_X_and_happy_birthday[Gbl.Usrs.Me.UsrDat.Sex],
Gbl.Usrs.Me.UsrDat.FirstName);
}
if (!CongratulateMyBirthday)
sprintf (Gbl.Alert.Txt,Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex],
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_Welcome_X[Gbl.Usrs.Me.UsrDat.Sex],
Gbl.Usrs.Me.UsrDat.FirstName);
Ale_ShowAlert (Ale_INFO,Gbl.Alert.Txt);
}
@ -2749,7 +2751,8 @@ unsigned Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (struct ListUsrCods *Lis
if (Wrong)
{
/***** String is not a valid user's nickname, email or ID *****/
sprintf (Gbl.Alert.Txt,Txt_The_ID_nickname_or_email_X_is_not_valid,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_nickname_or_email_X_is_not_valid,
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -3182,7 +3185,8 @@ static void Usr_ShowAlertThereAreMoreThanOneUsr (void)
Gbl.Action.Act = ActFrmLogIn;
Tab_SetCurrentTab ();
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
Gbl.Usrs.Me.UsrIdLogin);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -3277,7 +3281,8 @@ void Usr_ShowFormsLogoutAndRole (void)
/***** Write message with my new logged role *****/
if (Gbl.Usrs.Me.Role.HasChanged)
{
sprintf (Gbl.Alert.Txt,Txt_You_are_now_LOGGED_IN_as_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_You_are_now_LOGGED_IN_as_X,
Txt_logged[Gbl.Usrs.Me.UsrDat.Sex],
Txt_ROLES_SINGUL_abc[Gbl.Usrs.Me.Role.Logged][Gbl.Usrs.Me.UsrDat.Sex]);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
@ -5130,7 +5135,8 @@ static void Usr_GetListUsrsFromQuery (const char *Query,Rol_Role_t Role,Sco_Scop
{
if (Gbl.Usrs.LstUsrs[Role].NumUsrs > Cfg_MAX_USRS_IN_LIST)
{
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_users_is_too_large_to_be_displayed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_list_of_X_users_is_too_large_to_be_displayed,
Gbl.Usrs.LstUsrs[Role].NumUsrs);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
Abort = true;
@ -5319,7 +5325,9 @@ static void Usr_AllocateUsrsList (Rol_Role_t Role)
/*
if (Gbl.Usrs.Me.Roles.LoggedRole == Rol_SYS_ADM)
{
sprintf (Gbl.Alert.Txt,"Memory used by list = %lu",(long) sizeof (struct UsrInList) * NumUsrs);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"Memory used by list = %lu",
(long) sizeof (struct UsrInList) * NumUsrs);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}
*/
@ -5380,7 +5388,8 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs,const char
extern const char *Txt_Show_anyway;
/***** Show alert and button to confirm that I want to see the big list *****/
sprintf (Gbl.Alert.Txt,Txt_The_list_of_X_users_is_too_large_to_be_displayed,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_list_of_X_users_is_too_large_to_be_displayed,
NumUsrs);
Ale_ShowAlertAndButton (Ale_WARNING,Gbl.Alert.Txt,
Gbl.Action.Act,Usr_USER_LIST_SECTION_ID,OnSubmit,
@ -5525,7 +5534,8 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_nickname_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_is_no_user_with_nickname_X,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -5544,7 +5554,8 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_email_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_is_no_user_with_email_X,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
@ -5572,7 +5583,8 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{// TODO: Consider forbid IDs here
if (WriteErrorMsgs)
{
sprintf (Gbl.Alert.Txt,Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_are_more_than_one_user_with_the_ID_X_Please_type_a_nick_or_email,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}
@ -5583,7 +5595,8 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Alert.Txt,Txt_There_is_no_user_with_ID_nick_or_email_X,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_There_is_no_user_with_ID_nick_or_email_X,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_ERROR,Gbl.Alert.Txt);
}
@ -5594,7 +5607,8 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{
if (WriteErrorMsgs)
{
sprintf (Gbl.Alert.Txt,Txt_The_ID_nickname_or_email_X_is_not_valid,
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
Txt_The_ID_nickname_or_email_X_is_not_valid,
UsrIDNickOrEmail);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}

View File

@ -151,12 +151,16 @@ static void XML_GetElement (struct XMLElement *ParentElem)
EndTagNameLength = strcspn (Gbl.XMLPtr,">");
if (ParentElem->TagNameLength != EndTagNameLength)
{
sprintf (Gbl.Alert.Txt,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"XML syntax error. Expect end tag &lt;/%s&gt;.",
ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
if (strncmp (ParentElem->TagName,Gbl.XMLPtr,EndTagNameLength)) // XML tags are case sensitive
{
sprintf (Gbl.Alert.Txt,"XML syntax error. Expect end tag &lt;/%s&gt;.",ParentElem->TagName);
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"XML syntax error. Expect end tag &lt;/%s&gt;.",
ParentElem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}
@ -360,7 +364,8 @@ static void XML_GetAttributes (struct XMLElement *Elem)
}
else
{
sprintf (Gbl.Alert.Txt,"XML syntax error after attribute &quot;%s&quot; inside element &quot;%s&quot;.",
snprintf (Gbl.Alert.Txt,Ale_MAX_BYTES_ALERT,
"XML syntax error after attribute &quot;%s&quot; inside element &quot;%s&quot;.",
Attribute->AttributeName,Elem->TagName);
Lay_ShowErrorAndExit (Gbl.Alert.Txt);
}