From cbad1c97a3fbd7133e0eabd657b4dcaa6a32fa06 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 23 May 2005 06:07:09 +0000 Subject: [PATCH] Correct pngs for setupstatus git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@339 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/setup_checks.inc | 102 +++++++++++------- .../addons/ldapmanager/class_csvimport.inc | 2 - 2 files changed, 65 insertions(+), 39 deletions(-) diff --git a/include/setup_checks.inc b/include/setup_checks.inc index cc568dbc8..d67624763 100644 --- a/include/setup_checks.inc +++ b/include/setup_checks.inc @@ -10,9 +10,10 @@ function check_schema_version($description, $version) function view_schema_check($table) { $message=""; - foreach ($table as $key => $msg){ + foreach ($table as $key => $values){ + $msg = $values['msg']; $message.= ""; } else @@ -102,13 +103,16 @@ function schema_check($server, $admin, $password,$aff=0) /* Check if we are using the class that requires */ foreach($classes as $class){ if (!isset($objectclasses[$key])){ - $messages[$key]= sprintf(_("Optional objectclass '%s' required by plugin '%s' is not present in LDAP setup"), $key, $class); + $messages[$key]['msg']= sprintf(_("Optional objectclass '%s' required by plugin '%s' is not present in LDAP setup"), $key, $class); + $messages[$key]['status'] = FALSE; } else { if (!check_schema_version($objectclasses[$key], $value['version'])){ - $messages[$key]= sprintf(_("Optional objectclass '%s' required by plugin '%s' does not have version %s"), $key, $class, $value['version']); + $messages[$key]['msg']= sprintf(_("Optional objectclass '%s' required by plugin '%s' does not have version %s"), $key, $class, $value['version']); + $messages[$key]['status'] =FALSE; }else { if(!isset($affich2[$class])){ - $affich2[$class]= sprintf(_("Support for '%s' enabled"), $class).""; + $affich2[$class]['msg'] = sprintf(_("Support for '%s' enabled"), $class).""; + $affich2[$class]['status']= TRUE; } } } @@ -117,10 +121,12 @@ function schema_check($server, $admin, $password,$aff=0) } else { /* Required class */ if (!isset($objectclasses[$key])){ - $messages[$key]= sprintf(_("Required objectclass '%s' is not present in LDAP setup"), $key); - } else { + $messages[$key]['msg']= sprintf(_("Required objectclass '%s' is not present in LDAP setup"), $key); + $messages[$key]['status'] = FALSE; + } else { if (!check_schema_version($objectclasses[$key], $value['version'])){ - $messages[$key]= sprintf(_("Required objectclass '%s' does not have version %s"), $key, $value['version']); + $messages[$key]['msg']= sprintf(_("Required objectclass '%s' does not have version %s"), $key, $value['version']); + $messages[$key]['status'] = FALSE; } } } @@ -128,61 +134,83 @@ function schema_check($server, $admin, $password,$aff=0) /* Check for correct samba parameters */ if (!isset($objectclasses['sambaSamAccount'])){ - $messages['samba3']= _("SAMBA 3 support disabled, no schema seems to be installed"); - $affich['samba3']= $messages['samba3'].""; + $messages['samba3']['msg'] = _("SAMBA 3 support disabled, no schema seems to be installed"); + $affich['samba3']['msg'] = $messages['samba3']['msg'].""; + $messages['samba3']['status'] = FALSE; + $affich['samba3']['status'] = FALSE; }else{ - $affich['samba3']=_("SAMBA 3 support enabled").""; + $affich['samba3']['msg'] = _("SAMBA 3 support enabled").""; + $affich['samba3']['status'] = TRUE; } if (!isset($objectclasses['sambaAccount'])){ - $messages['samba2']= _("SAMBA 2 support disabled, no schema seems to be installed"); - $affich['samba2']=$messages['samba2'].""; + $messages['samba2']['msg'] = _("SAMBA 2 support disabled, no schema seems to be installed"); + $affich['samba2']['msg'] = $messages['samba2']['msg'].""; + $messages['samba2']['status'] = FALSE; + $affich['samba2']['status'] = FALSE; }else{ - $affich['samba2']=_("SAMBA 2 support enabled").""; + $affich['samba2']['msg'] = _("SAMBA 2 support enabled").""; + $affich['samba2']['status'] = TRUE; } /* Check pureftp/dns/ */ if (!isset($objectclasses['PureFTPdUser'])){ - $messages['pureftp']= _("Support for pureftp disabled, no schema seems to be installed"); - $affich['pureftp']= $messages['pureftp'].""; + $messages['pureftp']['msg'] = _("Support for pureftp disabled, no schema seems to be installed"); + $affich['pureftp']['msg'] = $messages['pureftp']['msg'].""; + $messages['pureftp']['status'] = FALSE; + $affich['pureftp']['status'] = FALSE; }else{ - $affich['pureftp']=_("Support for pureftp enabled").""; + $affich['pureftp']['msg'] = _("Support for pureftp enabled").""; + $affich['pureftp']['status'] = TRUE; } if (!isset($objectclasses['gosaWebdavAccount'])){ - $messages['webdav']= _("Support for WebDAV disabled, no schema seems to be installed"); - $affich['webdav']=$messages['webdav'].""; + $messages['webdav']['msg'] = _("Support for WebDAV disabled, no schema seems to be installed"); + $affich['webdav']['msg'] = $messages['webdav']['msg'].""; + $messages['webdav']['status'] = FALSE; + $affich['webdav']['status'] = FALSE; }else{ - $affich['webdav']=_("Support for WebDAV enabled").""; + $affich['webdav']['msg']=_("Support for WebDAV enabled").""; + $affich['webdav']['status'] = TRUE; } if (!isset($objectclasses['phpgwAccount'])){ - $messages['phpgroupware']= _("Support for phpgroupware disabled, no schema seems to be installed"); - $affich['phpgroupware']=$messages['phpgroupware'].""; + $messages['phpgroupware']['msg'] = _("Support for phpgroupware disabled, no schema seems to be installed"); + $affich['phpgroupware']['msg']=$messages['phpgroupware']['msg'].""; + $messages['phpgroupware']['status'] = FALSE; + $affich['phpgroupware']['status'] = FALSE; }else{ - $affich['phpgroupware']=_("Support for phpgroupware enabled").""; + $affich['phpgroupware']['msg'] = _("Support for phpgroupware enabled").""; + $affich['phpgroupware']['status'] = TRUE; } if (!isset($objectclasses['goFonAccount'])){ - $messages['phoneaccount']= _("Support for gofon disabled, no schema seems to be installed"); - $affich['phoneaccount']=$messages['phoneaccount'].""; + $messages['phoneaccount']['msg'] = _("Support for gofon disabled, no schema seems to be installed"); + $affich['phoneaccount']['msg'] = $messages['phoneaccount']['msg'].""; + $messages['phoneaccount']['status'] = FALSE; + $affich['phoneaccount']['status'] = FALSE; }else{ - $affich['phoneaccount']=_("Support for gofon enabled").""; + $affich['phoneaccount']['msg'] = _("Support for gofon enabled").""; + $affich['phoneaccount']['status'] = TRUE; } - if(($_SESSION['ldapconf']['mail_methods'][$_SESSION['ldapconf']['mail']] == "kolab")) - if(!isset($objectclasses['kolabInetOrgPerson'])) - { - $messages['kolab']= _("Support for Kolab disabled, no schema seems to be installed, setting mail-method to cyrus"); - $tmp = array_flip($_SESSION['ldapconf']['mail_methods']); - $_SESSION['ldapconf']['mail']=$tmp['cyrus']; - $affich['kolab']=$messages['kolab'].""; - }else{ - $affich['kolab']=_("Support for Kolab enabled").""; + if(($_SESSION['ldapconf']['mail_methods'][$_SESSION['ldapconf']['mail']] == "kolab")){ + if(!isset($objectclasses['kolabInetOrgPerson'])) + { + $messages['kolab']['msg'] = _("Support for Kolab disabled, no schema seems to be installed, setting mail-method to cyrus"); + $affich['kolab']['msg'] =$messages['kolab']['msg'].""; + + $tmp = array_flip($_SESSION['ldapconf']['mail_methods']); + $_SESSION['ldapconf']['mail'] =$tmp['cyrus']; + + $messages['kolab']['status'] = FALSE; + $affich['kolab']['status'] = FALSE; + }else{ + $affich['kolab']['msg'] =_("Support for Kolab enabled").""; + $affich['kolab']['status'] = TRUE; + } } - - if($aff==0)return ($messages); else return(array_merge($affich,$affich2)); diff --git a/plugins/addons/ldapmanager/class_csvimport.inc b/plugins/addons/ldapmanager/class_csvimport.inc index a2d4efe2c..8e81078b1 100644 --- a/plugins/addons/ldapmanager/class_csvimport.inc +++ b/plugins/addons/ldapmanager/class_csvimport.inc @@ -194,8 +194,6 @@ class csvimport extends plugin $password = $rand_str; } - print_a($this->usertab); - /* Insert in the LDAP tree */ if(count($this->usertab->check())) { show_errors($this->usertab->check()); -- 2.30.2
$msg"; - if(strstr($msg,"enabled")) { + if($values['status']) { $message.="true
".$value['file']." ".$value['file']."gosa+samba3.schemagosa+samba3.schemagosa+samba3.schemagosa+samba3.schemasamba.schemasamba.schemasamba.schemasamba.schemapureftpd.schemapureftpd.schemapureftpd.schemapureftpd.schemagosa+samba3.schemagosa+samba3.schemaphpgwaccount.schemaphpgwaccount.schemaphpgwaccount.schemaphpgwaccount.schemagofon.schemagofon.schemagofon.schemagofon.schemakolab2.schemagofon.schemakolab2.schemagofon.schema