- allow scriptcontext objects to be dynamic

- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
zolliker
2009-02-19 13:30:32 +00:00
parent 981534624f
commit 35f2b6b810
33 changed files with 753 additions and 310 deletions

25
macro.c
View File

@@ -982,14 +982,6 @@ int TclPublish(SConnection * pCon, SicsInterp * pSics, void *pData,
return 0;
}
/* check user rights */
if (!SCMatchRights(pCon, usMugger)) {
sprintf(pBueffel, "ERROR: you are not authorised to use %s", argv[0]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
/* try convert last parameter to user code */
iUser = decodeSICSPriv(argv[2]);
if (iUser < 0) {
@@ -1002,9 +994,26 @@ int TclPublish(SConnection * pCon, SicsInterp * pSics, void *pData,
/* check if the macro already exists */
pNew = FindCommandData(pSics, argv[1], "Macro");
if (pNew) { /* yes -> overwrite access code */
if (pNew->iUser == iUser) {
return 1;
}
/* check user rights */
if (!SCMatchRights(pCon, usMugger)) {
sprintf(pBueffel, "ERROR: you are not authorised to use %s", argv[0]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
pNew->iUser = iUser;
return 1;
}
/* check user rights */
if (!SCMatchRights(pCon, usMugger)) {
sprintf(pBueffel, "ERROR: you are not authorised to use %s", argv[0]);
SCWrite(pCon, pBueffel, eError);
return 0;
}
/* do a job ! */
pNew = CreatePublish(argv[1], iUser);
if (!pNew) {