diff options
author | Camil Staps | 2016-07-30 17:23:16 +0200 |
---|---|---|
committer | Camil Staps | 2016-07-30 17:23:16 +0200 |
commit | c7a8961879c26180212119a870a54b0c152b0064 (patch) | |
tree | 92040ae7374fe804694dca0489e1986b4fd55c4e | |
parent | Fix documentation issues (diff) |
Give new files a key
-rw-r--r-- | classes/BusinessAdmin.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/classes/BusinessAdmin.php b/classes/BusinessAdmin.php index be6f1a4..7c3c76c 100644 --- a/classes/BusinessAdmin.php +++ b/classes/BusinessAdmin.php @@ -376,7 +376,9 @@ class BusinessAdmin { $stmt = $pdo->prepare("INSERT INTO `".Constants::db_prefix."file` (`filename`) VALUES (?)"); $stmt->execute(array($filename)); if ($stmt->rowCount() == 1) { - return new File($pdo, $pdo->lastInsertId()); + $file = new File($pdo, $pdo->lastInsertId()); + $file->secret_key = File::getRandomSecretKey(); + return $file; } else { unlink(Constants::files_folder . $filename); throw new Exception("$filename could not be added to the database"); |