| 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 memberid ,userclass,name,passwd1 |
|---|
| 61 |
FROM foltia_envpolicy |
|---|
| 62 |
WHERE foltia_envpolicy.name = '$username' |
|---|
| 63 |
"; |
|---|
| 64 |
$isaccountexist = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 65 |
$isaccountexistncount = pg_num_rows($isaccountexist); |
|---|
| 66 |
|
|---|
| 67 |
if ($isaccountexistncount == 0){ |
|---|
| 68 |
|
|---|
| 69 |
}else{ |
|---|
| 70 |
$errflag = 1; |
|---|
| 71 |
$errmsg = "そのユーザ名は既に使われています。"; |
|---|
| 72 |
} |
|---|
| 73 |
} |
|---|
| 74 |
if ($userpasswd == ""){ |
|---|
| 75 |
$errflag = 2; |
|---|
| 76 |
$errmsg = "パスワードが不適切です。半角英数を指定して下さい。"; |
|---|
| 77 |
} |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
if ($errflag == 0){ |
|---|
| 81 |
|
|---|
| 82 |
$query = " |
|---|
| 83 |
SELECT max(memberid) |
|---|
| 84 |
FROM foltia_envpolicy |
|---|
| 85 |
"; |
|---|
| 86 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 87 |
$maxrows = pg_num_rows($rs); |
|---|
| 88 |
if ($maxrows == 0){ |
|---|
| 89 |
$nextcno = 1 ; |
|---|
| 90 |
}else{ |
|---|
| 91 |
$rowdata = pg_fetch_row($rs, 0); |
|---|
| 92 |
$nextcno = $rowdata[0]; |
|---|
| 93 |
$nextcno++ ; |
|---|
| 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 ( '$nextcno','2','$username','$userpasswd',now(),'$remotehost')"; |
|---|
| 113 |
|
|---|
| 114 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 115 |
|
|---|
| 116 |
"次のアカウントを登録しました。<br> |
|---|
| 117 |
|
|---|
| 118 |
; |
|---|
| 119 |
|
|---|
| 120 |
$environmentpolicytoken != ""){ |
|---|
| 121 |
"+セキュリティコード<br>\n"; |
|---|
| 122 |
|
|---|
| 123 |
"<a href=\"./index.php\">ログイン</a><br>\n"; |
|---|
| 124 |
|
|---|
| 125 |
"</body> |
|---|
| 126 |
|
|---|
| 127 |
; |
|---|
| 128 |
$oserr = system("$toolpath/perl/envpolicyupdate.pl"); |
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
}else{ |
|---|
| 133 |
print "$errmsg / $errflag<br>\n"; |
|---|
| 134 |
|
|---|
| 135 |
} |
|---|
| 136 |
|
|---|
| 137 |
} |
|---|
| 138 |
?> |
|---|
| 139 |
|
|---|
| 140 |
<form id="account" name="account" method="post" action="./accountregist.php"> |
|---|
| 141 |
<p>登録ユーザ名: |
|---|
| 142 |
<input name="username" type="text" id="username" size="19" value="" /> |
|---|
| 143 |
(半角英数のみ)</p> |
|---|
| 144 |
<p>登録パスワード: |
|---|
| 145 |
<input name="userpasswd" type="text" id="userpasswd" size="19" value="" /> |
|---|
| 146 |
(半角英数のみ)</p> |
|---|
| 147 |
|
|---|
| 148 |
<input type="submit" value="新規登録"> |
|---|
| 149 |
</form> |
|---|
| 150 |
|
|---|
| 151 |
</body> |
|---|
| 152 |
</html> |
|---|
| 153 |
|
|---|