<?php 
require("common_begin.php");

$lst = Listopia::getInstance();
$result = array();

if ($lst->isLoggedIn() && $lst->isAdminUser())
{
  $listID   = $_POST['id'];
  $opMod    = $_POST['op'];

  $data = array(
    'list_sealed' => ((int)$opMod)
  );

  $okA = $lst->Database()->update('t_lists', $data, 't_lists.list_id = '.((int)$listID));

  if (isset($okA))
  {
    $result['success'] = true;
  }
    
  $result['result'] = $okA;        
}
else
{
  $result['result'] = "FACK OFF";
}

echo json_encode($result);

require("common_end.php");

