From 01564fbcab4f6c97bf23be735a6fdaf318787d0c Mon Sep 17 00:00:00 2001 From: marksouthard Date: Wed, 29 Jun 2016 16:21:33 -0400 Subject: [PATCH] Plugin is free to use --- CHANGELOG.md | 4 ++ LICENSE.md | 117 +++++++---------------------------- config/admin.php | 5 +- src/Admin.php | 9 +-- src/License.php | 43 ------------- templates/license-error.html | 13 ---- 6 files changed, 27 insertions(+), 164 deletions(-) delete mode 100644 src/License.php delete mode 100644 templates/license-error.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 76601e0..474e258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Baun Admin UI Plugin Changelog +## v1.2.0 - 29th June 2016 + +* [Changed] Admin plugin is now free to use and completely open source + ## v1.1.0 - 19th March 2015 * [New] Choose between a "Simple" and "Advanced" editor diff --git a/LICENSE.md b/LICENSE.md index 0ec4915..066221e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,96 +1,21 @@ -# Baun Plugin License - -End User License Agreement - -This End User License Agreement (the "Agreement") is a binding legal agreement between you and Dev7studios Ltd -(the "Author"). By installing or using the Baun Plugin (the "Software"), you agree to be bound by the terms of -this Agreement. If you do not agree to the Agreement, do not download, install, or use the Software. Installation -or use of the Software signifies that you have read, understood, and agreed to be bound by the Agreement. - -Revised on: 12 March, 2015 - -## Usage -This Agreement grants a non-exclusive, non-transferable license to install and use a single instance of the Software on -a specific Website. Additional Software licenses must be purchased in order to install and use the Software on additional -Websites. The Author reserves the right to determine whether use of the Software qualifies under this Agreement. The -Author owns all rights, title and interest to the Software (including all intellectual property rights) and reserves -all rights to the Software that are not expressly granted in this Agreement. - -## Backups -You may make copies of the Software in any machine readable form solely for back-up purposes, provided that you reproduce -the Software in its original form and with all proprietary notices on the back-up copy. All rights to the Software not -expressly granted herein are reserved by the Author. - -## Technical Support -Technical support is provided as described on http://bauncms.com. No representations or guarantees are made regarding the -response time in which support questions are answered. - -## Refund Policy -We offer a 30-day, money back refund policy. - -## Restrictions -You understand and agree that you shall only use the Software in a manner that complies with any and all applicable laws in -the jurisdictions in which you use the Software. Your use shall be in accordance with applicable restrictions concerning -privacy and intellectual property rights. - -You may not: -* Distribute derivative works based on the Software; -* Reproduce the Software except as described in this Agreement; -* Sell, assign, license, disclose, distribute, or otherwise transfer or make available the Software or its Source Code, in whole or in part, in any form to any third parties; -* Use the Software to provide services to others; -* Remove or alter any proprietary notices on the Software. - -## No Warranty -THE SOFTWARE IS OFFERED ON AN "AS-IS" BASIS AND NO WARRANTY, EITHER EXPRESSED OR IMPLIED, IS GIVEN. THE AUTHOR EXPRESSLY -DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. YOU ASSUME ALL RISK ASSOCIATED WITH THE QUALITY, -PERFORMANCE, INSTALLATION AND USE OF THE SOFTWARE INCLUDING, BUT NOT LIMITED TO, THE RISKS OF PROGRAM ERRORS, DAMAGE TO -EQUIPMENT, LOSS OF DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. YOU ARE SOLELY RESPONSIBLE -FOR DETERMINING THE APPROPRIATENESS OF USE THE SOFTWARE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE. - -## Term, Termination, and Modification. -You may use the Software under this Agreement until either party terminates this Agreement as set forth in this paragraph. -Either party may terminate the Agreement at any time, upon written notice to the other party. Upon termination, all licenses -granted to you will terminate, and you will immediately uninstall and cease all use of the Software. The Sections entitled -"No Warranty," "Indemnification," and "Limitation of Liability" will survive any termination of this Agreement. - -The Author may modify the Software and this Agreement with notice to you either in email or by publishing content on the -Software website, including but not limited to changing the functionality or appearance of the Software, and such modification -will become binding on you unless you terminate this Agreement. - -## Indemnification. -By accepting the Agreement, you agree to indemnify and otherwise hold harmless the Author, its officers, employers, agents, -subsidiaries, affiliates and other partners from any direct, indirect, incidental, special, consequential or exemplary damages -arising out of, relating to, or resulting from your use of the Software or any other matter relating to the Software. - -## Limitation of Liability. -YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE AUTHOR SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -CONSEQUENTIAL OR EXEMPLARY DAMAGES, INCLUDING BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS, GOODWILL, USE, DATA OR -OTHER INTANGIBLE LOSSES (EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES). SOME JURISDICTIONS -DO NOT ALLOW THE EXCLUSION OF THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES. ACCORDINGLY, -SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU. IN NO EVENT WILL THE AUTHOR'S TOTAL CUMULATIVE DAMAGES EXCEED THE FEES -YOU PAID TO THE AUTHOR UNDER THIS AGREEMENT IN THE MOST RECENT TWELVE-MONTH PERIOD. - -## Definitions - -### Definition of Website -A "Website" is defined as a single domain including sub-domains that operate as a single entity. What constitutes a single -entity shall be at the sole discretion of the Author. - -### Definition of Source Code -The "Source Code" is defined as the contents of all HTML, CSS and JavaScript files provided with the Software and includes -all related image files and database schemas. - -### Definition of an Update -An "Update" of the Software is defined as that which adds minor functionality enhancements or any bug fix to the current -version. This class of release is identified by the change of the revision to the right of the decimal point, i.e. X.1 to X.2 - -The assignment to the category of Update or Upgrade shall be at the sole discretion of the Author. - - -### Definition of an Upgrade -An "Upgrade" is a major release of the Software and is defined as that which incorporates major new features or enhancement -that increase the core functionality of the software. This class of release is identified by the change of the revision to -the left of the decimal point, i.e. 4.X to 5.X - -The assignment to the category of Update or Upgrade shall be at the sole discretion of the Author. \ No newline at end of file +The MIT License (MIT) + +Copyright (c) 2015 BaunCMS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/config/admin.php b/config/admin.php index 744020e..22f0096 100644 --- a/config/admin.php +++ b/config/admin.php @@ -2,9 +2,6 @@ return [ - // Enter your plugin license key here - 'license_key' => '', - // Choose which type of editor you would like: simple/advanced 'editor' => 'simple', @@ -13,4 +10,4 @@ ] -]; \ No newline at end of file +]; diff --git a/src/Admin.php b/src/Admin.php index e3cd46b..acd5bd1 100644 --- a/src/Admin.php +++ b/src/Admin.php @@ -9,10 +9,8 @@ class Admin extends Plugin { protected $session; protected $csrf; - protected $license_key; protected $users; - private $license; private $adminPages; private $adminPosts; @@ -23,11 +21,8 @@ public function init() $this->csrf = new EasyCSRF(new CustomCSRFSessionProvider($this->session)); - $this->license_key = $this->config->get('plugins-bauncms-baun-admin-admin.license_key'); $this->users = $this->config->get('plugins-bauncms-baun-admin-admin.users'); - $this->license = new License($this->license_key, $this->theme); - $this->adminPages = new Pages( $this->config, $this->session, @@ -80,8 +75,6 @@ public function setupRoutes() } }); $this->router->filter('auth', function(){ - $this->license->validate_license(); - if (!$this->session->get('logged_in')) { header('Location: ' . $this->config->get('app.base_url') . '/admin/login'); return false; @@ -193,4 +186,4 @@ protected function getGlobalTemplateData() ]; } -} \ No newline at end of file +} diff --git a/src/License.php b/src/License.php deleted file mode 100644 index 7a6b848..0000000 --- a/src/License.php +++ /dev/null @@ -1,43 +0,0 @@ -license_key = $license_key; - $this->theme = $themeProvider; - } - - public function validate_license() - { - if (!$this->license_key) { - $data['error'] = 'Missing license key in config/plugins/bauncms/baun-admin/admin.php'; - $this->theme->render('license-error', $data); - exit; - } - - $cache_file = BASE_PATH . 'cache/baun-admin-license.json'; - if (file_exists($cache_file) && (filemtime($cache_file) + 21600 >= time())) { - $response = file_get_contents($cache_file); - } else { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'http://license.bauncms.com/verify.php?license=' . $this->license_key); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($ch); - curl_close($ch); - } - - $data = json_decode($response); - if ($data->license != 'valid') { - $templateData['error'] = $data->message; - $this->theme->render('license-error', $templateData); - exit; - } else { - file_put_contents($cache_file, json_encode($data)); - } - } - -} \ No newline at end of file diff --git a/templates/license-error.html b/templates/license-error.html deleted file mode 100644 index abb371a..0000000 --- a/templates/license-error.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "admin-layout.html" %} - -{% block title %}Login - {% endblock %} - -{% block content %} -
-

Valid License Required

-

Before you can start using this plugin, you need to have a valid license.

- {% if error %} - - {% endif %} -
-{% endblock %} \ No newline at end of file