Files
AIclinicalresearch/redcap-docker-dev/scripts/create-redcap-password.php
HaHafeng 440f75255e feat(rvw): Complete Phase 4-5 - Bug fixes and Word export
Summary:
- Fix methodology score display issue in task list (show score instead of 'warn')
- Add methodology_score field to database schema
- Fix report display when only methodology agent is selected
- Implement Word document export using docx library
- Update documentation to v3.0/v3.1

Backend changes:
- Add methodologyScore to Prisma schema and TaskSummary type
- Update reviewWorker to save methodologyScore
- Update getTaskList to return methodologyScore

Frontend changes:
- Install docx and file-saver libraries
- Implement handleExportReport with Word generation
- Fix activeTab auto-selection based on available data
- Add proper imports for docx components

Documentation:
- Update RVW module status to 90% (Phase 1-5 complete)
- Update system status document to v3.0

Tested: All review workflows verified, Word export functional
2026-01-10 22:52:15 +08:00

61 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* REDCap密码哈希生成脚本
* 直接在数据库中更新Admin密码
*/
// REDCap密码哈希算法SHA-512 + Salt
$username = 'Admin';
$new_password = 'Admin123!';
// 生成新的saltREDCap使用100字符的随机salt
$salt = '';
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]{}|;:,.<>?~';
for ($i = 0; $i < 100; $i++) {
$salt .= $characters[random_int(0, strlen($characters) - 1)];
}
// 生成密码哈希SHA-512(password + salt)
$password_hash = hash('sha512', $new_password . $salt);
// 数据库连接信息
$db_host = getenv('REDCAP_DB_HOST') ?: 'redcap-mysql';
$db_name = getenv('REDCAP_DB_NAME') ?: 'redcap';
$db_user = getenv('REDCAP_DB_USER') ?: 'redcap_user';
$db_pass = getenv('REDCAP_DB_PASS') ?: 'redcap_pass_dev_456';
try {
$pdo = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// 更新密码
$stmt = $pdo->prepare("UPDATE redcap_auth SET password = ?, password_salt = ? WHERE username = ?");
$result = $stmt->execute([$password_hash, $salt, $username]);
if ($result) {
echo "✅ Password updated successfully!\n\n";
echo "Username: $username\n";
echo "New Password: $new_password\n\n";
echo "You can now login at: http://localhost:8080/\n";
} else {
echo "❌ Failed to update password\n";
}
} catch (PDOException $e) {
echo "❌ Database error: " . $e->getMessage() . "\n";
}