diff --git a/modules/core/hooks/hook_sanitycheck.php b/modules/core/hooks/hook_sanitycheck.php
index c2e8e6fb713b67fc210883f321a77367b34f3c45..9055801561f9d85550158a44969f707d58daf7e0 100644
--- a/modules/core/hooks/hook_sanitycheck.php
+++ b/modules/core/hooks/hook_sanitycheck.php
@@ -31,5 +31,22 @@ function core_hook_sanitycheck(&$hookinfo) {
 		$hookinfo['errors'][] = '[core] You are running PHP version ' . phpversion() . '. SimpleSAMLphp requires version >= 5.1.2, and reccomends version >= 5.2. Please upgrade!';
 	}
 	
+	$info = array();
+	$mihookinfo = array(
+		'info' => &$info,
+	);
+	$availmodules = SimpleSAML_Module::getModules();
+	SimpleSAML_Module::callHooks('moduleinfo', $mihookinfo);
+	foreach($info AS $mi => $i) {
+		if (isset($i['dependencies']) && is_array($i['dependencies'])) {
+			foreach ($i['dependencies'] AS $dep) {
+				// $hookinfo['info'][] = '[core] Module ' . $mi . ' requires ' . $dep;
+				if (!in_array($dep, $availmodules)) {
+					$hookinfo['errors'][] = '[core] Module dependency not met: ' . $mi . ' requires ' . $dep;
+				}
+			}
+		}
+	}
+	
 }
 ?>
\ No newline at end of file
diff --git a/modules/modinfo/hooks/hook_moduleinfo.php b/modules/modinfo/hooks/hook_moduleinfo.php
new file mode 100644
index 0000000000000000000000000000000000000000..3518f70121101fc6fc62bd0edcb4c99086cc452a
--- /dev/null
+++ b/modules/modinfo/hooks/hook_moduleinfo.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * This hook lets the module describe itself.
+ *
+ * @param array &$moduleinfo  The links on the frontpage, split into sections.
+ */
+function modinfo_hook_moduleinfo(&$moduleinfo) {
+	assert('is_array($moduleinfo)');
+	assert('array_key_exists("info", $moduleinfo)');
+	
+
+	$moduleinfo['info']['modinfo'] = array(
+		'name' => array('en' => 'Module information'),
+		'description' => array('en' => 'This module lists all available modules, and tells whether they are enabled or not.'),
+		
+		'dependencies' => array('core'),
+		'uses' => array('sanitycheck'),
+	);
+
+}
+?>
\ No newline at end of file
diff --git a/modules/modinfo/www/index.php b/modules/modinfo/www/index.php
index 1de275fd76efa1df971edd529be604e588d1e0c9..74897f025f654b710bb8558bd987ad13a8e1c942 100644
--- a/modules/modinfo/www/index.php
+++ b/modules/modinfo/www/index.php
@@ -8,7 +8,7 @@ $modinfo = array();
 foreach($modules as $m) {
 	$modinfo[$m] = array(
 		'enabled' => SimpleSAML_Module::isModuleEnabled($m),
-		);
+	);
 }
 
 $config = SimpleSAML_Configuration::getInstance();
diff --git a/modules/sanitycheck/hooks/hook_moduleinfo.php b/modules/sanitycheck/hooks/hook_moduleinfo.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff9642df56a95be0f4b374d57c54d88a7842dd80
--- /dev/null
+++ b/modules/sanitycheck/hooks/hook_moduleinfo.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * This hook lets the module describe itself.
+ *
+ * @param array &$moduleinfo  The links on the frontpage, split into sections.
+ */
+function sanitycheck_hook_moduleinfo(&$moduleinfo) {
+	assert('is_array($moduleinfo)');
+	assert('array_key_exists("info", $moduleinfo)');
+
+	$moduleinfo['info']['sanitycheck'] = array(
+		'name' => array('en' => 'Sanity check'),
+		'description' => array('en' => 'This module adds functionality for other modules to provide santity checks.'),
+		
+		'dependencies' => array('core'),
+		'uses' => array('cron'),
+	);
+
+}
+?>
\ No newline at end of file
diff --git a/modules/sanitycheck/hooks/hook_sanitycheck.php b/modules/sanitycheck/hooks/hook_sanitycheck.php
index d551692a8ea8c41fb264186c86f02149f9b7ebae..045b7f4f4918c015f6545efca55c806712e702b8 100644
--- a/modules/sanitycheck/hooks/hook_sanitycheck.php
+++ b/modules/sanitycheck/hooks/hook_sanitycheck.php
@@ -9,11 +9,7 @@ function sanitycheck_hook_sanitycheck(&$hookinfo) {
 	assert('array_key_exists("errors", $hookinfo)');
 	assert('array_key_exists("info", $hookinfo)');
 
-
-
 	$hookinfo['info'][] = '[sanitycheck] At least the sanity check it self is working :)';	
-
-	
 	
 }
 ?>
\ No newline at end of file