| 1 | <?php | 
|---|
| 2 |  | 
|---|
| 3 |  | 
|---|
| 4 |  | 
|---|
| 5 |  | 
|---|
| 6 |  | 
|---|
| 7 |  | 
|---|
| 8 |  | 
|---|
| 9 |  | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | ?> | 
|---|
| 19 |  | 
|---|
| 20 | <?php | 
|---|
| 21 | include("./foltialib.php"); | 
|---|
| 22 |  | 
|---|
| 23 | $con = m_connect(); | 
|---|
| 24 | $now = date("YmdHi"); | 
|---|
| 25 | $errflag = 0; | 
|---|
| 26 | $errmsg = ""; | 
|---|
| 27 |  | 
|---|
| 28 |  | 
|---|
| 29 | function printtitle(){ | 
|---|
| 30 | print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"> | 
|---|
| 31 | <html lang=\"ja\"> | 
|---|
| 32 | <head> | 
|---|
| 33 | <meta http-equiv=\"Content-Type\" content=\"text/html; charset=EUC-JP\"> | 
|---|
| 34 | <meta http-equiv=\"Content-Style-Type\" content=\"text/css\"> | 
|---|
| 35 | <link rel=\"stylesheet\" type=\"text/css\" href=\"graytable.css\"> "; | 
|---|
| 36 |  | 
|---|
| 37 | print "<title>foltia:新規アカウント登録</title> | 
|---|
| 38 | </head>"; | 
|---|
| 39 | } | 
|---|
| 40 |  | 
|---|
| 41 | printtitle(); | 
|---|
| 42 | ?> | 
|---|
| 43 | <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > | 
|---|
| 44 |  | 
|---|
| 45 | <p align="left"><font color="#494949" size="6"> | 
|---|
| 46 | 新規アカウント登録 | 
|---|
| 47 | </font></p> | 
|---|
| 48 | <hr size="4"> | 
|---|
| 49 | <?php | 
|---|
| 50 |  | 
|---|
| 51 | $username = getform(username); | 
|---|
| 52 | $userpasswd = getform(userpasswd); | 
|---|
| 53 | if ($username == "") { | 
|---|
| 54 | print "<p align=\"left\">新規アカウント登録をします。</p>\n"; | 
|---|
| 55 |  | 
|---|
| 56 | }else{ | 
|---|
| 57 |  | 
|---|
| 58 | if ($username != ""){ | 
|---|
| 59 | $query = " | 
|---|
| 60 | SELECT count(memberid) | 
|---|
| 61 | FROM foltia_envpolicy | 
|---|
| 62 | WHERE foltia_envpolicy.name  = ? | 
|---|
| 63 | "; | 
|---|
| 64 |  | 
|---|
| 65 | $isaccountexist = sql_query($con, $query, "DBクエリに失敗しました",array($username)); | 
|---|
| 66 |  | 
|---|
| 67 | $isaccountexistncount = $isaccountexist->fetchColumn(0); | 
|---|
| 68 |  | 
|---|
| 69 | $isaccountexistncount == 0){ | 
|---|
| 70 |  | 
|---|
| 71 | }else{ | 
|---|
| 72 | $errflag = 1; | 
|---|
| 73 | $errmsg = "そのユーザ名は既に使われています。"; | 
|---|
| 74 |  | 
|---|
| 75 |  | 
|---|
| 76 | $userpasswd == ""){ | 
|---|
| 77 | $errflag = 2; | 
|---|
| 78 | $errmsg = "パスワードが不適切です。半角英数を指定して下さい。"; | 
|---|
| 79 |  | 
|---|
| 80 |  | 
|---|
| 81 |  | 
|---|
| 82 | $errflag == 0){ | 
|---|
| 83 |  | 
|---|
| 84 | $query = " | 
|---|
| 85 | SELECT max(memberid) | 
|---|
| 86 | FROM  foltia_envpolicy | 
|---|
| 87 | "; | 
|---|
| 88 | $rs = m_query($con, $query, "DBクエリに失敗しました"); | 
|---|
| 89 | $maxid = $rs->fetchColumn(0); | 
|---|
| 90 | if ($maxid) { | 
|---|
| 91 | $nextcno = $maxid + 1; | 
|---|
| 92 | }else{ | 
|---|
| 93 | $nextcno = 1; | 
|---|
| 94 | } | 
|---|
| 95 |  | 
|---|
| 96 |  | 
|---|
| 97 |  | 
|---|
| 98 | if ($demomode){ | 
|---|
| 99 | }else{ | 
|---|
| 100 |  | 
|---|
| 101 |  | 
|---|
| 102 |  | 
|---|
| 103 |  | 
|---|
| 104 |  | 
|---|
| 105 |  | 
|---|
| 106 |  | 
|---|
| 107 |  | 
|---|
| 108 | $remotehost = gethostbyaddr($_SERVER['REMOTE_ADDR']); | 
|---|
| 109 |  | 
|---|
| 110 | $query = " | 
|---|
| 111 | insert into foltia_envpolicy | 
|---|
| 112 | values ( ?,'2',?,?,now(),?)"; | 
|---|
| 113 |  | 
|---|
| 114 |  | 
|---|
| 115 | $rs = sql_query($con, $query, "DBクエリに失敗しました",array($nextcno,$username,$userpasswd,$remotehost)); | 
|---|
| 116 |  | 
|---|
| 117 | "次のアカウントを登録しました。<br> | 
|---|
| 118 |  | 
|---|
| 119 | ; | 
|---|
| 120 |  | 
|---|
| 121 | $environmentpolicytoken != ""){ | 
|---|
| 122 | "+セキュリティコード<br>\n"; | 
|---|
| 123 |  | 
|---|
| 124 | "<a href=\"./index.php\">ログイン</a><br>\n"; | 
|---|
| 125 |  | 
|---|
| 126 | "</body> | 
|---|
| 127 |  | 
|---|
| 128 | ; | 
|---|
| 129 | $oserr = system("$toolpath/perl/envpolicyupdate.pl"); | 
|---|
| 130 |  | 
|---|
| 131 |  | 
|---|
| 132 |  | 
|---|
| 133 | }else{ | 
|---|
| 134 | print "$errmsg / $errflag<br>\n"; | 
|---|
| 135 |  | 
|---|
| 136 | } | 
|---|
| 137 |  | 
|---|
| 138 | } | 
|---|
| 139 | ?> | 
|---|
| 140 |  | 
|---|
| 141 | <form id="account" name="account" method="post" action="./accountregist.php"> | 
|---|
| 142 | <p>登録ユーザ名: | 
|---|
| 143 | <input name="username" type="text" id="username" size="19" value="" /> | 
|---|
| 144 | (半角英数のみ)</p> | 
|---|
| 145 | <p>登録パスワード: | 
|---|
| 146 | <input name="userpasswd" type="text" id="userpasswd" size="19" value="" /> | 
|---|
| 147 | (半角英数のみ)</p> | 
|---|
| 148 |  | 
|---|
| 149 | <input type="submit" value="新規登録"> | 
|---|
| 150 | </form> | 
|---|
| 151 |  | 
|---|
| 152 | </body> | 
|---|
| 153 | </html> | 
|---|
| 154 |  | 
|---|