Commit 1d4c4a6c authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski

Prevent tools from being executed from webserver

parent 1919764b
......@@ -29,6 +29,12 @@
* along with GLPI. If not, see <http://www.gnu.org/licenses/>.
* ---------------------------------------------------------------------
*/
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
define('PER_LEVEL', 8);
define('COUNT', 1024);
......
......@@ -34,6 +34,11 @@
*Purge history with some criteria
*/
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
ini_set("memory_limit", "-1");
ini_set("max_execution_time", "0");
......
......@@ -30,6 +30,11 @@
* ---------------------------------------------------------------------
*/
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
/**
* An utility script to convert old getSearchOptions array to new ones,
* see https://github.com/glpi-project/glpi/issues/1396
......
......@@ -30,6 +30,11 @@
* ---------------------------------------------------------------------
*/
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
include ('../inc/includes.php');
$DB->query("SET FOREIGN_KEY_CHECKS = '0';");
......
......@@ -30,6 +30,11 @@
* ---------------------------------------------------------------------
*/
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
// This script generate and populate a complete glpi DB
// A good way to test GLPI with a lot of data
......@@ -38,11 +43,6 @@ define('DO_NOT_CHECK_HTTP_REFERER', 1);
include (__DIR__ . '/../inc/includes.php');
include (__DIR__ . '/generate_bigdump.function.php');
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
if (in_array('--help', $_SERVER['argv'])) {
die("usage: ".$_SERVER['argv'][0]." [ --user=glpi ] [ --pass=glpi ]\n");
}
......
......@@ -30,6 +30,11 @@
* ---------------------------------------------------------------------
*/
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
if (isset($_SERVER['argc'])) {
for ($i=1; $i<$_SERVER['argc']; $i++) {
$it = explode("=", $_SERVER['argv'][$i], 2);
......
......@@ -30,6 +30,11 @@
* ---------------------------------------------------------------------
*/
if (PHP_SAPI != 'cli') {
echo "This script must be run from command line";
exit();
}
/**
* @since 0.85
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment