phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sms inc/class.sms.inc.php inc/plugin/gateway/cl...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] sms inc/class.sms.inc.php inc/plugin/gateway/cl...
Date: Fri, 26 May 2006 08:06:05 +0000

CVSROOT:        /sources/phpgroupware
Module name:    sms
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/05/26 08:06:05

Modified files:
        inc            : class.sms.inc.php 
        inc/plugin/gateway/clickatell: fn.php 
        setup          : default_records.inc.php setup.inc.php 
                         tables_current.inc.php 

Log message:
        no message

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.sms.inc.php.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/plugin/gateway/clickatell/fn.php.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/default_records.inc.php.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/setup.inc.php.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/tables_current.inc.php.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: sms/inc/class.sms.inc.php
diff -u sms/inc/class.sms.inc.php:1.9 sms/inc/class.sms.inc.php:1.10
--- sms/inc/class.sms.inc.php:1.9       Thu May 25 19:47:10 2006
+++ sms/inc/class.sms.inc.php   Fri May 26 08:06:04 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage sms
-       * @version $Id: class.sms.inc.php,v 1.9 2006/05/25 19:47:10 sigurdne 
Exp $
+       * @version $Id: class.sms.inc.php,v 1.10 2006/05/26 08:06:04 sigurdne 
Exp $
        */
 
        /**
@@ -106,202 +106,20 @@
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                }
 
-               function validatelogin($username,$password)
-               {
-                       $db_query = "SELECT password FROM phpgw_sms_tblUser 
WHERE username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $res_password = trim($db_row[password]);
-                       if ($password && $res_password && 
($password==$res_password))
-                       {
-                       $ticket = md5(mktime().$username);
-                       return $ticket;
-                       }
-                       else
-                       {
-                       return 0;
-                       }
-               }
-               
-               function 
valid($var_ticket="",$var_username="",$var_multilogin_id="")
-               {
-                       $ticket = $_COOKIE[vc1];
-                       $username = $_COOKIE[vc2];
-                       $multilogin_id = $_COOKIE[vc3];
-                       if ($var_ticket && $var_username && $var_multilogin_id)
-                       {
-                       $ticket = $var_ticket;
-                       $username = $var_username;
-                       $multilogin_id = $var_multilogin_id;
-                       }
-                       if ($this->apps_config['multilogin'])
-                       {
-                       $db_query = "SELECT password FROM phpgw_sms_tblUser 
WHERE username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       if ($multilogin_id && md5($username.$db_row[password]) 
&& ($multilogin_id==md5($username.$db_row[password])))
-                       {
-                               return 1;
-                       }
-                       else
-                       {
-                               return 0;       
-                       }
-                       }
-                       else
-                       {
-                       $db_query = "SELECT ticket FROM phpgw_sms_tblUser WHERE 
username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       if ($ticket && $db_row[ticket] && 
($ticket==$db_row[ticket]))
-                       {
-                               return 1;
-                       }
-                       else
-                       {
-                               return 0;       
-                       }
-                       }
-               }
-               
-               function 
isadmin($var_ticket="",$var_username="",$var_multilogin_id="")
-               {
-/*
-                       $ticket = $_COOKIE[vc1];
-                       $username = $_COOKIE[vc2];
-                       $multilogin_id = $_COOKIE[vc3];
-                       if ($var_ticket && $var_username && $var_multilogin_id)
-                       {
-                       $ticket = $var_ticket;
-                       $username = $var_username;
-                       $multilogin_id = $var_multilogin_id;
-                       }
-                       if ($this->apps_config['multilogin'])
-                       {
-                       $db_query = "SELECT status,password FROM 
phpgw_sms_tblUser WHERE username='$username' AND ticket='$ticket'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       if ($db_row[status] && ($db_row[status]==2) && 
($multilogin_id==md5($username.$db_row[password])))
-                       {
-                               return 1;
-                       }
-                       else
-                       {
-                               return 0;       
-                       }
-                       }
-                       else
-                       {
-                       $db_query = "SELECT status FROM phpgw_sms_tblUser WHERE 
username='$username' AND ticket='$ticket'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       if ($db_row[status] && ($db_row[status]==1))
-                       {
-                               return 1;
-                       }
-                       else
-                       {
-                               return 0;       
-                       }
-                       }
-*/
-               
-                       return $GLOBALS['phpgw']->acl->check($location = 'run', 
$required = 1, $appname = 'admin');
-               }
-               
-               function forcelogout()
-               {
-                       setcookie("vc1");
-                       setcookie("vc2");
-                       setcookie("vc3");
-                       header("Location: goodbye.php");
-                       die();
-               }
-               
-               function gpid2gpname($gpid)
-               {
-                       if ($gpid)
-                       {
-                       $db_query = "SELECT gp_name FROM 
phpgw_sms_tblUserGroupPhonebook WHERE gpid='$gpid'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $gp_name = $db_row[gp_name];
-                       }
-                       return $gp_name;
-               }
-               
-/*             function gpid2gpcode($gpid)
-               {
-                       if ($gpid)
-                       {
-                       $db_query = "SELECT gp_code FROM 
phpgw_sms_tblUserGroupPhonebook WHERE gpid='$gpid'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $gp_code = $db_row[gp_code];
-                       }
-                       return $gp_code;
-               }
-*/             
-               function gpcode2gpname($uid,$gp_code)
-               {
-                       if ($uid && $gp_code)
-                       {
-                       $db_query = "SELECT gp_name FROM 
phpgw_sms_tblUserGroupPhonebook WHERE uid='$uid' AND gp_code='$gp_code'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $gp_name = $db_row[gp_name];
-                       }
-                       return $gp_name;
-               }
-               
                function gpcode2gpid($uid,$gp_code)
                {
                        if ($uid && $gp_code)
                        {
-                       $db_query = "SELECT gpid FROM 
phpgw_sms_tblUserGroupPhonebook WHERE uid='$uid' AND gp_code='$gp_code'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $gpid = $db_row[gpid];
+                               $db_query = "SELECT gpid FROM 
phpgw_sms_tblUserGroupPhonebook WHERE uid='$uid' AND gp_code='$gp_code'";
+                               $db_result = dba_query($db_query);
+                               $db_row = dba_fetch_array($db_result);
+                               $gpid = $db_row[gpid];
                        }
                        return $gpid;
                }
-               
-               function uid2username($uid)
-               {
-                       if ($uid)
-                       {
-                       $db_query = "SELECT username FROM phpgw_sms_tblUser 
WHERE uid='$uid'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $username = $db_row[username];
-                       }
-                       return $username;
-               }
-               
-               function username2uid($username)
-               {
-                       if ($username)
-                       {
-//                     $db_query = "SELECT uid FROM phpgw_sms_tblUser WHERE 
username='$username'";
-//                     $db_result = dba_query($db_query);
-//                     $db_row = dba_fetch_array($db_result);
-//                     $uid = $db_row[uid];
-                               $uid = 
$GLOBALS['phpgw']->accounts->name2id($username);
-                       }
 
-                       return $uid;
-               }
-               
                function username2mobile($username)
                {
-                  /* if ($username)
-                       {
-                       $db_query = "SELECT mobile FROM phpgw_sms_tblUser WHERE 
username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $mobile = $db_row[mobile];
-                       }
-               */      
                        
                //      $GLOBALS['phpgw']->preferences->account_id = 
$this->account;
                //      $GLOBALS['phpgw']->preferences->read_repository();
@@ -310,203 +128,28 @@
                }
                
                function username2sender($username)
-               {
-       /*              if ($username)
-                       {
-                       $db_query = "SELECT sender FROM phpgw_sms_tblUser WHERE 
username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $sender = $db_row[sender];
-                       }
-       */
-       //              $sender = $GLOBALS['phpgw_info']['user']['fullname'];
-                       
+               {                       
                        $sender = ' - ' . 
$GLOBALS['phpgw_info']['user']['account_lid'];
                        return $sender;
                }
-               
-               function username2email($username)
-               {
-                       if ($username)
-                       {
-                       $db_query = "SELECT email FROM phpgw_sms_tblUser WHERE 
username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $email = $db_row[email];
-                       }
-                       return $email;
-               }
-               
+                               
                function username2name($username)
                {
-       /*              if ($username)
-                       {
-                       $db_query = "SELECT name FROM phpgw_sms_tblUser WHERE 
username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $name = $db_row[name];
-                       }
-       */              
                        $name = $GLOBALS['phpgw_info']['user']['fullname'];
                        return $name;
                }
                
-               function username2status($username)
-               {
-                       if ($username)
-                       {
-                       $db_query = "SELECT status FROM phpgw_sms_tblUser WHERE 
username='$username'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $status = $db_row[status];
-                       }
-                       return $status;
-               }
-               
-               function pid2pnum($pid)
-               {
-                       global $username;
-                       if ($pid)
-                       {
-                       $uid = username2uid($username);
-                       $db_query = "SELECT p_num FROM 
phpgw_sms_tblUserPhonebook WHERE pid='$pid' AND uid='$uid'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $p_num = $db_row[p_num];
-                       }
-                       return $p_num;
-               }
                
-               function pnum2pdesc($p_num)
+               function sendmail($mail_from,$mail_to,$subject="",$mail_body="")
                {
-                       global $username;
-                       if ($p_num)
+                       if (!is_object($GLOBALS['phpgw']->send))
                        {
-                       $uid = username2uid($username);
-                       $db_query = "SELECT p_desc FROM 
phpgw_sms_tblUserPhonebook WHERE p_num='$p_num' AND uid='$uid'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $p_desc = $db_row[p_desc];
+                               $GLOBALS['phpgw']->send = 
CreateObject('phpgwapi.send');
                        }
-                       return $p_desc;
-               }
-               
-               function pnum2pemail($p_num)
-               {
-                       global $username;
-                       if ($p_num)
-                       {
-                       $uid = username2uid($username);
-                       $db_query = "SELECT p_email FROM 
phpgw_sms_tblUserPhonebook WHERE p_num='$p_num' AND uid='$uid'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $p_email = $db_row[p_email];
-                       }
-                       return $p_email;
-               }
-               
-               /*
-               function 
sendmail($mail_from,$mail_to,$mail_subject="",$mail_body="")
-               {
-                       if (!class_exists(mime_mail)) 
-                       { 
-                       include_once 
"$this->apps_path[libs]/gpl/mime_mail.inc.php"; 
-                       }
-                       $mail           = new mime_mail;
-                       $mail->from             = $mail_from;
-                       $mail->to                  = $mail_to;
-                       $mail->subject    = $mail_subject;
-                       $mail->body              = $mail_body;
-                       if ($mail->send()) 
-                       { 
-                       $err = true; 
-                       } 
-                       else 
-                       { 
-                       $err = false; 
-                       }
-                       unset ($mail);
-                       return $err;
-               }
-               */
-               function 
sendmail($mail_from,$mail_to,$mail_subject="",$mail_body="")
-               {
-                       if (!class_exists(email_message_class))
-                       {
-                       include_once 
$this->apps_path[libs]."/gpl/mimemessage/email_message.php";
-                       }
-                       if (!class_exists(smtp_message_class))
-                       {
-                       include_once 
$this->apps_path[libs]."/gpl/mimemessage/smtp_message.php";
-                       }
-                       if (!class_exists(smtp_class))
-                       {
-                       include_once 
$this->apps_path[libs]."/gpl/mimemessage/smtp/smtp.php";
-                       }
-               
-                       $from_name                      = $mail_from_name;
-                       $from_address           = $mail_from;
-                       $reply_name                     = $from_name;
-                       $reply_address          = $from_address;
-                       $error_delivery_name    = $from_name;
-                       $error_delivery_address = $from_address;
-                       $to_name                        = $mail_to_name;
-                       $to_address                     = $mail_to;
-                       $cc_name                        = $mail_cc_name;
-                       $cc_address                     = $mail_cc;
-                       $bcc_name                       = $mail_bcc_name;
-                       $bcc_address            = $mail_bcc;
-                       $subject                        = $mail_subject;
-                       $text_message           = $mail_body;
-               
-                       $email_message = new smtp_message_class;
-                       $email_message->localhost               = "localhost";
-                       $email_message->smtp_realm              = _SMTP_RELM_;
-                       $email_message->smtp_user               = _SMTP_USER_;
-                       $email_message->smtp_password   = _SMTP_PASS_;
-                       $email_message->smtp_host               = _SMTP_HOST_;
-                       $email_message->smtp_port               = _SMTP_PORT_;
-                       $email_message->smtp_debug              = 0;
-                       $email_message->smtp_direct_delivery = 0;
-               
-                       
$email_message->SetEncodedEmailHeader("To",$to_address,$to_name);
-                       if ($cc_address)
-                       
$email_message->SetEncodedEmailHeader("Cc",$cc_address,$cc_name);
-                       if ($bcc_address)
-                       
$email_message->SetEncodedEmailHeader("Bcc",$bcc_address,$bcc_name);
-                       
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name);
-                       
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name);
-                       
$email_message->SetEncodedEmailHeader("Errors-To",$error_delivery_address,$error_delivery_name);
-                       
$email_message->AddQuotedPrintableTextPart($email_message->WrapText($text_message));
-                       /*
-                        *  Set the Return-Path header to define the envelope 
sender address to which bounced messages are delivered.
-                        *  If you are using Windows, you need to use the 
smtp_message_class to set the return-path address.
-                        */
-                       if(defined("PHP_OS") && 
strcmp(substr(PHP_OS,0,3),"WIN"))
-                               
$email_message->SetHeader("Return-Path",$error_delivery_address);
-                       $email_message->SetEncodedHeader("Subject",$subject);
-               
-                       if ($attachment && $filename && $contenttype)
-                       {
-                       $file_attachment=array(
-                               "Data"=>"$attachment",
-                               "Name"=>"$filename",
-                               "Content-Type"=>"$contenttype",
-                               "Disposition"=>"attachment");
-                       $email_message->AddFilePart($file_attachment);
-                       }
-               
-                       /*
-                        *  The message is now ready to be assembled and sent.
-                        *  Notice that most of the functions used before this 
point may fail due to
-                        *  programming errors in your script. You may safely 
ignore any errors until
-                        *  the message is sent to not bloat your scripts with 
too much error checking.
-                        */
-                       $error = $email_message->Send();
-                       if (strcmp ($error, ""))
-                       return false;
-                       else
-                       return true;
+
+                       $rcpt = $GLOBALS['phpgw']->send->msg('email',$mail_to, 
$subject, stripslashes($mail_body), '', $cc, $bcc, $mail_from, $from_name, 
'plain');
+                       
+                       return $rcpt;
                }
                
                
@@ -520,7 +163,7 @@
                        $max_length = 160;
                        if ($sms_sender = $this->username2sender($username))
                        {
-                       $max_length = $max_length - strlen($sms_sender) - 1;
+                               $max_length = $max_length - strlen($sms_sender) 
- 1;
                        }
                        if (strlen($message)>$max_length)
                        {
@@ -536,36 +179,36 @@
                        $sms_sender = str_replace("\"","",$sms_sender);
                        if (is_array($sms_to))
                        {
-                       $array_sms_to = $sms_to;
+                               $array_sms_to = $sms_to;
                        }
                        else
                        {
-                       $array_sms_to[0] = $sms_to;
+                               $array_sms_to[0] = $sms_to;
                        }
                        for ($i=0;$i<count($array_sms_to);$i++)
                        {
-                       $c_sms_to = str_replace("\'","",$array_sms_to[$i]);
-                       $c_sms_to = str_replace("\"","",$array_sms_to[$i]);
-                       $message = $this->db->db_addslashes($message);
+                               $c_sms_to = 
str_replace("\'","",$array_sms_to[$i]);
+                               $c_sms_to = 
str_replace("\"","",$array_sms_to[$i]);
+                               $message = $this->db->db_addslashes($message);
                        
-                       $db_query = "INSERT INTO phpgw_sms_tblSMSOutgoing 
-                               
(uid,p_gateway,p_src,p_dst,p_footer,p_msg,p_datetime,p_sms_type,unicode) 
-                               VALUES 
('$uid','$gateway_module','$mobile_sender','$c_sms_to','$sms_sender','$message','$datetime_now','$sms_type','$unicode')";
-               
-                       
$GLOBALS['phpgw']->db->query($db_query,__LINE__,__FILE__);
-                       $smslog_id = 
$GLOBALS['phpgw']->db->get_last_insert_id(phpgw_sms_tblSMSOutgoing,'smslog_id');
-               
-                       $gp_code = "PV";
-                       $to[$i] = $c_sms_to;
-                       $ok[$i] = 0;
-                       if ($smslog_id)
-                       {
-                               if 
($this->gw_send_sms($mobile_sender,$sms_sender,$c_sms_to,$sms_msg,$gp_code,$uid,$smslog_id,$sms_type,$unicode))
+                               $db_query = "INSERT INTO 
phpgw_sms_tblSMSOutgoing 
+                                       
(uid,p_gateway,p_src,p_dst,p_footer,p_msg,p_datetime,p_sms_type,unicode) 
+                                       VALUES 
('$uid','$gateway_module','$mobile_sender','$c_sms_to','$sms_sender','$message','$datetime_now','$sms_type','$unicode')";
+               
+                               
$GLOBALS['phpgw']->db->query($db_query,__LINE__,__FILE__);
+                               $smslog_id = 
$GLOBALS['phpgw']->db->get_last_insert_id(phpgw_sms_tblSMSOutgoing,'smslog_id');
+               
+                               $gp_code = "PV";
+                               $to[$i] = $c_sms_to;
+                               $ok[$i] = 0;
+                               if ($smslog_id)
                                {
-                               $ok[$i] = $smslog_id;
+                                       if 
($this->gw_send_sms($mobile_sender,$sms_sender,$c_sms_to,$sms_msg,$gp_code,$uid,$smslog_id,$sms_type,$unicode))
+                                       {
+                                       $ok[$i] = $smslog_id;
+                                       }
                                }
                        }
-                       }
                        return array($ok,$to);
                }
                
@@ -573,12 +216,12 @@
                {
                        $datetime_now = $this->datetime_now;
                        $gateway_module = $this->gateway_module;
-                       $uid = username2uid($username);
+                       $uid = $GLOBALS['phpgw']->accounts->name2id($username);
                        $mobile_sender = $this->username2mobile($username);
                        $max_length = 160;
                        if ($sms_sender = $this->username2sender($username))
                        {
-                       $max_length = $max_length - strlen($sms_sender) - 1;
+                               $max_length = $max_length - strlen($sms_sender) 
- 1;
                        }
                        if (strlen($message)>$max_length)
                        {
@@ -586,114 +229,114 @@
                        }
                        if (is_array($gp_code))
                        {
-                       $array_gp_code = $gp_code;
+                               $array_gp_code = $gp_code;
                        }
                        else
                        {
-                       $array_gp_code[0] = $gp_code;
+                               $array_gp_code[0] = $gp_code;
                        }
                        $j=0;
                        for ($i=0;$i<count($array_gp_code);$i++)
                        {
-                       $c_gp_code = strtoupper($array_gp_code[$i]);
-                       $gpid = gpcode2gpid($uid,$c_gp_code);
-                       $db_query = "SELECT * FROM phpgw_sms_tblUserPhonebook 
WHERE gpid='$gpid'";
-                       $db_result = dba_query($db_query);
-                       while ($db_row = dba_fetch_array($db_result))
-                       {
-                               $p_num = $db_row[p_num];
-                               $sms_to = $p_num;
-                               $sms_msg = $message;
-                               $sms_msg = str_replace("\r","",$sms_msg);
-                               $sms_msg = str_replace("\n","",$sms_msg);
-                               $sms_msg = str_replace("\""," ",$sms_msg);
-                               $mobile_sender = 
str_replace("\'","",$mobile_sender);
-                               $mobile_sender = 
str_replace("\"","",$mobile_sender);
-                               $sms_sender = str_replace("\'","",$sms_sender);
-                               $sms_sender = str_replace("\"","",$sms_sender);
-                               $sms_to = str_replace("\'","",$sms_to);
-                               $sms_to = str_replace("\"","",$sms_to);
-                               $the_msg = "$sms_to\n$sms_msg";
-                               $db_query1 = "
-                               INSERT INTO phpgw_sms_tblSMSOutgoing 
-                               
(uid,p_gateway,p_src,p_dst,p_footer,p_msg,p_datetime,p_gpid,p_sms_type) 
-                               VALUES 
('$uid','$gateway_module','$mobile_sender','$sms_to','$sms_sender','$message','$datetime_now','$gpid','$sms_type')
-                               ";
-                               $smslog_id = @dba_insert_id($db_query1);
-                               $to[$j] = $sms_to;
-                               $ok[$j] = 0;
-                               if ($smslog_id)
-                               {
-                               if ( 
$this->gw_send_sms($mobile_sender,$sms_sender,$sms_to,$sms_msg,$c_gp_code,$uid,$smslog_id,$sms_type,$unicode))
-                               {
-                                       $ok[$j] = $sms_to;
-                               }
-                               }
-                               $j++;
-                       }
-                       }
-                       return array($ok,$to);
-               }
-               
-               function send2group($mobile_sender,$gp_code,$message)
-               {
-                       $datetime_now = $this->datetime_now;
-                       $ok = false;
-                       if ($mobile_sender && $gp_code && $message)
-                       {
-                       $db_query = "SELECT uid,username,sender FROM 
phpgw_sms_tblUser WHERE mobile='$mobile_sender'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $uid = $db_row[uid];
-                       $username = $db_row[username];
-                       $sms_sender = $db_row[sender];
-                       if ($uid && $username)
-                       {
-                               $gp_code = strtoupper($gp_code);
-                               $db_query = "SELECT * FROM 
phpgw_sms_tblUserGroupPhonebook WHERE uid='$uid' AND gp_code='$gp_code'";
-                               $db_result = dba_query($db_query);              
-                               $db_row = dba_fetch_array($db_result);
-                               $gpid = $db_row[gpid];
-                               if ($gpid && $message)
+                               $c_gp_code = strtoupper($array_gp_code[$i]);
+                               $gpid = gpcode2gpid($uid,$c_gp_code);
+                               $db_query = "SELECT * FROM 
phpgw_sms_tblUserPhonebook WHERE gpid='$gpid'";
+                               $db_result = dba_query($db_query);
+                               while ($db_row = dba_fetch_array($db_result))
                                {
-                                       $db_query = "SELECT * FROM 
phpgw_sms_tblUserPhonebook WHERE gpid='$gpid' AND uid='$uid'";
-                                       $db_result = dba_query($db_query);
-                                       while ($db_row = 
dba_fetch_array($db_result))
-                                       {
-                                               $p_num = $db_row[p_num];
+                                       $p_num = $db_row[p_num];
                                        $sms_to = $p_num;
-                                       $max_length = 160 - strlen($sms_sender) 
- 3;
-                                       if (strlen($message)>$max_length)
-                                       {
-                                       $message = substr 
($message,0,$max_length-1);
-                                       }
                                        $sms_msg = $message;
                                        $sms_msg = 
str_replace("\r","",$sms_msg);
                                        $sms_msg = 
str_replace("\n","",$sms_msg);
                                        $sms_msg = str_replace("\""," 
",$sms_msg);
-                                       $the_msg = "$sms_to\n$sms_msg";
                                        $mobile_sender = 
str_replace("\'","",$mobile_sender);
                                        $mobile_sender = 
str_replace("\"","",$mobile_sender);
                                        $sms_sender = 
str_replace("\'","",$sms_sender);
                                        $sms_sender = 
str_replace("\"","",$sms_sender);
                                        $sms_to = str_replace("\'","",$sms_to);
                                        $sms_to = str_replace("\"","",$sms_to);
-                                       $send_code = md5(mktime().$sms_to);
+                                       $the_msg = "$sms_to\n$sms_msg";
                                        $db_query1 = "
-                                       INSERT INTO phpgw_sms_tblSMSOutgoing 
(uid,p_src,p_dst,p_footer,p_msg,p_datetime,p_gpid) 
-                                       VALUES 
('$uid','$mobile_sender','$sms_to','$sms_sender','$message','$datetime_now','$gpid')";
+                                       INSERT INTO phpgw_sms_tblSMSOutgoing 
+                                       
(uid,p_gateway,p_src,p_dst,p_footer,p_msg,p_datetime,p_gpid,p_sms_type) 
+                                       VALUES 
('$uid','$gateway_module','$mobile_sender','$sms_to','$sms_sender','$message','$datetime_now','$gpid','$sms_type')
+                                       ";
                                        $smslog_id = @dba_insert_id($db_query1);
-                                       $sms_id = "$gp_code.$uid.$smslog_id";
+                                       $to[$j] = $sms_to;
+                                       $ok[$j] = 0;
                                        if ($smslog_id)
                                        {
-                                       if 
($this->gw_send_sms($mobile_sender,$sms_sender,$sms_to,$sms_msg,$gp_code,$uid,$smslog_id))
-                                       {
-                                               $ok = true;
-                                       }
+                                               if ( 
$this->gw_send_sms($mobile_sender,$sms_sender,$sms_to,$sms_msg,$c_gp_code,$uid,$smslog_id,$sms_type,$unicode))
+                                               {
+                                                       $ok[$j] = $sms_to;
+                                               }
                                        }
-                               }
+                                       $j++;
                                }
                        }
+                       return array($ok,$to);
+               }
+               
+               function send2group($mobile_sender,$gp_code,$message)
+               {
+                       $datetime_now = $this->datetime_now;
+                       $ok = false;
+                       if ($mobile_sender && $gp_code && $message)
+                       {
+                               $db_query = "SELECT uid,username,sender FROM 
phpgw_sms_tblUser WHERE mobile='$mobile_sender'";
+                               $db_result = dba_query($db_query);
+                               $db_row = dba_fetch_array($db_result);
+                               $uid = $db_row[uid];
+                               $username = $db_row[username];
+                               $sms_sender = $db_row[sender];
+                               if ($uid && $username)
+                               {
+                                       $gp_code = strtoupper($gp_code);
+                                       $db_query = "SELECT * FROM 
phpgw_sms_tblUserGroupPhonebook WHERE uid='$uid' AND gp_code='$gp_code'";
+                                       $db_result = dba_query($db_query);      
        
+                                       $db_row = dba_fetch_array($db_result);
+                                       $gpid = $db_row[gpid];
+                                       if ($gpid && $message)
+                                       {
+                                               $db_query = "SELECT * FROM 
phpgw_sms_tblUserPhonebook WHERE gpid='$gpid' AND uid='$uid'";
+                                               $db_result = 
dba_query($db_query);
+                                               while ($db_row = 
dba_fetch_array($db_result))
+                                               {
+                                                       $p_num = $db_row[p_num];
+                                                       $sms_to = $p_num;
+                                                       $max_length = 160 - 
strlen($sms_sender) - 3;
+                                                       if 
(strlen($message)>$max_length)
+                                                       {
+                                                               $message = 
substr ($message,0,$max_length-1);
+                                                       }
+                                                       $sms_msg = $message;
+                                                       $sms_msg = 
str_replace("\r","",$sms_msg);
+                                                       $sms_msg = 
str_replace("\n","",$sms_msg);
+                                                       $sms_msg = 
str_replace("\""," ",$sms_msg);
+                                                       $the_msg = 
"$sms_to\n$sms_msg";
+                                                       $mobile_sender = 
str_replace("\'","",$mobile_sender);
+                                                       $mobile_sender = 
str_replace("\"","",$mobile_sender);
+                                                       $sms_sender = 
str_replace("\'","",$sms_sender);
+                                                       $sms_sender = 
str_replace("\"","",$sms_sender);
+                                                       $sms_to = 
str_replace("\'","",$sms_to);
+                                                       $sms_to = 
str_replace("\"","",$sms_to);
+                                                       $send_code = 
md5(mktime().$sms_to);
+                                                       $db_query1 = "
+                                                       INSERT INTO 
phpgw_sms_tblSMSOutgoing (uid,p_src,p_dst,p_footer,p_msg,p_datetime,p_gpid) 
+                                                       VALUES 
('$uid','$mobile_sender','$sms_to','$sms_sender','$message','$datetime_now','$gpid')";
+                                                       $smslog_id = 
@dba_insert_id($db_query1);
+                                                       $sms_id = 
"$gp_code.$uid.$smslog_id";
+                                                       if ($smslog_id)
+                                                       {
+                                                               if 
($this->gw_send_sms($mobile_sender,$sms_sender,$sms_to,$sms_msg,$gp_code,$uid,$smslog_id))
+                                                               {
+                                                                       $ok = 
true;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
                        }
                        return $ok;
                }
@@ -709,31 +352,31 @@
                        if ($sms_sender && $target_code && $message)
                        {
                        // masked sender sets here
-                       $masked_sender = substr_replace($sms_sender,'xxxx',-4);
-                       $db_query = "
-                               INSERT INTO phpgw_sms_tblSMSIncoming 
-                               
(in_gateway,in_sender,in_masked,in_code,in_msg,in_datetime) 
-                               VALUES 
('$gateway_module','$sms_sender','$masked_sender','$target_code','$message','$sms_datetime')
-                       ";
-                       if ($cek_ok = @dba_insert_id($db_query))
-                       {
-                               $db_query1 = "SELECT board_forward_email FROM 
phpgw_sms_featboard WHERE board_code='$target_code'";
-                               $db_result1 = dba_query($db_query1);
-                               $db_row1 = dba_fetch_array($db_result1);
-                               $email = $db_row1[board_forward_email];
-                               if ($email)
-                               {
-                               $subject = "[SMSGW-$target_code] from 
$sms_sender";
-                               $body = "Forward WebSMS ($web_title)\n\n";
-                               $body .= "Date Time: $sms_datetime\n";
-                               $body .= "Sender: $sms_sender\n";
-                               $body .= "Code: $target_code\n\n";
-                               $body .= "Message:\n$message\n\n";
-                               $body .= $email_footer."\n\n";
-                               sendmail($email_service,$email,$subject,$body);
+                               $masked_sender = 
substr_replace($sms_sender,'xxxx',-4);
+                               $db_query = "
+                                       INSERT INTO phpgw_sms_tblSMSIncoming 
+                                       
(in_gateway,in_sender,in_masked,in_code,in_msg,in_datetime) 
+                                       VALUES 
('$gateway_module','$sms_sender','$masked_sender','$target_code','$message','$sms_datetime')
+                                       ";
+                               if ($cek_ok = @dba_insert_id($db_query))
+                               {
+                                       $db_query1 = "SELECT 
board_forward_email FROM phpgw_sms_featboard WHERE board_code='$target_code'";
+                                       $db_result1 = dba_query($db_query1);
+                                       $db_row1 = dba_fetch_array($db_result1);
+                                       $email = $db_row1[board_forward_email];
+                                       if ($email)
+                                       {
+                                               $subject = 
"[SMSGW-$target_code] from $sms_sender";
+                                               $body = "Forward WebSMS 
($web_title)\n\n";
+                                               $body .= "Date Time: 
$sms_datetime\n";
+                                               $body .= "Sender: 
$sms_sender\n";
+                                               $body .= "Code: 
$target_code\n\n";
+                                               $body .= 
"Message:\n$message\n\n";
+                                               $body .= $email_footer."\n\n";
+                                               
sendmail($email_service,$email,$subject,$body);
+                                       }
+                                       $ok = true;
                                }
-                               $ok = true;
-                       }
                        }
                        return $ok;
                }
@@ -852,46 +495,46 @@
                                if ($code == $reserved_codes[$i])
                                {
                                        $reserved = true;
-                       }
+                               }
                        }
                        if ($reserved)
                        {
-                       $ok = false;    
+                               $ok = false;    
                        }
                        else
                        {
-                       // check for SMS autoreply
-                       $db_query = "SELECT autoreply_id FROM 
phpgw_sms_featautoreply WHERE autoreply_code='$code'";
-                       if ($db_result = dba_num_rows($db_query))
-                       {
-                               $ok = false;
-                       }
-                       // check for SMS board
-                       $db_query = "SELECT board_id FROM phpgw_sms_featboard 
WHERE board_code='$code'";
-                       if ($db_result = dba_num_rows($db_query))
-                       {
-                               $ok = false;
-                       }
-                       // check for SMS command
-                       $db_query = "SELECT command_id FROM 
phpgw_sms_featcommand WHERE command_code='$code'";
-                       if ($db_result = dba_num_rows($db_query))
-                       {
-                               $ok = false;
-                       }
-                       // check for SMS custom
-                       $db_query = "SELECT custom_id FROM phpgw_sms_featcustom 
WHERE custom_code='$code'";
-                       if ($db_result = dba_num_rows($db_query))
-                       {
-                               $ok = false;
-                       }
-                       // check for SMS poll
-                       $db_query = "SELECT poll_id FROM phpgw_sms_featpoll 
WHERE poll_code='$code'";
-                       if ($db_result = dba_num_rows($db_query))
-                       {
-                               $ok = false;
-                       }
+                               // check for SMS autoreply
+                               $db_query = "SELECT autoreply_id FROM 
phpgw_sms_featautoreply WHERE autoreply_code='$code'";
+                               if ($db_result = dba_num_rows($db_query))
+                               {
+                                       $ok = false;
+                               }
+                               // check for SMS board
+                               $db_query = "SELECT board_id FROM 
phpgw_sms_featboard WHERE board_code='$code'";
+                               if ($db_result = dba_num_rows($db_query))
+                               {
+                                       $ok = false;
+                               }
+                               // check for SMS command
+                               $db_query = "SELECT command_id FROM 
phpgw_sms_featcommand WHERE command_code='$code'";
+                               if ($db_result = dba_num_rows($db_query))
+                               {
+                                       $ok = false;
+                               }
+                               // check for SMS custom
+                               $db_query = "SELECT custom_id FROM 
phpgw_sms_featcustom WHERE custom_code='$code'";
+                               if ($db_result = dba_num_rows($db_query))
+                               {
+                                       $ok = false;
+                               }
+                               // check for SMS poll
+                               $db_query = "SELECT poll_id FROM 
phpgw_sms_featpoll WHERE poll_code='$code'";
+                               if ($db_result = dba_num_rows($db_query))
+                               {
+                                       $ok = false;
+                               }
                        }
-                       return $ok;
+                               return $ok;
                }
                
                // part of SMS board
@@ -900,7 +543,11 @@
                        $web_title = $this->web_title;
                        include_once 
"$this->apps_path[libs]/gpl/feedcreator.class.php";
                        $code = strtoupper($code);
-                       if (!$line) { $line = "10"; };
+                       if (!$line)
+                       {
+                               $line = "10";
+                       };
+                       
                        $format_output = "RSS0.91";
                        $rss = new UniversalFeedCreator();
                        $db_query1 = "SELECT * FROM phpgw_sms_tblSMSIncoming 
WHERE in_code='$code' ORDER BY in_datetime DESC LIMIT 0,$line";
@@ -912,10 +559,10 @@
                                $datetime = $db_row1[in_datetime];
                                $items = new FeedItem();
                                $items->title = $title;
-                       $items->description = $description;
-                       $items->comments = $datetime;
-                       $items->date = strtotime($datetime);
-                       $rss->addItem($items);          
+                               $items->description = $description;
+                               $items->comments = $datetime;
+                               $items->date = strtotime($datetime);
+                               $rss->addItem($items);          
                        }
                        $feeds = $rss->createFeed($format_output);
                        return $feeds;
@@ -935,32 +582,32 @@
                        if ($db_row = dba_fetch_array($db_result))
                        {
                                $template = $db_row[board_pref_template];
-                       $db_query1 = "SELECT * FROM phpgw_sms_tblSMSIncoming 
WHERE in_code='$code' ORDER BY in_datetime DESC LIMIT 0,$line";
-                       $db_result1 = dba_query($db_query1);
-                       $content = "<html>\n<head>\n<title>$web_title - Code: 
$code</title>\n<meta name=\"author\" 
content=\"http://playsms.sourceforge.net\";>\n</head>\n<body 
bgcolor=\"$pref_bodybgcolor\" topmargin=\"0\" leftmargin=\"0\">\n<table 
width=100% cellpadding=2 cellspacing=2>\n";
-                       $i = 0;
-                       while ($db_row1 = dba_fetch_array($db_result1))
-                       {
-                               $i++;
-                               $sender = $db_row1[in_masked];
-                               $datetime = $db_row1[in_datetime];
-                               $message = $db_row1[in_msg];
-                               $tmp_template = $template;
-                               $tmp_template = 
str_replace("##SENDER##",$sender,$tmp_template);
-                               $tmp_template = 
str_replace("##DATETIME##",$datetime,$tmp_template);
-                               $tmp_template = 
str_replace("##MESSAGE##",$message,$tmp_template);
-                               if (($i % 2) == 0)
-                               {
-                               $pref_zigzagcolor = "$pref_evenbgcolor";
-                               }
-                               else
-                               {
-                               $pref_zigzagcolor = "$pref_oddbgcolor";
+                               $db_query1 = "SELECT * FROM 
phpgw_sms_tblSMSIncoming WHERE in_code='$code' ORDER BY in_datetime DESC LIMIT 
0,$line";
+                               $db_result1 = dba_query($db_query1);
+                               $content = "<html>\n<head>\n<title>$web_title - 
Code: $code</title>\n<meta name=\"author\" 
content=\"http://playsms.sourceforge.net\";>\n</head>\n<body 
bgcolor=\"$pref_bodybgcolor\" topmargin=\"0\" leftmargin=\"0\">\n<table 
width=100% cellpadding=2 cellspacing=2>\n";
+                               $i = 0;
+                               while ($db_row1 = dba_fetch_array($db_result1))
+                               {
+                                       $i++;
+                                       $sender = $db_row1[in_masked];
+                                       $datetime = $db_row1[in_datetime];
+                                       $message = $db_row1[in_msg];
+                                       $tmp_template = $template;
+                                       $tmp_template = 
str_replace("##SENDER##",$sender,$tmp_template);
+                                       $tmp_template = 
str_replace("##DATETIME##",$datetime,$tmp_template);
+                                       $tmp_template = 
str_replace("##MESSAGE##",$message,$tmp_template);
+                                       if (($i % 2) == 0)
+                                       {
+                                               $pref_zigzagcolor = 
"$pref_evenbgcolor";
+                                       }
+                                       else
+                                       {
+                                               $pref_zigzagcolor = 
"$pref_oddbgcolor";
+                                       }
+                                       $content .= "\n<tr><td width=100% 
bgcolor=\"$pref_zigzagcolor\">\n$tmp_template</td></tr>\n\n";
                                }
-                               $content .= "\n<tr><td width=100% 
bgcolor=\"$pref_zigzagcolor\">\n$tmp_template</td></tr>\n\n";
-                       }
-                       $content .= "</table>\n</body>\n</html>\n";
-                       return $content;
+                               $content .= "</table>\n</body>\n</html>\n";
+                               return $content;
                        }
                }
                
@@ -986,7 +633,7 @@
                        ";
                        if ($new_id = @dba_insert_id($db_query))
                        {
-                       $ok = true;
+                               $ok = true;
                        }
                        return $ok;
                }
@@ -1007,23 +654,23 @@
                        $url = parse_url($custom_url);
                        if (!$url['port']) 
                        {
-                       $url['port'] = 80;
+                               $url['port'] = 80;
                        }
                        $connection = 
fsockopen($url['host'],$url['port'],&$error_number,&$error_description,60);
                        if($connection) 
                        {
-                       socket_set_blocking($connection, false);
-                       fputs($connection, "GET $custom_url HTTP/1.0\r\n\r\n");
+                               socket_set_blocking($connection, false);
+                               fputs($connection, "GET $custom_url 
HTTP/1.0\r\n\r\n");
                                $db_query = "
                                INSERT INTO phpgw_sms_featcustom_log
                                
(sms_sender,custom_log_datetime,custom_log_code,custom_log_url) 
                                VALUES
                                
('$sms_sender','$datetime_now','$custom_code','$custom_url')
-                       ";
-                       if ($new_id = @dba_insert_id($db_query))
-                       {
-                               $ok = true;
-                       }
+                               ";
+                               if ($new_id = @dba_insert_id($db_query))
+                               {
+                                       $ok = true;
+                               }
                        }
                        return $ok;
                }
@@ -1037,13 +684,13 @@
                        $array_autoreply_request = explode(" 
",$autoreply_request);
                        for ($i=0;$i<count($array_autoreply_request);$i++)
                        {
-                       $autoreply_part[$i] = 
trim($array_autoreply_request[$i]);
-                       $tmp_autoreply_request .= 
$array_autoreply_request[$i]." ";
+                               $autoreply_part[$i] = 
trim($array_autoreply_request[$i]);
+                               $tmp_autoreply_request .= 
$array_autoreply_request[$i]." ";
                        }
                        $autoreply_request = trim($tmp_autoreply_request);
                        for ($i=1;$i<8;$i++)
                        {
-                       $autoreply_scenario_param_list .= 
"autoreply_scenario_param$i='".$autoreply_part[$i]."' AND ";
+                               $autoreply_scenario_param_list .= 
"autoreply_scenario_param$i='".$autoreply_part[$i]."' AND ";
                        }
                        $db_query = "
                        SELECT autoreply_scenario_result FROM 
phpgw_sms_featautoreply_scenario 
@@ -1058,25 +705,25 @@
                                
(sms_sender,autoreply_log_datetime,autoreply_log_code,autoreply_log_request) 
                                VALUES
                                
('$sms_sender','$datetime_now','$autoreply_code','$autoreply_request')
-                       ";
-                       if ($new_id = @dba_insert_id($db_query))
-                       {
-                               $ok = true;
-                       }
+                               ";
+                               if ($new_id = @dba_insert_id($db_query))
+                               {
+                                       $ok = true;
+                               }
                        }
                        if ($ok)
                        {
-                       $ok = false;
-                       $db_query = "SELECT uid FROM phpgw_sms_featautoreply 
WHERE autoreply_code='$autoreply_code'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $c_uid = $db_row[uid];
-                       $c_username = uid2username($c_uid);
-                       $smslog_id = 
websend2pv($c_username,$sms_sender,$autoreply_scenario_result);
-                       if ($smslog_id)
-                       {
-                               $ok = true;
-                       }
+                               $ok = false;
+                               $db_query = "SELECT uid FROM 
phpgw_sms_featautoreply WHERE autoreply_code='$autoreply_code'";
+                               $db_result = dba_query($db_query);
+                               $db_row = dba_fetch_array($db_result);
+                               $c_uid = $db_row[uid];
+                               $c_username = 
$GLOBALS['phpgw']->accounts->id2name($c_uid);
+                               $smslog_id = 
websend2pv($c_username,$sms_sender,$autoreply_scenario_result);
+                               if ($smslog_id)
+                               {
+                                       $ok = true;
+                               }
                        }
                        return $ok;
                }
@@ -1089,30 +736,30 @@
                        $target_choice = strtoupper($target_choice);
                        if ($sms_sender && $target_poll && $target_choice)
                        {
-                       $db_query = "SELECT poll_id,poll_enable FROM 
phpgw_sms_featpoll WHERE poll_code='$target_poll'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $poll_id = $db_row[poll_id];
-                       $poll_enable = $db_row[poll_enable];
-                       $db_query = "SELECT choice_id FROM 
phpgw_sms_featpoll_choice WHERE choice_code='$target_choice' AND 
poll_id='$poll_id'";
-                       $db_result = dba_query($db_query);
-                       $db_row = dba_fetch_array($db_result);
-                       $choice_id = $db_row[choice_id];
-                       if ($poll_id && $choice_id)
-                       {
-                               $db_query = "SELECT result_id FROM 
phpgw_sms_featpoll_result WHERE poll_sender='$sms_sender' AND 
poll_id='$poll_id'";
-                               $already_vote = @dba_num_rows($db_query);
-                               if ((!$already_vote) && $poll_enable)
+                               $db_query = "SELECT poll_id,poll_enable FROM 
phpgw_sms_featpoll WHERE poll_code='$target_poll'";
+                               $db_result = dba_query($db_query);
+                               $db_row = dba_fetch_array($db_result);
+                               $poll_id = $db_row[poll_id];
+                               $poll_enable = $db_row[poll_enable];
+                               $db_query = "SELECT choice_id FROM 
phpgw_sms_featpoll_choice WHERE choice_code='$target_choice' AND 
poll_id='$poll_id'";
+                               $db_result = dba_query($db_query);
+                               $db_row = dba_fetch_array($db_result);
+                               $choice_id = $db_row[choice_id];
+                               if ($poll_id && $choice_id)
                                {
-                               $db_query = "
-                                       INSERT INTO phpgw_sms_featpoll_result 
-                                       (poll_id,choice_id,poll_sender) 
-                                       VALUES 
('$poll_id','$choice_id','$sms_sender')
-                               ";
-                               dba_query($db_query);
+                                       $db_query = "SELECT result_id FROM 
phpgw_sms_featpoll_result WHERE poll_sender='$sms_sender' AND 
poll_id='$poll_id'";
+                                       $already_vote = 
@dba_num_rows($db_query);
+                                       if ((!$already_vote) && $poll_enable)
+                                       {
+                                               $db_query = "
+                                                       INSERT INTO 
phpgw_sms_featpoll_result 
+                                                       
(poll_id,choice_id,poll_sender) 
+                                                       VALUES 
('$poll_id','$choice_id','$sms_sender')
+                                                       ";
+                                               dba_query($db_query);
+                                       }
+                                       $ok = true;
                                }
-                               $ok = true;
-                       }
                        }
                        return $ok;     
                }
@@ -1130,11 +777,11 @@
                                $message = $array_target_group[1];
                                for ($i=2;$i<count($array_target_group);$i++)
                                {
-                               $message .= " ".$array_target_group[$i];
+                                       $message .= " ".$array_target_group[$i];
                                }
                                if 
($this->send2group($sms_sender,$target_group,$message))
                                {
-                               $ok = true;
+                                       $ok = true;
                                }
                                break;
                        case "PV":
@@ -1143,11 +790,11 @@
                                $message = $array_target_user[1];
                                for ($i=2;$i<count($array_target_user);$i++)
                                {
-                               $message .= " ".$array_target_user[$i];
+                                       $message .= " ".$array_target_user[$i];
                                }
                                if 
($this->insertsmstoinbox($sms_datetime,$sms_sender,$target_user,$message))
                                {
-                               $ok = true;
+                                       $ok = true;
                                }
                                break;
                        default:
@@ -1155,7 +802,6 @@
                                $db_query = "SELECT autoreply_id FROM 
phpgw_sms_featautoreply WHERE autoreply_code='$target_code'";
                                $this->db->query($db_query,__LINE__,__FILE__);
                                if($this->db->next_record())
-                       //      if ($db_result = dba_num_rows($db_query))
                                {
                                        if 
($this->processautoreply($sms_datetime,$sms_sender,$target_code,$message))
                                        {
@@ -1166,7 +812,6 @@
                                $db_query = "SELECT poll_id FROM 
phpgw_sms_featpoll WHERE poll_code='$target_code'";
                                $this->db->query($db_query,__LINE__,__FILE__);
                                if($this->db->next_record())
-                       //      if ($db_result = dba_num_rows($db_query))
                                {
                                        if 
($this->savepoll($sms_sender,$target_code,$message))
                                        {
@@ -1177,7 +822,6 @@
                                $db_query = "SELECT command_id FROM 
phpgw_sms_featcommand WHERE command_code='$target_code'";
                                $this->db->query($db_query,__LINE__,__FILE__);
                                if($this->db->next_record())
-//                             if ($db_result = dba_num_rows($db_query))
                                {
                                        if 
($this->execcommand($sms_datetime,$sms_sender,$target_code,$message))
                                        {
@@ -1188,7 +832,6 @@
                                $db_query = "SELECT custom_id FROM 
phpgw_sms_featcustom WHERE custom_code='$target_code'";
                                $this->db->query($db_query,__LINE__,__FILE__);
                                if($this->db->next_record())
-               //              if ($db_result = dba_num_rows($db_query))
                                {
                                        if 
($this->processcustom($sms_datetime,$sms_sender,$target_code,$message))
                                        {
@@ -1199,7 +842,6 @@
                                $db_query = "SELECT board_id FROM 
phpgw_sms_featboard WHERE board_code='$target_code'";
                                $this->db->query($db_query,__LINE__,__FILE__);
                                if($this->db->next_record())
-               //              if ($db_result = dba_num_rows($db_query))
                                {
                                        if 
($this->insertsmstodb($sms_datetime,$sms_sender,$target_code,$message))
                                        {
@@ -1209,16 +851,13 @@
                        }
                        if (!$ok)
                        {
-                       $message = $target_code." ".$message;
-                       if 
($this->insertsmstoinbox($sms_datetime,$sms_sender,"Admins",$message))
-                       {
-                               $ok = true;
-                       }
+                               $message = $target_code." ".$message;
+                               if 
($this->insertsmstoinbox($sms_datetime,$sms_sender,"Admins",$message))
+                               {
+                                       $ok = true;
+                               }
                        }
                        return $ok;
                }
-
-
        }
-
 ?>
Index: sms/inc/plugin/gateway/clickatell/fn.php
diff -u sms/inc/plugin/gateway/clickatell/fn.php:1.1.1.1 
sms/inc/plugin/gateway/clickatell/fn.php:1.2
--- sms/inc/plugin/gateway/clickatell/fn.php:1.1.1.1    Mon May 15 10:29:23 2006
+++ sms/inc/plugin/gateway/clickatell/fn.php    Fri May 26 08:06:04 2006
@@ -99,7 +99,7 @@
        $p_datetime = $db_row[p_datetime];
        $p_update = $db_row[p_update];
        $gpid = $db_row[p_gpid];
-       $gp_code = gpid2gpcode($gpid);
+       $gp_code = $GLOBALS['phpgw']->accounts->name2id($gpid);
        
clktl_gw_set_delivery_status($gp_code,$uid,$smslog_id,$p_datetime,$p_update);
     }
 }
Index: sms/setup/default_records.inc.php
diff -u sms/setup/default_records.inc.php:1.5 
sms/setup/default_records.inc.php:1.6
--- sms/setup/default_records.inc.php:1.5       Thu May 25 19:47:10 2006
+++ sms/setup/default_records.inc.php   Fri May 26 08:06:04 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage setup
-       * @version $Id: default_records.inc.php,v 1.5 2006/05/25 19:47:10 
sigurdne Exp $
+       * @version $Id: default_records.inc.php,v 1.6 2006/05/26 08:06:04 
sigurdne Exp $
        */
 
 
@@ -22,16 +22,7 @@
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('sms', '.', 'Top')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_grant) VALUES ('sms', '.inbox', 'InBox',1)");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_grant) VALUES ('sms', '.outbox', 'OutBox',1)");
-/*
-       $GLOBALS['phpgw_setup']->oProc->query("DELETE from phpgw_config WHERE 
config_app='sms'");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES ('sms','gnokii_cfg', 
'/usr/local')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES ('sms','email_service', 
'address@hidden')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES ('sms','gateway_module', 
'gnokii')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES ('sms','gateway_number', 
'+4790665164')");
-       $reserved_codes         = serialize(array 
("PV","BC","GET","PUT","INFO","SAVE","DEL","LIST","RETR","POP3","SMTP","BROWSE","NEW","SET","POLL","VOTE","REGISTER","REG","DO","USE","EXECUTE","EXEC","RUN","ACK"));
 
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES ('sms','reserved_codes', 
'$reserved_codes')");
-*/
 // -- start config
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_type (id,name, descr) VALUES ('1', 'common', 'common config 
values')");
@@ -101,12 +92,6 @@
 
 // -- end config
 
-//     $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_gwmodclickatell_config 
(cfg_name,cfg_api_id,cfg_username,cfg_password,cfg_sender,cfg_send_url,cfg_incoming_path,cfg_credit)
 VALUES 
('clickatell','123456','playsms','pwd','PlaySMS','http://api.clickatell.com/http','/usr/local',10)");
-//     $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_gwmodTemplate_config (cfg_name,cfg_path) VALUES 
('template','/usr/local')");
-//     $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_gwmodUplink_config 
(cfg_name,cfg_master,cfg_username,cfg_password,cfg_global_sender,cfg_incoming_path)
 VALUES 
('uplink','http://cpanel.smsrakyat.net','playsms','pwd','','/usr/local')");
-//     $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_gwmodgnokii_config (cfg_name, cfg_path) VALUES ('gnokii', 
'/usr/local')");
-//     $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_gwmodkannel_config (cfg_name, cfg_incoming_path, cfg_username, 
cfg_password, cfg_global_sender, cfg_bearerbox_host, cfg_sendsms_port, 
cfg_playsms_web) VALUES ('kannel', '/usr/local', 'playsms', 'pwd', '92824', 
'127.0.0.1', '13131', 'http://localhost/~playsms')");
-//     $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tblconfig_main (cfg_web_title, cfg_email_service, cfg_email_footer, 
cfg_gateway_module, cfg_gateway_number) VALUES ('PlaySMS MPS (Mobile Portal 
System)', 'address@hidden', 'PlaySMS MPS (Mobile Portal System)', 'gnokii', 
'')");
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_gwmodUplink (up_local_slid,up_remote_slid,up_status) VALUES 
(3,259,1)");
 
@@ -132,173 +117,6 @@
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tblsmstemplate ( uid, t_title, t_text) VALUES ( 1, 'Good morning', 
'Hi u there, good morning!!')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tblsmstemplate ( uid, t_title, t_text) VALUES ( 1, 'Good night have a 
sweet dream', 'Hi sweetheart, good night and have a sweet dream :*')");
 
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_tbluser ( 
status, ticket, username, password, name, mobile, email, sender, dailysms, 
gender, age, address, city, state, country, birthday, marital, education, 
zipcode, junktimestamp) VALUES (2, 'd0b3239a5da9504a1a38f7745790c3c4', 'admin', 
'admin', 'Administrator', '+628568809027', 'address@hidden', '- anton', 0, 1, 
0, 'Jl. Pangkalan Jati II no. 19 Kalimalang', 'Jakarta Timur', 'DKI Jakarta', 
132, '1979-02-14', 1, 1, '13620', '1102793982')");
-
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (1, 
'Afghanistan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (2, 'Albania')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (3, 'Algeria')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (5, 'Andorra')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (10, 'Argentina')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (11, 'Armenia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (14, 'Australia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (16, 'Austria')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (18, 
'Azerbaijan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (19, 'Bahamas')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (20, 'Bahrain')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (21, 
'Bangladesh')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (24, 'Belarus')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (25, 'Belgium')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (29, 'Bermuda')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (30, 'Bhutan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (31, 'Bolivia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (32, 
'Bosnia-Herzegovina')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (33, 'Botswana')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (35, 'Brazil')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (38, 'Brunei')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (39, 'Bulgaria')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (41, 'Burundi')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (42, 'Cambodia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (44, 'Cameroon')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (45, 'Canada')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (51, 'Chile')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (52, 'China')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (55, 'Columbia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (58, 'Congo')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (60, 'Costa 
Rica')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (61, 'Croatia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (62, 'Cuba')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (66, 'Czech 
Republic')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (67, 'Denmark')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (74, 'East 
Timor')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (76, 'Ecuador')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (77, 'Egypt')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (78, 'El 
Salvador')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (81, 'Estonia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (84, 'Fiji 
Islands')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (85, 'Finland')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (86, 'France')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (93, 'Gabon')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (94, 'Gambia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (96, 'Germany')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (98, 'Ghana')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (100, 'Greece')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (105, 'Guam')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (107, 
'Guatemala')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (108, 'UK')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (111, 'Guyana')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (112, 'Haiti')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (113, 'Honduras')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (114, 'HongKong')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (118, 'Hungary')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (120, 'Iceland')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (121, 'India')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (132, 
'Indonesia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (139, 'Iran')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (140, 'Iraq')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (141, 'Ireland')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (143, 'Israel')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (144, 'Italy')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (146, 'Ivory 
Coast')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (147, 'Jamaica')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (148, 'Japan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (150, 'Jordan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (151, 
'Kazakhstan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (153, 'Kenya')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (155, 'Korea 
(South)')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (156, 'Korea 
(North)')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (157, 'Kuwait')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (158, 
'Kyrgyzstan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (160, 'Latvia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (161, 'Lebanon')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (163, 'Liberia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (164, 'Libya')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (166, 
'Lithuania')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (167, 
'Luxembourg')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (170, 
'Macedonia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (171, 'Malawi')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (173, 'Malaysia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (175, 'Maldives')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (177, 'Mali 
Republic')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (178, 'Malta')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (181, 
'Mauritania')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (184, 'Mexico')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (186, 'Moldova')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (188, 'Mongolia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (189, 
'Montserrat')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (190, 'Morocco')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (192, 
'Mozambique')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (193, 'Myanmar')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (194, 'Namibia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (196, 'Nepal')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (197, 
'Netherlands')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (201, 'New 
Zealand')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (202, 
'Nicaragua')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (203, 'Niger')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (204, 'Nigeria')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (208, 'Norway')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (209, 'Oman')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (210, 'Pakistan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (211, 'Palau')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (212, 
'Palestine')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (213, 'Panama')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (214, 'Papua New 
Guinea')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (215, 'Paraguay')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (216, 'Peru')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (217, 
'Philippines')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (220, 'Poland')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (223, 'Portugal')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (225, 'Puerto 
Rico')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (226, 'Qatar')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (228, 'Romania')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (229, 'Russia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (232, 'Rwanda')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (238, 'Samoa')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (241, 'Saudi 
Arabia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (242, 'Senegal')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (244, 'Sierra 
Leone')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (245, 
'Singapore')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (248, 'Slovakia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (249, 'Slovenia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (251, 'Somalia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (252, 'South 
Africa')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (253, 'Spain')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (256, 'Sri 
Lanka')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (257, 'Sudan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (258, 'Suriname')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (259, 
'Swaziland')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (260, 'Sweden')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (262, 
'Switzerland')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (263, 'Syria')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (264, 'Taiwan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (267, 
'Tajikistan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (268, 'Tanzania')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (269, 'Thailand')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (274, 'Trinidad and 
Tobago')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (275, 'Tunisia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (276, 'Turkey')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (277, 
'Turkmenistan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (279, 'Tuvalu')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (280, 'Uganda')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (281, 'Ukraine')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (284, 'USA')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (289, 'United Arab 
Emirates')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (290, 'Uruguay')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (291, 
'Uzbekistan')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (293, 'Vatican City 
State')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (294, 
'Venezuela')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (295, 'Vietnam')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (299, 'Yemen')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (300, 
'Yugoslavia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (303, 'Zambia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (305, 'Zimbabwe')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (312, 'Ethiopia')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (314, 'South 
Korea')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (318, 'Angola')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (319, 'Aruba')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (320, 'Laos')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (325, 'Serbia & 
Montenegro (Yugoslavia)')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (332, 'Jersey')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tbluser_country (country_id, country_name) VALUES (334, 'OTHER 
(unlisted)')");
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_tblusergroupphonebook ( uid, gp_name, gp_code) VALUES ( 1, 'Friends', 
'FR')");
 
Index: sms/setup/setup.inc.php
diff -u sms/setup/setup.inc.php:1.4 sms/setup/setup.inc.php:1.5
--- sms/setup/setup.inc.php:1.4 Thu May 25 19:47:10 2006
+++ sms/setup/setup.inc.php     Fri May 26 08:06:04 2006
@@ -6,7 +6,7 @@
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package sms
        * @subpackage setup
-       * @version $Id: setup.inc.php,v 1.4 2006/05/25 19:47:10 sigurdne Exp $
+       * @version $Id: setup.inc.php,v 1.5 2006/05/26 08:06:04 sigurdne Exp $
        */
 
        $setup_info['sms']['name']      = 'sms';
@@ -57,12 +57,12 @@
                'phpgw_sms_tblsmsincoming',
                'phpgw_sms_tblsmsoutgoing',
                'phpgw_sms_tblsmstemplate',
-               'phpgw_sms_tbluser',
+//             'phpgw_sms_tbluser',
                'phpgw_sms_tblusergroupphonebook',
                'phpgw_sms_tblusergroupphonebook_public',
                'phpgw_sms_tbluserinbox',
                'phpgw_sms_tbluserphonebook',
-               'phpgw_sms_tbluser_country'
+//             'phpgw_sms_tbluser_country'
        );
 
        /* The hooks this app includes, needed for hooks registration */
Index: sms/setup/tables_current.inc.php
diff -u sms/setup/tables_current.inc.php:1.6 
sms/setup/tables_current.inc.php:1.7
--- sms/setup/tables_current.inc.php:1.6        Thu May 25 19:47:10 2006
+++ sms/setup/tables_current.inc.php    Fri May 26 08:06:04 2006
@@ -7,7 +7,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage setup
-       * @version $Id: tables_current.inc.php,v 1.6 2006/05/25 19:47:10 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.7 2006/05/26 08:06:04 
sigurdne Exp $
        */
 
 
@@ -339,7 +339,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-
+/*
                'phpgw_sms_tbluser' => array(
                        'fd' => array(
                                'uid' => array('type' => 'auto','nullable' => 
False),
@@ -369,7 +369,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-
+*/
                'phpgw_sms_tblusergroupphonebook' => array(
                        'fd' => array(
                                'gpid' => array('type' => 'auto','nullable' => 
False),
@@ -425,6 +425,7 @@
                        'uc' => array()
                ),
 
+/*
                'phpgw_sms_tbluser_country' => array(
                        'fd' => array(
                                'country_id' => array('type' => 
'auto','nullable' => False),
@@ -435,7 +436,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-
+*/
                'phpgw_sms_config_type' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
4,'nullable' => False),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]