summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71f8aa4)
raw | patch | inline | side by side (parent: 71f8aa4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 24 Jun 2008 10:01:51 +0000 (10:01 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 24 Jun 2008 10:01:51 +0000 (10:01 +0000) |
-Update voicemail table entry correctly
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@11412 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@11412 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history |
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index 27fbbf800febff56cb62496bbc461a0bd7aa34f8..3acd47d61a64d8e0b1baaf23c9614a6125374629 100644 (file)
$voice_data_array['pager'] = $this->parent->by_object['user']->pager;
}
+ $query = "SELECT id,name,callerid FROM ".$a_New['SIP_TABLE']." WHERE name='".$this->uid."';";
+
+ $rid = mysql_query($query,$new_connection);
+ @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
+ $result = mysql_fetch_assoc($rid);
+
+ $old_customer_id = "";
+ if($result){
+ $old_customer_id = $result['callerid'];
+ }
+
/* Check if there is already an entry in sip_users for this uid */
- $query_tmp = "SELECT * FROM ".$a_New['VOICE_TABLE']." WHERE customer_id='".$customer_id."';\n";
+ $query_tmp = "SELECT * FROM ".$a_New['VOICE_TABLE']." WHERE customer_id='".$old_customer_id."';\n";
$rid = mysql_query($query_tmp,$new_connection);
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query_tmp, "Database query");
if(mysql_affected_rows($new_connection)){
$query.= "".$key."='".$val."',";
}
$query = preg_replace("/,$/","",$query);
- $query.= " WHERE customer_id='".$customer_id."';";
+ $query.= " WHERE customer_id='".$old_customer_id."';";
$SQL_query_array[] = $query;
}
}else{