Code

Updated registration class
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Nov 2010 07:28:34 +0000 (07:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Nov 2010 07:28:34 +0000 (07:28 +0000)
-Added additional functions, sever accessibility aso.

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

gosa-core/include/class_GOsaRegistration.inc

index 7609fe5eeab6d01e5ec98ab7f3020a8563d21544..cdb78ce2244927563c89ce58962db35f31d76579 100644 (file)
@@ -12,6 +12,8 @@ class GOsaRegistration
 
     function __construct(&$config)
     {
+        // Check if we're registrated 
+
         $this->config = $config;
     }    
 
@@ -41,12 +43,28 @@ class GOsaRegistration
             }
     }
 
+    function registrationNotWanted()
+    {
+        // Check if the registration process was postponed or completely(>=0) canceled (-1)
+        $date = $this->config->configRegistry->getPropertyValue('GOsaRegistration','askForRegistration');
+        return($date == -1);
+    }
+
     function registrationRequired()
     {
+        // If we are already registered, then do not ask for regsitration again
+        if(!empty($this->config->instancePassword)) 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.
         $date = $this->config->configRegistry->getPropertyValue('GOsaRegistration','askForRegistration');
         if($date == -1){
+
+            // We do not want to registrate
             return(FALSE);
         }else{
+
+            // Registration may be postponed.
             return($date < time());
         }
     }