From: hickert Date: Fri, 5 Nov 2010 16:11:01 +0000 (+0000) Subject: Added new class which separately handles the registration dialogs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1089722c226d46b69bbb9c69d675a9e920b92a44;p=gosa.git Added new class which separately handles the registration dialogs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20197 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/generic/dashBoard/Register/class_RegisterGOsa.inc b/gosa-core/plugins/generic/dashBoard/Register/class_RegisterGOsa.inc index 735f3197b..c95f4a82d 100644 --- a/gosa-core/plugins/generic/dashBoard/Register/class_RegisterGOsa.inc +++ b/gosa-core/plugins/generic/dashBoard/Register/class_RegisterGOsa.inc @@ -1,87 +1,7 @@ config = $config; - $this->isRegistered = GOsaRegistration::isRegistered($this->config); - - foreach($this->attrs as $attr) $this->values[$attr] = ""; - - // Try to establish a rpc connection. - $this->rpcConfigured = FALSE; - if ($this->config->get_cfg_value("core","gosaRpcServer") != ""){ - $this->rpcConfigured = TRUE; - $this->rpcHandle = $this->config->getRpcHandle( - "http://10.3.64.59:4000", - "65717fe6-9e3e-11df-b010-5452005f1250", - "WyukwauWoid2", - TRUE); - } - } - - - function registerNow() - { - if($this->selectedRegistrationType == "registered"){ - print_a($this->rpcHandle->registerUser('cajus', $this->values)); - } - - $this->step = 200; // Awaiting verification - } - - - function execute() - { - // Registration request. - if(isset($_POST['registerNow'])){ - $msgs = $this->check(); - if(count($msgs)){ - msg_dialog::displayChecks($msgs); - }else{ - $this->registerNow(); - } - } - - - $smarty = get_smarty(); - $smarty->assign("default", $this->selectedRegistrationType); - $smarty->assign("step", $this->step); - - foreach($this->attrs as $attr) $smarty->assign($attr, set_post($this->values[$attr])); - - - return($smarty->fetch(get_template_path("Register/register.tpl", TRUE))); - } - - - function save_object() - { - if(isset($_POST['registrationType'])) $this->selectedRegistrationType = get_post('registrationType'); - if(isset($_POST['startRegistration'])) $this->step = 1; - if(isset($_POST['stepBack'])) $this->step -= 1; - - foreach($this->attrs as $attr){ - if(isset($_POST[$attr])) $this->values[$attr] = get_post($attr); - } - } - - - static function registerGOsa($config, $uuid, $type, $userData = array()) { echo "
Register GOsa."; diff --git a/gosa-core/plugins/generic/dashBoard/Register/class_RegistrationDialog.inc b/gosa-core/plugins/generic/dashBoard/Register/class_RegistrationDialog.inc new file mode 100644 index 000000000..86e9046c8 --- /dev/null +++ b/gosa-core/plugins/generic/dashBoard/Register/class_RegistrationDialog.inc @@ -0,0 +1,83 @@ +config = $config; + $this->isRegistered = GOsaRegistration::isRegistered($this->config); + + foreach($this->attrs as $attr) $this->values[$attr] = ""; + + // Try to establish a rpc connection. + $this->rpcConfigured = FALSE; + if ($this->config->get_cfg_value("core","gosaRpcServer") != ""){ + $this->rpcConfigured = TRUE; + $this->rpcHandle = $this->config->getRpcHandle( + "http://10.3.64.59:4000", + "65717fe6-9e3e-11df-b010-5452005f1250", + "WyukwauWoid2", + TRUE); + } + } + + + function registerNow() + { + if($this->selectedRegistrationType == "registered"){ + print_a($this->rpcHandle->registerUser('cajus', $this->values)); + } + + $this->step = 200; // Awaiting verification + } + + + function execute() + { + // Registration request. + if(isset($_POST['registerNow'])){ + $msgs = $this->check(); + if(count($msgs)){ + msg_dialog::displayChecks($msgs); + }else{ + $this->registerNow(); + } + } + + + $smarty = get_smarty(); + $smarty->assign("default", $this->selectedRegistrationType); + $smarty->assign("step", $this->step); + + foreach($this->attrs as $attr) $smarty->assign($attr, set_post($this->values[$attr])); + + + return($smarty->fetch(get_template_path("Register/register.tpl", TRUE))); + } + + + function save_object() + { + if(isset($_POST['registrationType'])) $this->selectedRegistrationType = get_post('registrationType'); + if(isset($_POST['startRegistration'])) $this->step = 1; + if(isset($_POST['stepBack'])) $this->step -= 1; + + foreach($this->attrs as $attr){ + if(isset($_POST[$attr])) $this->values[$attr] = get_post($attr); + } + } +} +?>