Commit 63227a77 authored by Son Nguyen's avatar Son Nguyen
Browse files

Allow to delete google and local fonts Bug #1297510



Change-Id: Idc78d7393a1fbf7637a2767e839fba04d3bbc2ab
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 3fd420f9
...@@ -24,14 +24,15 @@ if (!get_config('skins')) { ...@@ -24,14 +24,15 @@ if (!get_config('skins')) {
throw new FeatureNotEnabledException(); throw new FeatureNotEnabledException();
} }
$font = param_alphanum('font'); $font = param_alphanumext('font');
$fontdata = null; $fontdata = null;
$fontdata = get_record('skin_fonts', 'name', $font); $fontdata = get_record('skin_fonts', 'name', $font);
if ($fontdata == false) { if ($fontdata == false) {
throw new AccessDeniedException("Font not found"); throw new AccessDeniedException("Font not found");
} }
if ($fontdata->fonttype != 'site') { // Admins can not delete 'common' fonts
if ($fontdata->fonttype == 'common') {
throw new AccessDeniedException("Cannot delete this font"); throw new AccessDeniedException("Cannot delete this font");
} }
......
Supports Markdown
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