Code

Fixed string
[gosa.git] / gosa-plugins / gofon / gofon / phoneaccount / class_phoneAccount.inc
index d55d023e496ccd62a500408d549526077bb99fee..872faefff6ddd4b96eefdd1eed5a32861be8e616 100644 (file)
@@ -4,7 +4,7 @@ class phoneAccount extends plugin
 {
     /* Definitions */
     var $plHeadline   = "Phone";
-    var $plDescription= "This does something";
+    var $plDescription= "Manage personal phone settings";
     var $plIcon       = "plugins/gofon/images/phoneAccount.png";
 
     /* Attributes */
@@ -359,8 +359,8 @@ class phoneAccount extends plugin
                     ".$cur_cfg['VOICE_TABLE'].".password 
                         FROM  ".$cur_cfg['VOICE_TABLE'].", 
                     ".$cur_cfg['SIP_TABLE']." 
-                        WHERE ".$cur_cfg['VOICE_TABLE'].".mailbox = ".$num." 
-                        AND ".$cur_cfg['SIP_TABLE'].".name='".$this->uid."'";
+                        WHERE ".$cur_cfg['VOICE_TABLE'].".mailbox = ".mysql_real_escape_string($num)." 
+                        AND ".$cur_cfg['SIP_TABLE'].".name='".mysql_real_escape_string($this->uid)."'";
                 $res = mysql_query($query_tmp);
                 $vp  = mysql_fetch_assoc($res);
                 if(!isset($vp['context'])){
@@ -409,7 +409,7 @@ class phoneAccount extends plugin
                  */
                 $inno_tables = array("SIP_TABLE","EXT_TABLE","VOICE_TABLE","QUEUE_TABLE","QUEUE_MEMBER_TABLE"); 
                 foreach($inno_tables as $inno_table){
-                    $sql = "show table status like '".$config[$inno_table]."';";
+                    $sql = "show table status like '".mysql_real_escape_string($config[$inno_table])."';";
                     $res = mysql_query($sql);
                     $vp  = mysql_fetch_assoc($res);
                     if(!preg_match("/^InnoDB$/i",$vp['Engine'])){
@@ -653,7 +653,7 @@ class phoneAccount extends plugin
                             WARNING_DIALOG);
                 }
 
-                $query  = "SELECT id,name,callerid FROM ".$a_Remove['SIP_TABLE']." WHERE name='".$this->uid."';";
+                $query  = "SELECT id,name,callerid FROM ".$a_Remove['SIP_TABLE']." WHERE name='".mysql_real_escape_string($this->uid)."';";
                 $rid    = mysql_query($query,$old_connection);
                 @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, 
                         "<i>Reguest callerid to be able to identify the user.</i>");
@@ -667,11 +667,11 @@ class phoneAccount extends plugin
                        Strict disallows the addition of entries that do not match the targets field length.
                      */
                     $query_a[]= "SET @@sql_mode = STRICT_ALL_TABLES;";
-                    $query_a[]= "DELETE FROM ".$a_Remove['SIP_TABLE']." WHERE name='".$this->uid."';";
-                    $query_a[]= "DELETE FROM ".$a_Remove['VOICE_TABLE']." WHERE customer_id='".$result['callerid']."';";
-                    $query_a[]= "DELETE FROM ".$a_Remove['EXT_TABLE']." WHERE exten='".$this->uid."';";
+                    $query_a[]= "DELETE FROM ".$a_Remove['SIP_TABLE']." WHERE name='".mysql_real_escape_string($this->uid)."';";
+                    $query_a[]= "DELETE FROM ".$a_Remove['VOICE_TABLE']." WHERE customer_id='".mysql_real_escape_string($result['callerid'])."';";
+                    $query_a[]= "DELETE FROM ".$a_Remove['EXT_TABLE']." WHERE exten='".mysql_real_escape_string($this->uid)."';";
                     foreach($oldnums as $s_telenums) {
-                        $query_a[]= "DELETE FROM ".$a_Remove['EXT_TABLE']." WHERE exten='".$s_telenums."';";
+                        $query_a[]= "DELETE FROM ".$a_Remove['EXT_TABLE']." WHERE exten='".mysql_real_escape_string($s_telenums)."';";
                     }
 
                     /* Start transaction, to be able to rollback 
@@ -733,7 +733,7 @@ class phoneAccount extends plugin
              */
             $SQL_query_array[] = "SET @@sql_mode = STRICT_ALL_TABLES;";
 
-            $query = "SELECT * FROM ".$a_New['SIP_TABLE']." WHERE name='".$this->uid."';\n"; 
+            $query = "SELECT * FROM ".$a_New['SIP_TABLE']." WHERE name='".mysql_real_escape_string($this->uid)."';\n"; 
             $rid = mysql_query($query,$new_connection);
             @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Receive current mysql entries.");
             if(mysql_affected_rows($new_connection)){
@@ -760,10 +760,10 @@ class phoneAccount extends plugin
                 if(count($sip_data_array)){
                     $query = "UPDATE ".$a_New['SIP_TABLE']." SET ";
                     foreach($sip_data_array as $key => $val){
-                        $query.= "".$key."='".$val."',"; 
+                        $query.= "".$key."='".mysql_real_escape_string($val)."',"; 
                     } 
                     $query = preg_replace("/,$/","",$query);
-                    $query.= " WHERE name='".$this->uid."';";
+                    $query.= " WHERE name='".mysql_real_escape_string($this->uid)."';";
                     $SQL_query_array[] = $query;
                 }
             } else {
@@ -812,7 +812,7 @@ class phoneAccount extends plugin
                  */
                 foreach($sip_data_array as $s_sip_key=>$s_sip_val){
                     if($s_sip_val === NULL) continue;
-                    $s_sip_values.="'".$s_sip_val."',";
+                    $s_sip_values.="'".mysql_real_escape_string($s_sip_val)."',";
                     $s_sip_keys  .="`".$s_sip_key."`,";
                 }
                 $s_sip_values =  preg_replace("/,$/","",$s_sip_values);
@@ -828,7 +828,7 @@ class phoneAccount extends plugin
              **********************/
 
             $customer_id = $newnums[$i_new_key];
-            $query  = "SELECT id,name,callerid FROM ".$a_New['SIP_TABLE']." WHERE name='".$this->uid."';";
+            $query  = "SELECT id,name,callerid FROM ".$a_New['SIP_TABLE']." WHERE name='".mysql_real_escape_string($this->uid)."';";
             $rid    = mysql_query($query,$new_connection);
 
             @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Receive callerid");
@@ -850,7 +850,7 @@ class phoneAccount extends plugin
             $voice_data_array['pager']   = $this->pager;
 
             /* Check if there is already an entry in sip_users for this uid */
-            $query_tmp = "SELECT * FROM ".$a_New['VOICE_TABLE']." WHERE customer_id='".$old_customer_id."';\n";
+            $query_tmp = "SELECT * FROM ".$a_New['VOICE_TABLE']." WHERE customer_id='".mysql_real_escape_string($old_customer_id)."';\n";
             $rid = mysql_query($query_tmp,$new_connection);
 
             @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query_tmp, "Check if voicemail entry exists");
@@ -876,7 +876,7 @@ class phoneAccount extends plugin
                         $query.= "".$key."='".$val."',"; 
                     } 
                     $query = preg_replace("/,$/","",$query);
