diff --git a/apps/user_ldap/tests/.htaccess b/apps/user_ldap/tests/.htaccess
new file mode 100755
index 0000000000000000000000000000000000000000..5e068d28661f9395b476a41b3d026733464007fa
--- /dev/null
+++ b/apps/user_ldap/tests/.htaccess
@@ -0,0 +1,14 @@
+# Generated by ownCloud on 2015-06-18 14:16:40
+# line below if for Apache 2.4
+<ifModule mod_authz_core.c>
+Require all denied
+</ifModule>
+
+# line below if for Apache 2.2
+<ifModule !mod_authz_core.c>
+deny from all
+Satisfy All
+</ifModule>
+
+# section for Apache 2.2 and 2.4
+IndexIgnore *
diff --git a/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroups.php b/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroups.php
index 60166dec26ac3115210336c73030f877f103cb5c..68854de55716b84982505e5407541a6ee4ecaae1 100644
--- a/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroups.php
+++ b/apps/user_ldap/tests/integration/setup-scripts/createExplicitGroups.php
@@ -1,5 +1,10 @@
 <?php
 
+if(php_sapi_name() !== 'cli') {
+	print('Only via CLI, please.');
+	exit(1);
+}
+
 include __DIR__ . '/config.php';
 
 $cr = ldap_connect($host, $port);
diff --git a/apps/user_ldap/tests/integration/setup-scripts/createExplicitUsers.php b/apps/user_ldap/tests/integration/setup-scripts/createExplicitUsers.php
index 957c25236fd2aba10d10785ccc56410222a1ac2f..ac21d48fd16d6c7f4506151156935b91e65a181b 100644
--- a/apps/user_ldap/tests/integration/setup-scripts/createExplicitUsers.php
+++ b/apps/user_ldap/tests/integration/setup-scripts/createExplicitUsers.php
@@ -1,5 +1,10 @@
 <?php
 
+if(php_sapi_name() !== 'cli') {
+	print('Only via CLI, please.');
+	exit(1);
+}
+
 include __DIR__ . '/config.php';
 
 $cr = ldap_connect($host, $port);