Subversion Repositories wimsdev

Rev

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

Rev 15874 Rev 15875
Line 160... Line 160...
160
#define ac_exam  0x200/* work during an exam */
160
#define ac_exam  0x200/* work during an exam */
161
 
161
 
162
/* Check site or class access policy. */
162
/* Check site or class access policy. */
163
void access_check(int isclass)
163
void access_check(int isclass)
164
{
164
{
165
  char *p, *p1, *p2, *p3, *pp1, *pp2, *name;
165
  char *p, *p1, *p2, *p3, *pp1, *pp2;
-
 
166
  char msg[200], *name="";
166
  char cbuf[MAX_LINELEN+1];
167
  char cbuf[MAX_LINELEN+1];
167
  long int thisaccess, lineaccess, linepol, thispol;
168
  long int thisaccess, lineaccess, linepol, thispol;
168
  int non, refuse;
169
  int non, refuse;
169
 
170
 
170
  if(manageable>=2 || robot_access) return;
171
  if(manageable>=2 || robot_access) return;
Line 234... Line 235...
234
      if(thispol==0) continue;
235
      if(thispol==0) continue;
235
      if(non) lineaccess^=thispol;
236
      if(non) lineaccess^=thispol;
236
      linepol|=thispol;
237
      linepol|=thispol;
237
    }
238
    }
238
    if(linepol==0 || (linepol&lineaccess)!=linepol) continue;
239
    if(linepol==0 || (linepol&lineaccess)!=linepol) continue;
239
    char msg[200]; snprintf(msg,200,"no_access_class %s",name);
240
    snprintf(msg,200,"no_access_class %s",name);
240
    if(refuse)
241
    if(refuse)
241
      if (isclass) user_error(msg); else user_error("no_access");
242
      if (isclass) user_error(msg); else user_error("no_access");
242
    else return;
243
    else return;
243
  }
244
  }
244
  /* end of limited access */
245
  /* end of limited access */