summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6e51370)
raw | patch | inline | side by side (parent: 6e51370)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Feb 2006 06:32:01 +0000 (06:32 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Feb 2006 06:32:01 +0000 (06:32 +0000) |
Added upper/lower case detection of attributes
Added Debug messages for testing
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2651 594d385d-05f5-0310-b6e9-bd551577e9d8
Added Debug messages for testing
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2651 594d385d-05f5-0310-b6e9-bd551577e9d8
index cdbb3ca19ac513c76ca286d3bf13f5f3bf8a37b3..a966dda4d1d01e75c9b1f0fccacd26808bbd69a2 100644 (file)
--- a/TODO
+++ b/TODO
* LabeledURI fix
+* Phone account is not removable if the mysql database is not reachable.
+ This is no real problem, but I'd like to see the hint message for it.
+
Target for 2.5:
===============
diff --git a/debian/rules b/debian/rules
index 608cf565f0f2f643513e744458d0e55d51e54ec4..104068f7d97735b204e63f1104cb93c23270d622 100755 (executable)
--- a/debian/rules
+++ b/debian/rules
-rm -rf debian/gosa/usr/share/gosa/compile
-mkdir -p debian/gosa/etc/gosa/vacation
-cp -R debian/apache.conf debian/gosa/etc/gosa/apache.conf
+ -cp -R contrib/encodings debian/gosa/etc/gosa/encodings
-cp -R plugins/personal/mail/sieve-*.txt debian/gosa/etc/gosa
-cp contrib/shells debian/gosa/etc/gosa
-rm -rf debian/gosa/usr/share/gosa/contrib
index 624714b6febbd10dc4cf70e3bb7af0998a3753d4..17814d986563b9e1619d1c8763043b8366c65515 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
var $attributes= array();
var $objectclasses= array();
var $new= TRUE;
+ var $saved_attributes= array();
/*! \brief plugin constructor
/* Copy needed attributes */
foreach ($this->attributes as $val){
- if (isset($this->attrs["$val"][0])){
- $this->$val= $this->attrs["$val"][0];
+ #if (isset($this->attrs["$val"][0])){
+ $found= array_key_ics($val, $this->attrs);
+ if ($found != ""){
+ $this->$val= $this->attrs["$found"][0];
}
}
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
"found", "Object check");
}
+
+ /* Prepare saved attributes */
+ $this->saved_attributes= $this->attrs;
+ foreach ($this->saved_attributes as $index => $value){
+ if (preg_match('/^[0-9]+$/', $index)){
+ unset($this->saved_attributes[$index]);
+ continue;
+ }
+ if (!in_array($index, $this->attributes) && $index != "objectClass"){
+ unset($this->saved_attributes[$index]);
+ continue;
+ }
+ if ($this->saved_attributes[$index]["count"] == 1){
+ $tmp= $this->saved_attributes[$index][0];
+ unset($this->saved_attributes[$index]);
+ $this->saved_attributes[$index]= $tmp;
+ continue;
+ }
+
+ unset($this->saved_attributes["$index"]["count"]);
+ }
}
/* Save initial account state */
}
}
+ /* Clean up */
+ foreach ($this->attrs as $index => $value){
+ if (is_array($this->attrs[$index]) && count($this->attrs[$index]) == 0 && !isset($this->saved_attributes[$index])){
+ unset ($this->attrs[$index]);
+ continue;
+ }
+
+ if (!is_array($this->attrs[$index]) && isset($this->saved_attributes[$index])
+ && !is_array($this->saved_attributes[$index]) && $value == $this->saved_attributes[$index]){
+ unset ($this->attrs[$index]);
+ continue;
+ }
+
+ if (is_array($this->attrs[$index]) && is_array($this->saved_attributes[$index]) &&
+ count(array_diff($this->attrs[$index], $this->saved_attributes[$index]))==0 && $index != "objectClass"){
+ unset ($this->attrs[$index]);
+ continue;
+ }
+ }
+#################################
+; echo "--- DEBUG: changes ---" ;
+; print_a ($this->attrs) ;
+#################################
}
/* Check formular input */
}
}
-
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/include/functions.inc b/include/functions.inc
index 57ded91d438c11c7c317763fa8eb4c68d15f5df6..1fa462740a06a8334e2a92f76b1d05279bdc7531 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
+function array_key_ics($ikey, $items)
+{
+ /* Gather keys, make them lowercase */
+ $tmp= array();
+ foreach ($items as $key => $value){
+ $tmp[strtolower($key)]= $key;
+ }
+
+ if (isset($tmp[strtolower($ikey)])){
+ return($tmp[strtolower($ikey)]);
+ }
+
+ return ("");
+}
+
+
function search_config($arr, $name, $return)
{
if (is_array($arr)){
index 0ea53a5e11142737f0da53b908534e575dcddd34..f759f74357bf8fa70cff38a486f9090bb86df315 100644 (file)
var $mailusers= array();
var $perms= array();
var $imapacl= array('anyone' => 'p', '%members%' => 'lrsp', '' => 'p');
+ var $mmethod= "";
/* Helper */
var $indexed_acl= array();
/* Set mailMethod to the one defined in gosa.conf */
if (isset($this->config->current['MAILMETHOD'])){
- $method= $this->config->current['MAILMETHOD'];
- if (class_exists("mailMethod$method")){
- $this->method= "mailMethod$method";
- } else {
- print_red(sprintf(_("There is no mail method '%s' specified in your gosa.conf available."), $method));
- }
+ $this->mmethod= $this->config->current['MAILMETHOD'];
+ }
+
+ if (class_exists("mailMethod$this->mmethod")){
+ $this->method= "mailMethod$this->mmethod";
+ } else {
+ print_red(sprintf(_("There is no mail method '%s' specified in your gosa.conf available."), $this->mmethod));
}
/* Load Mailserver string, only in case of kolab ???? */
- if(preg_match("/kolab/i",$this->config->current['MAILMETHOD'])){
+ if(preg_match("/kolab/i",$this->mmethod)){
if(isset($this->attrs['gosaMailServer'][0])){
$this->gosaMailServer = $this->attrs['gosaMailServer'][0];
}
/* Load permissions */
$tmp = array();
- if(preg_match("/kolab/i",$this->config->current['MAILMETHOD'])){
+ if(preg_match("/kolab/i",$this->mmethod)){
$ldap = $this->config->get_ldap_link();
if (isset($this->attrs['acl'])){
for ($i= 0; $i<$this->attrs['acl']['count']; $i++){
/* Save shared folder target */
$this->attrs['gosaSharedFolderTarget']= "share+".$this->uid;
- if(preg_match("/kolab/i",$this->config->current['MAILMETHOD'])){
+ if(preg_match("/kolab/i",$this->mmethod)){
/* Save acl's */
$this->attrs['acl']= array();
foreach ($this->imapacl as $user => $acl){
}
/* Only do IMAP actions if we are not a template */
- if(preg_match("/kolab/i",$this->config->current['MAILMETHOD'])){
+ if(preg_match("/kolab/i",$this->mmethod)){
if (empty($this->gosaMailServer)||is_array($this->gosaMailServer)){
if(isset($this->attrs['gosaMailServer'][0])){
$this->gosaMailServer = $this->attrs['gosaMailServer'][0];
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index 40694034e5466ceabe5d2b28dd8aacb518adece1..db1c304c2ff7a753dd94e03d75991e91e5cfb469 100644 (file)
function remove_from_parent()
{
-
foreach($this->attributes as $key=>$val){
if(in_array($val,array("uid","cn","mail"))){
unset($this->attributes[$key]);
$SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$this->uid."';\n";
$SQL[] = "DELETE FROM ".$a_SETUP['SIP_TABLE']." WHERE name='".$this->uid."';\n";
-
foreach($SQL as $query){
if(!@mysql_query($query,$r_con)){
print_red(_("Stop".mysql_error()));
}
}
-
/* unset macro attr, it will cause an error */
$tmp = array_flip($this->attributes);
unset($tmp['macro']);