Code

Updated registration
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Nov 2010 09:15:56 +0000 (09:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Nov 2010 09:15:56 +0000 (09:15 +0000)
-Updated check: isRegistered

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20215 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_GOsaRegistration.inc

index cdb78ce2244927563c89ce58962db35f31d76579..26acccbb1cee3f7f38ecaaf1378d4e84d5d366dc 100644 (file)
@@ -52,8 +52,7 @@ class GOsaRegistration
 
     function registrationRequired()
     {
-        // If we are already registered, then do not ask for regsitration again
-        if(!empty($this->config->instancePassword)) return(FALSE);
+        if($this->isInstanceRegistered) return(FALSE);
 
         // Seems that we haven't received an instancePassword yet, this can has two reasons:
         // 1. Not registered yet or registration postponed     2. We do not want to registrate our instance.
@@ -70,6 +69,19 @@ class GOsaRegistration
     }
 
     function isInstanceRegistered()
+    {
+        if($this->isServerAccessible()){
+
+            // First check if the server is accessible and if the instance is registered.
+            return($this->isInstanceRegisteredWithServer());
+        }else{
+
+            // Server is down, now check if we've an instancePassword set in our gosa.conf.             
+            return(!empty($this->config->instancePassword));
+        }
+    }
+
+    function isInstanceRegisteredWithServer()
     {
         if($this->isRegistered === NULL){
             $con = $this->getConnection();