diff --git a/classes/MarketRelease.class.php b/classes/MarketRelease.class.php index 6286acc7ea189966ca905c5037fc366b408179e5..22c941706d03c57db08ccca1a0b2b14e63b52a07 100755 --- a/classes/MarketRelease.class.php +++ b/classes/MarketRelease.class.php @@ -25,6 +25,7 @@ class MarketRelease extends SimpleORMap { 'on_delete' => 'delete', 'on_store' => 'store', ); + $config['additional_fields']['last_upload_time']['get'] = 'getFileMTime'; parent::configure($config); } @@ -101,16 +102,21 @@ class MarketRelease extends SimpleORMap { public function getContentLength() { - return filesize($this->getFilePath()); + return @filesize($this->getFilePath()); + } + + public function getFileMtime() + { + return @filemtime($this->getFilePath()); } public function getContent() { - return file_get_contents($this->getFilePath()); + return @file_get_contents($this->getFilePath()); } public function getChecksum() { - return md5_file($this->getFilePath()); + return @md5_file($this->getFilePath()); } public function getSecurityHash() { diff --git a/controllers/myplugins.php b/controllers/myplugins.php index 605ac6b762eb3c9999b4f44e084c6b2b77d988e4..0dab40611046bb34fd4426c72d2845b41c0d0088 100755 --- a/controllers/myplugins.php +++ b/controllers/myplugins.php @@ -182,11 +182,9 @@ class MypluginsController extends MarketController } if (!Request::get("use_secret")) { $this->release['repository_secret'] = null; - $this->release['chdate'] = time(); } elseif(!$this->release['repository_secret']) { $this->release['repository_secret'] = md5(uniqid()); } - $this->release->installFile(); $this->release->store(); diff --git a/views/myplugins/_edit_release.php b/views/myplugins/_edit_release.php index 29ade294d0052b56c80e82a66785e1a2e1e2cf2d..cf115c97951e172b4fcef51e010844339151a0e9 100755 --- a/views/myplugins/_edit_release.php +++ b/views/myplugins/_edit_release.php @@ -40,7 +40,7 @@ <input type="text" name="release[repository_download_url]" value="<?= htmlReady($release['repository_download_url']) ?>"> </label> <label> - <input type="checkbox" name="use_secret"<? $release->isNew() || $release['repository_secret'] ? " checked" : "" ?> value="1"> + <input type="checkbox" name="use_secret" <?= $release->isNew() || $release['repository_secret'] ? " checked" : "" ?> value="1"> <?= _("Automatisches Update absichern über Sicherheitstoken (optional)") ?> </label> <p class="info"> diff --git a/views/presenting/details.php b/views/presenting/details.php index 37f1bbd79066282205723c3a82b375370e52e9ab..19755df849b1eeff812aed5c0cfc5f98bb9f5395 100755 --- a/views/presenting/details.php +++ b/views/presenting/details.php @@ -134,7 +134,7 @@ if ($image) { </td> <td><?= $release['studip_min_version'] ? htmlReady($release['studip_min_version']) : " - " ?></td> <td><?= $release['studip_max_version'] ? htmlReady($release['studip_max_version']) : " - " ?></td> - <td><?= strftime("%x", $release['mkdate']) ?></td> + <td><?= strftime("%x %R", $release['last_upload_time']) ?></td> <td><?= htmlReady($release->getChecksum()) ?></td> <td><?= htmlReady($release['downloads']) ?></td> <td class="actions"> diff --git a/views/presenting/overview_list.php b/views/presenting/overview_list.php index 68bf9a1e8ba17c0f20ac047fea591820db4e4583..eb7cc2f1ff76d881984c0112b24e2cf7f74e4160 100755 --- a/views/presenting/overview_list.php +++ b/views/presenting/overview_list.php @@ -32,8 +32,8 @@ <td> <?= htmlReady($marketplugin->uses->count()) ?> </td> - <td data-sorter="<?= $marketplugin->releases->orderBy('chdate DESC')->val('mkdate') ?>"> - <?= strftime('%x', $marketplugin->releases->orderBy('chdate DESC')->val('mkdate')) ?> + <td data-sorter="<?= $marketplugin->releases->orderBy('last_upload_time DESC')->val('last_upload_time') ?>"> + <?= strftime('%x', $marketplugin->releases->orderBy('last_upload_time DESC')->val('last_upload_time')) ?> </td> <td> <?= htmlReady($marketplugin->getDownloads()) ?>