switch($data->language) { case 'ja': ?>新規登録 break; case 'de': ?>Einschreibung break; default: #en ?>Register } ?>
if($data->edit && $data->confirm) { $que = pg_query($db, 'SELECT max(id) AS next FROM members'); $res = pg_fetch_object($que); $data->id = intval($res->next + 1); $data->code = ak_random_string(64); $que = pg_query_params($db, 'INSERT INTO members (id, name, password, mail) VALUES ($1, $2, $3, $4)', array($data->id, $data->username, password_hash($data->password, PASSWORD_BCRYPT), $data->mail)); if($que) { $data->success = true; $que = pg_query_params($db, 'INSERT INTO codes (code, type, id, address, host, port, referer, agent) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)', array($data->code, 'join', $data->id, $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']), $_SERVER['REMOTE_PORT'], $_SERVER['HTTP_REFERER'], $_SERVER['HTTP_USER_AGENT'])); $que = pg_query_params($db, 'UPDATE codes SET valid = TRUE WHERE code = $1 AND type = $2 AND id = $3 AND valid = FALSE AND expired = FALSE', array($data->code, 'join', $data->id)); mail_join($data->language, $data->mail, $data->id, $data->username, $data->code); mail_join($data->language, $email_notice, $data->id, $data->username, $data->code); } else $data->success = false; } ?> if($data->edit) { $data->check = true; if(!$data->username) { $data->check = false; $data->error_1 = true; } if(!preg_match('/^([a-z][a-z0-9_]{2,18}[a-z0-9])$/', $data->username) && $data->username) { $data->check = false; $data->error_1 = true; } if(!$data->password) { $data->check = false; $data->error_2 = true; } if($data->password !== $data->again && $data->password) { $data->check = false; $data->error_2 = true; } if(!$data->mail) { $data->check = false; $data->error_3 = true; } if($data->username) { $que = pg_query_params($db, 'SELECT * FROM members WHERE name = $1', array($data->username)); if($res = pg_fetch_object($que) && !$data->success) { $data->check = false; $data->error_4 = true; } if(preg_match('/(shun|tamu)/i', $data->username) && !preg_match('/[0-9_]/i', $data->username)) { $data->check = false; $data->error_4 = true; } if(preg_match('/(admin|staff|root|info|auskunft|manage|master|help)/i', $data->username)) { $data->check = false; $data->error_4 = true; } } if($data->mail) { $que = pg_query_params($db, 'SELECT * FROM members WHERE mail = $1', array($data->mail)); if($res = pg_fetch_object($que) && !$data->success) { $data->check = false; $data->error_5 = true; } if(!preg_match('/^([!-~]+@[!-~]+)$/', $data->mail)) { $data->check = false; $data->error_5 = true; } } } ?> if($data->success) { ?>switch($data->language) { case 'ja': ?>完了 break; case 'de': ?>Abschluss break; default: #en ?>Done } ?>
} else if($data->check) { ?>switch($data->language) { case 'ja': ?>確認 break; case 'de': ?>Bestätigung break; default: #en ?>Confirm } ?>
} else { ?>switch($data->language) { case 'ja': ?>編集 break; case 'de': ?>Redaktion break; default: #en ?>Edit } ?>
} ?> if($data->success) { ?>switch($data->language) { case 'ja': ?>Auskunft.jpへようこそ!確認メールを送信しましたので、アカウントの認証をしてください。 break; case 'de': ?>Wilkommen bei Auskunft.jp! Sie können eine Bestätigung via Ihre E-mail erhalten, denn bitte machen die Beglaubingung. break; default: #en ?>Welcome to Auskunft.jp! You can receive a confirmation mail, then please validate your account. } ?>
} else if($data->confirm) { ?>switch($data->language) { case 'ja': ?>登録に失敗しました。 break; case 'de': ?>Misserfolg einzuschreiben! break; default: #en ?>Failure to register! } ?>
} else if($data->check) { ?>switch($data->language) { case 'ja': ?>以下の通り登録しますか? break; case 'de': ?>Schreiben Sie gewiss im Folgende ein? break; default: #en ?>Do you regster as below certainly? } ?>
} else if($data->edit) { ?>switch($data->language) { case 'ja': ?>エラーがあります。訂正してください。 break; case 'de': ?>Es gibt Fehler. Bitte korrigieren es richtig. break; default: #en ?>There are errors. Please change it correctly. } ?>
} ?> if($data->error_1) { ?>switch($data->language) { case 'ja': ?>ユーザー名を確認してください。 break; case 'de': ?>Bitte checken den Username. break; default: #en ?>Please check the username. } ?>
} ?> if($data->error_2) { ?>switch($data->language) { case 'ja': ?>パスワードを確認してください。 break; case 'de': ?>Bitte checken das Passwort. break; default: #en ?>Please check the password. } ?>
} ?> if($data->error_3) { ?>switch($data->language) { case 'ja': ?>メールアドレスを確認してください。 break; case 'de': ?>Bitte checken die E-mail Adresse. break; default: #en ?>Please check the mail address. } ?>
} ?> if($data->error_4) { ?>switch($data->language) { case 'ja': ?>指定のユーザー名は既に使用されています。 break; case 'de': ?>Der Username hat schon benutzt. break; default: #en ?>The username is used already. } ?>
} ?> if($data->error_5) { ?>switch($data->language) { case 'ja': ?>指定のメールアドレスでは登録できません。 break; case 'de': ?>Mit der E-mail Adresse kann man nicht einschreiben. break; default: #en ?>You can't register with the email address. } ?>
} ?> if($data->success) { ?> } else { ?> } ?>