Code

A voicemail PIN can be changed directly from a phone, without any update written...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Sep 2005 12:26:55 +0000 (12:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 2 Sep 2005 12:26:55 +0000 (12:26 +0000)
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

plugins/gofon/phoneaccount/class_phoneAccount.inc

index ad23ecfcb7a947527c0643efc6b1a9e46b0f740e..003d75b4165f255b0bfbe66af5b5867e893f82c9 100644 (file)
@@ -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];
+        }
+      }
+    }
   }