Rev 8185 | Rev 12210 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8185 | Rev 12209 | ||
---|---|---|---|
Line 183... | Line 183... | ||
183 | else cc=c; |
183 | else cc=c; |
184 | if(classe==NULL || *classe==0) i=1; |
184 | if(classe==NULL || *classe==0) i=1; |
185 | else i=getscorestatus(classe,atoi(sh)); |
185 | else i=getscorestatus(classe,atoi(sh)); |
186 | pend=getvar("wims_scoring"); if(pend==NULL) pend=""; |
186 | pend=getvar("wims_scoring"); if(pend==NULL) pend=""; |
187 | if((i==0 || !exodepOK || strcmp(pend,"pending")!=0) && strcmp(cc,"rafale")!=0) |
187 | if((i==0 || !exodepOK || strcmp(pend,"pending")!=0) && strcmp(cc,"rafale")!=0) |
188 | allow=" |
188 | allow="\tnoscore"; |
189 | else allow=""; |
189 | else allow="\t"; |
190 | ip=remote_addr; if(*ip==0) ip="-"; scorelog=0; |
190 | ip=remote_addr; if(*ip==0) ip="-"; scorelog=0; |
191 | if(user==NULL || *user==0) { |
191 | if(user==NULL || *user==0) { |
192 | classe="0"; allow=""; |
192 | classe="0"; allow=""; |
193 | mkfname(fname,"../sessions/%s/.score",sess); |
193 | mkfname(fname,"../sessions/%s/.score",sess); |
194 | } |
194 | } |
Line 201... | Line 201... | ||
201 | else |
201 | else |
202 | mkfname(fname,"classes/%s/noscore/%s",classe,user); |
202 | mkfname(fname,"classes/%s/noscore/%s",classe,user); |
203 | } |
203 | } |
204 | if(isexam && user!=NULL && *user!=0) { |
204 | if(isexam && user!=NULL && *user!=0) { |
205 | allow=exam_sheetexo; |
205 | allow=exam_sheetexo; |
206 | snprintf(logbuf,sizeof(logbuf),":%s %2s %s |
206 | snprintf(logbuf,sizeof(logbuf),":%s %2s %s \t%s%s\n", |
207 | nowstr,exo,cc,ip,allow); |
207 | nowstr,exo,cc,ip,allow); |
208 | accessfile(logbuf,"a","%s/%s/examscore.%s", session_dir,sess,sh); |
208 | accessfile(logbuf,"a","%s/%s/examscore.%s", session_dir,sess,sh); |
209 | Sc=currexamscore(atoi(sh)); |
209 | Sc=currexamscore(atoi(sh)); |
210 | accessfile(logbuf,"r","%s/.E%s",class_dir,sh); |
210 | accessfile(logbuf,"r","%s/.E%s",class_dir,sh); |
211 | if(simuxam==0) { /* not simulation */ |
211 | if(simuxam==0) { /* not simulation */ |
Line 217... | Line 217... | ||
217 | class_dir,user); |
217 | class_dir,user); |
218 | } |
218 | } |
219 | } |
219 | } |
220 | else snprintf(exam_sheetexo+strlen(exam_sheetexo), |
220 | else snprintf(exam_sheetexo+strlen(exam_sheetexo), |
221 | sizeof(exam_sheetexo)-strlen(exam_sheetexo), |
221 | sizeof(exam_sheetexo)-strlen(exam_sheetexo), |
222 | " |
222 | "\tS"); |
223 | } |
223 | } |
224 | snprintf(logbuf,sizeof(logbuf),"%s%s %s %2s %2s %s |
224 | snprintf(logbuf,sizeof(logbuf),"%s%s %s %2s %2s %s \t%s%s", |
225 | ex,nowstr,sess,sh,exo,cc,ip,allow); |
225 | ex,nowstr,sess,sh,exo,cc,ip,allow); |
226 | if(scorelog) { |
226 | if(scorelog) { |
227 | snprintf(tmplbuf,sizeof(tmplbuf),"-c%s -u%s scorelog %s", |
227 | snprintf(tmplbuf,sizeof(tmplbuf),"-c%s -u%s scorelog %s", |
228 | classe,user,logbuf); |
228 | classe,user,logbuf); |
229 | _daemoncmd(tmplbuf); |
229 | _daemoncmd(tmplbuf); |
Line 235... | Line 235... | ||
235 | void class_log(char *cl, char *l, char *ip) |
235 | void class_log(char *cl, char *l, char *ip) |
236 | { |
236 | { |
237 | char logbuf[1024]; |
237 | char logbuf[1024]; |
238 | 238 | ||
239 | if(robot_access) return; |
239 | if(robot_access) return; |
240 | snprintf(logbuf,sizeof(logbuf),"%s %s |
240 | snprintf(logbuf,sizeof(logbuf),"%s %s \t%s", |
241 | nowstr,ip,l); |
241 | nowstr,ip,l); |
242 | write_logfile(mkfname(NULL,"classes/%s/.log",cl),logbuf); |
242 | write_logfile(mkfname(NULL,"classes/%s/.log",cl),logbuf); |
243 | } |
243 | } |
244 | 244 | ||
245 | /* Log accesses to modules. For server counting use. */ |
245 | /* Log accesses to modules. For server counting use. */ |
Line 325... | Line 325... | ||
325 | strcat(ll,"xxxx"); |
325 | strcat(ll,"xxxx"); |
326 | mystrncpy(l1,p+strlen(authpwd),strlen(l)); |
326 | mystrncpy(l1,p+strlen(authpwd),strlen(l)); |
327 | if((p=strstr(l1,"&"))!=NULL) strcat(ll,p); |
327 | if((p=strstr(l1,"&"))!=NULL) strcat(ll,p); |
328 | } |
328 | } |
329 | 329 | ||
330 | snprintf(logstr,sizeof(logstr),"%s %s |
330 | snprintf(logstr,sizeof(logstr),"%s %s\t%s", |
331 | nowstr, h, ll); |
331 | nowstr, h, ll); |
332 | write_logfile("post.log",logstr); |
332 | write_logfile("post.log",logstr); |
333 | } |
333 | } |
334 | 334 | ||
335 | /* It is this routine which is called by main(). */ |
335 | /* It is this routine which is called by main(). */ |