(username, accountManager, invalidUsernameTemplate, dateOfRemoval, supportEmail)
| 34 | } |
| 35 | |
| 36 | function backupIndexFile (username, accountManager, invalidUsernameTemplate, dateOfRemoval, supportEmail) { |
| 37 | const userDirectory = accountManager.accountDirFor(username) |
| 38 | const currentIndex = path.join(userDirectory, 'index.html') |
| 39 | const currentIndexExists = fs.existsSync(currentIndex) |
| 40 | const backupIndex = path.join(userDirectory, 'index.backup.html') |
| 41 | const backupIndexExists = fs.existsSync(backupIndex) |
| 42 | if (currentIndexExists && !backupIndexExists) { |
| 43 | fs.renameSync(currentIndex, backupIndex) |
| 44 | createNewIndexAcl(userDirectory) |
| 45 | createNewIndex(username, invalidUsernameTemplate, dateOfRemoval, supportEmail, currentIndex) |
| 46 | console.info(`index.html updated for user ${username}`) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | function createNewIndex (username, invalidUsernameTemplate, dateOfRemoval, supportEmail, currentIndex) { |
| 51 | const newIndexSource = invalidUsernameTemplate({ |
no test coverage detected