$additional_style = smart_addslashes($_POST['additional_style']); } if (isset($_FILES['style_file']) && is_uploaded_file($_FILES['style_file']['tmp_name'])) { $fp = fopen($_FILES['style_file']['tmp_name'], 'r'); $style = addslashes(fread($fp, $_FILES['style_file']['size'])); fclose($fp); unlink($_FILES['style_file']['tmp_name']); } else { $style = smart_addslashes($_POST['style']); } if ($template_id > 0) { $template = $cms->get_template_by_name($GO_SECURITY->user_id, $name); if ($template && $template['id'] != $template_id) { $feedback = '<p class="Error">' . $fbNameExists . '</p>'; } else { if (!$cms->update_template($template_id, $name, $style, $additional_style, $restrict_editor)) { $feedback = '<p class="Error">' . $strSaveError . '</p>'; } else { $template = $cms->get_template($template_id); } } } else { if ($cms->get_template_by_name($GO_SECURITY->user_id, $name)) { $feedback = '<p class="Error">' . $fbNameExists . '</p>'; } else { if (!($acl_read = $GO_SECURITY->get_new_acl('cms template read: ' . $name))) { die($strAclError); } if (!($acl_write = $GO_SECURITY->get_new_acl('cms template write: ' . $name))) { $GO_SECURITY->delete_acl($acl_read); die($strAclError);