Subversion Repositories wimsdev

Rev

Rev 15407 | Rev 15411 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15407 Rev 15410
Line 184... Line 184...
184
    accessfile(cbuf,"r","%s/access.conf",class_dir);
184
    accessfile(cbuf,"r","%s/access.conf",class_dir);
185
  }
185
  }
186
  else accessfile(cbuf,"r",ACCESS_CONF);
186
  else accessfile(cbuf,"r",ACCESS_CONF);
187
  if(cbuf[0]==0) return;
187
  if(cbuf[0]==0) return;
188
    /* access limited */
188
    /* access limited */
189
    if(cmd_type==cmd_hint) thisaccess|=ac_hint;
189
  if(cmd_type==cmd_hint) thisaccess|=ac_hint;
190
    p1=getvar("wims_accessright"); if(p1!=NULL && *p1!=0) {
190
  p1=getvar("wims_accessright"); if(p1!=NULL && *p1!=0) {
191
      p=getvar(ro_name[ro_module]);
191
    p=getvar(ro_name[ro_module]);
192
      for(p1=find_word_start(p1);*p1; p1=find_word_start(p2)) {
192
    for(p1=find_word_start(p1);*p1; p1=find_word_start(p2)) {
193
        p2=find_word_end(p1);
193
      p2=find_word_end(p1);
194
        if(strncmp(p,p1,p2-p1)==0) return;
194
      if(strncmp(p,p1,p2-p1)==0) return;
195
      }
-
 
196
    }
195
    }
-
 
196
  }
197
    p=getvar("module_category"); if(p) {
197
  p=getvar("module_category");
-
 
198
  if(p) {
198
      if(strstr(p,"exercise")!=NULL) thisaccess|=ac_exo;
199
    if(strstr(p,"exercise")!=NULL) thisaccess|=ac_exo;
199
      if(strstr(p,"tool")!=NULL) thisaccess|=ac_tool;
200
    if(strstr(p,"tool")!=NULL) thisaccess|=ac_tool;
200
      if(strstr(p,"recre")!=NULL) thisaccess|=ac_recre;
201
    if(strstr(p,"recre")!=NULL) thisaccess|=ac_recre;
201
      if(strstr(p,"doc")!=NULL) thisaccess|=ac_doc;
202
    if(strstr(p,"doc")!=NULL) thisaccess|=ac_doc;
202
    }
203
  }
203
    for(p1=find_word_start(cbuf);*p1;p1=find_word_start(p2)) {
204
  for(p1=find_word_start(cbuf);*p1;p1=find_word_start(p2)) {
204
    p2=strchr(p1,'\n'); if(p2) *p2++=0; else p2=p1+strlen(p1);
205
    p2=strchr(p1,'\n'); if(p2) *p2++=0; else p2=p1+strlen(p1);
205
    if(!myisalpha(*p1)) continue;
206
    if(!myisalpha(*p1)) continue;
206
    p3=strchr(p1,':'); if(p3==NULL) continue;
207
    p3=strchr(p1,':'); if(p3==NULL) continue;
207
    *p3++=0; p3=find_word_start(p3); strip_trailing_spaces(p3);
208
    *p3++=0; p3=find_word_start(p3); strip_trailing_spaces(p3);
208
    refuse=0;
209
    refuse=0;
Line 237... Line 238...
237
    if(linepol==0 || (linepol&lineaccess)!=linepol) continue;
238
    if(linepol==0 || (linepol&lineaccess)!=linepol) continue;
238
    if(refuse) user_error("no_access"); else return;
239
    if(refuse) user_error("no_access"); else return;
239
  }
240
  }
240
  /* end of limited access */
241
  /* end of limited access */
241
}
242
}
242
 
-