index c11a7dbbfcfb596362cf685c938e12dd31b3db00..17b860c58386189fc00acba33f58227ca1acbe9d 100644 (file)
var $filename = "";
var $last_modified = 0;
+ private $jsonRPChandle = NULL;
+
public $configRegistry = NULL;
/*! \brief Class constructor of the config class
$this->data['PATHMENU']= array(); ;
break;
+ case 'SHORTCUTMENU':
+ $this->data['SHORTCUTMENU']= array(); ;
+ break;
+
/* Inser plugins */
case 'PLUGIN':
if ($this->tags[$this->level-3] == 'MENU' &&
if ($this->tags[$this->level-2] == 'PATHMENU'){
$this->data['PATHMENU'][$this->gpc++]= $attrs;
}
+ if ($this->tags[$this->level-2] == 'SHORTCUTMENU'){
+ $this->data['SHORTCUTMENU'][$this->gpc++]= $attrs;
+ }
if ($this->tags[$this->level-2] == 'SERVICEMENU'){
$this->data['SERVICE'][$attrs['CLASS']]= $attrs;
}
}
+ function getRpcHandle()
+ {
+ // Create jsonRPC handle on demand.
+ if(!$this->jsonRPChandle){
+ $this->jsonRPChandle = new jsonRPC($this);
+ }
+ return($this->jsonRPChandle);
+ }
+
+
/*! \brief Get a LDAP link object
*
* This function can be used to get an ldap object, which in turn can
}
if (!session::global_is_set('size_limit')){
- session::global_set('size_limit',$this->current['LDAPSIZELIMIT']);
- session::global_set('size_ignore',$this->current['LDAPSIZEIGNORE']);
+ session::global_set('size_limit', $this->get_cfg_value('core', 'ldapSizelimit'));
+ session::global_set('size_ignore', $this->boolValueIsTrue('core', 'ldapSizeIgnore'));
}
}
*/
function getShareList($listboxEntry = false)
{
- $tmp = get_sub_list("(&(objectClass=goShareServer)(goExportEntry=*))","server",get_ou("serverRDN"),
+ $tmp = get_sub_list("(&(objectClass=goShareServer)(goExportEntry=*))","server",get_ou("servgeneric", "serverRDN"),
$this->current['BASE'],array("goExportEntry","cn"), GL_NONE);
$return =array();
foreach($tmp as $entry){
$ui = get_userinfo();
$base = $config->current['BASE'];
$res= get_sub_list("(&(objectClass=goShareServer)(goExportEntry=*))", "server",
- get_ou("serverRDN"), $base,array("goExportEntry","cn"),GL_NONE | GL_NO_ACL_CHECK);
+ get_ou("servgeneric", "serverRDN"), $base,array("goExportEntry","cn"),GL_NONE | GL_NO_ACL_CHECK);
foreach($res as $entry){
}
- /*! Search for a configuration setting in different categories
+ /*! Outdated - try to use pluginEnabled, boolValueIsTrue or get_cfg_value instead.
+ *
+ * (Search for a configuration setting in different categories
*
* Searches for the value of a given key in the configuration data.
* Optionally the list of categories to search (tabs, main, locations) can
* \code
* $postcmd = $this->config->search(get_class($this), "POSTCOMMAND", array("menu", "tabs"));
* \endcode
+ * )
*
* */
function search($class, $value, $categories= "")
return ("");
}
+
+ /*! \brief Check whether a plugin is activated or not
+ */
+ function pluginEnabled($class){
+ $tmp = $this->search($class, "CLASS",array('menu','tabs'));
+ return(!empty($tmp));
+ }
+
/*! \brief Get a configuration value from the config
*
*
*
*/
- function get_cfg_value($class,$name, $default= "")
+ function get_cfg_value($class,$name, $default= NULL)
{
+ // The default parameter is deprecated
+ if($default != NULL){
+# trigger_error("Third parameter 'default' is deprecated for function 'get_cfg_value'!");
+ }
+ // Return the matching property value if it exists.
if($this->configRegistry->propertyExists($class,$name)){
return($this->configRegistry->getPropertyValue($class,$name));
}
- syslog(1, $name);
-
- $name= strtoupper($name);
-
- /* Check if we have a current value for $name */
- if (isset($this->current[$name])){
- return ($this->current[$name]);
- }
-
- /* Check if we have a global value for $name */
- if (isset($this->data["MAIN"][$name])){
- return ($this->data["MAIN"][$name]);
+ // Show a warning in the syslog if there is an undefined property requested.
+ if($this->configRegistry->propertyInitializationComplete() &&
+ "{$class}::{$name}" != 'core::config' && // <--- This on is never set, only in gosa.conf.
+ "{$class}::{$name}" != 'core::logging'){ // <--- This one may cause endless recursions in class_log.inc
+ new log("debug","","Unconfigured property: '{$class}::{$name}'",array(),'');
}
- return ($default);
+ // Try to find the property in the config file directly.
+ $name= strtoupper($name);
+ if (isset($this->current[$name])) return ($this->current[$name]);
+ if (isset($this->data["MAIN"][$name])) return ($this->data["MAIN"][$name]);
+ return ("");
}