openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 0208d207243efe990dcee0e9f3fb2e52012788ae
parent 65e81dd7f07585e8026da9ee3d24c45adf37ddb9
Author: Jan Dankert <devnull@localhost>
Date:   Sat, 12 Jul 2014 00:56:10 +0200

Administratoren dürfen den Original-Erstellungs-Timestamp ändern.

Diffstat:
action/PageAction.class.php | 3+++
model/Object.class.php | 13+++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/action/PageAction.class.php b/action/PageAction.class.php @@ -303,6 +303,9 @@ class PageAction extends ObjectAction $this->page->save(); $this->addNotice($this->page->getType(),$this->page->name,'PROP_SAVED','ok'); + + if ( $this->hasRequestVar('creationTimestamp') && $this->currentUser->isAdmin ) + $this->page->createDate = $this->getRequestVar('creationTimestamp',OR_FILTER_NUMBER); } else { diff --git a/model/Object.class.php b/model/Object.class.php @@ -729,7 +729,20 @@ SQL } + public function setCreationTimestamp() + { + $db = db_connection(); + + $sql = new Sql('UPDATE {t_object} SET '. + ' create_date = {time} '. + ' WHERE id={objectid}'); + + $sql->setInt ('time' ,$this->createDate ); + + $db->query( $sql ); + } + /** * Logischen Namen und Beschreibung des Objektes in Datenbank speichern * (wird von objectSave() automatisch aufgerufen)