summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2e51351)
raw | patch | inline | side by side (parent: 2e51351)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 May 2010 14:09:07 +0000 (14:09 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 25 May 2010 14:09:07 +0000 (14:09 +0000) |
-Keep results and prepared plugin deactivation
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18694 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18694 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_configRegistry.inc | patch | blob | history | |
gosa-core/plugins/personal/generic/class_user.inc | patch | blob | history |
diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc
index d64d82872403452da0e4ab53659d982d24d8abd9..1a2d7b733f522a99d533df5f80068f5387d71f08 100644 (file)
public $detectedSchemaIssues = array();
public $schemaCheckFailed = FALSE;
public $schemaCheckFinished = FALSE;
+ public $pluginsDeactivated = array();
function __construct($config)
{
$this->detectedSchemaIssues['missing'] = array();
$this->detectedSchemaIssues['versionMismatch'] = array();
+ // Clear last results
+ $this->pluginsDeactivated = array();
+
// Read objectClasses from ldap
if(!count($this->objectClasses)){
$ldap = $this->config->get_ldap_link();
$this->pluginRequirements = array('ldapSchema' => array());
$this->categoryToClass = array();
foreach($this->classesWithInfo as $cname => $defs){
- if(isset($defs['plRequirements']['ldapSchema'])){
- $this->pluginRequirements['ldapSchema'][$cname] = $defs['plRequirements']['ldapSchema'];
+ if(isset($defs['plRequirements'])){
+ $this->pluginRequirements[$cname] = $defs['plRequirements'];
}
}
// Check schema requirements now $missing = $invalid = array();
- foreach($this->pluginRequirements['ldapSchema'] as $cname => $requirements){
- foreach($requirements as $oc => $version){
- if(1 || !$this->ocAvailable($oc)){
- $this->detectedSchemaIssues['missing'][] = $oc;
- $this->schemaCheckFailed = TRUE;
- }elseif(!empty($version)){
- $currentVersion = $this->getObjectClassVersion($oc);
- if(!empty($currentVersion) && !$this->ocVersionMatch($version, $currentVersion)){
- if($currentVersion == -1){
- $currentVersion = _("unknown");
- }
- $this->detectedSchemaIssues['versionMismatch'] =
- sprintf(_("%s has version %s but %s required!"), bold($oc),bold($currentVersion),bold($version));
+ foreach($this->pluginRequirements as $cname => $requirements){
+
+ // Check LDAP schema requirements for this plugins
+ $failure = FALSE;
+ if(isset($requirements['ldapSchema'])){
+ foreach($requirements['ldapSchema'] as $oc => $version){
+ if(!$this->ocAvailable($oc)){
+ $this->detectedSchemaIssues['missing'][] = $oc;
$this->schemaCheckFailed = TRUE;
+ $failure = TRUE;
+ }elseif(!empty($version)){
+ $currentVersion = $this->getObjectClassVersion($oc);
+ if(!empty($currentVersion) && !$this->ocVersionMatch($version, $currentVersion)){
+ if($currentVersion == -1){
+ $currentVersion = _("unknown");
+ }
+ $this->detectedSchemaIssues['versionMismatch'] =
+ sprintf(_("%s has version %s but %s required!"), bold($oc),bold($currentVersion),bold($version));
+ $this->schemaCheckFailed = TRUE;
+ $failure = TRUE;
+ }
}
}
}
+
+ // Display corresponding plugins now
+ if($disableIncompatiblePlugins && $failure && isset($requirements['onFailureDisablePlugin'])){
+ foreach($requirements['onFailureDisablePlugin'] as $name){
+ $this->pluginsDeactivated[] = $name;
+ }
+ }
}
$this->schemaCheckFinished =TRUE;
return(!$this->schemaCheckFailed);
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index 94e3ed23a0c52144fb78450c0effeb1e9c833e5f..cc86338b105b57f8e9f0d685543b659830066c50 100644 (file)
'ldapSchema' => array(
'gosaAccount' => '>=2.7',
'gosaUserTemplate' => '>=2.7'
- )
+ ),
+ 'onFailureDisablePlugin' => array('userManagement')
),
"plProperties" => array(