(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
$data = new EntityData();
if (isset($_POST["add"])) {
    $data->check(-1, 'w', $_POST);
    if ($data->add($_POST)) {
        Event::log($_POST["entities_id"], "entity", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
    }
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if (isset($_POST["update"])) {
        $data->check($_POST["entities_id"], 'w');
        if ($data->update($_POST)) {
            Event::log($_POST["entities_id"], "entity", 4, "setup", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
        }
        glpi_header($_SERVER['HTTP_REFERER']);
    }
}
displayErrorAndDie("lost");