Skip to content

Commit

Permalink
Version 16.211
Browse files Browse the repository at this point in the history
  • Loading branch information
acanas committed May 10, 2017
1 parent 41b15cf commit c5cb0e6
Show file tree
Hide file tree
Showing 53 changed files with 1,060 additions and 1,050 deletions.
34 changes: 17 additions & 17 deletions swad_ID.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,8 @@ static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe)
ID_RemoveUsrIDFromDB (UsrDat->UsrCod,UsrID);

/***** Show message *****/
sprintf (Gbl.Message,Txt_ID_X_removed,UsrID);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_ID_X_removed,UsrID);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_delete_this_ID);
Expand Down Expand Up @@ -872,21 +872,21 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
if (ItsMe || UsrDat->IDs.List[NumIDFound].Confirmed)
{
Error = true;
sprintf (Gbl.Message,Txt_The_ID_X_matches_one_of_the_existing,
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_matches_one_of_the_existing,
NewID);
}
else // It's not me && !Confirmed
{
/***** Mark this ID as confirmed *****/
ID_ConfirmUsrID (UsrDat,NewID);
sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed,
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed,
NewID);
}
}
else if (UsrDat->IDs.Num >= ID_MAX_IDS_PER_USER)
{
Error = true;
sprintf (Gbl.Message,Txt_A_user_can_not_have_more_than_X_IDs,
sprintf (Gbl.Alert.Txt,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
Expand All @@ -896,20 +896,20 @@ static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe)
// It's not me ==> ID confirmed
ID_InsertANewUsrIDInDB (UsrDat->UsrCod,NewID,!ItsMe);

sprintf (Gbl.Message,Txt_The_ID_X_has_been_registered_successfully,
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_registered_successfully,
NewID);
}
}
else // New ID is not valid
{
Error = true;
sprintf (Gbl.Message,Txt_The_ID_X_is_not_valid,NewID);
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_is_not_valid,NewID);
}

/***** Show message *****/
Lay_ShowAlert (Error ? Lay_WARNING :
Lay_SUCCESS,
Gbl.Message);
Gbl.Alert.Txt);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
Expand Down Expand Up @@ -951,7 +951,7 @@ void ID_ConfirmOtherUsrID (void)
unsigned NumIDFound = 0; // Initialized to avoid warning

/***** Initialize alert type and message *****/
Gbl.AlertType = Lay_NONE; // Do not show alert
Gbl.Alert.Type = Lay_NONE; // Do not show alert

