summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e84e39a)
raw | patch | inline | side by side (parent: e84e39a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Nov 2010 16:10:13 +0000 (16:10 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Nov 2010 16:10:13 +0000 (16:10 +0000) |
-Updated server accessibility detection
-Updated registration handling
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20208 594d385d-05f5-0310-b6e9-bd551577e9d8
-Updated registration handling
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20208 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 81ea9ae6aeb875f8a844f07070d65eb48782b30b..fd87e6bd825570de015012db373c2577846ee510 100644 (file)
protected $values = array();
public $attrs = array('username','password');
+ protected $finished = FALSE;
+
+ function finished()
+ {
+ return($this->finished);
+ }
+
function __construct(&$config)
{
$this->config = $config;
$smarty->assign("error", "");
// Registration page one filled in, next step requested.
- if(isset($_POST['registerPage2'])){
+ if(isset($_POST['registerPage1'])){
$msgs = $this->check();
if(count($msgs)){
msg_dialog::displayChecks($msgs);
if($this->selectedRegistrationType == "registered"){
- // Try to login with the given username / password
- $rpcHandle = $this->config->getRpcHandle(
- "http://10.3.64.59:4000",
- $this->values['username'],
- $this->values['password'],
- TRUE, FALSE);
-
- // Register instance
+ // Try to registrate the instance with the given username and password.
+ $rpcHandle = $this->config->registration->getConnection($this->values['username'],$this->values['password']);
$rpcHandle->registerInstance($this->config->getInstanceUuid());
-
- // Check if we're able to connect.
if(!$rpcHandle->success()){
-
$code = $rpcHandle->getHTTPstatusCode();
if($code == 0){
$smarty->assign("error", _("Communciation with the backend failed! Please check your internet connection!"));
}elseif($code == 403){
$smarty->assign("error", _("Internal server error, please try again later. If the problem persists contact the GOsa-Team!"));
}
+ }else{
+ $this->step = 2;
}
}
}
}
if(isset($_POST['registrationType'])) $this->selectedRegistrationType = get_post('registrationType');
- if(isset($_POST['startRegistration'])) $this->step = 1;
+
+ // Registration type selected and next page choosen.
+ if(isset($_POST['startRegistration'])){
+ if($this->selectedRegistrationType == "none"){
+ $this->step = 100;
+ }else{
+ $this->step = 1;
+ }
+ }
+ if(isset($_POST['registerComplete'])) $this->finished = TRUE;
if(isset($_POST['stepBack'])) $this->step -= 1;
}
}
diff --git a/gosa-core/plugins/generic/dashBoard/Register/register.tpl b/gosa-core/plugins/generic/dashBoard/Register/register.tpl
index 24a6813f7a43053142abd4c779c27bc65990f982..c4c532963016be776bddbd7b7d4e1af01d4b457a 100644 (file)
{/if}
-{if $step == 1 || $step == -1}
+{if $step == 1}
<table>
<tr>
<td><LABEL for="username">{t}Login{/t}</LABEL></td>
<hr>
<div class="plugin-actions">
<button name='stepBack'>{msgPool type=backButton}</button>
- <button name='registerPage2'>{msgPool type=okButton}</button>
+ <button name='registerPage1'>{msgPool type=okButton}</button>
</div>
{/if}
+{if $step == 2}
+ <h3>{t}Registration complete{/t}</h3>
+ <p>
+ {t}GOsa instance sucessfully registered{/t}
+ </p>
+ <hr>
+ <div class="plugin-actions">
+ <button name='registerComplete'>{msgPool type=okButton}</button>
+ </div>
+{/if}
+{if $step == 100}
+ <h3>{t}Registration complete{/t}</h3>
+ <p>
+ {t}GOsa instance will not be registered{/t}
+ </p>
+ <hr>
+ <div class="plugin-actions">
+ <button name='registerComplete'>{msgPool type=okButton}</button>
+ </div>
+{/if}
diff --git a/gosa-core/plugins/generic/dashBoard/class_dashBoard.inc b/gosa-core/plugins/generic/dashBoard/class_dashBoard.inc
index b0e8e7f4630d887a5537fd451b8e7bae0c948f5e..8d1e791a1d0797149822bcdf60796a1ee0934548 100644 (file)
$this->dbNotifications = new dbNotifications($config);
$this->dbInformation = new dbInformation($config);
-
- // Detect registration status
- $this->RegistrationDialog = new RegistrationDialog($config);
+ // Check if we've access to the registration server
+ if($config->registration->isServerAccessible()){
+ if(!$config->registration->isInstanceRegistered()){
+ $this->dialog = new RegistrationDialog($config);
+ }
+ }
}
function execute()
{
- if(!$this->config->registration->isRegistered()){
- return($this->RegistrationDialog->execute());
+ // Seems that we haven't registered our GOsa instance yet.
+ // Ask the user to do so, now.
+ if($this->dialog instanceOf RegistrationDialog){
+ $this->dialog->save_object();
+
+ // Check if the registration is complete/canceled
+ if(!$this->dialog->finished()){
+ return($this->dialog->execute());
+ }else{
+ $this->dialog = NULL;
+ }
}
$smarty = get_smarty();
function save_object()
{
plugin::save_object();
-
- if(!$this->config->registration->isRegistered()) $this->RegistrationDialog->save_object();
+
+ if($this->dialog instanceOf RegistrationDialog){
+ $this->dialog->save_object();
+ }else{
- $this->dbPluginStatus->save_object();
- $this->dbChannelStatus->save_object();
- $this->dbNotifications->save_object();
- $this->dbInformation->save_object();
+ $this->dbPluginStatus->save_object();
+ $this->dbChannelStatus->save_object();
+ $this->dbNotifications->save_object();
+ $this->dbInformation->save_object();
+ }
}
function save()