Commit 666df549 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Revert "Enable 'No institution' users to use skins (Bug 1249123) if it is activated in config.php"

This reverts commit 35a6a62a.

Change-Id: I5902b77157fdb8df7c73dba27921c832c69b338b
parent e326ecec
......@@ -107,13 +107,6 @@ $siteoptionform = array(
'defaultvalue' => get_config('homepageinfo'),
'disabled' => in_array('homepageinfo', $OVERRIDDEN),
),
'skins' => array(
'type' => 'checkbox',
'title' => get_string('skins', 'admin'),
'description' => get_string('skinssitedescription', 'admin'),
'defaultvalue' => get_config('skins'),
'disabled' => in_array('skins', $OVERRIDDEN),
),
'registration_sendweeklyupdates' => array(
'type' => 'checkbox',
'title' => get_string('sendweeklyupdates', 'admin'),
......@@ -688,7 +681,7 @@ function siteoptions_fail(Pieform $form, $field) {
function siteoptions_submit(Pieform $form, $values) {
$fields = array(
'sitename','lang','theme', 'dropdownmenu', 'skins',
'sitename','lang','theme', 'dropdownmenu',
'defaultaccountlifetime', 'defaultregistrationexpirylifetime', 'defaultaccountinactiveexpire', 'defaultaccountinactivewarn',
'defaultaccountlifetimeupdate', 'allowpublicviews', 'allowpublicprofiles', 'generatesitemap',
'registration_sendweeklyupdates', 'institutionexpirynotification', 'institutionautosuspend',
......
......@@ -361,7 +361,6 @@ $string['siteoptionsset'] = 'Site options have been updated.';
$string['sitethemedescription'] = 'The default theme for the site. If your theme is not listed, check the error log.';
$string['skins'] = 'Page skins';
$string['skinsinstitutiondescription'] = 'Allow this institution\'s users to set "skins" on their pages.';
$string['skinssitedescription'] = 'Allow site\'s users to set "skins" on their pages.';
$string['smallviewheaders'] = 'Small page headers';
$string['smallviewheadersdescription'] = 'If checked, a small header and site navigation block will be displayed when viewing or editing portfolio pages created by users.';
$string['spamhaus'] = 'Enable Spamhaus URL blacklist';
......
......@@ -2090,7 +2090,7 @@ function admin_nav() {
);
// Add the menu items for skins, if that feature is enabled
if (can_use_skins()) {
if (get_config('skins')) {
$menu['configsite/siteskins'] = array(
'path' => 'configsite/siteskins',
'url' => 'admin/site/skins.php',
......@@ -3944,24 +3944,14 @@ function escape_css_string($string, $singlequote=true) {
* @return bool
*/
function can_use_skins($userid = null) {
global $USER;
if (!get_config('skins')) {
return false;
}
// Site admin can create site skins
if ($USER->get('admin')) {
return true;
}
// A user can belong to multiple institutions. If any of their institutions allow it, then
// let them use skins!
$results = get_config_user_institution('skins', $userid);
foreach ($results as $inst => $r) {
if (($inst == 'mahara') && get_config('skins')) {
return true;
}
foreach ($results as $r) {
if ($r) {
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment