Exemplo n.º 1
0
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
require_once 'geograph/gridimage.class.php';
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/map.class.php';
require_once 'geograph/mapmosaic.class.php';
require_once 'geograph/image.inc.php';
if ($_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] && strpos($_SERVER['HTTP_X_FORWARDED_FOR'], $CONF['server_ip']) !== 0) {
    init_session();
    $USER->hasPerm("mapmod") || $USER->mustHavePerm("admin");
}
$smarty = new GeographPage();
if (isset($_GET['deleteInvalidateAll']) && $USER->hasPerm('admin')) {
    $mosaic = new GeographMapMosaic();
    $mosaic->deleteAndInvalidateAll();
    //redirect to prevent page refreshes of this url
    header("Location:http://{$_SERVER['HTTP_HOST']}/admin/recreatemaps.php");
    exit;
}
if (isset($_GET['invalidateAll']) && $USER->hasPerm('admin')) {
    $mosaic = new GeographMapMosaic();
    $mosaic->invalidateAll();
    //redirect to prevent page refreshes of this url
    header("Location:http://{$_SERVER['HTTP_HOST']}/admin/recreatemaps.php");
    exit;
}
if (isset($_GET['expireAll']) && $USER->hasPerm('admin')) {
    $mosaic = new GeographMapMosaic();
    $mosaic->expireAll($_GET['expireAll'] ? true : false);
    $smarty->clear_cache(null, 'mapbrowse');