Version 18.6.5

This commit is contained in:
Antonio Cañas Vargas 2018-10-17 22:11:11 +02:00
parent ffcd8b0abe
commit 2f2c0b731c
2 changed files with 310 additions and 220 deletions

View File

@ -359,6 +359,9 @@ ps2pdf source.ps destination.pdf
#define CSS_FILE "swad18.4.css" #define CSS_FILE "swad18.4.css"
#define JS_FILE "swad17.17.1.js" #define JS_FILE "swad17.17.1.js"
/* /*
*
* Código QR no sale en la ficha cuando no estoy en una asignatura!!!!!
Version 18.6.5: Oct 17, 2018 Some sprintf changed by snprintf. (236125 lines)
Version 18.6.4: Oct 17, 2018 Some sprintf changed by snprintf. (236034 lines) Version 18.6.4: Oct 17, 2018 Some sprintf changed by snprintf. (236034 lines)
Version 18.6.3: Oct 17, 2018 Some sprintf changed by snprintf or asprintf. (235954 lines) Version 18.6.3: Oct 17, 2018 Some sprintf changed by snprintf or asprintf. (235954 lines)
Version 18.6.2: Oct 17, 2018 Some sprintf changed by snprintf. (235808 lines) Version 18.6.2: Oct 17, 2018 Some sprintf changed by snprintf. (235808 lines)

View File

@ -25,10 +25,12 @@
/********************************* Headers ***********************************/ /********************************* Headers ***********************************/
/*****************************************************************************/ /*****************************************************************************/
#define _GNU_SOURCE // For asprintf
#include <dirent.h> // For scandir, etc. #include <dirent.h> // For scandir, etc.
#include <errno.h> // For errno #include <errno.h> // For errno
#include <linux/limits.h> // For PATH_MAX #include <linux/limits.h> // For PATH_MAX
#include <linux/stddef.h> // For NULL #include <linux/stddef.h> // For NULL
#include <stdio.h> // For asprintf
#include <stdlib.h> // For exit, system, malloc, free, etc #include <stdlib.h> // For exit, system, malloc, free, etc
#include <string.h> // For string functions #include <string.h> // For string functions
#include <time.h> // For time #include <time.h> // For time
@ -6070,8 +6072,10 @@ void Brw_SetFullPathInTree (const char *PathInTreeUntilFileOrFolder,const char *
if (!PathInTreeUntilFileOrFolder[0]) if (!PathInTreeUntilFileOrFolder[0])
Gbl.FileBrowser.Priv.FullPathInTree[0] = '\0'; Gbl.FileBrowser.Priv.FullPathInTree[0] = '\0';
else if (strcmp (FilFolLnkName,".")) else if (strcmp (FilFolLnkName,"."))
sprintf (Gbl.FileBrowser.Priv.FullPathInTree,"%s/%s", snprintf (Gbl.FileBrowser.Priv.FullPathInTree,
PathInTreeUntilFileOrFolder,FilFolLnkName); sizeof (Gbl.FileBrowser.Priv.FullPathInTree),
"%s/%s",
PathInTreeUntilFileOrFolder,FilFolLnkName);
else // It's the root folder else // It's the root folder
Str_Copy (Gbl.FileBrowser.Priv.FullPathInTree,PathInTreeUntilFileOrFolder, Str_Copy (Gbl.FileBrowser.Priv.FullPathInTree,PathInTreeUntilFileOrFolder,
PATH_MAX); PATH_MAX);
@ -6156,9 +6160,10 @@ static bool Brw_CheckIfCanPasteIn (unsigned Level)
if (Gbl.FileBrowser.Clipboard.IsThisTree) // We are in the same tree of the clipboard ==> we can paste or not depending on the subtree if (Gbl.FileBrowser.Clipboard.IsThisTree) // We are in the same tree of the clipboard ==> we can paste or not depending on the subtree
{ {
/***** Construct the name of the file or folder destination *****/ /***** Construct the name of the file or folder destination *****/
sprintf (PathDstWithFile,"%s/%s", snprintf (PathDstWithFile,sizeof (PathDstWithFile),
Gbl.FileBrowser.Priv.FullPathInTree, "%s/%s",
Gbl.FileBrowser.Clipboard.FileName); Gbl.FileBrowser.Priv.FullPathInTree,
Gbl.FileBrowser.Clipboard.FileName);
return !Str_Path1BeginsByPath2 (PathDstWithFile, return !Str_Path1BeginsByPath2 (PathDstWithFile,
Gbl.FileBrowser.Clipboard.Path); Gbl.FileBrowser.Clipboard.Path);
@ -6186,7 +6191,9 @@ static void Brw_PutIconRemoveFile (const char PathInTree[PATH_MAX + 1],
Brw_PutParamsFileBrowser (Brw_ActAskRemoveFile[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActAskRemoveFile[Gbl.FileBrowser.Type],
PathInTree,FileName, PathInTree,FileName,
Gbl.FileBrowser.FileType,-1L); Gbl.FileBrowser.FileType,-1L);
sprintf (Gbl.Title,Txt_Remove_FILE_OR_LINK_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Remove_FILE_OR_LINK_X,
FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/remove-on64x64.png\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/remove-on64x64.png\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO20x20\" />", " class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO20x20\" />",
@ -6219,7 +6226,9 @@ static void Brw_PutIconRemoveDir (const char PathInTree[PATH_MAX + 1],
Brw_PutParamsFileBrowser (Brw_ActRemoveFolder[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActRemoveFolder[Gbl.FileBrowser.Type],
PathInTree,FileName, PathInTree,FileName,
Brw_IS_FOLDER,-1L); Brw_IS_FOLDER,-1L);
sprintf (Gbl.Title,Txt_Remove_folder_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Remove_folder_X,
FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/remove-on64x64.png\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/remove-on64x64.png\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO20x20\" />", " class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO20x20\" />",
@ -6250,7 +6259,9 @@ static void Brw_PutIconCopy (const char PathInTree[PATH_MAX + 1],
Brw_PutParamsFileBrowser (Brw_ActCopy[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActCopy[Gbl.FileBrowser.Type],
PathInTree,FileName, PathInTree,FileName,
Gbl.FileBrowser.FileType,-1L); Gbl.FileBrowser.FileType,-1L);
sprintf (Gbl.Title,Txt_Copy_FOLDER_FILE_OR_LINK_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Copy_FOLDER_FILE_OR_LINK_X,
FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/copy_on16x16.gif\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/copy_on16x16.gif\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />", " class=\"ICO20x20\" />",
@ -6278,7 +6289,9 @@ static void Brw_PutIconPasteOn (const char PathInTree[PATH_MAX + 1],
Brw_PutParamsFileBrowser (Brw_ActPaste[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActPaste[Gbl.FileBrowser.Type],
PathInTree,FileName, PathInTree,FileName,
Brw_IS_FOLDER,-1L); Brw_IS_FOLDER,-1L);
sprintf (Gbl.Title,Txt_Paste_in_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Paste_in_X,
FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/paste_on16x16.gif\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/paste_on16x16.gif\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />", " class=\"ICO20x20\" />",
@ -6393,7 +6406,7 @@ static void Brw_PutIconToExpandFolder (const char *FileBrowserId,const char *Row
const char *FileNameToShow) const char *FileNameToShow)
{ {
extern const char *Txt_Expand; extern const char *Txt_Expand;
char JavaScriptFunctionToExpandFolder[256 + Brw_MAX_ROW_ID]; char JavaScriptFuncToExpandFolder[256 + Brw_MAX_ROW_ID];
/***** Start container *****/ /***** Start container *****/
fprintf (Gbl.F.Out,"<div id=\"expand_%s_%s\"", fprintf (Gbl.F.Out,"<div id=\"expand_%s_%s\"",
@ -6403,15 +6416,18 @@ static void Brw_PutIconToExpandFolder (const char *FileBrowserId,const char *Row
fprintf (Gbl.F.Out,">"); fprintf (Gbl.F.Out,">");
/***** Form and icon *****/ /***** Form and icon *****/
sprintf (JavaScriptFunctionToExpandFolder,"ExpandFolder('%s_%s')", snprintf (JavaScriptFuncToExpandFolder,sizeof (JavaScriptFuncToExpandFolder),
FileBrowserId,RowId); "ExpandFolder('%s_%s')",
FileBrowserId,RowId);
Act_StartFormAnchorOnSubmit (Brw_ActExpandFolder[Gbl.FileBrowser.Type], Act_StartFormAnchorOnSubmit (Brw_ActExpandFolder[Gbl.FileBrowser.Type],
FileBrowserId, FileBrowserId,
JavaScriptFunctionToExpandFolder); // JavaScript function to unhide rows JavaScriptFuncToExpandFolder); // JavaScript function to unhide rows
Brw_PutParamsFileBrowser (Brw_ActExpandFolder[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActExpandFolder[Gbl.FileBrowser.Type],
PathInTree,FileName, PathInTree,FileName,
Brw_IS_FOLDER,-1L); Brw_IS_FOLDER,-1L);
sprintf (Gbl.Title,"%s %s",Txt_Expand,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
"%s %s",
Txt_Expand,FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/expand64x64.png\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/expand64x64.png\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />", " class=\"ICO20x20\" />",
@ -6435,7 +6451,7 @@ static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *R
const char *FileNameToShow) const char *FileNameToShow)
{ {
extern const char *Txt_Contract; extern const char *Txt_Contract;
char JavaScriptFunctionToContractFolder[256 + Brw_MAX_ROW_ID]; char JavaScriptFuncToContractFolder[256 + Brw_MAX_ROW_ID];
/***** Start container *****/ /***** Start container *****/
fprintf (Gbl.F.Out,"<div id=\"contract_%s_%s\"", fprintf (Gbl.F.Out,"<div id=\"contract_%s_%s\"",
@ -6445,15 +6461,18 @@ static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *R
fprintf (Gbl.F.Out,">"); fprintf (Gbl.F.Out,">");
/***** Form and icon *****/ /***** Form and icon *****/
sprintf (JavaScriptFunctionToContractFolder,"ContractFolder('%s_%s')", snprintf (JavaScriptFuncToContractFolder,sizeof (JavaScriptFuncToContractFolder),
FileBrowserId,RowId); "ContractFolder('%s_%s')",
FileBrowserId,RowId);
Act_StartFormAnchorOnSubmit (Brw_ActContractFolder[Gbl.FileBrowser.Type], Act_StartFormAnchorOnSubmit (Brw_ActContractFolder[Gbl.FileBrowser.Type],
FileBrowserId, FileBrowserId,
JavaScriptFunctionToContractFolder); // JavaScript function to hide rows JavaScriptFuncToContractFolder); // JavaScript function to hide rows
Brw_PutParamsFileBrowser (Brw_ActContractFolder[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActContractFolder[Gbl.FileBrowser.Type],
PathInTree,FileName, PathInTree,FileName,
Brw_IS_FOLDER,-1L); Brw_IS_FOLDER,-1L);
sprintf (Gbl.Title,"%s %s",Txt_Contract,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
"%s %s",
Txt_Contract,FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/contract64x64.png\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/contract64x64.png\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />", " class=\"ICO20x20\" />",
@ -6479,7 +6498,9 @@ static void Brw_PutIconShow (unsigned Level,const char *PathInTree,const char *F
Brw_PutParamsFileBrowser (ActUnk, Brw_PutParamsFileBrowser (ActUnk,
PathInTree,FileName, PathInTree,FileName,
Gbl.FileBrowser.FileType,-1L); Gbl.FileBrowser.FileType,-1L);
sprintf (Gbl.Title,Txt_Show_FOLDER_FILE_OR_LINK_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Show_FOLDER_FILE_OR_LINK_X,
FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye-slash-%s64x64.png\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye-slash-%s64x64.png\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />", " class=\"ICO20x20\" />",
@ -6505,7 +6526,9 @@ static void Brw_PutIconHide (unsigned Level,const char *PathInTree,const char *F
Brw_PutParamsFileBrowser (ActUnk, Brw_PutParamsFileBrowser (ActUnk,
PathInTree,FileName, PathInTree,FileName,
Gbl.FileBrowser.FileType,-1L); Gbl.FileBrowser.FileType,-1L);
sprintf (Gbl.Title,Txt_Hide_FOLDER_FILE_OR_LINK_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Hide_FOLDER_FILE_OR_LINK_X,
FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye-%s64x64.png\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye-%s64x64.png\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />", " class=\"ICO20x20\" />",
@ -6674,7 +6697,9 @@ static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *Row
Brw_PutParamsFileBrowser (Brw_ActFormCreate[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActFormCreate[Gbl.FileBrowser.Type],
PathInTree,FileName, PathInTree,FileName,
Brw_IS_FOLDER,-1L); Brw_IS_FOLDER,-1L);
sprintf (Gbl.Title,Txt_Upload_file_or_create_folder_in_FOLDER,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Upload_file_or_create_folder_in_FOLDER,
FileNameToShow);
fprintf (Gbl.F.Out,"<input type=\"image\"" fprintf (Gbl.F.Out,"<input type=\"image\""
" src=\"%s/folder-%s-plus16x16.gif\"" " src=\"%s/folder-%s-plus16x16.gif\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
@ -6727,8 +6752,9 @@ static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size,
FileMetadata->FilCod); FileMetadata->FilCod);
/***** Name and link of the file or folder *****/ /***** Name and link of the file or folder *****/
sprintf (Gbl.Title,Txt_View_data_of_FILE_OR_LINK_X, snprintf (Gbl.Title,sizeof (Gbl.Title),
FileNameToShow); Txt_View_data_of_FILE_OR_LINK_X,
FileNameToShow);
/* Link to the form and to the file */ /* Link to the form and to the file */
Act_LinkFormSubmit (Gbl.Title,Gbl.FileBrowser.TxtStyle,NULL); Act_LinkFormSubmit (Gbl.Title,Gbl.FileBrowser.TxtStyle,NULL);
@ -6864,10 +6890,11 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic,
Gbl.FileBrowser.FileType,-1L); Gbl.FileBrowser.FileType,-1L);
/* Link to the form and to the file */ /* Link to the form and to the file */
sprintf (Gbl.Title,(Gbl.FileBrowser.Type == Brw_SHOW_MRK_CRS || snprintf (Gbl.Title,sizeof (Gbl.Title),
Gbl.FileBrowser.Type == Brw_SHOW_MRK_GRP) ? Txt_Check_marks_in_file_X : (Gbl.FileBrowser.Type == Brw_SHOW_MRK_CRS ||
Txt_Download_FILE_OR_LINK_X, Gbl.FileBrowser.Type == Brw_SHOW_MRK_GRP) ? Txt_Check_marks_in_file_X :
FileNameToShow); Txt_Download_FILE_OR_LINK_X,
FileNameToShow);
Act_LinkFormSubmit (Gbl.Title,Gbl.FileBrowser.TxtStyle,NULL); Act_LinkFormSubmit (Gbl.Title,Gbl.FileBrowser.TxtStyle,NULL);
fprintf (Gbl.F.Out,"%s</a>", fprintf (Gbl.F.Out,"%s</a>",
FileNameToShow); FileNameToShow);
@ -6929,9 +6956,10 @@ void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
char Link[PATH_MAX + 1]; char Link[PATH_MAX + 1];
/***** Create, into temporary public directory, a symbolic link to file *****/ /***** Create, into temporary public directory, a symbolic link to file *****/
sprintf (Link,"%s/%s/%s/%s", snprintf (Link,sizeof (Link),
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP, "%s/%s/%s/%s",
Gbl.FileBrowser.TmpPubDir,FileName); Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
Gbl.FileBrowser.TmpPubDir,FileName);
if (symlink (FullPathIncludingFile,Link) != 0) if (symlink (FullPathIncludingFile,Link) != 0)
Lay_ShowErrorAndExit ("Can not create temporary link."); Lay_ShowErrorAndExit ("Can not create temporary link.");
} }
@ -7151,9 +7179,10 @@ void Brw_RemFileFromTree (void)
if (Brw_CheckIfICanEditFileOrFolder (Gbl.FileBrowser.Level)) // Can I remove this file? if (Brw_CheckIfICanEditFileOrFolder (Gbl.FileBrowser.Level)) // Can I remove this file?
{ {
sprintf (Path,"%s/%s", snprintf (Path,sizeof (Path),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s",
Gbl.FileBrowser.Priv.FullPathInTree); Gbl.FileBrowser.Priv.PathAboveRootFolder,
Gbl.FileBrowser.Priv.FullPathInTree);
/***** Check if is a file/link or a folder *****/ /***** Check if is a file/link or a folder *****/
if (lstat (Path,&FileStatus)) // On success ==> 0 is returned if (lstat (Path,&FileStatus)) // On success ==> 0 is returned
@ -7206,9 +7235,10 @@ void Brw_RemFolderFromTree (void)
if (Brw_CheckIfICanEditFileOrFolder (Gbl.FileBrowser.Level)) // Can I remove this folder? if (Brw_CheckIfICanEditFileOrFolder (Gbl.FileBrowser.Level)) // Can I remove this folder?
{ {
sprintf (Path,"%s/%s", snprintf (Path,sizeof (Path),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s",
Gbl.FileBrowser.Priv.FullPathInTree); Gbl.FileBrowser.Priv.PathAboveRootFolder,
Gbl.FileBrowser.Priv.FullPathInTree);
/***** Check if it's a file or a folder *****/ /***** Check if it's a file or a folder *****/
if (lstat (Path,&FileStatus)) // On success ==> 0 is returned if (lstat (Path,&FileStatus)) // On success ==> 0 is returned
@ -7293,9 +7323,10 @@ void Brw_RemSubtreeInFileBrowser (void)
if (Brw_CheckIfICanEditFileOrFolder (Gbl.FileBrowser.Level)) // Can I remove this subtree? if (Brw_CheckIfICanEditFileOrFolder (Gbl.FileBrowser.Level)) // Can I remove this subtree?
{ {
sprintf (Path,"%s/%s", snprintf (Path,sizeof (Path),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s",
Gbl.FileBrowser.Priv.FullPathInTree); Gbl.FileBrowser.Priv.PathAboveRootFolder,
Gbl.FileBrowser.Priv.FullPathInTree);
/***** Remove the whole tree *****/ /***** Remove the whole tree *****/
Fil_RemoveTree (Path); Fil_RemoveTree (Path);
@ -7428,111 +7459,125 @@ static void Brw_WriteCurrentClipboard (void)
case Brw_ADMI_DOC_INS: case Brw_ADMI_DOC_INS:
Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
Ins_GetDataOfInstitutionByCod (&Ins,false); Ins_GetDataOfInstitutionByCod (&Ins,false);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_documents_management_area, "%s, %s <strong>%s</strong>",
Txt_institution,Ins.ShrtName); Txt_documents_management_area,
Txt_institution,Ins.ShrtName);
break; break;
case Brw_ADMI_SHR_INS: case Brw_ADMI_SHR_INS:
Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
Ins_GetDataOfInstitutionByCod (&Ins,false); Ins_GetDataOfInstitutionByCod (&Ins,false);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_shared_files_area, "%s, %s <strong>%s</strong>",
Txt_institution,Ins.ShrtName); Txt_shared_files_area,
Txt_institution,Ins.ShrtName);
break; break;
case Brw_ADMI_DOC_CTR: case Brw_ADMI_DOC_CTR:
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
Ctr_GetDataOfCentreByCod (&Ctr); Ctr_GetDataOfCentreByCod (&Ctr);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_documents_management_area, "%s, %s <strong>%s</strong>",
Txt_centre,Ctr.ShrtName); Txt_documents_management_area,
Txt_centre,Ctr.ShrtName);
break; break;
case Brw_ADMI_SHR_CTR: case Brw_ADMI_SHR_CTR:
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
Ctr_GetDataOfCentreByCod (&Ctr); Ctr_GetDataOfCentreByCod (&Ctr);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_shared_files_area, "%s, %s <strong>%s</strong>",
Txt_centre,Ctr.ShrtName); Txt_shared_files_area,
Txt_centre,Ctr.ShrtName);
break; break;
case Brw_ADMI_DOC_DEG: case Brw_ADMI_DOC_DEG:
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDataOfDegreeByCod (&Deg);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_documents_management_area, "%s, %s <strong>%s</strong>",
Txt_degree,Deg.ShrtName); Txt_documents_management_area,
Txt_degree,Deg.ShrtName);
break; break;
case Brw_ADMI_SHR_DEG: case Brw_ADMI_SHR_DEG:
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
Deg_GetDataOfDegreeByCod (&Deg); Deg_GetDataOfDegreeByCod (&Deg);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_shared_files_area, "%s, %s <strong>%s</strong>",
Txt_degree,Deg.ShrtName); Txt_shared_files_area,
Txt_degree,Deg.ShrtName);
break; break;
case Brw_ADMI_DOC_CRS: case Brw_ADMI_DOC_CRS:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_documents_management_area, "%s, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName); Txt_documents_management_area,
Txt_course,Crs.ShrtName);
break; break;
case Brw_ADMI_DOC_GRP: case Brw_ADMI_DOC_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetDataOfGroupByCod (&GrpDat);
Crs.CrsCod = GrpDat.CrsCod; Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_documents_management_area, "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_course,Crs.ShrtName, Txt_documents_management_area,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName); Txt_course,Crs.ShrtName,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName);
break; break;
case Brw_ADMI_TCH_CRS: case Brw_ADMI_TCH_CRS:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_teachers_files_area, "%s, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName); Txt_teachers_files_area,
Txt_course,Crs.ShrtName);
break; break;
case Brw_ADMI_TCH_GRP: case Brw_ADMI_TCH_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetDataOfGroupByCod (&GrpDat);
Crs.CrsCod = GrpDat.CrsCod; Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_teachers_files_area, "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_course,Crs.ShrtName, Txt_teachers_files_area,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName); Txt_course,Crs.ShrtName,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName);
break; break;
case Brw_ADMI_SHR_CRS: case Brw_ADMI_SHR_CRS:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_shared_files_area, "%s, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName); Txt_shared_files_area,
Txt_course,Crs.ShrtName);
break; break;
case Brw_ADMI_SHR_GRP: case Brw_ADMI_SHR_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetDataOfGroupByCod (&GrpDat);
Crs.CrsCod = GrpDat.CrsCod; Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_shared_files_area, "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_course,Crs.ShrtName, Txt_shared_files_area,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName); Txt_course,Crs.ShrtName,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName);
break; break;
case Brw_ADMI_ASG_USR: case Brw_ADMI_ASG_USR:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_assignments_area, "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName, Txt_assignments_area,
Txt_user[Gbl.Usrs.Me.UsrDat.Sex],Gbl.Usrs.Me.UsrDat.FullName); Txt_course,Crs.ShrtName,
Txt_user[Gbl.Usrs.Me.UsrDat.Sex],Gbl.Usrs.Me.UsrDat.FullName);
break; break;
case Brw_ADMI_WRK_USR: case Brw_ADMI_WRK_USR:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_works_area, "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName, Txt_works_area,
Txt_user[Gbl.Usrs.Me.UsrDat.Sex],Gbl.Usrs.Me.UsrDat.FullName); Txt_course,Crs.ShrtName,
Txt_user[Gbl.Usrs.Me.UsrDat.Sex],Gbl.Usrs.Me.UsrDat.FullName);
break; break;
case Brw_ADMI_ASG_CRS: case Brw_ADMI_ASG_CRS:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
@ -7540,10 +7585,11 @@ static void Brw_WriteCurrentClipboard (void)
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod; UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod;
Usr_GetAllUsrDataFromUsrCod (&UsrDat); Usr_GetAllUsrDataFromUsrCod (&UsrDat);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_assignments_area, "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName, Txt_assignments_area,
Txt_user[UsrDat.Sex],UsrDat.FullName); Txt_course,Crs.ShrtName,
Txt_user[UsrDat.Sex],UsrDat.FullName);
Usr_UsrDataDestructor (&UsrDat); Usr_UsrDataDestructor (&UsrDat);
break; break;
case Brw_ADMI_WRK_CRS: case Brw_ADMI_WRK_CRS:
@ -7552,10 +7598,11 @@ static void Brw_WriteCurrentClipboard (void)
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod; UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod;
Usr_GetAllUsrDataFromUsrCod (&UsrDat); Usr_GetAllUsrDataFromUsrCod (&UsrDat);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_works_area, "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName, Txt_works_area,
Txt_user[UsrDat.Sex],UsrDat.FullName); Txt_course,Crs.ShrtName,
Txt_user[UsrDat.Sex],UsrDat.FullName);
Usr_UsrDataDestructor (&UsrDat); Usr_UsrDataDestructor (&UsrDat);
break; break;
case Brw_ADMI_DOC_PRJ: case Brw_ADMI_DOC_PRJ:
@ -7565,34 +7612,38 @@ static void Brw_WriteCurrentClipboard (void)
Prj_GetDataOfProjectByCod (&Prj); Prj_GetDataOfProjectByCod (&Prj);
Crs.CrsCod = Prj.CrsCod; Crs.CrsCod = Prj.CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Gbl.FileBrowser.Clipboard.FileBrowser == Brw_ADMI_DOC_PRJ ? Txt_project_documents : "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",
Txt_project_assessment, Gbl.FileBrowser.Clipboard.FileBrowser == Brw_ADMI_DOC_PRJ ? Txt_project_documents :
Txt_course,Crs.ShrtName, Txt_project_assessment,
Txt_project,Prj.Title); Txt_course,Crs.ShrtName,
Txt_project,Prj.Title);
Prj_FreeMemProject (&Prj); Prj_FreeMemProject (&Prj);
break; break;
case Brw_ADMI_MRK_CRS: case Brw_ADMI_MRK_CRS:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_marks_management_area, "%s, %s <strong>%s</strong>",
Txt_course,Crs.ShrtName); Txt_marks_management_area,
Txt_course,Crs.ShrtName);
break; break;
case Brw_ADMI_MRK_GRP: case Brw_ADMI_MRK_GRP:
GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetDataOfGroupByCod (&GrpDat);
Crs.CrsCod = GrpDat.CrsCod; Crs.CrsCod = GrpDat.CrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_marks_management_area, "%s, %s <strong>%s</strong>, %s <strong>%s %s</strong>",
Txt_course,Crs.ShrtName, Txt_marks_management_area,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName); Txt_course,Crs.ShrtName,
Txt_group,GrpDat.GrpTypName,GrpDat.GrpName);
break; break;
case Brw_ADMI_BRF_USR: case Brw_ADMI_BRF_USR:
sprintf (TxtClipboardZone,"%s, %s <strong>%s</strong>", snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
Txt_temporary_private_storage_area, "%s, %s <strong>%s</strong>",
Txt_user[Gbl.Usrs.Me.UsrDat.Sex],Gbl.Usrs.Me.UsrDat.FullName); Txt_temporary_private_storage_area,
Txt_user[Gbl.Usrs.Me.UsrDat.Sex],Gbl.Usrs.Me.UsrDat.FullName);
break; break;
default: default:
break; break;
@ -8417,11 +8468,12 @@ static void Brw_PasteClipboard (void)
case Brw_ADMI_SHR_INS: case Brw_ADMI_SHR_INS:
Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
if (Ins_GetDataOfInstitutionByCod (&Ins,false)) if (Ins_GetDataOfInstitutionByCod (&Ins,false))
sprintf (PathOrg,"%s/%s/%02u/%u/%s", snprintf (PathOrg,sizeof (PathOrg),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_INS, "%s/%s/%02u/%u/%s",
(unsigned) (Ins.InsCod % 100), Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_INS,
(unsigned) Ins.InsCod, (unsigned) (Ins.InsCod % 100),
Gbl.FileBrowser.Clipboard.Path); (unsigned) Ins.InsCod,
Gbl.FileBrowser.Clipboard.Path);
else else
Lay_ShowErrorAndExit ("The copy source does not exist."); Lay_ShowErrorAndExit ("The copy source does not exist.");
break; break;
@ -8429,11 +8481,12 @@ static void Brw_PasteClipboard (void)
case Brw_ADMI_SHR_CTR: case Brw_ADMI_SHR_CTR:
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
if (Ctr_GetDataOfCentreByCod (&Ctr)) if (Ctr_GetDataOfCentreByCod (&Ctr))
sprintf (PathOrg,"%s/%s/%02u/%u/%s", snprintf (PathOrg,sizeof (PathOrg),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CTR, "%s/%s/%02u/%u/%s",
(unsigned) (Ctr.CtrCod % 100), Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CTR,
(unsigned) Ctr.CtrCod, (unsigned) (Ctr.CtrCod % 100),
Gbl.FileBrowser.Clipboard.Path); (unsigned) Ctr.CtrCod,
Gbl.FileBrowser.Clipboard.Path);
else else
Lay_ShowErrorAndExit ("The copy source does not exist."); Lay_ShowErrorAndExit ("The copy source does not exist.");
break; break;
@ -8441,11 +8494,12 @@ static void Brw_PasteClipboard (void)
case Brw_ADMI_SHR_DEG: case Brw_ADMI_SHR_DEG:
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
if (Deg_GetDataOfDegreeByCod (&Deg)) if (Deg_GetDataOfDegreeByCod (&Deg))
sprintf (PathOrg,"%s/%s/%02u/%u/%s", snprintf (PathOrg,sizeof (PathOrg),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_DEG, "%s/%s/%02u/%u/%s",
(unsigned) (Deg.DegCod % 100), Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_DEG,
(unsigned) Deg.DegCod, (unsigned) (Deg.DegCod % 100),
Gbl.FileBrowser.Clipboard.Path); (unsigned) Deg.DegCod,
Gbl.FileBrowser.Clipboard.Path);
else else
Lay_ShowErrorAndExit ("The copy source does not exist."); Lay_ShowErrorAndExit ("The copy source does not exist.");
break; break;
@ -8455,9 +8509,10 @@ static void Brw_PasteClipboard (void)
case Brw_ADMI_MRK_CRS: case Brw_ADMI_MRK_CRS:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
if (Crs_GetDataOfCourseByCod (&Crs)) if (Crs_GetDataOfCourseByCod (&Crs))
sprintf (PathOrg,"%s/%s/%ld/%s", snprintf (PathOrg,sizeof (PathOrg),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod, "%s/%s/%ld/%s",
Gbl.FileBrowser.Clipboard.Path); Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,
Gbl.FileBrowser.Clipboard.Path);
else else
Lay_ShowErrorAndExit ("The copy source does not exist."); Lay_ShowErrorAndExit ("The copy source does not exist.");
break; break;
@ -8469,10 +8524,11 @@ static void Brw_PasteClipboard (void)
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetDataOfGroupByCod (&GrpDat);
Crs.CrsCod = GrpDat.CrsCod; Crs.CrsCod = GrpDat.CrsCod;
if (Crs_GetDataOfCourseByCod (&Crs)) if (Crs_GetDataOfCourseByCod (&Crs))
sprintf (PathOrg,"%s/%s/%ld/%s/%ld/%s", snprintf (PathOrg,sizeof (PathOrg),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_GRP, "%s/%s/%ld/%s/%ld/%s",
GrpDat.GrpCod, Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_GRP,
Gbl.FileBrowser.Clipboard.Path); GrpDat.GrpCod,
Gbl.FileBrowser.Clipboard.Path);
else else
Lay_ShowErrorAndExit ("The copy source does not exist."); Lay_ShowErrorAndExit ("The copy source does not exist.");
break; break;
@ -8480,11 +8536,12 @@ static void Brw_PasteClipboard (void)
case Brw_ADMI_WRK_USR: case Brw_ADMI_WRK_USR:
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
if (Crs_GetDataOfCourseByCod (&Crs)) if (Crs_GetDataOfCourseByCod (&Crs))
sprintf (PathOrg,"%s/%s/%ld/%s/%02u/%ld/%s", snprintf (PathOrg,sizeof (PathOrg),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_USR, "%s/%s/%ld/%s/%02u/%ld/%s",
(unsigned) (Gbl.Usrs.Me.UsrDat.UsrCod % 100), Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_USR,
Gbl.Usrs.Me.UsrDat.UsrCod, (unsigned) (Gbl.Usrs.Me.UsrDat.UsrCod % 100),
Gbl.FileBrowser.Clipboard.Path); Gbl.Usrs.Me.UsrDat.UsrCod,
Gbl.FileBrowser.Clipboard.Path);
else else
Lay_ShowErrorAndExit ("The copy source does not exist."); Lay_ShowErrorAndExit ("The copy source does not exist.");
break; break;
@ -8493,7 +8550,8 @@ static void Brw_PasteClipboard (void)
PrjCod = Gbl.FileBrowser.Clipboard.Cod; PrjCod = Gbl.FileBrowser.Clipboard.Cod;
Crs.CrsCod = Prj_GetCourseOfProject (PrjCod); Crs.CrsCod = Prj_GetCourseOfProject (PrjCod);
if (Crs_GetDataOfCourseByCod (&Crs)) if (Crs_GetDataOfCourseByCod (&Crs))
sprintf (PathOrg,"%s/%s/%ld/%s/%02u/%ld/%s", snprintf (PathOrg,sizeof (PathOrg),
"%s/%s/%ld/%s/%02u/%ld/%s",
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_PRJ, Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_PRJ,
(unsigned) (PrjCod % 100), (unsigned) (PrjCod % 100),
PrjCod, PrjCod,
@ -8502,9 +8560,10 @@ static void Brw_PasteClipboard (void)
Lay_ShowErrorAndExit ("The copy source does not exist."); Lay_ShowErrorAndExit ("The copy source does not exist.");
break; break;
case Brw_ADMI_BRF_USR: case Brw_ADMI_BRF_USR:
sprintf (PathOrg,"%s/%s", snprintf (PathOrg,sizeof (PathOrg),
Gbl.Usrs.Me.PathDir, "%s/%s",
Gbl.FileBrowser.Clipboard.Path); Gbl.Usrs.Me.PathDir,
Gbl.FileBrowser.Clipboard.Path);
break; break;
default: default:
break; break;
@ -8652,12 +8711,15 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
PATH_MAX); PATH_MAX);
else // Origin of copy is a file or folder inside the root folder else // Origin of copy is a file or folder inside the root folder
// for example "sha/folder1/file1" // for example "sha/folder1/file1"
sprintf (PathDstInTreeWithFile,"%s/%s",PathDstInTree,FileNameOrg); snprintf (PathDstInTreeWithFile,sizeof (PathDstInTreeWithFile),
"%s/%s",
PathDstInTree,FileNameOrg);
/***** Construct the relative path of the destination file or folder *****/ /***** Construct the relative path of the destination file or folder *****/
sprintf (PathDstWithFile,"%s/%s", snprintf (PathDstWithFile,sizeof (PathDstWithFile),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s",
PathDstInTreeWithFile); Gbl.FileBrowser.Priv.PathAboveRootFolder,
PathDstInTreeWithFile);
/***** Update and check number of levels *****/ /***** Update and check number of levels *****/
// The number of levels is counted starting on the root folder raíz, not included. // The number of levels is counted starting on the root folder raíz, not included.
@ -8803,7 +8865,9 @@ static bool Brw_PasteTreeIntoFolder (unsigned LevelOrg,
strcmp (FileList[NumFile]->d_name,".") && strcmp (FileList[NumFile]->d_name,".") &&
strcmp (FileList[NumFile]->d_name,"..")) // Skip directories "." and ".." strcmp (FileList[NumFile]->d_name,"..")) // Skip directories "." and ".."
{ {
sprintf (PathInFolderOrg,"%s/%s",PathOrg,FileList[NumFile]->d_name); snprintf (PathInFolderOrg,sizeof (PathInFolderOrg),
"%s/%s",
PathOrg,FileList[NumFile]->d_name);
/* Recursive call to this function */ /* Recursive call to this function */
if (!Brw_PasteTreeIntoFolder (LevelOrg + 1, if (!Brw_PasteTreeIntoFolder (LevelOrg + 1,
PathInFolderOrg, PathInFolderOrg,
@ -9158,9 +9222,10 @@ void Brw_RecFolderFileBrowser (void)
if (Str_ConvertFilFolLnkNameToValid (Gbl.FileBrowser.NewFilFolLnkName)) if (Str_ConvertFilFolLnkNameToValid (Gbl.FileBrowser.NewFilFolLnkName))
{ {
/* In Gbl.FileBrowser.NewFilFolLnkName is the name of the new folder */ /* In Gbl.FileBrowser.NewFilFolLnkName is the name of the new folder */
sprintf (Path,"%s/%s", snprintf (Path,sizeof (Path),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s",
Gbl.FileBrowser.Priv.FullPathInTree); Gbl.FileBrowser.Priv.PathAboveRootFolder,
Gbl.FileBrowser.Priv.FullPathInTree);
if (strlen (Path) + 1 + strlen (Gbl.FileBrowser.NewFilFolLnkName) > PATH_MAX) if (strlen (Path) + 1 + strlen (Gbl.FileBrowser.NewFilFolLnkName) > PATH_MAX)
Lay_ShowErrorAndExit ("Path is too long."); Lay_ShowErrorAndExit ("Path is too long.");
@ -9194,9 +9259,10 @@ void Brw_RecFolderFileBrowser (void)
Brw_InsFoldersInPathAndUpdOtherFoldersInExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree); Brw_InsFoldersInPathAndUpdOtherFoldersInExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree);
/* Add entry to the table of files/folders */ /* Add entry to the table of files/folders */
sprintf (PathCompleteInTreeIncludingFolder,"%s/%s", snprintf (PathCompleteInTreeIncludingFolder,sizeof (PathCompleteInTreeIncludingFolder),
Gbl.FileBrowser.Priv.FullPathInTree, "%s/%s",
Gbl.FileBrowser.NewFilFolLnkName); Gbl.FileBrowser.Priv.FullPathInTree,
Gbl.FileBrowser.NewFilFolLnkName);
Brw_AddPathToDB (Gbl.Usrs.Me.UsrDat.UsrCod,Brw_IS_FOLDER, Brw_AddPathToDB (Gbl.Usrs.Me.UsrDat.UsrCod,Brw_IS_FOLDER,
PathCompleteInTreeIncludingFolder,false,Brw_LICENSE_DEFAULT); PathCompleteInTreeIncludingFolder,false,Brw_LICENSE_DEFAULT);
@ -9266,24 +9332,28 @@ void Brw_RenFolderFileBrowser (void)
if (strcmp (Gbl.FileBrowser.FilFolLnkName,Gbl.FileBrowser.NewFilFolLnkName)) // The name has changed if (strcmp (Gbl.FileBrowser.FilFolLnkName,Gbl.FileBrowser.NewFilFolLnkName)) // The name has changed
{ {
/* Gbl.FileBrowser.FilFolLnkName holds the new name of the folder */ /* Gbl.FileBrowser.FilFolLnkName holds the new name of the folder */
sprintf (OldPathInTree,"%s/%s", snprintf (OldPathInTree,sizeof (OldPathInTree),
Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk, "%s/%s",
Gbl.FileBrowser.FilFolLnkName); Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk,
sprintf (OldPath,"%s/%s", Gbl.FileBrowser.FilFolLnkName);
Gbl.FileBrowser.Priv.PathAboveRootFolder, snprintf (OldPath,sizeof (OldPath),
OldPathInTree); "%s/%s",
Gbl.FileBrowser.Priv.PathAboveRootFolder,
OldPathInTree);
/* Gbl.FileBrowser.NewFilFolLnkName holds the new name of the folder */ /* Gbl.FileBrowser.NewFilFolLnkName holds the new name of the folder */
if (strlen (Gbl.FileBrowser.Priv.PathAboveRootFolder) + 1 + if (strlen (Gbl.FileBrowser.Priv.PathAboveRootFolder) + 1 +
strlen (Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk) + 1 + strlen (Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk) + 1 +
strlen (Gbl.FileBrowser.NewFilFolLnkName) > PATH_MAX) strlen (Gbl.FileBrowser.NewFilFolLnkName) > PATH_MAX)
Lay_ShowErrorAndExit ("Path is too long."); Lay_ShowErrorAndExit ("Path is too long.");
sprintf (NewPathInTree,"%s/%s", snprintf (NewPathInTree,sizeof (NewPathInTree),
Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk, "%s/%s",
Gbl.FileBrowser.NewFilFolLnkName); Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk,
sprintf (NewPath,"%s/%s", Gbl.FileBrowser.NewFilFolLnkName);
Gbl.FileBrowser.Priv.PathAboveRootFolder, snprintf (NewPath,sizeof (NewPath),
NewPathInTree); "%s/%s",
Gbl.FileBrowser.Priv.PathAboveRootFolder,
NewPathInTree);
/* We should check here that a folder with the same name does not exist. /* We should check here that a folder with the same name does not exist.
but we leave this work to the system */ but we leave this work to the system */
@ -9456,10 +9526,13 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
if (Str_ConvertFilFolLnkNameToValid (Gbl.FileBrowser.NewFilFolLnkName)) // Gbl.Alert.Txt contains feedback text if (Str_ConvertFilFolLnkNameToValid (Gbl.FileBrowser.NewFilFolLnkName)) // Gbl.Alert.Txt contains feedback text
{ {
/* Gbl.FileBrowser.NewFilFolLnkName holds the name of the new file */ /* Gbl.FileBrowser.NewFilFolLnkName holds the name of the new file */
sprintf (Path,"%s/%s", snprintf (Path,sizeof (Path),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s",
Gbl.FileBrowser.Priv.FullPathInTree); Gbl.FileBrowser.Priv.PathAboveRootFolder,
if (strlen (Path) + 1 + strlen (Gbl.FileBrowser.NewFilFolLnkName) + strlen (".tmp") > PATH_MAX) Gbl.FileBrowser.Priv.FullPathInTree);
if (strlen (Path) + 1 +
strlen (Gbl.FileBrowser.NewFilFolLnkName) +
strlen (".tmp") > PATH_MAX)
Lay_ShowErrorAndExit ("Path is too long."); Lay_ShowErrorAndExit ("Path is too long.");
Str_Concat (Path,"/", Str_Concat (Path,"/",
PATH_MAX); PATH_MAX);
@ -9477,7 +9550,9 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
else // Destination file does not exist else // Destination file does not exist
{ {
/* End receiving the file */ /* End receiving the file */
sprintf (PathTmp,"%s.tmp",Path); snprintf (PathTmp,sizeof (PathTmp),
"%s.tmp",
Path);
FileIsValid = Fil_EndReceptionOfFile (PathTmp,Param); // Gbl.Alert.Txt contains feedback text FileIsValid = Fil_EndReceptionOfFile (PathTmp,Param); // Gbl.Alert.Txt contains feedback text
/* Check if the content of the file of marks is valid */ /* Check if the content of the file of marks is valid */
@ -9521,9 +9596,11 @@ static bool Brw_RcvFileInFileBrw (Brw_UploadType_t UploadType)
Brw_InsFoldersInPathAndUpdOtherFoldersInExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree); Brw_InsFoldersInPathAndUpdOtherFoldersInExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree);
/* Add entry to the table of files/folders */ /* Add entry to the table of files/folders */
sprintf (PathCompleteInTreeIncludingFile,"%s/%s", snprintf (PathCompleteInTreeIncludingFile,
Gbl.FileBrowser.Priv.FullPathInTree, sizeof (PathCompleteInTreeIncludingFile),
Gbl.FileBrowser.NewFilFolLnkName); "%s/%s",
Gbl.FileBrowser.Priv.FullPathInTree,
Gbl.FileBrowser.NewFilFolLnkName);
FilCod = Brw_AddPathToDB (Gbl.Usrs.Me.UsrDat.UsrCod,Brw_IS_FILE, FilCod = Brw_AddPathToDB (Gbl.Usrs.Me.UsrDat.UsrCod,Brw_IS_FILE,
PathCompleteInTreeIncludingFile,false,Brw_LICENSE_DEFAULT); PathCompleteInTreeIncludingFile,false,Brw_LICENSE_DEFAULT);
@ -9665,9 +9742,10 @@ void Brw_RecLinkFileBrowser (void)
if (Str_ConvertFilFolLnkNameToValid (FileName)) // Gbl.Alert.Txt contains feedback text if (Str_ConvertFilFolLnkNameToValid (FileName)) // Gbl.Alert.Txt contains feedback text
{ {
/* The name of the file with the link will be the FileName.url */ /* The name of the file with the link will be the FileName.url */
sprintf (Path,"%s/%s", snprintf (Path,sizeof (Path),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s",
Gbl.FileBrowser.Priv.FullPathInTree); Gbl.FileBrowser.Priv.PathAboveRootFolder,
Gbl.FileBrowser.Priv.FullPathInTree);
if (strlen (Path) + 1 + strlen (FileName) + strlen (".url") > PATH_MAX) if (strlen (Path) + 1 + strlen (FileName) + strlen (".url") > PATH_MAX)
Lay_ShowErrorAndExit ("Path is too long."); Lay_ShowErrorAndExit ("Path is too long.");
Str_Concat (Path,"/", Str_Concat (Path,"/",
@ -9718,9 +9796,11 @@ void Brw_RecLinkFileBrowser (void)
Brw_InsFoldersInPathAndUpdOtherFoldersInExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree); Brw_InsFoldersInPathAndUpdOtherFoldersInExpandedFolders (Gbl.FileBrowser.Priv.FullPathInTree);
/* Add entry to the table of files/folders */ /* Add entry to the table of files/folders */
sprintf (PathCompleteInTreeIncludingFile,"%s/%s.url", snprintf (PathCompleteInTreeIncludingFile,
Gbl.FileBrowser.Priv.FullPathInTree, sizeof (PathCompleteInTreeIncludingFile),
FileName); "%s/%s.url",
Gbl.FileBrowser.Priv.FullPathInTree,
FileName);
FilCod = Brw_AddPathToDB (Gbl.Usrs.Me.UsrDat.UsrCod,Brw_IS_LINK, FilCod = Brw_AddPathToDB (Gbl.Usrs.Me.UsrDat.UsrCod,Brw_IS_LINK,
PathCompleteInTreeIncludingFile,false,Brw_LICENSE_DEFAULT); PathCompleteInTreeIncludingFile,false,Brw_LICENSE_DEFAULT);
@ -10670,7 +10750,9 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL,
FileMetadata->FileType,-1L); FileMetadata->FileType,-1L);
/* Link begin */ /* Link begin */
sprintf (Gbl.Title,Txt_Check_marks_in_file_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Check_marks_in_file_X,
FileNameToShow);
Act_LinkFormSubmit (Gbl.Title,"FILENAME_TXT",NULL); Act_LinkFormSubmit (Gbl.Title,"FILENAME_TXT",NULL);
Brw_PutIconFile (32,FileMetadata->FileType,FileMetadata->FilFolLnkName); Brw_PutIconFile (32,FileMetadata->FileType,FileMetadata->FilFolLnkName);
@ -10726,7 +10808,9 @@ static void Brw_WriteSmallLinkToDownloadFile (const char *URL,Brw_FileType_t Fil
FileType,-1L); FileType,-1L);
/* Link begin */ /* Link begin */
sprintf (Gbl.Title,Txt_Check_marks_in_file_X,FileNameToShow); snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Check_marks_in_file_X,
FileNameToShow);
Act_LinkFormSubmit (Gbl.Title,"DAT",NULL); Act_LinkFormSubmit (Gbl.Title,"DAT",NULL);
/* Name of the file of marks, link end and form end */ /* Name of the file of marks, link end and form end */
@ -10750,9 +10834,10 @@ void Brw_GetLinkToDownloadFile (const char *PathInTree,const char *FileName,char
char URLWithSpaces[PATH_MAX + 1]; char URLWithSpaces[PATH_MAX + 1];
/***** Construct absolute path to file in the private directory *****/ /***** Construct absolute path to file in the private directory *****/
sprintf (FullPathIncludingFile,"%s/%s/%s", snprintf (FullPathIncludingFile,sizeof (FullPathIncludingFile),
Gbl.FileBrowser.Priv.PathAboveRootFolder, "%s/%s/%s",
PathInTree,FileName); Gbl.FileBrowser.Priv.PathAboveRootFolder,
PathInTree,FileName);
if (Str_FileIs (FileName,"url")) // It's a link (URL inside a .url file) if (Str_FileIs (FileName,"url")) // It's a link (URL inside a .url file)
{ {
@ -10774,10 +10859,11 @@ void Brw_GetLinkToDownloadFile (const char *PathInTree,const char *FileName,char
Brw_CreateTmpPublicLinkToPrivateFile (FullPathIncludingFile,FileName); Brw_CreateTmpPublicLinkToPrivateFile (FullPathIncludingFile,FileName);
/***** Create URL pointing to symbolic link *****/ /***** Create URL pointing to symbolic link *****/
sprintf (URLWithSpaces,"%s/%s/%s/%s", snprintf (URLWithSpaces,sizeof (URLWithSpaces),
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP, "%s/%s/%s/%s",
Gbl.FileBrowser.TmpPubDir, Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
FileName); Gbl.FileBrowser.TmpPubDir,
FileName);
} }
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
@ -11250,8 +11336,10 @@ bool Brw_GetFileTypeSizeAndDate (struct FileMetadata *FileMetadata)
char Path[PATH_MAX + 1 + PATH_MAX + 1]; char Path[PATH_MAX + 1 + PATH_MAX + 1];
struct stat FileStatus; struct stat FileStatus;
sprintf (Path,"%s/%s",Gbl.FileBrowser.Priv.PathAboveRootFolder, snprintf (Path,sizeof (Path),
FileMetadata->FullPathInTree); "%s/%s",
Gbl.FileBrowser.Priv.PathAboveRootFolder,
FileMetadata->FullPathInTree);
if (lstat (Path,&FileStatus)) // On success ==> 0 is returned if (lstat (Path,&FileStatus)) // On success ==> 0 is returned
{ {
// Error on lstat // Error on lstat
@ -12334,8 +12422,9 @@ void Brw_RemoveGrpZones (long CrsCod,long GrpCod)
Brw_RemoveGrpFilesFromDB (GrpCod); Brw_RemoveGrpFilesFromDB (GrpCod);
/***** Remove group zones *****/ /***** Remove group zones *****/
sprintf (PathGrpFileZones,"%s/%s/%ld/grp/%ld", snprintf (PathGrpFileZones,sizeof (PathGrpFileZones),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod,GrpCod); "%s/%s/%ld/grp/%ld",
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod,GrpCod);
Fil_RemoveTree (PathGrpFileZones); Fil_RemoveTree (PathGrpFileZones);
} }
@ -12351,9 +12440,10 @@ void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs)
Brw_RemoveWrkFilesFromDB (Crs->CrsCod,UsrDat->UsrCod); Brw_RemoveWrkFilesFromDB (Crs->CrsCod,UsrDat->UsrCod);
/***** Remove the folder for this user inside the course *****/ /***** Remove the folder for this user inside the course *****/
sprintf (PathUsrInCrs,"%s/%s/%ld/usr/%02u/%ld", snprintf (PathUsrInCrs,sizeof (PathUsrInCrs),
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs->CrsCod, "%s/%s/%ld/usr/%02u/%ld",
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod); Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs->CrsCod,
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
Fil_RemoveTree (PathUsrInCrs); Fil_RemoveTree (PathUsrInCrs);
// If this was the last user in his/her subfolder ==> the subfolder will be empty // If this was the last user in his/her subfolder ==> the subfolder will be empty
} }
@ -12397,8 +12487,6 @@ void Brw_RemoveUsrWorksInAllCrss (struct UsrData *UsrDat)
/*****************************************************************************/ /*****************************************************************************/
// This function may be called inside a web service, so don't report error // This function may be called inside a web service, so don't report error
#define Brw_MAX_BYTES_FILE_CONTENT_STR (100 + NAME_MAX + 100 + PATH_MAX + 100 + Usr_MAX_BYTES_FULL_NAME + 100 + Fil_MAX_BYTES_FILE_SIZE_STRING)
void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr, char **ContentStr,
long FilCod,bool GetContent) long FilCod,bool GetContent)
@ -12427,32 +12515,31 @@ void Brw_GetSummaryAndContentOfFile (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
/***** Copy some file metadata into content string *****/ /***** Copy some file metadata into content string *****/
if (GetContent && ContentStr) if (GetContent && ContentStr)
{ {
if ((*ContentStr = (char *) malloc (Brw_MAX_BYTES_FILE_CONTENT_STR))) /* Get publisher */
if (FileMetadata.PublisherUsrCod > 0)
{ {
/* Get publisher */ /* Initialize structure with publisher's data */
if (FileMetadata.PublisherUsrCod > 0) Usr_UsrDataConstructor (&PublisherUsrDat);
{ PublisherUsrDat.UsrCod = FileMetadata.PublisherUsrCod;
/* Initialize structure with publisher's data */ FileHasPublisher = Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&PublisherUsrDat);
Usr_UsrDataConstructor (&PublisherUsrDat);
PublisherUsrDat.UsrCod = FileMetadata.PublisherUsrCod;
FileHasPublisher = Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&PublisherUsrDat);
}
else
/* Unknown publisher */
FileHasPublisher = false;
sprintf (*ContentStr,"%s: %s<br />" // File name
"%s: %s<br />" // File path
"%s: %s", // Publisher
Txt_Filename,FileMetadata.FilFolLnkName,
Txt_Folder,FileMetadata.PathInTreeUntilFilFolLnk, // TODO: Fix bug: do not write internal name (for example "comun")
Txt_Uploaded_by,FileHasPublisher ? PublisherUsrDat.FullName :
Txt_ROLES_SINGUL_Abc[Rol_UNK][Usr_SEX_UNKNOWN]);
/* Free memory used for publisher's data */
if (FileMetadata.PublisherUsrCod > 0)
Usr_UsrDataDestructor (&PublisherUsrDat);
} }
else
/* Unknown publisher */
FileHasPublisher = false;
if (asprintf (ContentStr,"%s: %s<br />" // File name
"%s: %s<br />" // File path
"%s: %s", // Publisher
Txt_Filename,FileMetadata.FilFolLnkName,
Txt_Folder,FileMetadata.PathInTreeUntilFilFolLnk, // TODO: Fix bug: do not write internal name (for example "comun")
Txt_Uploaded_by,
FileHasPublisher ? PublisherUsrDat.FullName :
Txt_ROLES_SINGUL_Abc[Rol_UNK][Usr_SEX_UNKNOWN]) < 0)
Lay_ShowErrorAndExit ("Not enough memory to store string.");
/* Free memory used for publisher's data */
if (FileMetadata.PublisherUsrCod > 0)
Usr_UsrDataDestructor (&PublisherUsrDat);
} }
} }