Rev 15875 | Rev 17879 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15875 | Rev 17878 | ||
---|---|---|---|
Line 156... | Line 156... | ||
156 | #define ac_local 0x20 /* access to local modules */ |
156 | #define ac_local 0x20 /* access to local modules */ |
157 | #define ac_com 0x40 /* access to commercial modules */ |
157 | #define ac_com 0x40 /* access to commercial modules */ |
158 | #define ac_hint 0x80 /* hint command */ |
158 | #define ac_hint 0x80 /* hint command */ |
159 | #define ac_sheet 0x100/* use within a worksheet */ |
159 | #define ac_sheet 0x100/* use within a worksheet */ |
160 | #define ac_exam 0x200/* work during an exam */ |
160 | #define ac_exam 0x200/* work during an exam */ |
- | 161 | #define ac_freew 0x400/* work during a freework */ |
|
161 | 162 | ||
162 | /* Check site or class access policy. */ |
163 | /* Check site or class access policy. */ |
163 | void access_check(int isclass) |
164 | void access_check(int isclass) |
164 | { |
165 | { |
165 | char *p, *p1, *p2, *p3, *pp1, *pp2; |
166 | char *p, *p1, *p2, *p3, *pp1, *pp2; |
Line 170... | Line 171... | ||
170 | 171 | ||
171 | if(manageable>=2 || robot_access) return; |
172 | if(manageable>=2 || robot_access) return; |
172 | thisaccess=0; |
173 | thisaccess=0; |
173 | p=getvar(ro_name[ro_module]); if(p==NULL || *p==0) return; |
174 | p=getvar(ro_name[ro_module]); if(p==NULL || *p==0) return; |
174 | if(strncmp(p,"adm/doc",7)==0) thisaccess|=ac_doc; |
175 | if(strncmp(p,"adm/doc",7)==0) thisaccess|=ac_doc; |
- | 176 | else if(strncmp(p,"adm/class/freeworks",17)==0) thisaccess|=ac_freew; |
|
175 | else if(strncmp(p,"adm/",4)==0 || strcmp(p,home_module)==0) return; |
177 | else if(strncmp(p,"adm/",4)==0 || strcmp(p,home_module)==0) return; |
176 | if(strncmp(p,"local/",6)==0) thisaccess|=ac_local; |
178 | if(strncmp(p,"local/",6)==0) thisaccess|=ac_local; |
177 | if(strncmp(p,"com/",4)==0) thisaccess|=ac_com; |
179 | if(strncmp(p,"com/",4)==0) thisaccess|=ac_com; |
178 | p=getvar("wims_user"); |
180 | p=getvar("wims_user"); |
179 | if(p!=NULL && *p!=0) { |
181 | if(p!=NULL && *p!=0) { |
Line 226... | Line 228... | ||
226 | if(strcmp(pp1,"tool")==0) {thispol=ac_tool; name="tool"; goto nxt;} |
228 | if(strcmp(pp1,"tool")==0) {thispol=ac_tool; name="tool"; goto nxt;} |
227 | if(strcmp(pp1,"recre")==0) {thispol=ac_recre; name="recre"; goto nxt;} |
229 | if(strcmp(pp1,"recre")==0) {thispol=ac_recre; name="recre"; goto nxt;} |
228 | if(strcmp(pp1,"recreation")==0) {thispol=ac_recre; name="recre"; goto nxt;} |
230 | if(strcmp(pp1,"recreation")==0) {thispol=ac_recre; name="recre"; goto nxt;} |
229 | if(strcmp(pp1,"doc")==0) {thispol=ac_doc; name="doc"; goto nxt;} |
231 | if(strcmp(pp1,"doc")==0) {thispol=ac_doc; name="doc"; goto nxt;} |
230 | if(strcmp(pp1,"document")==0) {thispol=ac_doc; name="doc"; goto nxt;} |
232 | if(strcmp(pp1,"document")==0) {thispol=ac_doc; name="doc"; goto nxt;} |
- | 233 | if(strcmp(pp1,"freeworks")==0) {thispol=ac_freew; name="freework"; goto nxt;} |
|
231 | if(strcmp(pp1,"local")==0) {thispol=ac_local; name="local"; goto nxt;} |
234 | if(strcmp(pp1,"local")==0) {thispol=ac_local; name="local"; goto nxt;} |
232 | if(strcmp(pp1,"com")==0) {thispol=ac_com; name="com"; goto nxt;} |
235 | if(strcmp(pp1,"com")==0) {thispol=ac_com; name="com"; goto nxt;} |
233 | if(strcmp(pp1,"hint")==0) {thispol=ac_hint; name="hint"; goto nxt;} |
236 | if(strcmp(pp1,"hint")==0) {thispol=ac_hint; name="hint"; goto nxt;} |
234 | nxt: |
237 | nxt: |
235 | if(thispol==0) continue; |
238 | if(thispol==0) continue; |