Code

Updated regsitration handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Nov 2010 06:29:01 +0000 (06:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Nov 2010 06:29:01 +0000 (06:29 +0000)
-Moved registration class to include
-Updated statistic and dashBoard plugin to use the correct class.

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

gosa-core/plugins/generic/dashBoard/class_dashBoard.inc
gosa-core/plugins/generic/statistics/class_statistics.inc

index b68367460bc179d6a4e8435bb6371ac8f95f3bd6..7a446679485504bceba08ef8c634866209c25da8 100644 (file)
@@ -25,13 +25,11 @@ class dashBoard extends plugin
 
         // Detect registration status 
         $this->RegistrationDialog = new RegistrationDialog($config);
-        $this->registered = GOsaRegistration::isRegistered($config);
     }
 
     function execute()
     {
-
-        if(!$this->registered){
+        if(!$this->config->registration->isRegistered()){
             return($this->RegistrationDialog->execute());
         }
 
index 1bf0a2229a090ec7c2603bef20845c7ecace1bc4..df1f8182e43f2580158ca58ebf6143664b234aa9 100644 (file)
@@ -33,11 +33,7 @@ class statistics extends plugin
         plugin::plugin($config, NULL);
 
         // Detect registration status first
-        $this->registered = 
-            GOsaRegistration::isRegistered($config) && 
-            GOsaRegistration::getRegistrationType($config) == "registered";
-
-        if($this->registered){
+        if(!$this->config->registration->isRegistered()){
             $this->graphs[] = new categoryActionsOverTime($config); 
             $this->graphs[] = new memoryUsageChart($config); 
             $this->graphs[] = new cpuLoadChart($config); 
@@ -141,7 +137,7 @@ class statistics extends plugin
         $smarty = get_smarty();
        
         // Check registration status, we need at least 'registered'. 
-        $smarty->assign("registered", $this->registered);
+        $smarty->assign("registered", $this->config->registration->isRegistered());
         if(!$this->registered){
     
             $plist = session::get('plist');
@@ -423,7 +419,7 @@ class statistics extends plugin
     function save_object()
     {
         // Nothing to do for not registered accounts.
-        if(!$this->registered) return;
+        if(!$this->config->registration->isRegistered()) return;
 
         plugin::save_object();
         if(isset($_POST['graph1DatePicker1'])) $this->graph1DatePicker1 = get_post('graph1DatePicker1');