Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/joomla/joomla-cms into s…
Browse files Browse the repository at this point in the history
…taging
  • Loading branch information
brianteeman committed Aug 18, 2016
2 parents 14f5b1c + 4c539c4 commit 962b424
Show file tree
Hide file tree
Showing 100 changed files with 1,232 additions and 579 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#### Steps to reproduce the issue
### Steps to reproduce the issue



#### Expected result
### Expected result



#### Actual result
### Actual result



#### System information (as much as possible)
### System information (as much as possible)



#### Additional comments
### Additional comments

6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pull Request for Issue # .

#### Summary of Changes
### Summary of Changes

#### Testing Instructions
### Testing Instructions

#### Documentation Changes Required
### Documentation Changes Required
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--
-- Increasing size of the URL field in com_newsfeeds
--

ALTER TABLE `#__newsfeeds` MODIFY `link` VARCHAR(2048) NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--
-- Increasing size of the URL field in com_newsfeeds
--

ALTER TABLE "#__newsfeeds" ALTER COLUMN "link" TYPE character varying(2048);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--
-- Increasing size of the URL field in com_newsfeeds
--

ALTER TABLE [#__newsfeeds] ALTER COLUMN [link] [nvarchar](2048) NOT NULL;
2 changes: 1 addition & 1 deletion administrator/components/com_banners/banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

if (!JFactory::getUser()->authorise('core.manage', 'com_banners'))
{
throw new JControllerExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}

// Execute the task.
Expand Down
146 changes: 81 additions & 65 deletions administrator/components/com_banners/sql/install.mysql.utf8.sql
Original file line number Diff line number Diff line change
@@ -1,69 +1,85 @@
CREATE TABLE `#__banners` (
`id` INTEGER NOT NULL auto_increment,
`cid` INTEGER NOT NULL DEFAULT '0',
`type` INTEGER NOT NULL DEFAULT '0',
`name` VARCHAR(255) NOT NULL DEFAULT '',
`alias` VARCHAR(255) NOT NULL DEFAULT '',
`imptotal` INTEGER NOT NULL DEFAULT '0',
`impmade` INTEGER NOT NULL DEFAULT '0',
`clicks` INTEGER NOT NULL DEFAULT '0',
`clickurl` VARCHAR(200) NOT NULL DEFAULT '',
`state` TINYINT(3) NOT NULL DEFAULT '0',
`catid` INTEGER UNSIGNED NOT NULL DEFAULT 0,
`description` TEXT NOT NULL,
`custombannercode` VARCHAR(2048) NOT NULL,
`sticky` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
`ordering` INTEGER NOT NULL DEFAULT 0,
`metakey` TEXT NOT NULL,
`params` TEXT NOT NULL,
`own_prefix` TINYINT(1) NOT NULL DEFAULT '0',
`metakey_prefix` VARCHAR(255) NOT NULL DEFAULT '',
`purchase_type` TINYINT NOT NULL DEFAULT '-1',
`track_clicks` TINYINT NOT NULL DEFAULT '-1',
`track_impressions` TINYINT NOT NULL DEFAULT '-1',
`checked_out` INTEGER UNSIGNED NOT NULL DEFAULT '0',
`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`publish_up` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`publish_down` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`reset` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
--
-- Table structure for table `#__banners`
--

CREATE TABLE IF NOT EXISTS `#__banners` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cid` int(11) NOT NULL DEFAULT 0,
`type` int(11) NOT NULL DEFAULT 0,
`name` varchar(255) NOT NULL DEFAULT '',
`alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
`imptotal` int(11) NOT NULL DEFAULT 0,
`impmade` int(11) NOT NULL DEFAULT 0,
`clicks` int(11) NOT NULL DEFAULT 0,
`clickurl` varchar(200) NOT NULL DEFAULT '',
`state` tinyint(3) NOT NULL DEFAULT 0,
`catid` int(10) unsigned NOT NULL DEFAULT 0,
`description` text NOT NULL,
`custombannercode` varchar(2048) NOT NULL,
`sticky` tinyint(1) unsigned NOT NULL DEFAULT 0,
`ordering` int(11) NOT NULL DEFAULT 0,
`metakey` text NOT NULL,
`params` text NOT NULL,
`own_prefix` tinyint(1) NOT NULL DEFAULT 0,
`metakey_prefix` varchar(400) NOT NULL DEFAULT '',
`purchase_type` tinyint(4) NOT NULL DEFAULT -1,
`track_clicks` tinyint(4) NOT NULL DEFAULT -1,
`track_impressions` tinyint(4) NOT NULL DEFAULT -1,
`checked_out` int(10) unsigned NOT NULL DEFAULT 0,
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`reset` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`language` char(7) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
INDEX `idx_state` (`state`),
INDEX `idx_own_prefix` (`own_prefix`),
INDEX `idx_metakey_prefix` (`metakey_prefix`),
INDEX `idx_banner_catid`(`catid`),
INDEX `idx_language` (`language`)
) DEFAULT CHARSET=utf8;
`created_by` int(10) unsigned NOT NULL DEFAULT 0,
`created_by_alias` varchar(255) NOT NULL DEFAULT '',
`modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified_by` int(10) unsigned NOT NULL DEFAULT 0,
`version` int(10) unsigned NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
KEY `idx_state` (`state`),
KEY `idx_own_prefix` (`own_prefix`),
KEY `idx_metakey_prefix` (`metakey_prefix`(100)),
KEY `idx_banner_catid` (`catid`),
KEY `idx_language` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `#__banner_clients`
--

CREATE TABLE `#__banner_clients` (
`id` INTEGER NOT NULL auto_increment,
`name` VARCHAR(255) NOT NULL DEFAULT '',
`contact` VARCHAR(255) NOT NULL DEFAULT '',
`email` VARCHAR(255) NOT NULL DEFAULT '',
`extrainfo` TEXT NOT NULL,
`state` TINYINT(3) NOT NULL DEFAULT '0',
`checked_out` INTEGER UNSIGNED NOT NULL DEFAULT '0',
`checked_out_time` DATETIME NOT NULL default '0000-00-00 00:00:00',
`metakey` TEXT NOT NULL,
`own_prefix` TINYINT NOT NULL DEFAULT '0',
`metakey_prefix` VARCHAR(255) NOT NULL default '',
`purchase_type` TINYINT NOT NULL DEFAULT '-1',
`track_clicks` TINYINT NOT NULL DEFAULT '-1',
`track_impressions` TINYINT NOT NULL DEFAULT '-1',
PRIMARY KEY (`id`),
INDEX `idx_own_prefix` (`own_prefix`),
INDEX `idx_metakey_prefix` (`metakey_prefix`)
) DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__banner_clients` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`contact` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`extrainfo` text NOT NULL,
`state` tinyint(3) NOT NULL DEFAULT 0,
`checked_out` int(10) unsigned NOT NULL DEFAULT 0,
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`metakey` text NOT NULL,
`own_prefix` tinyint(4) NOT NULL DEFAULT 0,
`metakey_prefix` varchar(400) NOT NULL DEFAULT '',
`purchase_type` tinyint(4) NOT NULL DEFAULT -1,
`track_clicks` tinyint(4) NOT NULL DEFAULT -1,
`track_impressions` tinyint(4) NOT NULL DEFAULT -1,
PRIMARY KEY (`id`),
KEY `idx_own_prefix` (`own_prefix`),
KEY `idx_metakey_prefix` (`metakey_prefix`(100))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `#__banner_tracks` (
`track_date` DATETIME NOT NULL,
`track_type` INTEGER UNSIGNED NOT NULL,
`banner_id` INTEGER UNSIGNED NOT NULL,
`count` INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`track_date`, `track_type`, `banner_id`),
INDEX `idx_track_date` (`track_date`),
INDEX `idx_track_type` (`track_type`),
INDEX `idx_banner_id` (`banner_id`)
) DEFAULT CHARSET=utf8;
--
-- Table structure for table `#__banner_tracks`
--

