switch($data->language) { case 'ja': ?>パスワード再発行 break; case 'de': ?>Passwort Wiederherstellung break; default: #en ?>Reset password } ?>
if($data->edit && $data->confirm) { $que = pg_query_params($db, 'SELECT * FROM members WHERE name = $1 AND mail = $2 AND valid = TRUE AND expired = FALSE', array($data->username, $data->mail)); if($res = pg_fetch_object($que)) { $data->id = $res->id; $data->code = ak_random_string(64); if($que) $data->success = true; else $data->success = false; 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, 'forgot', $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, 'forgot', $data->id)); mail_forgot($data->language, $data->mail, $data->id, $data->code); mail_forgot($data->language, $email_notice, $data->id, $data->code); } else $data->success = false; } } ?> if($data->edit) { $data->check = true; if(!$data->username) { $data->check = false; $data->error_1 = 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_1 = true; } } if(!$data->mail) { $data->check = false; $data->error_2 = 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_2 = true; } if(!preg_match('/^([!-~]+@[!-~]+)$/', $data->mail)) { $data->check = false; $data->error_2 = 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': ?>パスワード再発行申請を受け付けました。確認メールを送信しましたので、申請の認証をしてください。 break; case 'de': ?>Angenommen! Sie können eine Bestätigung via Ihre E-mail erhalten, denn bitte machen die Beglaubingung. break; default: #en ?>Accepted! You can receive a confirmation mail, then please validate your application to reset password. } ?>
} else if($data->confirm) { ?>switch($data->language) { case 'ja': ?>パスワード再発行に失敗しました。 break; case 'de': ?>Misserfolg Ihre Passwort Wiederherstellung zu machen! break; default: #en ?>Failure to reset password! } ?>
} else if($data->check) { ?>switch($data->language) { case 'ja': ?>以下の通りパスワードを再発行しますか? break; case 'de': ?>Machen Sie gewiss im Folgende Ihre Passwort Wiederherstellung? break; default: #en ?>Do you reset password 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 die E-mail Adresse. break; default: #en ?>Please check the mail address. } ?>
} ?> if($data->success) { ?> } else { ?> } ?>