本文整理汇总了PHP中permissionException函数的典型用法代码示例。如果您正苦于以下问题:PHP permissionException函数的具体用法?PHP permissionException怎么用?PHP permissionException使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了permissionException函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
*
* @param Gdn_Controller $Sender
* @throws Exception
*/
public function __construct($Sender = null)
{
if (property_exists($Sender, 'Conversation')) {
$this->Conversation = $Sender->Conversation;
}
// Allowed to use this module?
$this->AddUserAllowed = $Sender->ConversationModel->addUserAllowed($this->Conversation->ConversationID);
$this->Form = Gdn::factory('Form', 'AddPeople');
// If the form was posted back, check for people to add to the conversation
if ($this->Form->authenticatedPostBack()) {
// Defer exceptions until they try to use the form so we don't fill our logs
if (!$this->AddUserAllowed || !checkPermission('Conversations.Conversations.Add')) {
throw permissionException();
}
$NewRecipientUserIDs = array();
$NewRecipients = explode(',', $this->Form->getFormValue('AddPeople', ''));
$UserModel = Gdn::factory("UserModel");
foreach ($NewRecipients as $Name) {
if (trim($Name) != '') {
$User = $UserModel->getByUsername(trim($Name));
if (is_object($User)) {
$NewRecipientUserIDs[] = $User->UserID;
}
}
}
$Sender->ConversationModel->addUserToConversation($this->Conversation->ConversationID, $NewRecipientUserIDs);
$Sender->informMessage(t('Your changes were saved.'));
$Sender->RedirectUrl = url('/messages/' . $this->Conversation->ConversationID);
}
$this->_ApplicationFolder = $Sender->Application;
$this->_ThemeFolder = $Sender->Theme;
}
示例2: archives
/**
*
*
* @param $Category
* @param $Month
* @param bool $Page
* @throws Exception
* @throws Gdn_UserException
*/
public function archives($Category, $Month, $Page = false)
{
$Category = CategoryModel::categories($Category);
if (!$Category) {
throw notFoundException('Category');
}
if (!$Category['PermsDiscussionsView']) {
throw permissionException();
}
$Timestamp = strtotime($Month);
if (!$Timestamp) {
throw new Gdn_UserException("The archive month is not a valid date.");
}
$this->setData('Category', $Category);
// Round the month to the first day.
$From = gmdate('Y-m-01', $Timestamp);
$To = gmdate('Y-m-01', strtotime('+1 month', strtotime($From)));
// Grab the discussions.
list($Offset, $Limit) = offsetLimit($Page, c('Vanilla.Discussions.PerPage', 30));
$Where = array('CategoryID' => $Category['CategoryID'], 'Announce' => 'all', 'DateInserted >=' => $From, 'DateInserted <' => $To);
saveToConfig('Vanilla.Discussions.SortField', 'd.DateInserted', false);
$DiscussionModel = new DiscussionModel();
$DiscussionModel->setSort(Gdn::request()->get());
$DiscussionModel->setFilters(Gdn::request()->get());
$this->setData('Sort', $DiscussionModel->getSort());
$this->setData('Filters', $DiscussionModel->getFilters());
$Discussions = $DiscussionModel->getWhereRecent($Where, $Limit, $Offset);
$this->DiscussionData = $this->setData('Discussions', $Discussions);
$this->setData('_CurrentRecords', count($Discussions));
$this->setData('_Limit', $Limit);
$Canonical = '/categories/archives/' . rawurlencode($Category['UrlCode']) . '/' . gmdate('Y-m', $Timestamp);
$Page = PageNumber($Offset, $Limit, true, false);
$this->canonicalUrl(url($Canonical . ($Page ? '?page=' . $Page : ''), true));
PagerModule::Current()->configure($Offset, $Limit, false, $Canonical . '?page={Page}');
// PagerModule::Current()->Offset = $Offset;
// PagerModule::Current()->Url = '/categories/archives'.rawurlencode($Category['UrlCode']).'?page={Page}';
Gdn_Theme::section(val('CssClass', $Category));
Gdn_Theme::section('DiscussionList');
$this->title(htmlspecialchars(val('Name', $Category, '')));
$this->Description(sprintf(t("Archives for %s"), gmdate('F Y', strtotime($From))), true);
$this->addJsFile('discussions.js');
$this->Head->addTag('meta', array('name' => 'robots', 'content' => 'noindex'));
$this->ControllerName = 'DiscussionsController';
$this->CssClass = 'Discussions';
$this->render();
}
示例3: notSpam
public function notSpam($LogIDs)
{
$this->permission(array('Garden.Moderation.Manage', 'Moderation.Spam.Manage'), false);
if (!$this->Request->isPostBack()) {
throw permissionException('Javascript');
}
$Logs = array();
// Verify the appropriate users.
$UserIDs = $this->Form->getFormValue('UserID', array());
if (!is_array($UserIDs)) {
$UserIDs = array();
}
foreach ($UserIDs as $UserID) {
Gdn::userModel()->setField($UserID, 'Verified', true);
$Logs = array_merge($Logs, $this->LogModel->getWhere(array('Operation' => 'Spam', 'RecordUserID' => $UserID)));
}
// Grab the logs.
$Logs = array_merge($Logs, $this->LogModel->getIDs($LogIDs));
// try {
foreach ($Logs as $Log) {
$this->LogModel->restore($Log);
}
// } catch (Exception $Ex) {
// $this->Form->addError($Ex->getMessage());
// }
$this->LogModel->recalculate();
$this->setData('Complete');
$this->setData('Count', count($Logs));
$this->render('Blank', 'Utility');
}
示例4: emailImage
/**
* Form for adding an email image.
* Exposes the Garden.EmailTemplate.Image setting.
* Garden.EmailTemplate.Image must be an upload.
*
* Saves the image based on 2 config settings:
* Garden.EmailTemplate.ImageMaxWidth (default 400px) and
* Garden.EmailTemplate.ImageMaxHeight (default 300px)
*
* @throws Gdn_UserException
*/
public function emailImage()
{
if (!Gdn::session()->checkPermission('Garden.Community.Manage')) {
throw permissionException();
}
$this->addJsFile('email.js');
$this->addSideMenu('dashboard/settings/email');
$image = c('Garden.EmailTemplate.Image');
$this->Form = new Gdn_Form();
$validation = new Gdn_Validation();
$configurationModel = new Gdn_ConfigurationModel($validation);
// Set the model on the form.
$this->Form->setModel($configurationModel);
if ($this->Form->authenticatedPostBack() !== false) {
try {
$upload = new Gdn_UploadImage();
// Validate the upload
$tmpImage = $upload->validateUpload('EmailImage', false);
if ($tmpImage) {
// Generate the target image name
$targetImage = $upload->generateTargetName(PATH_UPLOADS);
$imageBaseName = pathinfo($targetImage, PATHINFO_BASENAME);
// Delete any previously uploaded images.
if ($image) {
$upload->delete($image);
}
// Save the uploaded image
$parts = $upload->saveImageAs($tmpImage, $imageBaseName, c('Garden.EmailTemplate.ImageMaxWidth', 400), c('Garden.EmailTemplate.ImageMaxHeight', 300));
$imageBaseName = $parts['SaveName'];
saveToConfig('Garden.EmailTemplate.Image', $imageBaseName);
$this->setData('EmailImage', Gdn_UploadImage::url($imageBaseName));
} else {
$this->Form->addError(t('There\'s been an error uploading the image. Your email logo can uploaded in one of the following filetypes: gif, jpg, png'));
}
} catch (Exception $ex) {
$this->Form->addError($ex);
}
}
$this->render();
}
示例5: verify
/**
*
*
* @param $UserID
* @param $Verified
* @throws Exception
*/
public function verify($UserID, $Verified)
{
$this->permission('Garden.Moderation.Manage');
if (!$this->Request->isAuthenticatedPostBack()) {
throw permissionException('Javascript');
}
// First, set the field value.
Gdn::userModel()->setField($UserID, 'Verified', $Verified);
$User = Gdn::userModel()->getID($UserID);
if (!$User) {
throw notFoundException('User');
}
// Send back the verified button.
require_once $this->fetchViewLocation('helper_functions', 'Profile', 'Dashboard');
$this->jsonTarget('.User-Verified', userVerified($User), 'ReplaceWith');
$this->render('Blank', 'Utility', 'Dashboard');
}
示例6: synchronize
/**
* Synchronizes the user based on a given UserKey.
*
* @param string $UserKey A string that uniquely identifies this user.
* @param array $Data Information to put in the user table.
* @return int The ID of the user.
*/
public function synchronize($UserKey, $Data)
{
$UserID = 0;
$Attributes = val('Attributes', $Data);
if (is_string($Attributes)) {
$Attributes = dbdecode($Attributes);
}
if (!is_array($Attributes)) {
$Attributes = [];
}
// If the user didnt log in, they won't have a UserID yet. That means they want a new
// account. So create one for them.
if (!isset($Data['UserID']) || $Data['UserID'] <= 0) {
// Prepare the user data.
$UserData = [];
$UserData['Name'] = $Data['Name'];
$UserData['Password'] = randomString(16);
$UserData['Email'] = val('Email', $Data, 'no@email.com');
$UserData['Gender'] = strtolower(substr(val('Gender', $Data, 'u'), 0, 1));
$UserData['HourOffset'] = val('HourOffset', $Data, 0);
$UserData['DateOfBirth'] = val('DateOfBirth', $Data, '');
$UserData['CountNotifications'] = 0;
$UserData['Attributes'] = $Attributes;
$UserData['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());
if ($UserData['DateOfBirth'] == '') {
$UserData['DateOfBirth'] = '1975-09-16';
}
// Make sure there isn't another user with this username.
if ($this->validateUniqueFields($UserData['Name'], $UserData['Email'])) {
if (!BanModel::checkUser($UserData, $this->Validation, true)) {
throw permissionException('Banned');
}
// Insert the new user.
$this->addInsertFields($UserData);
$UserID = $this->insertInternal($UserData);
}
if ($UserID > 0) {
$NewUserRoleIDs = $this->newUserRoleIDs();
// Save the roles.
$Roles = val('Roles', $Data, false);
if (empty($Roles)) {
$Roles = $NewUserRoleIDs;
}
$this->saveRoles($UserID, $Roles, false);
}
} else {
$UserID = $Data['UserID'];
}
// Synchronize the transientkey from the external user data source if it is present (eg. WordPress' wpnonce).
if (array_key_exists('TransientKey', $Attributes) && $Attributes['TransientKey'] != '' && $UserID > 0) {
$this->setTransientKey($UserID, $Attributes['TransientKey']);
}
return $UserID;
}
示例7: unauthorized
/**
* Display 'no permission' page.
*
* @since 2.0.0
* @access public
*/
public function unauthorized()
{
Gdn_Theme::section('Error');
if ($this->deliveryMethod() == DELIVERY_METHOD_XHTML) {
safeHeader("HTTP/1.0 401", true, 401);
$this->render();
} else {
$this->RenderException(permissionException());
}
}
示例8: refetchPageInfo
/**
* Re-fetch a discussion's content based on its foreign url.
* @param type $DiscussionID
*/
public function refetchPageInfo($DiscussionID)
{
// Make sure we are posting back.
if (!$this->Request->isAuthenticatedPostBack(true)) {
throw permissionException('Javascript');
}
// Grab the discussion.
$Discussion = $this->DiscussionModel->getID($DiscussionID);
if (!$Discussion) {
throw notFoundException('Discussion');
}
// Make sure the user has permission to edit this discussion.
$this->permission('Vanilla.Discussions.Edit', true, 'Category', $Discussion->PermissionCategoryID);
$ForeignUrl = valr('Attributes.ForeignUrl', $Discussion);
if (!$ForeignUrl) {
throw new Gdn_UserException(t("This discussion isn't associated with a url."));
}
$Stub = $this->DiscussionModel->fetchPageInfo($ForeignUrl, true);
// Save the stub.
$this->DiscussionModel->setField($DiscussionID, (array) $Stub);
// Send some of the stuff back.
if (isset($Stub['Name'])) {
$this->jsonTarget('.PageTitle h1', Gdn_Format::text($Stub['Name']));
}
if (isset($Stub['Body'])) {
$this->jsonTarget("#Discussion_{$DiscussionID} .Message", Gdn_Format::to($Stub['Body'], $Stub['Format']));
}
$this->informMessage('The page was successfully fetched.');
$this->render('Blank', 'Utility', 'Dashboard');
}
示例9: deletePicture
/**
* Delete a screenshot from an addon.
*
* @param string $AddonPictureID Picture id to remove.
* @throws Gdn_UserException No permission to delete this picture.
*/
public function deletePicture($AddonPictureID = '')
{
$AddonPictureModel = new Gdn_Model('AddonPicture');
$Picture = $AddonPictureModel->getWhere(array('AddonPictureID' => $AddonPictureID))->firstRow();
$AddonModel = new AddonModel();
$Addon = $AddonModel->getID($Picture->AddonID);
$Session = Gdn::session();
if ($Session->UserID != $Addon['InsertUserID'] && !$Session->checkPermission('Addons.Addon.Manage')) {
throw permissionException();
}
if ($this->Form->authenticatedPostBack() && $this->Form->getFormValue('Yes')) {
if ($Picture) {
$Upload = new Gdn_Upload();
$Upload->delete(changeBasename($Picture->File, 'ao%s'));
$Upload->delete(changeBasename($Picture->File, 'at%s'));
$AddonPictureModel->delete(array('AddonPictureID' => $AddonPictureID));
}
$this->RedirectUrl = url('/addon/' . $Picture->AddonID);
}
$this->render('deletepicture');
}
示例10: moderationController_mergeDiscussions_create
/**
* Add a method to the ModerationController to handle merging discussions.
*
* @param Gdn_Controller $Sender
*/
public function moderationController_mergeDiscussions_create($Sender)
{
$Session = Gdn::session();
$Sender->Form = new Gdn_Form();
$Sender->title(t('Merge Discussions'));
$DiscussionModel = new DiscussionModel();
$CheckedDiscussions = Gdn::userModel()->getAttribute($Session->User->UserID, 'CheckedDiscussions', array());
if (!is_array($CheckedDiscussions)) {
$CheckedDiscussions = array();
}
$DiscussionIDs = $CheckedDiscussions;
$Sender->setData('DiscussionIDs', $DiscussionIDs);
$CountCheckedDiscussions = count($DiscussionIDs);
$Sender->setData('CountCheckedDiscussions', $CountCheckedDiscussions);
$Discussions = $DiscussionModel->SQL->whereIn('DiscussionID', $DiscussionIDs)->get('Discussion')->resultArray();
$Sender->setData('Discussions', $Discussions);
// Make sure none of the selected discussions are ghost redirects.
$discussionTypes = array_column($Discussions, 'Type');
if (in_array('redirect', $discussionTypes)) {
throw Gdn_UserException('You cannot merge redirects.', 400);
}
// Perform the merge
if ($Sender->Form->authenticatedPostBack()) {
// Create a new discussion record
$MergeDiscussion = false;
$MergeDiscussionID = $Sender->Form->getFormValue('MergeDiscussionID');
foreach ($Discussions as $Discussion) {
if ($Discussion['DiscussionID'] == $MergeDiscussionID) {
$MergeDiscussion = $Discussion;
break;
}
}
$RedirectLink = $Sender->Form->getFormValue('RedirectLink');
if ($MergeDiscussion) {
$ErrorCount = 0;
// Verify that the user has permission to perform the merge.
$Category = CategoryModel::categories($MergeDiscussion['CategoryID']);
if ($Category && !$Category['PermsDiscussionsEdit']) {
throw permissionException('Vanilla.Discussions.Edit');
}
$DiscussionModel->defineSchema();
$MaxNameLength = val('Length', $DiscussionModel->Schema->getField('Name'));
// Assign the comments to the new discussion record
$DiscussionModel->SQL->update('Comment')->set('DiscussionID', $MergeDiscussionID)->whereIn('DiscussionID', $DiscussionIDs)->put();
$CommentModel = new CommentModel();
foreach ($Discussions as $Discussion) {
if ($Discussion['DiscussionID'] == $MergeDiscussionID) {
continue;
}
// Create a comment out of the discussion.
$Comment = arrayTranslate($Discussion, array('Body', 'Format', 'DateInserted', 'InsertUserID', 'InsertIPAddress', 'DateUpdated', 'UpdateUserID', 'UpdateIPAddress', 'Attributes', 'Spam', 'Likes', 'Abuse'));
$Comment['DiscussionID'] = $MergeDiscussionID;
$CommentModel->Validation->results(true);
$CommentID = $CommentModel->save($Comment);
if ($CommentID) {
// Move any attachments (FileUpload plugin awareness)
if (class_exists('MediaModel')) {
$MediaModel = new MediaModel();
$MediaModel->reassign($Discussion['DiscussionID'], 'discussion', $CommentID, 'comment');
}
if ($RedirectLink) {
// The discussion needs to be changed to a moved link.
$RedirectDiscussion = array('Name' => SliceString(sprintf(t('Merged: %s'), $Discussion['Name']), $MaxNameLength), 'Type' => 'redirect', 'Body' => formatString(t('This discussion has been <a href="{url,html}">merged</a>.'), array('url' => DiscussionUrl($MergeDiscussion))), 'Format' => 'Html');
$DiscussionModel->setField($Discussion['DiscussionID'], $RedirectDiscussion);
$CommentModel->updateCommentCount($Discussion['DiscussionID']);
$CommentModel->removePageCache($Discussion['DiscussionID']);
} else {
// Delete discussion that was merged.
$DiscussionModel->delete($Discussion['DiscussionID']);
}
} else {
$Sender->informMessage($CommentModel->Validation->resultsText());
$ErrorCount++;
}
}
// Update counts on all affected discussions.
$CommentModel->updateCommentCount($MergeDiscussionID);
$CommentModel->removePageCache($MergeDiscussionID);
// Clear selections
Gdn::userModel()->saveAttribute($Session->UserID, 'CheckedDiscussions', false);
ModerationController::informCheckedDiscussions($Sender);
if ($ErrorCount == 0) {
$Sender->jsonTarget('', '', 'Refresh');
}
}
}
$Sender->render('MergeDiscussions', '', 'plugins/SplitMerge');
}
示例11: emailTest
/**
* Form for sending a test email.
* On postback, sends a test email to the addresses specified in the form.
*
* @throws Exception
* @throws Gdn_UserException
*/
public function emailTest()
{
if (!Gdn::session()->checkPermission('Garden.Community.Manage')) {
throw permissionException();
}
$this->setHighlightRoute('dashboard/settings/email');
$this->Form = new Gdn_Form();
$validation = new Gdn_Validation();
$configurationModel = new Gdn_ConfigurationModel($validation);
$this->Form->setModel($configurationModel);
if ($this->Form->authenticatedPostBack() !== false) {
$addressList = $this->Form->getFormValue('EmailTestAddresses');
$addresses = explode(',', $addressList);
if (sizeof($addresses) > 10) {
$this->Form->addError(sprintf(t('Too many addresses! We\'ll send up to %s addresses at once.'), '10'));
} else {
$emailer = $this->getTestEmail();
$emailer->to($addresses);
$emailer->subject(sprintf(t('Test email from %s'), c('Garden.Title')));
try {
if ($emailer->send()) {
$this->informMessage(t("The email has been sent."));
} else {
$this->Form->addError(t('Error sending email. Please review the addresses and try again.'));
}
} catch (Exception $e) {
if (debug()) {
throw $e;
}
}
}
}
$this->render();
}
示例12: setHourOffset
/**
*
*
* @throws Exception
*/
public function setHourOffset()
{
$Form = new Gdn_Form();
if ($Form->authenticatedPostBack()) {
if (!Gdn::session()->isValid()) {
throw permissionException('Garden.SignIn.Allow');
}
$HourOffset = $Form->getFormValue('HourOffset');
Gdn::userModel()->setField(Gdn::session()->UserID, 'HourOffset', $HourOffset);
$this->setData('Result', true);
$this->setData('HourOffset', $HourOffset);
$time = time();
$this->setData('UTCDateTime', gmdate('r', $time));
$this->setData('UserDateTime', gmdate('r', $time + $HourOffset * 3600));
} else {
throw forbiddenException('GET');
}
$this->render('Blank');
}
示例13: getUserInfo
/**
* Retrieve the user to be manipulated. Defaults to current user.
*
* @since 2.0.0
* @access public
* @param mixed $User Unique identifier, possibly username or ID.
* @param string $Username .
* @param int $UserID Unique ID.
* @param bool $CheckPermissions Whether or not to check user permissions.
* @return bool Always true.
*/
public function getUserInfo($UserReference = '', $Username = '', $UserID = '', $CheckPermissions = false)
{
if ($this->_UserInfoRetrieved) {
return;
}
if (!c('Garden.Profile.Public') && !Gdn::session()->isValid()) {
throw permissionException();
}
// If a UserID was provided as a querystring parameter, use it over anything else:
if ($UserID) {
$UserReference = $UserID;
$Username = 'Unknown';
// Fill this with a value so the $UserReference is assumed to be an integer/userid.
}
$this->Roles = array();
if ($UserReference == '') {
if ($Username) {
$this->User = $this->UserModel->getByUsername($Username);
} else {
$this->User = $this->UserModel->getID(Gdn::session()->UserID);
}
} elseif (is_numeric($UserReference) && $Username != '') {
$this->User = $this->UserModel->getID($UserReference);
} else {
$this->User = $this->UserModel->getByUsername($UserReference);
}
$this->fireEvent('UserLoaded');
if ($this->User === false) {
throw notFoundException('User');
} elseif ($this->User->Deleted == 1) {
redirect('dashboard/home/deleted');
} else {
$this->RoleData = $this->UserModel->getRoles($this->User->UserID);
if ($this->RoleData !== false && $this->RoleData->numRows(DATASET_TYPE_ARRAY) > 0) {
$this->Roles = array_column($this->RoleData->resultArray(), 'Name');
}
// Hide personal info roles
if (!checkPermission('Garden.PersonalInfo.View')) {
$this->Roles = array_filter($this->Roles, 'RoleModel::FilterPersonalInfo');
}
$this->setData('Profile', $this->User);
$this->setData('UserRoles', $this->Roles);
if ($CssClass = val('_CssClass', $this->User)) {
$this->CssClass .= ' ' . $CssClass;
}
}
if ($CheckPermissions && Gdn::session()->UserID != $this->User->UserID) {
$this->permission(array('Garden.Users.Edit', 'Moderation.Profiles.Edit'), false);
}
$this->addSideMenu();
$this->_UserInfoRetrieved = true;
return true;
}
示例14: getNew
/**
*
*
* @param $ConversationID
* @param null $LastMessageID
* @throws Exception
*/
public function getNew($ConversationID, $LastMessageID = null)
{
$this->RecipientData = $this->ConversationModel->getRecipients($ConversationID);
$this->setData('Recipients', $this->RecipientData);
// Check permissions on the recipients.
$InConversation = false;
foreach ($this->RecipientData->result() as $Recipient) {
if ($Recipient->UserID == Gdn::session()->UserID) {
$InConversation = true;
break;
}
}
if (!$InConversation) {
// Conversation moderation must be enabled and they must have permission
if (!c('Conversations.Moderation.Allow', false)) {
throw permissionException();
}
$this->permission('Conversations.Moderation.Manage');
}
$this->Conversation = $this->ConversationModel->getID($ConversationID);
$this->setData('Conversation', $this->Conversation);
// Bad conversation? Redirect
if ($this->Conversation === false) {
throw notFoundException('Conversation');
}
$Where = array();
if ($LastMessageID) {
if (strpos($LastMessageID, '_') !== false) {
$LastMessageID = array_pop(explode('_', $LastMessageID));
}
$Where['MessageID >='] = $LastMessageID;
}
// Fetch message data
$this->setData('MessageData', $this->ConversationMessageModel->get($ConversationID, Gdn::session()->UserID, 0, 50, $Where), true);
$this->render('Messages');
}
示例15: editDiscussion
/**
* Edit a discussion (wrapper for PostController::Discussion).
*
* Will throw an error if both params are blank.
*
* @since 2.0.0
* @access public
*
* @param int $DiscussionID Unique ID of the discussion to edit.
* @param int $DraftID Unique ID of draft discussion to edit.
*/
public function editDiscussion($DiscussionID = '', $DraftID = '')
{
if ($DraftID != '') {
$this->Draft = $this->DraftModel->getID($DraftID);
$this->CategoryID = $this->Draft->CategoryID;
// Verify this is their draft
if (val('InsertUserID', $this->Draft) != Gdn::session()->UserID) {
throw permissionException();
}
} else {
$this->setData('Discussion', $this->DiscussionModel->getID($DiscussionID), true);
$this->CategoryID = $this->Discussion->CategoryID;
}
if (c('Garden.ForceInputFormatter')) {
$this->Form->removeFormValue('Format');
}
$this->setData('_CancelUrl', discussionUrl($this->data('Discussion')));
// Set view and render
$this->View = 'Discussion';
$this->discussion($this->CategoryID);
}