-                    $query.= " WHERE customer_id='".$old_customer_id."';";
+                    $query.= " WHERE customer_id='".mysql_real_escape_string($old_customer_id)."';";
                     $SQL_query_array[] = $query;
                 }
             }else{
@@ -893,7 +893,7 @@ class phoneAccount extends plugin
                 $s_voi_values = $s_voi_keys = "";
                 foreach($voice_data_array as $s_voi_key=>$s_voi_val){
                     if($s_voi_val === NULL) continue;
-                    $s_voi_values.="'".$s_voi_val."',";
+                    $s_voi_values.="'".mysql_real_escape_string($s_voi_val)."',";
                     $s_voi_keys  .="`".$s_voi_key."`,";
                 }
                 $s_voi_values =  preg_replace("/,$/","",$s_voi_values);
@@ -910,13 +910,13 @@ class phoneAccount extends plugin
 
             /* Initiate transaction 
              */
-            $SQL_query_array[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".$this->uid."\";";
+            $SQL_query_array[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".mysql_real_escape_string($this->uid)."\";";
             $oldnums= array();
             foreach($oldnums as $s_telenums){
-                $SQL_query_array[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".$s_telenums."\";";
+                $SQL_query_array[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".mysql_real_escape_string($s_telenums)."\";";
             }
             foreach($newnums as $s_telenums){
-                $SQL_query_array[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".$s_telenums."\";";
+                $SQL_query_array[]= "DELETE FROM ".$a_New['EXT_TABLE']." WHERE exten=\"".mysql_real_escape_string($s_telenums)."\";";
             }
 
             /********************** 
@@ -987,7 +987,7 @@ class phoneAccount extends plugin
                 $SQL_syn = preg_replace("/,$/","",$SQL_syn);
                 $SQL_syn .= ") VALUES ("; 
                 foreach($entr as $key2 => $val2){
-                    $SQL_syn .= "'".$val2."',";
+                    $SQL_syn .= "'".mysql_real_escape_string($val2)."',";
                 }
                 $SQL_syn = preg_replace("/,$/","",$SQL_syn);
                 $SQL_syn .=");\n";
@@ -1113,7 +1113,7 @@ class phoneAccount extends plugin
             } else {
                 if(empty($this->uid)){
                     $display= $this->show_enable_header(_("Create phone account"),
-                            msgPool::featuresDisabled(_("Phone"),_("User uid")));
+                            msgPool::featuresDisabled(_("Phone"),_("User UID")));
                 }else{
                     $display= $this->show_enable_header(_("Create phone account"),
                             msgPool::featuresDisabled(_("Phone")));
@@ -1135,14 +1135,14 @@ class phoneAccount extends plugin
         }
 
         /* Assing macroselectbox values  */
-        $smarty->assign("macros",$this->macros);   
-        $smarty->assign("macro", $this->macro);   
+        $smarty->assign("macros",set_post($this->macros));   
+        $smarty->assign("macro", set_post($this->macro));   
 
         /* Assign contexts */
-        $smarty->assign("voicemail_contexts",$this->voicemail_contexts);
-        $smarty->assign("sip_contexts",$this->sip_contexts);
-        $smarty->assign("context" ,$this->context);
-        $smarty->assign("voice_context" ,$this->voice_context);
+        $smarty->assign("voicemail_contexts",  set_post($this->voicemail_contexts));
+        $smarty->assign("sip_contexts",        set_post($this->sip_contexts));
+        $smarty->assign("context" ,            set_post($this->context));
+        $smarty->assign("voice_context" ,      set_post($this->voice_context));
 
         /* check if there is a FON server created */
         if(!count($this->goFonHomeServer)){
@@ -1209,32 +1209,35 @@ class phoneAccount extends plugin
                 $macrotab.= "<tr>";
                 switch ($type){
 
-                    case "combo":
+                    case "combo":{
                         $str= "<select name='".$var."' ".$dis." >";
-                    foreach(explode(":",$default) as $choice){
-                        if($choosen==$choice){
-                            $str.= "\n<option value='".$choice."' selected>".$choice."&nbsp;</option>";
-                        }else{
-                            $str.= "\n<option value='".$choice."'>".$choice."&nbsp;</option>";
+                        foreach(explode(":",$default) as $choice){
+                            if($choosen==$choice){
+                                $str.= "\n<option value='".$choice."' selected>".$choice."&nbsp;</option>";
+                            }else{
+                                $str.= "\n<option value='".$choice."'>".$choice."&nbsp;</option>";
+                            }
                         }
+                        $str.="</select>";
+                        $macrotab.= "<td style='vertical-align: middle;'>".base64_decode($name)."&nbsp;</td><td>$str";
+                        break;
                     }
-                    $str.="</select>";
-                    $macrotab.= "<td>".base64_decode($name)."</td><td>$str";
-                    break;
 
-                    case "bool":
+                    case "bool":{
                         if(!$choosen){
                             $str="\n<input type='checkbox' name='".$var."' value='1' ".$dis." >";
                         }else{
                             $str="\n<input type='checkbox' name='".$var."' value='1' checked  ".$dis.">";
                         }
-                    $macrotab.= "<td colspan='2'>$str&nbsp;".base64_decode($name)."";
-                    break;
+                        $macrotab.= "<td style='vertical-align: middle;'colspan='2'>$str&nbsp;".base64_decode($name)."";
+                        break;
+                    }
 
-                    case "string":
-                        $str="<input name='".$var."' value='".$choosen."' ".$dis." style='width:340px;'>";
-                    $macrotab.= "<td>".base64_decode($name)."</td><td>$str";
-                    break;
+                    case "string": {
+                        $str="<input type='text' name='".$var."' value='".set_post($choosen)."' ".$dis." style='width:340px;'>";
+                        $macrotab.= "<td style='vertical-align: middle;'>".base64_decode($name)."&nbsp;</td><td>$str";
+                        break;  
+                    }
 
                 }
                 $macrotab.= "</td></tr>";
@@ -1253,7 +1256,7 @@ class phoneAccount extends plugin
             if(strlen(trim($_POST["phonenumber"])) > 20 ){
                 msg_dialog::display(_("Error"), msgPool::toobig("Phone number"), ERROR_DIALOG);
             }elseif (tests::is_phone_nr($_POST['phonenumber'])){
-                $number= trim($_POST["phonenumber"]);
+                $number= trim(get_post("phonenumber"));
                 $this->phoneNumbers[$number]= $number;
                 $this->is_modified= TRUE;
             } else {
@@ -1278,7 +1281,7 @@ class phoneAccount extends plugin
         /* Transfer ACL's */
         foreach($this->attributes as $val){
             if(isset($this->$val)){
-                $smarty->assign($val,$this->$val);
+                $smarty->assign($val,set_post($this->$val));
             }else{
                 $smarty->assign($val,"");
             }
@@ -1291,14 +1294,14 @@ class phoneAccount extends plugin
                 $tmp[$dn] = $attrs['SERVER'];
             }
         }
-        $smarty->assign("goFonHomeServers",$tmp);
+        $smarty->assign("goFonHomeServers", set_post($tmp));
 
         /* Fill arrays */
-        $smarty->assign ("goFonHardware", $this->goFonHardware);
+        $smarty->assign ("goFonHardware", set_post($this->goFonHardware));
         if (!count($this->phoneNumbers)){
             $smarty->assign ("phoneNumbers", array());
         } else {
-            $smarty->assign ("phoneNumbers", $this->phoneNumbers);
+            $smarty->assign ("phoneNumbers", set_post($this->phoneNumbers));
         }
 
         $dis = "";
@@ -1319,7 +1322,7 @@ class phoneAccount extends plugin
             } else {
                 $color= "";
             }
-            $hl.= "  <option $color label=\"$cn\" value=\"$cn\" $selected>$description&nbsp;</option>\n";
+            $hl.= "  <option $color label=\"$cn\" value=\"".set_post($cn)."\" $selected>".$description."&nbsp;</option>\n";
         }
         $hl.= "</select>\n";
         $smarty->assign ("hardware_list", $hl);
@@ -1380,18 +1383,18 @@ class phoneAccount extends plugin
 
             /* Save context */
             if(isset($_POST['context'])){
-                if($this->context != $_POST['context']){
+                if($this->context != get_post('context')){
                     $this->is_modified= TRUE;
                 }
-                $this->context= $_POST['context'];
+                $this->context= get_post('context');
             }
 
             /* Save voice context */
             if(isset($_POST['voice_context'])){
-                if($this->voice_context != $_POST['voice_context']){
+                if($this->voice_context != get_post('voice_context')){
                     $this->is_modified= TRUE;
                 }
-                $this->voice_context= $_POST['voice_context'];
+                $this->voice_context= get_post('voice_context');
             }
 
             if(is_array($this->phoneNumbers)){
@@ -1414,7 +1417,7 @@ class phoneAccount extends plugin
                         $backup = $this->macroarray[$this->macro][$key];
 
                         if(isset($_POST[$paras['var']])){
-                            $this->macroarray[$this->macro][$key]['choosen'] = $_POST[$paras['var']];
+                            $this->macroarray[$this->macro][$key]['choosen'] = get_post($paras['var']);
                         }
 
                         /* Checkboxes are special, they are not Posted if they are not selected, so the won't be changed with the above code
@@ -1457,10 +1460,10 @@ class phoneAccount extends plugin
         }
 
         if((strlen($this->goFonVoicemailPIN)==0)||(strlen($this->goFonVoicemailPIN)>4)){
-            $message[]= msgPool::invalid(_("Voicemail PIN"),"","",_("Between 1-4 charactes"));
+            $message[]= msgPool::invalid(_("Voice mail PIN"),"","",_("Between 1-4 characters"));
         }else{
             if(preg_match("/[^0-9]/",$this->goFonVoicemailPIN)){
-                $message[]= msgPool::invalid(_("Voicemail PIN"),preg_replace("/[0-9]/","X",$this->goFonVoicemailPIN),"/X/");
+                $message[]= msgPool::invalid(_("Voice mail PIN"),preg_replace("/[0-9]/","X",$this->goFonVoicemailPIN),"/X/");
             }
         }
 
@@ -1553,7 +1556,7 @@ class phoneAccount extends plugin
          */
         $str = $this->generate_mysql_entension_entries(true);
         if(!$str){
-            msg_dialog::display(_("Error"),_("An error occured while updating the database entries!") , ERROR_DIALOG);
+            msg_dialog::display(_("Error"),_("An error occurred while updating the database entries!") , ERROR_DIALOG);
         }
 
         if($this->attrs['goFonMacro']==""){
@@ -1671,11 +1674,11 @@ class phoneAccount extends plugin
             if(!$first_num){
                 $first_num = $s_telenums;
             }
-            $SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$s_telenums."';\n";
+            $SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".mysql_real_escape_string($s_telenums)."';\n";
         }
 
 
-        $query  = "SELECT id,name,callerid FROM ".$a_SETUP['SIP_TABLE']." WHERE name='".$this->uid."';";
+        $query  = "SELECT id,name,callerid FROM ".$a_SETUP['SIP_TABLE']." WHERE name='".mysql_real_escape_string($this->uid)."';";
         $rid    = mysql_query($query,$r_con);
         @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
         $result = mysql_fetch_assoc($rid);
@@ -1687,9 +1690,9 @@ class phoneAccount extends plugin
         /* Set mode to strict
            Strict disallows the addition of entries that do not match the targets field length.
          */
-        $SQL[] = "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id='".$callerid."';";
-        $SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$this->uid."';\n";
-        $SQL[] = "DELETE FROM ".$a_SETUP['SIP_TABLE']." WHERE name='".$this->uid."';\n";
+        $SQL[] = "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id='".mysql_real_escape_string($callerid)."';";
+        $SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".mysql_real_escape_string($this->uid)."';\n";
+        $SQL[] = "DELETE FROM ".$a_SETUP['SIP_TABLE']." WHERE name='".mysql_real_escape_string($this->uid)."';\n";
 
         /* Start transaction, to be able to rollback
          */
@@ -1786,9 +1789,9 @@ class phoneAccount extends plugin
         foreach($this->phoneNumbers as $num){
             if((isset($numbers[$num]))&&(($numbers[$num]['uid'][0]!=$this->uid))){
                 if(isset($numbers[$num]['uid'][0])){
-                    return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]);
+                    return sprintf(_("The specified telephone number '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]);
                 }else{
-                    return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]);
+                    return sprintf(_("The specified telephone number '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]);
                 }
             }
         }
@@ -1803,11 +1806,11 @@ class phoneAccount extends plugin
         if (!count($this->phoneNumbers)){
             $smarty->assign ("phoneNumbers", array(""));
         } else {
-            $smarty->assign ("phoneNumbers", $this->phoneNumbers);
+            $smarty->assign ("phoneNumbers", set_post($this->phoneNumbers));
         }
 
-        $smarty->assign("goFonVoicemailPIN",$this->goFonVoicemailPIN);
-        $smarty->assign("goFonPIN",$this->goFonPIN);
+        $smarty->assign("goFonVoicemailPIN",set_post($this->goFonVoicemailPIN));
+        $smarty->assign("goFonPIN",set_post($this->goFonPIN));
 
         $display= $smarty->fetch(get_template_path('paste_generic.tpl', TRUE, dirname(__FILE__)));
         $ret =array();
@@ -1822,10 +1825,10 @@ class phoneAccount extends plugin
         if(!$this->is_account) return;
         $this->execute();
         if(isset($_POST['goFonVoicemailPIN'])) {
-            $this->goFonVoicemailPIN = $_POST['goFonVoicemailPIN'];
+            $this->goFonVoicemailPIN = get_post('goFonVoicemailPIN');
         }
         if(isset($_POST['goFonPIN'])){
-            $this->goFonPIN = $_POST['goFonPIN'];
+            $this->goFonPIN = get_post('goFonPIN');
         }
     }
 
@@ -1852,7 +1855,10 @@ class phoneAccount extends plugin
 
 
                     "plOptions"       => array(),
-                    "plRequirements"=> array('ldapSchema' => array('goFonAccount' => '>=2.7')),
+                    "plRequirements"=> array(
+                        'ldapSchema' => array('goFonAccount' => '>=2.7'),
+                        'onFailureDisablePlugin' => array(get_class(),'phoneAccount','phoneConferenceManagment','goFonMacro')
+                        ),
 
                     "plProvidedAcls"  => array(
                         "telephoneNumber"     => _("Telephone number"),
@@ -1861,8 +1867,8 @@ class phoneAccount extends plugin
                         "goFonHomeServer"     => _("Home server"),
                         "goFonContext"          => _("Phone context"),
                         "goFonVoiceMailContext" => _("Voice mail context"),
-                        "goFonPIN"            => _("Telephone pin"),
-                        "goFonVoicemailPIN"   => _("Voicemail pin"))
+                        "goFonPIN"            => _("Telephone PIN"),
+                        "goFonVoicemailPIN"   => _("Voice mail PIN"))
                         ));
     }
 
@@ -1911,7 +1917,7 @@ class phoneAccount extends plugin
             }
 
             if(isset($_POST['macro']) && $_POST['macro'] != $this->macro){
-                $this->macro = $_POST['macro'];
+                $this->macro = get_post('macro');
                 $this->is_modified =true;
             }
 
@@ -1920,12 +1926,12 @@ class phoneAccount extends plugin
                 foreach($this->macroarray[$this->macro] as $key => $paras){
                     $backup = $this->macroarray[$this->macro][$key];
                     if(isset($_POST[$paras['var']])){
-                        $this->macroarray[$this->macro][$key]['choosen'] = $_POST[$paras['var']];
+                        $this->macroarray[$this->macro][$key]['choosen'] = get_post($paras['var']);
                     }
                     if(isset($_POST['post_success'])){
                         if($this->macroarray[$this->macro][$key]['type']=="bool"){
                             if(isset($_POST[$this->macroarray[$this->macro][$key]['var']])) {
-                                $this->macroarray[$this->macro][$key]['choosen']=$_POST[$paras['var']];
+                                $this->macroarray[$this->macro][$key]['choosen']=get_post($paras['var']);
                             }else{
                                 $this->macroarray[$this->macro][$key]['choosen']=false;
                             }
@@ -1954,15 +1960,15 @@ class phoneAccount extends plugin
         if(in_array("goFonVoicemailPIN",$this->multi_boxes) && 
                 ( (strlen($this->goFonVoicemailPIN)==0)||
                   (strlen($this->goFonVoicemailPIN)>4))){
-            $message[]=(_("Voicemail PIN must be 4 characters long!"));
+            $message[]=(_("Voice mail PIN must be 4 characters long!"));
         }else{
             if(preg_match("/[^0-9]/",$this->goFonVoicemailPIN) && in_array("goFonVoicemailPIN",$this->multi_boxes) ){
-                $message[]=(_("Voicemail PIN contains invalid characters!"));
+                $message[]=(_("Voice mail PIN contains invalid characters!"));
             }
         }
 
         if(preg_match("/[^0-9a-z]/i",$this->goFonPIN) && in_array("goFonPIN",$this->multi_boxes)){
-            $message[]=(_("Phone pin contains invalid characters!"));
+            $message[]=(_("Phone PIN contains invalid characters!"));
         }
 
         /* check for ! in any parameter setting*/