<?php

$dont_close_session=true;
$accessControl = array("Admin" => true);
require_once '../../AccessControl.php';

if($session->isAdmin() && isset($_GET['activateall'])) {
	# Activate All Profiles
	$db->Execute("UPDATE ".TBL_PROFILES." SET `activated` = 1");
	$res = $db->Affected_Rows();
	# reste the profile object in the session, if any
	if (isset($_SESSION['profilename']) || isset($_SESSION['profileobject'])) {
	 	unset($_SESSION['profilename']);
	 	unset($_SESSION['profileobject']);
	}
	echo json_encode(array("Status" => "Success", "Message" => "$res ". _X_PROFILES_UPDATED));
	exit();
}

echo json_encode(array("Status" => "Error", "Message" => _ACCESS_DENIED));

?>