From 64f707b19bc3caf11fbfc6b30e18ca86ef5377fc Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Sep 2005 12:26:55 +0000 Subject: [PATCH] A voicemail PIN can be changed directly from a phone, without any update written to the ldap. We schoul use the DB PIN, because this one is up to date. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1305 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../gofon/phoneaccount/class_phoneAccount.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index ad23ecfcb..003d75b41 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -211,6 +211,24 @@ class phoneAccount extends plugin $this->is_modified = true; } + + /* Get voicemail PIN from MySQL DB + * Because every user can change his PIN directly from the phone + * without any update to the ldap + * This means, the PIN in the DB is up to date + */ + // Connect to DB server + if((isset($a_SETUP))&&(isset($a_SETUP['SERVER']))&&(isset($a_SETUP['LOGIN']))&&(isset($a_SETUP['PASSWORD']))){ + $r_con = @mysql_connect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']); + if($r_con){ + $r_db = @mysql_select_db($a_SETUP['DB'],$r_con); + $vp = mysql_fetch_row(mysql_query("SELECT voicemail_users.password FROM `voicemail_users`,`sip_users` WHERE customer_id = sip_users.mailbox AND name='".$this->uid."'")); + + if((isset($vp[0]))&&(!empty($vp[0]))){ + $this->goFonPINVoice = $vp[0]; + } + } + } } -- 2.30.2