switch($data->language) { case 'ja': ?>パスワード変更 break; case 'de': ?>Passwort Änderung break; default: #en ?>Change Password } ?>
if($data->edit && $data->confirm) { $que = pg_query_params($db, 'SELECT * FROM members WHERE name = $1 AND valid = TRUE AND expired = FALSE', array($auth->name)); if($res = pg_fetch_object($que)) { if(password_verify($data->old, $res->password)) { $data->id = $res->id; $data->mail = $res->mail; $que = pg_query_params($db, 'UPDATE members SET password = $3, changed = now() WHERE id = $1 AND name = $2 AND valid = TRUE AND expired = FALSE', array($data->id, $auth->name, password_hash($data->password, PASSWORD_BCRYPT))); if($que) { $data->success = true; mail_change($data->language, $data->mail); mail_change($data->language, $email_notice); } else $data->success = false; } } } ?> if($data->edit) { $data->check = true; if(!$auth->name) { $data->check = false; $data->error_1 = true; } if(!$data->old) { $data->check = false; $data->error_1 = true; } if(!$data->password) { $data->check = false; $data->error_1 = true; } if($data->password === $data->old && $data->password) { $data->check = false; $data->error_2 = true; } if($data->password !== $data->again) { $data->check = false; $data->error_1 = true; } $que = pg_query_params($db, 'SELECT * FROM members WHERE name = $1 AND valid = TRUE AND expired = FALSE', array($auth->name)); if($res = pg_fetch_object($que)) { if(!password_verify($data->old, $res->password) && !$data->success) { $data->check = false; $data->error_1 = true; } } else { $data->check = false; $data->error_3 = 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': ?>Erfolg Ihren Passwort zu ändern! break; default: #en ?>Success to change your password! } ?>
} else if($data->confirm) { ?>switch($data->language) { case 'ja': ?>パスワード変更に失敗しました。 break; case 'de': ?>Misserfolg Ihren Passwort zu ändern! break; default: #en ?>Failure to change your password! } ?>
} else if($data->check) { ?>switch($data->language) { case 'ja': ?>以下の通りパスワードを変更しますか? break; case 'de': ?>Ändern Sie gewiss im Folgende? break; default: #en ?>Do you change 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 Inhalt. break; default: #en ?>Please check the content. } ?>
} ?> if($data->error_2) { ?>switch($data->language) { case 'ja': ?>以前と同様のパスワードは設定できません。 break; case 'de': ?>Der gleiche Passwort hat verboten. break; default: #en ?>The same password is prohibited. } ?>
} ?> if($data->error_3) { ?>switch($data->language) { case 'ja': ?>不明なエラーです。 break; case 'de': ?>Es gibt unklar Fehler. break; default: #en ?>There are unknown errors. } ?>
} ?> if($data->success) { ?> } else { ?> } ?>