- allow scriptcontext objects to be dynamic
- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
25
macro.c
25
macro.c
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user