summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 340bba6)
raw | patch | inline | side by side (parent: 340bba6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Nov 2010 07:27:55 +0000 (07:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Nov 2010 07:27:55 +0000 (07:27 +0000) |
-
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20212 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20212 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/generic/dashBoard/Register/class_RegistrationDialog.inc b/gosa-core/plugins/generic/dashBoard/Register/class_RegistrationDialog.inc
index be319f2f10a7e7ffcf19785feeeb6f073cfe9313..c8d0ff71f99abf27f8645e537de307e5a7ca311f 100644 (file)
$smarty = get_smarty();
$smarty->assign("error", "");
+ // Tell GOsa not to ask for a regsitration again.
+ if(isset($_POST['registerComplete'])){
+ if($this->selectedRegistrationType == "dontWant"){
+ $prop = $this->config->configRegistry->getProperty('GOsaRegistration','askForRegistration');
+ $prop->setValue(-1);
+ $prop->save();
+ }
+ }
+
// Registration page one filled in, next step requested.
if(isset($_POST['registerPage1'])){
$msgs = $this->check();
}
}else{
$this->step = 2;
+ $prop = $this->config->configRegistry->getProperty('GOsaRegistration','askForRegistration');
+ $prop->setValue(0);
+ $prop->save();
}
}
}
if(isset($_POST['startRegistration'])) $this->step = 1;
if(isset($_POST['registerComplete'])){
$this->finished = TRUE;
-
- // Tell GOsa not to ask for a regsitration again.
- if($this->selectedRegistrationType == "dontWant"){
- $prop = $this->config->configRegistry->getProperty('GOsaRegistration','askForRegistration');
- $prop->setValue(-1);
- $prop->save();
- }
}
if(isset($_POST['stepBack'])) $this->step -= 1;
}
diff --git a/gosa-core/plugins/generic/dashBoard/class_dashBoard.inc b/gosa-core/plugins/generic/dashBoard/class_dashBoard.inc
index acec1156bbf68c35bb86d40b4cac5701ad5c8319..0289b8bca479cc729a071f54998f16ac8781c130 100644 (file)
{
plugin::plugin($config, NULL);
- // Instantiate child classes
- $this->dbPluginStatus = new dbPluginStatus($config);
- $this->dbChannelStatus = new dbChannelStatus($config);
- $this->dbNotifications = new dbNotifications($config);
- $this->dbInformation = new dbInformation($config);
-
// Check if we've access to the registration server
if($this->config->registration->registrationRequired() && $config->registration->isServerAccessible()){
if(!$config->registration->isInstanceRegistered()){
$this->dialog = new RegistrationDialog($config);
}
}
+
+ $this->initialized = FALSE;
+ }
+
+ function init()
+ {
+ // Instantiate child classes
+ if($this->config->registration->isInstanceRegistered()){
+ $this->dbPluginStatus = new dbPluginStatus($config);
+ $this->dbChannelStatus = new dbChannelStatus($config);
+ $this->dbNotifications = new dbNotifications($config);
+ $this->dbInformation = new dbInformation($config);
+ $this->initialized = TRUE;
+ }
}
function execute()
{
+ // The wants to registrate his instance of GOsa now!
+ if(isset($_POST['registerNow']) && $this->config->registration->isServerAccessible()){
+ $this->dialog = new RegistrationDialog($this->config);
+ }
+
// Seems that we haven't registered our GOsa instance yet.
// Ask the user to do so, now.
if($this->dialog instanceOf RegistrationDialog){
}
}
+ $this->init();
+
$smarty = get_smarty();
- $smarty->assign('dbPluginStatus', $this->dbPluginStatus->execute());
- $smarty->assign('dbChannelStatus', $this->dbChannelStatus->execute());
- $smarty->assign('dbNotifications', $this->dbNotifications->execute());
- $smarty->assign('dbInformation', $this->dbInformation->execute());
+ $smarty->assign('instanceRegistered', $this->config->registration->isInstanceRegistered());
+ $smarty->assign('registrationServerAvailable', $this->config->registration->isServerAccessible());
+
+ if($this->initialized){
+ $smarty->assign('dbPluginStatus', $this->dbPluginStatus->execute());
+ $smarty->assign('dbChannelStatus', $this->dbChannelStatus->execute());
+ $smarty->assign('dbNotifications', $this->dbNotifications->execute());
+ $smarty->assign('dbInformation', $this->dbInformation->execute());
+ }
return($smarty->fetch(get_template_path('dashBoard.tpl', TRUE)));
}
function check()
{
$messages = plugin::check();
- $messages = array_merge($this->dbPluginStatus->check());
- $messages = array_merge($this->dbChannelStatus->check());
- $messages = array_merge($this->dbNotifications->check());
- $messages = array_merge($this->dbInformation->check());
+
+ if($this->initialized){
+ $messages = array_merge($this->dbPluginStatus->check());
+ $messages = array_merge($this->dbChannelStatus->check());
+ $messages = array_merge($this->dbNotifications->check());
+ $messages = array_merge($this->dbInformation->check());
+ }
return($messages);
}
if($this->dialog instanceOf RegistrationDialog){
$this->dialog->save_object();
- }else{
-
+ }
+ if($this->initialized){
$this->dbPluginStatus->save_object();
$this->dbChannelStatus->save_object();
$this->dbNotifications->save_object();
function save()
{
plugin::save();
- $this->dbPluginStatus->save();
- $this->dbChannelStatus->save();
- $this->dbNotifications->save();
- $this->dbInformation->save();
+ if($this->initialized){
+ $this->dbPluginStatus->save();
+ $this->dbChannelStatus->save();
+ $this->dbNotifications->save();
+ $this->dbInformation->save();
+ }
}
function remove_from_parent()
{
plugin::remove_from_parent();
- $this->dbPluginStatus->remove_from_parent();
- $this->dbChannelStatus->remove_from_parent();
- $this->dbNotifications->remove_from_parent();
- $this->dbInformation->remove_from_parent();
+ if($this->initialized){
+ $this->dbPluginStatus->remove_from_parent();
+ $this->dbChannelStatus->remove_from_parent();
+ $this->dbNotifications->remove_from_parent();
+ $this->dbInformation->remove_from_parent();
+ }
}
}
diff --git a/gosa-core/plugins/generic/dashBoard/dashBoard.tpl b/gosa-core/plugins/generic/dashBoard/dashBoard.tpl
index 018f19f94d0e01fe21ca57a9d70aba43f4abd510..972f316798fce93acb38410ed94431ddb2889047 100644 (file)
-
-<table style='width:100%' summary="{t}GOsa dash board{/t}">
- <tr>
- <td style='width:50%; padding-right:5px;' class='right-border'>
-
- <!-- Channel -->
-
- {$dbChannelStatus}
-
- <!--Chanel END -->
-
- </td>
- <td>
-
- <!-- Plugins Status -->
-
- {$dbPluginStatus}
-
- <!-- Plugins Status END -->
-
- </td>
- </tr>
- <tr><td colspan="2"><hr></td></tr>
- <tr>
- <td style='width:50%; padding-right:5px;' class='right-border'>
-
- <!-- Messages -->
-
- {$dbNotifications}
-
- <!-- Messages END -->
-
- </td>
- <td>
-
- <!-- RSS Feeds -->
-
- {$dbInformation}
-
- <!-- RSS Feeds END -->
-
- </td>
- </tr>
-</table>
+{if !$instanceRegistered}
+ <h3>{t}This feature is only accessible for registrated instances of GOsa{/t}</h3>
+
+ {if $registrationServerAvailable}
+ <button name="registerNow">{t}Registrate{/t}</button>
+ {else}
+ {t}Unfortunately the registration server cannot be reached, maybe the server is down for maintaince or you've no internet access!{/t}
+ {/if}
+{else}
+ <table style='width:100%' summary="{t}GOsa dash board{/t}">
+ <tr>
+ <td style='width:50%; padding-right:5px;' class='right-border'>
+
+ <!-- Channel -->
+
+ {$dbChannelStatus}
+
+ <!--Chanel END -->
+
+ </td>
+ <td>
+
+ <!-- Plugins Status -->
+
+ {$dbPluginStatus}
+
+ <!-- Plugins Status END -->
+
+ </td>
+ </tr>
+ <tr><td colspan="2"><hr></td></tr>
+ <tr>
+ <td style='width:50%; padding-right:5px;' class='right-border'>
+
+ <!-- Messages -->
+
+ {$dbNotifications}
+
+ <!-- Messages END -->
+
+ </td>
+ <td>
+
+ <!-- RSS Feeds -->
+
+ {$dbInformation}
+
+ <!-- RSS Feeds END -->
+
+ </td>
+ </tr>
+ </table>
+{/if}