CREATE TABLE IF NOT EXISTS `#__banner_tracks` (
`track_date` datetime NOT NULL,
`track_type` int(10) unsigned NOT NULL,
`banner_id` int(10) unsigned NOT NULL,
`count` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`track_date`,`track_type`,`banner_id`),
KEY `idx_track_date` (`track_date`),
KEY `idx_track_type` (`track_type`),
KEY `idx_banner_id` (`banner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
2 changes: 1 addition & 1 deletion administrator/components/com_cache/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if (!JFactory::getUser()->authorise('core.manage', 'com_cache'))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}

$controller = JControllerLegacy::getInstance('Cache');
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_categories/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

if (!JFactory::getUser()->authorise('core.manage', $component))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}

JLoader::register('JHtmlCategoriesAdministrator', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/html/categoriesadministrator.php');
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_checkin/checkin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if (!JFactory::getUser()->authorise('core.manage', 'com_checkin'))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}

$controller = JControllerLegacy::getInstance('Checkin');
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_contact/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@
type="radio"
label="JGLOBAL_FILTER_FIELD_LABEL"
description="JGLOBAL_FILTER_FIELD_DESC"
default="1"
default="0"
class="btn-group btn-group-yesno"
>
<option value="1">JSHOW</option>
Expand All @@ -671,7 +671,7 @@
type="radio"
label="JGLOBAL_DISPLAY_SELECT_LABEL"
description="JGLOBAL_DISPLAY_SELECT_DESC"
default="1"
default="0"
class="btn-group btn-group-yesno"
>
<option value="1">JSHOW</option>
Expand All @@ -695,7 +695,7 @@
type="radio"
label="COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_LABEL"
description="COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_DESC"
default="1"
default="0"
class="btn-group btn-group-yesno"
>
<option value="1">JSHOW</option>
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_contact/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

if (!JFactory::getUser()->authorise('core.manage', 'com_contact'))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}

$controller = JControllerLegacy::getInstance('contact');
Expand Down
24 changes: 16 additions & 8 deletions administrator/components/com_contact/controllers/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,29 @@ protected function allowAdd($data = array())
protected function allowEdit($data = array(), $key = 'id')
{
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$categoryId = 0;

if ($recordId)
// Since there is no asset tracking, fallback to the component permissions.
if (!$recordId)
{
$categoryId = (int) $this->getModel()->getItem($recordId)->catid;
return parent::allowEdit($data, $key);
}

if ($categoryId)
// Get the item.
$item = $this->getModel()->getItem($recordId);

// Since there is no item, return false.
if (empty($item))
{
// The category has been set. Check the category permissions.
return JFactory::getUser()->authorise('core.edit', $this->option . '.category.' . $categoryId);
return false;
}

// Since there is no asset tracking, revert to the component permissions.
return parent::allowEdit($data, $key);
$user = JFactory::getUser();

// Check if can edit own core.edit.own.
$canEditOwn = $user->authorise('core.edit.own', $this->option . '.category.' . (int) $item->catid) && $item->created_by == $user->id;

// Check the category core.edit permissions.
return $canEditOwn || $user->authorise('core.edit', $this->option . '.category.' . (int) $item->catid);
}

/**
Expand Down
Loading

0 comments on commit 962b424

Please sign in to comment.