summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b2588f1)
raw | patch | inline | side by side (parent: b2588f1)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Oct 2010 08:59:25 +0000 (08:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Oct 2010 08:59:25 +0000 (08:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20090 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc
index 43a93b36d33600955870bd952f7f9fa519c990c2..9fc2272b07f48d6321af139a415b7119f8456f51 100644 (file)
public $installMirrorDNList = array();
public $installKernelPackage = "";
- public $installKernelPackageList = array('kernel1','kk1');
+ public $installKernelPackageList = array();
public $installKeyboardlayout = "";
- public $installKeyboardlayoutList = array("104","105");
+ public $installKeyboardlayoutList = array();
public $installSystemLocale = "";
- public $installSystemLocaleList = array('de','en_EN.UTF-8');
+ public $installSystemLocaleList = array();
public $installTimezone = "";
public $installTimeUTC = "";
// Start without error.
$this->initFailed = FALSE;
-
// Prepare list of timezones
$this->timezones = $this->getTimezones();
}
// Load list of bootstrap methods.
- if(!$this->loadInstallationMethods()){
+ $res = $this->loadInstallationMethods();
+ if($res == NULL){
$this->initFailed = TRUE;
msg_dialog(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
return;
}
-
+ $this->installBootstrapMethodList = $res['installBootstrapMethodList'];
+ $this->installConfigManagementList = $res['installConfigManagementList'];
+
+ // Load system locales
+ $locales = $this->getSystemLocales();
+ if($locales == NULL){
+ $this->initFailed = TRUE;
+ msg_dialog(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
+ return;
+ }
+ $this->installSystemLocaleList = $locales;
+
+ // Load installation templates
+ $res = $this->loadInstallationTemplates();
+ if($res == NULL){
+ $this->initFailed = TRUE;
+ msg_dialog(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
+ return;
+ }
+ $this->installTemplateDNList = $res;
+
+
+ // Load installation keyboard layouts
+ $res = $this->loadInstallationKeyboardLayouts();
+ if($res == NULL){
+ $this->initFailed = TRUE;
+ msg_dialog(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
+ return;
+ }
+ $this->installKeyboardlayoutList = $res;
+
+
+ // Load kernel package list
+ $res = $this->loadInstallationKernelPackages();
+ if($res == NULL){
+ $this->initFailed = TRUE;
+ msg_dialog(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
+ return;
+ }
+ $this->installKernelPackageList = $res;
+
- $this->installTemplateDNList = array(
- 'dc=intranet,dc=gonicus,dc=de' => 'Intranet-Tpl',
- 'ou=systems,dc=intranet,dc=gonicus,dc=de' => 'System-Tpl');
+ // Load installation mirrors
+ $res = $this->loadInstallationMirrors();
+ if($res == NULL){
+ $this->initFailed = TRUE;
+ msg_dialog(_("Error"), msgPool::rpcError($this->rpcErrorMessage), ERROR_DIALOG);
+ return;
+ }
+ $this->installMirrorDNList = $res;
- $this->installMirrorDNList = array(
- 'dc=intranet,dc=gonicus,dc=de' => 'Intranet',
- 'ou=systems,dc=intranet,dc=gonicus,dc=de' => 'System');
// Preset some values for new accounts
if(!$this->is_account){
$this->installConfigManagement = key($this->installConfigManagementList[$this->installBootstrapMethod]);
}
+
// Check if we've a valid bootstrap and configMangement method selected
if(!isset($this->installConfigManagementList[$this->installBootstrapMethod])){
$newMethod = key($this->installBootstrapMethodList);
uksort($list, 'strnatcasecmp');
return($list);
}
-
+
+
+ function loadInstallationKernelPackages()
+ {
+ return(array('kernel1','kk1'));
+ }
+
+
+ function loadInstallationMirrors()
+ {
+ $res = array(
+ 'dc=intranet,dc=gonicus,dc=de' => 'Intranet',
+ 'ou=systems,dc=intranet,dc=gonicus,dc=de' => 'System');
+ return($res);
+ }
+
+ function loadInstallationTemplates()
+ {
+ $res = array(
+ 'dc=intranet,dc=gonicus,dc=de' => 'Intranet-Tpl',
+ 'ou=systems,dc=intranet,dc=gonicus,dc=de' => 'System-Tpl');
+ return($res);
+ }
+
+ function loadInstallationKeyboardLayouts()
+ {
+ return(array('104','105'));
+ }
+
+ function getSystemLocales()
+ {
+ $locales = json_decode('{"hu_HU.UTF-8": "Hungarian",
+ "es_DO.UTF-8": "Spanish (Dominican Republic)",
+ "es_CL.UTF-8": "Spanish (Chile)"}');
+
+ return($locales);
+ }
+
/*! \brief Try to load install and bootstrap methods from the GOsa-backend
* This is done via jsonRPC, if calling the backend method fails,
*/
function loadInstallationMethods()
{
- $this->installBootstrapMethodList = array();
- $this->installConfigManagementList = array();
$rpc = $this->config->getRpcHandle();
$res = $rpc->getSupportedBaseInstallMethods();
$this->rpcError = !$rpc->success();
if(!$rpc->success()){
$this->rpcErrorMessage = $rpc->get_error();
- return(FALSE);
+ return(NULL);
}
// Walk through result and set bootstrap methods.
foreach($res as $name => $method){
- $this->installBootstrapMethodList[$name] = $method['name'];
+ $res['installBootstrapMethodList'][$name] = $method['name'];
foreach($method['methods'] as $m){
- $this->installConfigManagementList[$name][$m] = $m;
+ $res['installConfigManagementList'][$name][$m] = $m;
}
}
- return(TRUE);
+ return($res);
}