<parent>message.general</parent>
<options>module_poll</options>
</category>
+ <category name="message.general.edit">
+ <parent>message.general</parent>
+ </category>
<category name="message.attachment">
<parent>message</parent>
</option>
<!-- /message.general -->
+ <!-- message.general.edit -->
+ <option name="edit_history_expiration">
+ <categoryname>message.general.edit</categoryname>
+ <optiontype>integer</optiontype>
+ <defaultvalue>90</defaultvalue>
+ <minvalue>0</minvalue>
+ </option>
+ <!-- /message.general.edit -->
+
<!-- message.general.share -->
<option name="enable_share_buttons">
<categoryname>message.general.share</categoryname>
(TIME_NOW - 86400)
));
+ // clean up expired edit history entries
+ if (EDIT_HISTORY_EXPIRATION) {
+ $sql = "DELETE FROM wcf".WCF_N."_edit_history_entry
+ WHERE insertionTime < ?";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute(array(
+ (TIME_NOW - 86400 * EDIT_HISTORY_EXPIRATION)
+ ));
+ }
+
// clean up user authentication failure log
if (ENABLE_USER_AUTHENTICATION_FAILURE) {
$sql = "DELETE FROM wcf".WCF_N."_user_authentication_failure
public function add($objectType, $objectID, $message, $time, $userID, $username, $editReason) {
// save new entry
$sql = "INSERT INTO wcf".WCF_N."_edit_history_entry
- (objectTypeID, objectID, message, time, userID, username, editReason)
- VALUES (?, ?, ?, ?, ?, ?, ?)";
+ (objectTypeID, objectID, message, time, insertionTime, userID, username, editReason)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
$statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array($this->getObjectTypeID($objectType), $objectID, $message, $time, $userID, $username, $editReason));
+ $statement->execute(array($this->getObjectTypeID($objectType), $objectID, $message, $time, TIME_NOW, $userID, $username, $editReason));
}
/**
<item name="wcf.acp.option.show_signature_default_value"><![CDATA[Signatur anzeigen [Vorgabewert]]]></item>
<item name="wcf.acp.option.enable_share_buttons"><![CDATA[Buttons zum Teilen von Inhalten anzeigen]]></item>
<item name="wcf.acp.option.share_buttons_show_count"><![CDATA[Anzahl der Teilungen anzeigen]]></item>
+ <item name="wcf.acp.option.category.message.general.edit"><![CDATA[Bearbeitungen]]></item>
+ <iten name="wcf.acp.option.edit_history_expiration"><![CDATA[Speicherzeit]]></item>
+ <iten name="wcf.acp.option.edit_history_expiration.description"><![CDATA[Zeitraum, nachdem alte Einträge aus dem Bearbeitungsverlauf entfernt werden [Zeitraum in Tagen]]]></item>
<item name="wcf.acp.option.github_public_key"><![CDATA[GitHub Client ID]]></item>
<item name="wcf.acp.option.github_public_key.description"><![CDATA[Sie können Ihre Client ID und Ihr Client Secret bei <a href="{@$__wcf->getPath()}acp/dereferrer.php?url={'https://github.com/settings/applications'|rawurlencode}" class="externalURL">GitHub</a> anfordern. Die Callback URL ist: {link controller="GithubAuth" forceFrontend=true appendSession=false}{/link}]]></item>
<item name="wcf.acp.option.github_private_key"><![CDATA[GitHub Client Secret]]></item>
<item name="wcf.acp.option.show_signature_default_value"><![CDATA[Show signatures [default value]]]></item>
<item name="wcf.acp.option.enable_share_buttons"><![CDATA[Show content share button]]></item>
<item name="wcf.acp.option.share_buttons_show_count"><![CDATA[Show number of shares]]></item>
+ <item name="wcf.acp.option.category.message.general.edit"><![CDATA[Edits]]></item>
+ <iten name="wcf.acp.option.edit_history_expiration"><![CDATA[Storage time]]></item>
+ <iten name="wcf.acp.option.edit_history_expiration.description"><![CDATA[Items in the edit history will be discarded if they are older than the given period. [time in days]]]></item>
<item name="wcf.acp.option.github_public_key"><![CDATA[GitHub Client ID]]></item>
<item name="wcf.acp.option.github_public_key.description"><![CDATA[You can obtain both your Client ID and Client Secret at <a href="{@$__wcf->getPath()}acp/dereferrer.php?url={'https://github.com/settings/applications'|rawurlencode}" class="externalURL">GitHub</a>. The Callback URL is: {link controller="GithubAuth" forceFrontend=true appendSession=false}{/link}]]></item>
<item name="wcf.acp.option.github_private_key"><![CDATA[GitHub Client Secret]]></item>
objectID INT(10) NOT NULL,
userID INT(10),
username VARCHAR(255) NOT NULL DEFAULT '',
- time INT(10) NOT NULL DEFAULT 0,
+ time INT(10) NOT NULL DEFAULT 0, -- time the version was created, displayed to the user
+ insertionTime INT(10) NOT NULL DEFAULT 0, -- time the version was inserted into the edit history, used for clean up
message MEDIUMTEXT,
editReason TEXT,