/***** Get where we came from *****/
OriginalActCod = Par_GetParToLong ("OriginalActCod");
Expand Down Expand Up @@ -986,8 +986,8 @@ void ID_ConfirmOtherUsrID (void)
if (Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed)
{
/***** ID found and already confirmed *****/
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_ID_X_had_already_been_confirmed,
Gbl.Alert.Type = Lay_INFO;
sprintf (Gbl.Alert.Txt,Txt_ID_X_had_already_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
}
else
Expand All @@ -998,21 +998,21 @@ void ID_ConfirmOtherUsrID (void)
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed = true;

/***** Write success message *****/
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed,
Gbl.Alert.Type = Lay_SUCCESS;
sprintf (Gbl.Alert.Txt,Txt_The_ID_X_has_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
}
}
else // User's ID not found
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}
}
else // I can not confirm
{
Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
Gbl.Alert.Type = Lay_WARNING;
sprintf (Gbl.Alert.Txt,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
}

/***** Show one or multiple records *****/
Expand Down
50 changes: 25 additions & 25 deletions swad_account.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ void Acc_CheckIfEmptyAccountExists (void)
}
else
{
sprintf (Gbl.Message,Txt_There_is_no_empty_account_associated_with_your_ID_X_,
sprintf (Gbl.Alert.Txt,Txt_There_is_no_empty_account_associated_with_your_ID_X_,
ID);
Lay_ShowAlert (Lay_INFO,Gbl.Message);
Lay_ShowAlert (Lay_INFO,Gbl.Alert.Txt);
}

/***** Free structure that stores the query result *****/
Expand Down Expand Up @@ -633,19 +633,19 @@ 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.Message,Txt_The_nickname_X_had_been_registered_by_another_user,
sprintf (Gbl.Alert.Txt,Txt_The_nickname_X_had_been_registered_by_another_user,
NewNicknameWithoutArroba);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // New nickname is not valid
{
Error = true;
sprintf (Gbl.Message,Txt_The_nickname_entered_X_is_not_valid_,
sprintf (Gbl.Alert.Txt,Txt_The_nickname_entered_X_is_not_valid_,
NewNicknameWithArroba,
Nck_MIN_CHARS_NICKNAME_WITHOUT_ARROBA,
Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}

/***** Step 2/3: Get new email from form *****/
Expand All @@ -661,17 +661,17 @@ 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.Message,Txt_The_email_address_X_had_been_registered_by_another_user,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_X_had_been_registered_by_another_user,
NewEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}
}
else // New email is not valid
{
Error = true;
sprintf (Gbl.Message,Txt_The_email_address_entered_X_is_not_valid,
sprintf (Gbl.Alert.Txt,Txt_The_email_address_entered_X_is_not_valid,
NewEmail);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt);
}

/***** Step 3/3: Get new password from form *****/
Expand All @@ -680,7 +680,7 @@ static bool Acc_GetParamsNewAccount (char NewNicknameWithoutArroba[Nck_MAX_BYTES
if (!Pwd_SlowCheckIfPasswordIsGood (NewPlainPassword,NewEncryptedPassword,-1L)) // New password is good?
{
Error = true;
Lay_ShowAlert (Lay_WARNING,Gbl.Message); // Error message is set in Usr_SlowCheckIfPasswordIsGood
Lay_ShowAlert (Lay_WARNING,Gbl.Alert.Txt); // Error message is set in Usr_SlowCheckIfPasswordIsGood
}

return !Error;
Expand Down Expand Up @@ -814,10 +814,10 @@ 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.Message,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
sprintf (Gbl.Alert.Txt,Txt_Congratulations_You_have_created_your_account_X_Now_Y_will_request_you_,
Gbl.Usrs.Me.UsrDat.Nickname,
Cfg_PLATFORM_SHORT_NAME);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);

/***** Show form with account data *****/
Acc_ShowFormChangeMyAccount ();
Expand Down Expand Up @@ -1005,9 +1005,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,

if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_from_all_his_her_courses,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

/***** Remove user as administrator of any degree *****/
Expand All @@ -1017,9 +1017,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,

if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_THE_USER_X_has_been_removed_as_administrator,
sprintf (Gbl.Alert.Txt,Txt_THE_USER_X_has_been_removed_as_administrator,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

/***** Remove user's clipboard in forums *****/
Expand All @@ -1032,9 +1032,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Acc_RemoveUsrBriefcase (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Briefcase_of_THE_USER_X_has_been_removed,
sprintf (Gbl.Alert.Txt,Txt_Briefcase_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

/***** Remove test results made by user in all courses *****/
Expand All @@ -1048,9 +1048,9 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
Msg_DelAllRecAndSntMsgsUsr (UsrDat->UsrCod);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Messages_of_THE_USER_X_have_been_deleted,
sprintf (Gbl.Alert.Txt,Txt_Messages_of_THE_USER_X_have_been_deleted,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

/***** Remove user from tables of banned users *****/
Expand Down Expand Up @@ -1095,18 +1095,18 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
PhotoRemoved = Pho_RemovePhoto (UsrDat);
if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Photo_of_THE_USER_X_has_been_removed,
sprintf (Gbl.Alert.Txt,Txt_Photo_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}

/***** Remove user *****/
Acc_RemoveUsr (UsrDat);
if (QuietOrVerbose == Cns_VERBOSE)
{
sprintf (Gbl.Message,Txt_Record_card_of_THE_USER_X_has_been_removed,
sprintf (Gbl.Alert.Txt,Txt_Record_card_of_THE_USER_X_has_been_removed,
UsrDat->FullName);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
}

Expand Down
28 changes: 14 additions & 14 deletions swad_agenda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,9 +1299,9 @@ void Agd_AskRemEvent (void)

/***** Show question and button to remove event *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_event_X,
sprintf (Gbl.Alert.Txt,Txt_Do_you_really_want_to_remove_the_event_X,
AgdEvent.Event);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Alert.Txt);

/* End alert */
Gbl.Agenda.AgdCodToEdit = AgdEvent.AgdCod;
Expand Down Expand Up @@ -1337,8 +1337,8 @@ void Agd_RemoveEvent (void)
DB_QueryDELETE (Query,"can not remove event");

/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_removed,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Event_X_removed,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);

/***** Show events again *****/
Agd_ShowMyAgenda ();
Expand Down Expand Up @@ -1369,8 +1369,8 @@ void Agd_HideEvent (void)
DB_QueryUPDATE (Query,"can not hide event");

/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_hidden,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_hidden,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);

/***** Show events again *****/
Agd_ShowMyAgenda ();
Expand Down Expand Up @@ -1401,9 +1401,9 @@ void Agd_UnhideEvent (void)
DB_QueryUPDATE (Query,"can not show event");

/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_visible,
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible,
AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);

/***** Show events again *****/
Agd_ShowMyAgenda ();
Expand Down Expand Up @@ -1434,8 +1434,8 @@ void Agd_MakeEventPrivate (void)
DB_QueryUPDATE (Query,"can not make event private");

/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_private,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_private,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);

/***** Show events again *****/
Agd_ShowMyAgenda ();
Expand Down Expand Up @@ -1466,9 +1466,9 @@ void Agd_MakeEventPublic (void)
DB_QueryUPDATE (Query,"can not make event public");

/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_Event_X_is_now_visible_to_users_of_your_courses,
sprintf (Gbl.Alert.Txt,Txt_Event_X_is_now_visible_to_users_of_your_courses,
AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);

/***** Show events again *****/
Agd_ShowMyAgenda ();
Expand Down Expand Up @@ -1665,8 +1665,8 @@ void Agd_RecFormEvent (void)
Agd_CreateEvent (&AgdEvent,Txt); // Add new event to database

/***** Write success message *****/
sprintf (Gbl.Message,Txt_Created_new_event_X,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
sprintf (Gbl.Alert.Txt,Txt_Created_new_event_X,AgdEvent.Event);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Alert.Txt);
}
else
{
Expand Down

0 comments on commit c5cb0e6

Please sign in to comment.