Changeset 82
- Timestamp:
- Jun 17, 2009, 11:46:33 AM (15 years ago)
- Location:
- hadoop-register
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
hadoop-register/check_user_identification.php
r58 r82 2 2 /* 3 3 <HEAD> 4 5 4 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 5 <TITLE>Hadoop 帳號</TITLE> 6 6 </HEAD> 7 7 */ 8 8 ?> 9 9 <? 10 /* 11 * 取得由 index.php 傳來的表單資料,並驗證使用者身份。 12 */ 10 /* 11 * 取得由 index.php 傳來的表單資料,並驗證使用者身份。 12 * 20090520 增加 hadoop_user、hadoop_password 的 input tag 13 */ 13 14 14 15 15 require_once ("./etc/init.php"); 16 include_once ("./etc/funs.php"); 16 17 17 18 19 18 // 取得表單資料 19 $user = $_POST["user"]; 20 $password = md5($_POST["password"]); 20 21 21 22 23 24 22 // 連結資料庫 23 $link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die(mysql_error() ); 24 mysql_select_db($mysql_database, $link); 25 mysql_query("SET NAMES 'utf8'"); 25 26 26 // 驗證帳號密碼是否正確 27 $str = sprintf("SELECT * FROM `%s` 28 WHERE `user` LIKE '%s' AND `password` LIKE '%s' limit 1", 29 $mysql_table, $user ,$password); 30 $result = mysql_query($str, $link) or die(mysql_error() ); 27 // 驗證帳號密碼是否正確 28 $str = sprintf("SELECT * FROM `%s` 29 WHERE `user` LIKE '%s' AND `password` LIKE '%s' limit 1", 30 $mysql_table, $user ,$password); 31 31 32 // 顯示使用者資料 33 $row = mysql_fetch_assoc($result); 34 if ($row["password"] == $password) 35 { 36 echo '<TABLE ALIGN="center" BORDER="1">'; 37 echo '<TR> <TD> 帳號 </TD> <TD>' . $row["user"] . '</TD> <TR>'; 38 if ($row["is_activate"] == 0) 39 { 40 echo '<TR> <TD> 認證 </TD> <TD> <FONT COLOR="#FF000000"> 未認證 </FONT> -- <A HREF=re_send_activate_code.php?user=' . "$user" . "&email=" . $row["email"] . ">重寄認證信</A> </TD> <TR>"; 41 } 42 else 43 { 44 // 讀取使用者 hadoop 帳號 45 $str = sprintf("SELECT `hadoop_user` FROM `%s` 46 WHERE `hadoop_owner` LIKE '%s' limit 1", 47 $mysql_table_owner, $user ,$password); 48 $result = mysql_query($str, $link) or die(mysql_error() ); 49 $row1 = mysql_fetch_assoc($result); 50 echo '<TR> <TD> Hadoop 帳號 </TD> <TD>' . $row1["hadoop_user"] . '</TD> <TR>'; 51 } 52 echo '<TR> <TD> E-mail </TD> <TD>' . $row["email"] . '</TD> <TR>'; 53 echo '<TR> <TD> 姓名 </TD> <TD>' . $row["name"] . '</TD> <TR>'; 54 echo '<TR> <TD> 電話 </TD> <TD>' . $row["telephone"] . '</TD> <TR>'; 55 echo '<TR> <TD> 單位 </TD> <TD>' . $row["department"] . '</TD> <TR>'; 56 echo '<TR> <TD> 用途 </TD> <TD>' . $row["purpose"] . '</TD> <TR>'; 57 echo '</TABLE>'; 58 /* 59 echo ' 60 <FORM ACTION="check_user_identification.php" METHOD="post" NAME="myForm"> 61 <TABLE WIDTH="40%" ALIGN="center"> 62 <TR><TD ALIGN="center"> 63 <FONT COLOR="#3333FF">修改密碼:</FONT> 64 <INPUT NAME="password" TYPE="password" SIZE="15"> 65 </TD></TR> 66 <TR><TD ALIGN="center"> 67 <FONT COLOR="#3333FF">再次確認密碼:</FONT> 68 <INPUT NAME="password" TYPE="password" SIZE="15"> 69 </TD></TR> 70 <TR><TD ALIGN="center"> 71 <FONT COLOR="#3333FF">修改Email:</FONT> 72 <INPUT NAME="password" TYPE="password" SIZE="15"> 73 </TD></TR> 74 <TR><TD ALIGN="center"> 75 <INPUT TYPE="button" VALUE="送出" onClick="check_data()"> 76 </TD></TR> 77 </TABLE> 78 </FORM> 32 $result = mysql_query($str, $link) or die(mysql_error() ); 79 33 80 '; 81 */ 34 // 顯示使用者資料 35 $row = mysql_fetch_assoc($result); 36 37 if ($row["password"] == $password) 38 { 82 39 83 } 84 else 85 { 86 $my_user = new W_user(); 87 $my_user->redirect_to("http://$w_localhost", "帳號密碼錯誤"); 88 } 89 mysql_close($link); 40 // 設定標頭 41 echo ' 42 <HEAD> 43 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 44 <TITLE>Hadoop 帳號</TITLE> 45 </HEAD>'; 46 47 echo '<TABLE ALIGN="center" BORDER="1" width="100%">'; 48 49 // 如果帳號未啟動就出現重新認證信的連結 50 if ($row["is_activate"] == 0) 51 { 52 echo '<TR> <TD> 認證 </TD> <TD colspan="5"> <FONT COLOR="#FF000000"> 未認證 </FONT> -- <A HREF=re_send_activate_code.php?user=' . "$user" . "&email=" . $row["email"] . ">重寄認證信</A> </TD> <TR>"; 53 } 54 else 55 { 56 57 // 讀取使用者 hadoop 帳號、密碼 58 $str = sprintf("SELECT `hadoop_user`, `hadoop_password` FROM `%s` 59 WHERE `hadoop_owner` LIKE '%s' limit 1", 60 $mysql_table_owner, $user ,$password); 61 $result = mysql_query($str, $link) or die(mysql_error() ); 62 $row1 = mysql_fetch_assoc($result); 63 } 64 65 // 顯示使用者註冊資料 66 echo '<TR> <TD> 網站帳號 </TD> <TD>' . $row["user"] . '</TD>'; 67 echo '<TD> E-mail </TD> <TD>' . $row["email"] . '</TD>'; 68 echo '<TD> 姓名 </TD> <TD>' . $row["name"] . '</TD>'; 69 echo '<TD> 電話 </TD> <TD>' . $row["telephone"] . '</TD>'; 70 echo '<TD> 單位 </TD> <TD>' . $row["department"] . '</TD>'; 71 echo '<TD> 用途 </TD> <TD>' . $row["purpose"] . '</TD>'; 72 echo "<TD> 主機帳號 </TD> 73 <TD>". $row1["hadoop_user"] . "</TD>"; 74 echo "<TD> 主機密碼 </TD> 75 <TD>". $row1["hadoop_password"]."</TD>"; 76 echo '<TD> <A HREF="index.php"> 登出</A> </TD>'; 77 echo '</TR></TABLE>'; 78 echo '<applet code=org.zhouer.zterm.ZTerm.class name="w_zterm" width=100% height=100% archive=ZTermApplet.jar> 79 <param name="p1" value="' . $row1["hadoop_user"] . '">' . 80 '<param name="p2" value="' . $row1["hadoop_password"] . '"> 81 </applet> 82 '; 83 } 84 else 85 { 86 $my_user = new W_user(); 87 $my_user->redirect_to("http://$w_localhost", "帳號密碼錯誤"); 88 } 89 mysql_close($link); 90 90 ?> -
hadoop-register/etc/init.php
r63 r82 40 40 41 41 // mail password 42 $mail_password = ' 0911772703';42 $mail_password = ''; 43 43 44 44 ?> -
hadoop-register/new_register.php
r62 r82 80 80 <TD ALIGN="center"> 81 81 <FONT COLOR="#3333FF">確認密碼:</FONT> 82 <INPUT NAME="checkPassword" TYPE=" checkPassword" SIZE="20">82 <INPUT NAME="checkPassword" TYPE="password" SIZE="20"> 83 83 </TD> 84 84 </TR>
Note: See TracChangeset
for help on using the changeset viewer.