File name: addrbook/register.wel (2,229 bytes) Text file viewer v1.2
    1 : #!/bin/wel
    2 : 
    3 : /* file: register.wel
    4 : 
    5 :    주소록 사용자 등록신청 프로그램 (author: 서광현)
    6 : 
    7 :    Copyright (c) 2001/02/22 by Wesoft
    8 :    All Rights Reserved.
    9 : */
   10 : 
   11 : htmlquery("POST");
   12 : include("common.inc");
   13 : if(register_flag==0)
   14 :  {
   15 :     MSG1= "주소록 신규 신청 불능 상태";
   16 :     MSG2= "현재는 관리자가 신청서를 작성할 수 없도록 했습니다.<br>"
   17 :         ~ "등록을 희망하시면 직접 " ~ HELP_ADMIN;
   18 :     print_type("");
   19 :     formdump(message_form);
   20 :     return;
   21 :  }
   22 : step= val(step);
   23 : if(step<2)
   24 :  {
   25 :     if(step==0) fmfile= "register.fom"; else fmfile= "register2.fom";
   26 :     print_type("");
   27 :     fm= formdump("form/" ~ fmfile);
   28 :     if(fm==FORM_OPENERR) err_form(fmfile);
   29 :     return;
   30 :  }
   31 : if(mysql_connection()==MYSQL_ERR) return;
   32 : id= strchange(tolower(left(id,12)), fch~"| ", rch~"|");
   33 : recnt= get_recount(mysql, myustable, "id='" ~ id ~ "'");
   34 : if(recnt>0)
   35 :  {
   36 :     MSG1= "ID 중복 오류";
   37 :     MSG2= "주소록 ID: " ~ id ~ " 는 이미 등록되어 있습니다!" ~ BACK_BUTTON;
   38 :     print_type("");
   39 :     formdump(message_form);
   40 :     return disconnect();
   41 :  }
   42 : 
   43 : wdtime= date(1) ~ " " ~ left(time(1),5);
   44 : pass= tolower(left(pass,12));
   45 : enpass= encode(pass, encodekey(), "", decode_variable);
   46 : title= strchange(lrtrim(title), fch, rch);
   47 : name= strchange(lrtrim(name), fch, rch);
   48 : phone= strchange(lrtrim(phone), fch, rch);
   49 : hdphone= strchange(lrtrim(hdphone), fch, rch);
   50 : email= strchange(lrtrim(email), fch, rch);
   51 : 
   52 : if(register_flag==2) useflag= "Y"; else useflag= "S";
   53 : qstr= "insert into " ~ myustable
   54 :   ~ " (wdtime,id,pass,title,class,kind,useflag,name,phone,hdphone,email,pagerec) "
   55 :   ~ strform("values('{$wdtime}','{$id}','{$enpass}','{$title}','U','{$kind}',",
   56 :             "'{$useflag}','{$name}','{$phone}','{$hdphone}','{$email}','10')");
   57 : 
   58 : if(mysql_query(mysql, qstr)==MYSQL_ERR) return err_query();
   59 : 
   60 : include("adminsert.sub");
   61 : if(mysql_query(mysql, create_addrtable)==MYSQL_ERR)
   62 :  {
   63 :     MSG1= "주소록 ID: " ~ id ~ " 테이블 생성 오류";
   64 :     MSG2= "주소록 ID: " ~ id ~ " 테이블을 생성할 수 없습니다." ~ HELP_ADMIN;
   65 :     print_type("");
   66 :     formdump(message_form);
   67 :     return disconnect();
   68 :  }
   69 : 
   70 : url= "register3.wel?id=" ~ id ~ "&use=";
   71 : if(register_flag==2)
   72 :  {
   73 :     send_cookie(id, pass);
   74 :     url~= "1";
   75 :  }
   76 : else
   77 :  {
   78 :     print_type("");
   79 :     url~= "0";
   80 :  }
   81 : replace_location(url);
   82 : return disconnect();
File name: addrbook/register.wel (2,229 bytes) Wesoft Corp. ⓒ 2001 All rights reserved.