summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 762020f)
raw | patch | inline | side by side (parent: 762020f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Nov 2010 15:30:08 +0000 (15:30 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Nov 2010 15:30:08 +0000 (15:30 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20184 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/generic/dashBoard/Register/class_RegisterGOsa.inc | [new file with mode: 0644] | patch | blob |
gosa-core/plugins/generic/dashBoard/Register/register.tpl | [new file with mode: 0644] | patch | blob |
gosa-core/plugins/generic/dashBoard/class_dashBoard.inc | patch | blob | history |
diff --git a/gosa-core/plugins/generic/dashBoard/Register/class_RegisterGOsa.inc b/gosa-core/plugins/generic/dashBoard/Register/class_RegisterGOsa.inc
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+
+
+
+/* Missing functions, validate registration
+ *
+ */
+
+class GOsaRegistration extends plugin
+{
+
+ protected $isRegistered = FALSE;
+
+ function __construct(&$config)
+ {
+ $this->config = $config;
+ $this->isRegistered = GOsaRegistration::isRegistered($this->config);
+ }
+
+
+
+ function execute()
+ {
+ $smarty = get_smarty();
+
+ return($smarty->fetch(get_template_path("Register/register.tpl", TRUE)));
+ }
+
+
+ static function registerGOsa($config, $uuid, $type, $userData = array())
+ {
+
+ echo "<br>Register GOsa.";
+ print_a(func_get_args());
+
+ }
+
+
+ static function isRegistered($config, $uuid = NULL)
+ {
+ $status = $config->configRegistry->getPropertyValue('GOsaRegistration','registerStatus');
+ if(!$uuid){
+ $uuid = $config->configRegistry->getPropertyValue('GOsaRegistration','registeredUUID');
+ }
+
+ // Not yet registered
+ if(!$status) return(FALSE);
+
+ // Registered, but backend status not confirmed.
+ echo "<br>Validate registration";
+ }
+
+
+ public static function getRegisterStatusValues()
+ {
+ $ret= array();
+ $ret[''] = _("not registered");
+ $ret['anonymous'] = _("anonym");
+ $ret['registered'] = _("registered");
+ return($ret);
+ }
+
+
+ public static function checkRegisteredUUID($message,$class,$name,$value, $type)
+ {
+ // Add check here later
+ $valid = TRUE;
+
+ // Display the reason for failing this check.
+ if($message && !$valid){
+ msg_dialog::display(_("Warning"),
+ sprintf(_("The given registration UUID '%s' specified for '%s:%s' is invalid!"),
+ bold($value),bold($class),bold($name)),
+ WARNING_DIALOG);
+ }
+
+ return($valid);
+ }
+
+
+ static function plInfo()
+ {
+ return (array(
+ "plProperties" => array(
+ array(
+ "name" => "registerStatus",
+ "type" => "switch",
+ "default" => "",
+ "defaults" => "GOsaRegistration::getRegisterStatusValues",
+ "description" => _("The GOsa registration status."),
+ "check" => "",
+ "migrate" => "",
+ "group" => "registerGOsa",
+ "mandatory" => FALSE),
+ array(
+ "name" => "registeredUUID",
+ "type" => "string",
+ "default" => "",
+ "description" => _("The UUID of the current GOsa installation. This UUID is used to identify the installation, once you've registered GOsa."),
+ "check" => "GOsaRegistration::checkRegisteredUUID",
+ "migrate" => "",
+ "group" => "registerGOsa",
+ "mandatory" => FALSE)
+ )));
+ }
+}
+?>
diff --git a/gosa-core/plugins/generic/dashBoard/Register/register.tpl b/gosa-core/plugins/generic/dashBoard/Register/register.tpl
--- /dev/null
@@ -0,0 +1 @@
+asdf
diff --git a/gosa-core/plugins/generic/dashBoard/class_dashBoard.inc b/gosa-core/plugins/generic/dashBoard/class_dashBoard.inc
index 76fd74ee5b63c20ad26808dc8ed9ed30bac7b97e..89fd2fc6d7964d1e87d758ed3ded35f10fae85ae 100644 (file)
$this->dbChannelStatus = new dbChannelStatus($config);
$this->dbNotifications = new dbNotifications($config);
$this->dbInformation = new dbInformation($config);
+
+
+ // Detect registration status
+ $this->GOsaRegistration = new GOsaRegistration($config);
+ $this->registered = GOsaRegistration::isRegistered($config);
}
function execute()
{
+
+ if(!$this->registered){
+ return($this->GOsaRegistration->execute());
+ }
+
$smarty = get_smarty();
$smarty->assign('dbPluginStatus', $this->dbPluginStatus->execute());
$smarty->assign('dbChannelStatus', $this->dbChannelStatus->execute());