+unsigned long authcookie;
+
+void handle_hash(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
+{
+ // # <mask> <who-set-it> <time-set> <duration> :<reason>
+ log(DEBUG,"Adding G-line");
+ char* mask = strtok(params," ");
+ char* who = strtok(NULL," ");
+ char* create_time = strtok(NULL," ");
+ char* duration = strtok(NULL," :");
+ char* reason = strtok(NULL,"\r\n");
+ reason++;
+ add_gline(atoi(duration),(const char*)who,(const char*)reason,(const char*)mask);
+ // we must update the creation time on this gline
+ // now that we've added it, or it wont expire at the right time.
+ gline_set_creation_time(mask,atoi(create_time));
+ if (!atoi(duration))
+ {
+ WriteOpers("*** %s Added permenant G-Line on %s.",who,mask);
+ }
+ else
+ {
+ WriteOpers("*** %s Added timed G-Line on %s to expire in %d seconds.",who,mask,atoi(duration));
+ }
+ apply_lines();
+}
+
+void handle_dot(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
+{
+ log(DEBUG,"Removing G-line");
+ char* mask = strtok(params," ");
+ char* who = strtok(NULL," ");
+ if (mask)
+ {
+ if (del_gline((const char*)mask))
+ {
+ if (who)
+ {
+ WriteOpers("*** %s Removed G-line on %s.",who,mask);
+ }
+ }
+ }
+}
+
+void handle_add_sqline(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
+{
+ // { <mask> <who-set-it> <time-set> <duration> :<reason>
+ log(DEBUG,"Adding Q-line");
+ char* mask = strtok(params," ");
+ char* who = strtok(NULL," ");
+ char* create_time = strtok(NULL," ");
+ char* duration = strtok(NULL," :");
+ char* reason = strtok(NULL,"\r\n");
+ reason++;
+ add_qline(atoi(duration),(const char*)who,(const char*)reason,(const char*)mask);
+ // we must update the creation time on this gline
+ // now that we've added it, or it wont expire at the right time.
+ qline_set_creation_time(mask,atoi(create_time));
+ qline_make_global(mask);
+ if (!atoi(duration))
+ {
+ WriteOpers("*** %s Added permenant Q-Line on %s.",who,mask);
+ }
+ else
+ {
+ WriteOpers("*** %s Added timed Q-Line on %s to expire in %d seconds.",who,mask,atoi(duration));
+ }
+ apply_lines();
+}
+
+void handle_del_sqline(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
+{
+ log(DEBUG,"Removing Q-line");
+ char* mask = strtok(params," ");
+ char* who = strtok(NULL," ");
+ if (mask)
+ {
+ if (del_qline((const char*)mask))
+ {
+ if (who)
+ {
+ WriteOpers("*** %s Removed Q-line on %s.",who,mask);
+ }
+ }
+ }
+}
+
+void handle_add_szline(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
+{
+ // } <mask> <who-set-it> <time-set> <duration> :<reason>
+ log(DEBUG,"Adding Z-line");
+ char* mask = strtok(params," ");
+ char* who = strtok(NULL," ");
+ char* create_time = strtok(NULL," ");
+ char* duration = strtok(NULL," :");
+ char* reason = strtok(NULL,"\r\n");
+ reason++;
+ add_zline(atoi(duration),(const char*)who,(const char*)reason,(const char*)mask);
+ // we must update the creation time on this gline
+ // now that we've added it, or it wont expire at the right time.
+ zline_set_creation_time(mask,atoi(create_time));
+ zline_make_global(mask);
+ if (!atoi(duration))
+ {
+ WriteOpers("*** %s Added permenant Z-Line on %s.",who,mask);
+ }
+ else
+ {
+ WriteOpers("*** %s Added timed Z-Line on %s to expire in %d seconds.",who,mask,atoi(duration));
+ }
+ apply_lines();
+}
+
+void handle_del_szline(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
+{
+ log(DEBUG,"Removing Z-line");
+ char* mask = strtok(params," ");
+ char* who = strtok(NULL," ");
+ if (mask)
+ {
+ if (del_zline((const char*)mask))
+ {
+ if (who)
+ {
+ WriteOpers("*** %s Removed Q-line on %s.",who,mask);
+ }
+ }
+ }
+}
+
+void handle_pipe(char token,char* params,serverrec* source,serverrec* reply, char* tcp_host)
+{
+ char* nick = strtok(params," ");
+ char* type = strtok(params," ");
+ userrec* u = Find(nick);
+ if (u)
+ {
+ strlcpy(u->oper,type,NICKMAX);
+ }
+}