[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sms inc/class.bocommon.inc.php inc/class.bosms....
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] sms inc/class.bocommon.inc.php inc/class.bosms.... |
Date: |
Tue, 16 May 2006 19:45:49 +0000 |
CVSROOT: /sources/phpgroupware
Module name: sms
Branch:
Changes by: Sigurd Nes <address@hidden> 06/05/16 19:45:49
Modified files:
inc : class.bocommon.inc.php class.bosms.inc.php
class.sms.inc.php class.uisms.inc.php
setup : default_records.inc.php setup.inc.php
inc/plugin/gateway/gnokii: fn.php
. : init.php
Added files:
inc : config.php hook_preferences.inc.php
hook_settings.inc.php
Log message:
no message
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.bocommon.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.bosms.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.sms.inc.php.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.uisms.inc.php.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/config.php?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/hook_preferences.inc.php?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/hook_settings.inc.php?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/default_records.inc.php.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/setup.inc.php.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/plugin/gateway/gnokii/fn.php.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/init.php.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: sms/inc/class.bocommon.inc.php
diff -u sms/inc/class.bocommon.inc.php:1.1 sms/inc/class.bocommon.inc.php:1.2
--- sms/inc/class.bocommon.inc.php:1.1 Mon May 15 13:22:39 2006
+++ sms/inc/class.bocommon.inc.php Tue May 16 19:45:49 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage core
- * @version $Id: class.bocommon.inc.php,v 1.1 2006/05/15 13:22:39
sigurdne Exp $
+ * @version $Id: class.bocommon.inc.php,v 1.2 2006/05/16 19:45:49
sigurdne Exp $
*/
/**
@@ -55,7 +55,7 @@
function bocommon()
{
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->socommon =
CreateObject($this->currentapp.'.socommon');
+ // $this->socommon =
CreateObject($this->currentapp.'.socommon');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->join = $this->socommon->join;
@@ -76,6 +76,10 @@
$this->dateformat =
"Y-m-d";
$this->datetimeformat = "Y-m-d G:i:s";
break;
+ case 'postgres':
+ $this->dateformat =
"Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ break;
}
}
Index: sms/inc/class.bosms.inc.php
diff -u sms/inc/class.bosms.inc.php:1.1 sms/inc/class.bosms.inc.php:1.2
--- sms/inc/class.bosms.inc.php:1.1 Tue May 16 13:56:05 2006
+++ sms/inc/class.bosms.inc.php Tue May 16 19:45:49 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage place
- * @version $Id: class.bosms.inc.php,v 1.1 2006/05/16 13:56:05 sigurdne
Exp $
+ * @version $Id: class.bosms.inc.php,v 1.2 2006/05/16 19:45:49 sigurdne
Exp $
*/
/**
@@ -41,6 +41,8 @@
$this->so =
CreateObject($this->currentapp.'.sms');
// $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
+ $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
+
if ($session)
{
$this->read_sessiondata();
@@ -136,6 +138,8 @@
function send_sms($values)
{
+ $username =
$GLOBALS['phpgw']->accounts->id2name($this->account);
+
$p_num = $values['p_num'];
if (!$p_num[0])
{
Index: sms/inc/class.sms.inc.php
diff -u sms/inc/class.sms.inc.php:1.2 sms/inc/class.sms.inc.php:1.3
--- sms/inc/class.sms.inc.php:1.2 Tue May 16 13:56:05 2006
+++ sms/inc/class.sms.inc.php Tue May 16 19:45:49 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.2 2006/05/16 13:56:05 sigurdne
Exp $
+ * @version $Id: class.sms.inc.php,v 1.3 2006/05/16 19:45:49 sigurdne
Exp $
*/
/**
@@ -17,11 +17,26 @@
*/
-// print_r ($GLOBALS['phpgw_info']['sms_config']);
+// _debug_array ($GLOBALS['phpgw_info']['sms_config']);
+
+ $apps_path[base] = PHPGW_SERVER_ROOT . SEP . 'sms';
+ $apps_path[libs] = "$apps_path[base]/lib";
+ $apps_path[plug] = "$apps_path[base]/inc/plugin";
+ $apps_path[inc] = "$apps_path[base]/inc";
- if
(file_exists($GLOBALS['phpgw_info']['sms_config']['apps_path'][plug]."/gateway/"
. $GLOBALS['phpgw_info']['sms_config']['gateway_module']. "/fn.php"))
+ // SMS command security parameter
+ $feat_command_path[bin] = $apps_path[base]."/bin";
+ $GLOBALS['phpgw_info']['sms_config']['apps_path'] = $apps_path;
+ $GLOBALS['phpgw_info']['sms_config']['feat_command_path'] =
$feat_command_path;
+
+ if(!$GLOBALS['phpgw_info']['sms_config']['gateway_module'])
{
-
include_once($GLOBALS['phpgw_info']['sms_config']['apps_path'][plug]."/gateway/"
. $GLOBALS['phpgw_info']['sms_config']['gateway_module']. "/fn.php");
+ include_once(PHPGW_APP_INC . SEP . 'config.php');
+ }
+
+ if (file_exists($apps_path[inc] . SEP . 'plugin' . SEP . 'gateway' .
SEP . $GLOBALS['phpgw_info']['sms_config']['gateway_module']. "/fn.php"))
+ {
+ include_once($apps_path[inc] . SEP . 'plugin' . SEP . 'gateway' .
SEP. $GLOBALS['phpgw_info']['sms_config']['gateway_module']. "/fn.php");
}
else
{
@@ -39,7 +54,6 @@
{
var $apps_path;
-
function sms_()
{
$this->apps_config =
$GLOBALS['phpgw_info']['sms_config']['apps_config'];
@@ -50,15 +64,48 @@
$this->web_title =
$GLOBALS['phpgw_info']['sms_config']['web_title'];
$this->email_service =
$GLOBALS['phpgw_info']['sms_config']['email_service'];
$this->email_footer =
$GLOBALS['phpgw_info']['sms_config']['email_footer'];
- $this->datetime_now =
$GLOBALS['phpgw_info']['sms_config']['datetime_now'];
$this->reserved_codes =
$GLOBALS['phpgw_info']['sms_config']['reserved_codes'];
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ $request['start_date'] =
$GLOBALS['phpgw']->common->show_date($request['start_date'],$dateformat);
+ $request['end_date'] =
$GLOBALS['phpgw']->common->show_date($request['end_date'],$dateformat);
+
+
$this->db = $GLOBALS['phpgw']->db;
$this->db2 = clone($this->db);
$this->init = true;
- }
+ switch($GLOBALS['phpgw_info']['server']['db_type'])
+ {
+ case 'mssql':
+ $this->dateformat = "M d
Y";
+ $this->datetimeformat = "M d
Y g:iA";
+ $this->time_format =
"g:iA";
+
+ break;
+ case 'mysql':
+ $this->dateformat =
"Y-m-d";
+ $this->datetimeformat =
"Y-m-d G:i:s";
+ $this->time_format =
"G:i:s";
+
+ break;
+ case 'pgsql':
+ $this->dateformat =
"Y-m-d";
+ $this->datetimeformat =
"Y-m-d G:i:s";
+ $this->time_format =
"G:i:s";
+ break;
+ case 'postgres':
+ $this->dateformat =
"Y-m-d";
+ $this->datetimeformat =
"Y-m-d G:i:s";
+ $this->time_format =
"G:i:s";
+ break;
+ }
+
+ $this->datetime_now = date($this->datetime_format,
time());
+ $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
+
+ }
function validatelogin($username,$password)
{
@@ -242,13 +289,18 @@
function username2mobile($username)
{
- if ($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();
+ $mobile =
$GLOBALS['phpgw_info']['user']['preferences']['sms']['cellphone'];
return $mobile;
}
@@ -450,11 +502,13 @@
function
websend2pv($username,$sms_to,$message,$sms_type="text",$unicode="0")
{
$datetime_now = $this->datetime_now;
- $gateway_module = $this->$gateway_module;
- $uid = username2uid($username);
- $mobile_sender = username2mobile($username);
+ $gateway_module = $this->gateway_module;
+
+ $uid = $this->account;
+// $uid = $this->username2uid($username);
+ $mobile_sender = $this->username2mobile($username);
$max_length = 160;
- if ($sms_sender = username2sender($username))
+ if ($sms_sender = $this->username2sender($username))
{
$max_length = $max_length - strlen($sms_sender) - 1;
}
@@ -508,7 +562,7 @@
function
websend2group($username,$gp_code,$message,$sms_type="text")
{
$datetime_now = $this->datetime_now;
- $gateway_module = $this->$gateway_module;
+ $gateway_module = $this->gateway_module;
$uid = username2uid($username);
$mobile_sender = username2mobile($username);
$max_length = 160;
@@ -639,7 +693,7 @@
$email_footer = $this->email_footer;
$email_service = $this->email_service;
$web_title = $this->web_title;
- $gateway_module = $this->$gateway_module;
+ $gateway_module = $this->gateway_module;
$ok = false;
if ($sms_sender && $target_code && $message)
Index: sms/inc/class.uisms.inc.php
diff -u sms/inc/class.uisms.inc.php:1.3 sms/inc/class.uisms.inc.php:1.4
--- sms/inc/class.uisms.inc.php:1.3 Tue May 16 13:56:05 2006
+++ sms/inc/class.uisms.inc.php Tue May 16 19:45:49 2006
@@ -1,53 +1,52 @@
-<?php
- /**
- * phpGroupWare - sms: A SMS Gateway
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package sms
- * @subpackage sms
- * @version $Id: class.uisms.inc.php,v 1.3 2006/05/16 13:56:05 sigurdne
Exp $
- */
-
- /**
- * Description
- * @package sms
- */
-
- class uisms
- {
- var $grants;
- var $start;
- var $query;
- var $sort;
- var $order;
- var $sub;
- var $currentapp;
-
- var $public_functions = array
- (
- 'index' => True,
- 'outbox' => True,
+<?php
+ /**
+ * phpGroupWare - sms: A SMS Gateway
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package sms
+ * @subpackage sms
+ * @version $Id: class.uisms.inc.php,v 1.4 2006/05/16 19:45:49 sigurdne
Exp $
+ */
+
+ /**
+ * Description
+ * @package sms
+ */
+
+ class uisms
+ {
+ var $grants;
+ var $start;
+ var $query;
+ var $sort;
+ var $order;
+ var $sub;
+ var $currentapp;
+
+ var $public_functions = array
+ (
+ 'index' => True,
+ 'outbox' => True,
'send' => True,
- 'send_group'=> True,
- 'delete' => True
- );
-
- function uisms()
- {
- $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
- $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
- $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
-
- $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
+ 'send_group'=> True,
+ 'delete' => True
+ );
+
+ function uisms()
+ {
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
+ $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
// $this->bocategory =
CreateObject($this->currentapp.'.bocategory');
$this->config =
CreateObject('phpgwapi.config');
$this->config->read_repository();
$this->gateway_number =
$this->config->config_data['gateway_number'];
- $GLOBALS['phpgw_info']['sms_config']['gateway_module']
= $this->config->config_data['gateway_module'];
+// $GLOBALS['phpgw_info']['sms_config']['gateway_module']
= $this->config->config_data['gateway_module'];
$this->bo =
CreateObject($this->currentapp.'.bosms',False);
/*
$GLOBALS['phpgw_info']['sms_config']['reserved_codes'] = $reserved_codes;
@@ -64,30 +63,30 @@
$GLOBALS['phpgw_info']['sms_config']['gnokii_cfg'] = $gnokii_cfg;
*/
- $this->menu =
CreateObject($this->currentapp.'.menu');
- $this->grants =
$this->bo->grants;
- $this->start =
$this->bo->start;
- $this->query =
$this->bo->query;
- $this->sort =
$this->bo->sort;
- $this->order =
$this->bo->order;
- $this->allrows =
$this->bo->allrows;
- }
-
- function save_sessiondata()
- {
- $data = array
- (
- 'start' => $this->start,
- 'query' => $this->query,
- 'sort' => $this->sort,
- 'order' => $this->order,
- );
-
- // $this->bo->save_sessiondata($data);
- }
-
- function index()
- {
+ $this->menu =
CreateObject($this->currentapp.'.menu');
+ $this->grants =
$this->bo->grants;
+ $this->start =
$this->bo->start;
+ $this->query =
$this->bo->query;
+ $this->sort =
$this->bo->sort;
+ $this->order =
$this->bo->order;
+ $this->allrows =
$this->bo->allrows;
+ }
+
+ function save_sessiondata()
+ {
+ $data = array
+ (
+ 'start' => $this->start,
+ 'query' => $this->query,
+ 'sort' => $this->sort,
+ 'order' => $this->order,
+ );
+
+ // $this->bo->save_sessiondata($data);
+ }
+
+ function index()
+ {
$GLOBALS['phpgw']->xslttpl->add_file(array('sms','nextmatchs','menu',
'search_field'));
@@ -98,7 +97,6 @@
while (is_array($sms_info) && list(,$entry) =
each($sms_info))
{
-
$content[] = array
(
'name'
=> $entry['name'],
@@ -192,8 +190,10 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
$this->save_sessiondata();
-
- }
+
+
+ }
+
function outbox()
{
@@ -300,22 +300,25 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
$this->save_sessiondata();
-
- }
+
+
+ }
function send()
{
- $values =
get_var('values',array('POST'));
- $values['p_num_text'] =
get_var('p_num_text',array('POST'));
- $values['message'] =
get_var('message',array('POST'));
- $values['msg_flash'] =
get_var('msg_flash',array('POST'));
- $values['msg_unicode'] =
get_var('msg_unicode',array('POST'));
+ $values =
get_var('values',array('POST'));
$GLOBALS['phpgw']->xslttpl->add_file(array('sms'));
$max_length = 160;
+
if (is_array($values))
{
+ $values['p_num_text'] =
get_var('p_num_text',array('POST'));
+ $values['message'] =
get_var('message',array('POST'));
+ $values['msg_flash'] =
get_var('msg_flash',array('POST'));
+ $values['msg_unicode'] =
get_var('msg_unicode',array('POST'));
+
if ($values['save'] || $values['apply'])
{
@@ -342,7 +345,7 @@
}
else
{
-
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uisms.send&sms_id='
. $sms_id);
+
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uisms.index');
}
}
@@ -443,5 +446,7 @@
}
-
- }
+
+
+ }
+
Index: sms/inc/plugin/gateway/gnokii/fn.php
diff -u sms/inc/plugin/gateway/gnokii/fn.php:1.1.1.1
sms/inc/plugin/gateway/gnokii/fn.php:1.2
--- sms/inc/plugin/gateway/gnokii/fn.php:1.1.1.1 Mon May 15 10:29:23 2006
+++ sms/inc/plugin/gateway/gnokii/fn.php Tue May 16 19:45:49 2006
@@ -1,8 +1,7 @@
<?php
class sms extends sms_
- {
-
+ {
function sms()
{
$this->db = $GLOBALS['phpgw']->db;
@@ -129,4 +128,4 @@
}
}
-?>
\ No newline at end of file
+?>
Index: sms/init.php
diff -u sms/init.php:1.2 sms/init.php:1.3
--- sms/init.php:1.2 Tue May 16 13:56:05 2006
+++ sms/init.php Tue May 16 19:45:49 2006
@@ -1,36 +1,10 @@
<?php
-// include "config.php";
-//
--------------------------------------------------------------------------------
-/*
-if (!$DAEMON_PROCESS)
-{
- if (trim($SERVER_PROTOCOL)=="HTTP/1.1")
- {
- header ("Cache-Control: no-cache, must-revalidate");
- }
- else
- {
- header ("Pragma: no-cache");
- }
- ob_start();
-}
-*/
-//
--------------------------------------------------------------------------------
-
-// set global variable
-$date_format = "Y-m-d";
-$time_format = "G:i:s";
-$datetime_format = $date_format." ".$time_format;
-$date_now = date($date_format, time());
-$time_now = date($time_format, time());
-$datetime_now = date($datetime_format, time());
-$reserved_codes = 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");
-sort ($reserved_codes);
-$nd = "<font color=red>(*)</font>";
+ // set global variable
+ $nd = "<font color=red>(*)</font>";
-// very important, do not try to remove it or change it
-define ("_SECURE_","1");
+ // very important, do not try to remove it or change it
+ define ("_SECURE_","1");
$path_to_phpgroupware = dirname(__FILE__) . '/..'; // need to be
adapted if this script is moved somewhere else
$_GET['domain'] = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] :
'default';
@@ -40,126 +14,22 @@
'noapi' => True // this stops header.inc.php to
include phpgwapi/inc/function.inc.php
);
include($path_to_phpgroupware.'/header.inc.php');
-
unset($GLOBALS['phpgw_info']['flags']['noapi']);
-
$db_type = $GLOBALS['phpgw_domain'][$_GET['domain']]['db_type'];
-
$GLOBALS['phpgw_info']['server']['sessions_type'] = 'db';
-
include(PHPGW_API_INC.'/functions.inc.php');
+ // SMTP sendmail
+ define("_SMTP_RELM_","");
+ define("_SMTP_USER_","");
+ define("_SMTP_PASS_","");
+ define("_SMTP_HOST_","localhost");
+ define("_SMTP_PORT_","25");
+
+ // more configuration
+ $apps_config['multilogin'] = 1; // 0 for single session login; 1
for multi session login
+ $GLOBALS['phpgw_info']['sms_config']['apps_config'] = $apps_config;
-// SMTP sendmail
-define("_SMTP_RELM_","");
-define("_SMTP_USER_","");
-define("_SMTP_PASS_","");
-define("_SMTP_HOST_","localhost");
-define("_SMTP_PORT_","25");
-
-// base application directory
-$apps_path[base] = PHPGW_SERVER_ROOT . SEP .
'sms';//"/home/playsms/public_html";
-
-
-// Do not change anything below this line unless you know what to do
-// -----------------------------------------------------------------
-
-
-// you can turn off PHP error reporting by uncommenting below line
-// on production level you should turn off PHP error reporting
-//error_reporting(0);
-
-// libraries directory
-$apps_path[libs] = "$apps_path[base]/lib";
-
-// plugins directory
-$apps_path[plug] = "$apps_path[base]/inc/plugin";
-
-// includes directories
-$apps_path[inc] = "$apps_path[base]/inc";
-
-// SMS command security parameter
-$feat_command_path[bin] = $apps_path[base]."/bin";
-
-// more configuration
-$apps_config['multilogin'] = 1; // 0 for single session login; 1 for
multi session login
-
-// connect to database
-
-$db = $GLOBALS['phpgw']->db;
-
-// get main config
-$sql = "SELECT * FROM phpgw_config WHERE config_app='sms' AND config_name =
'email_service'";
-$db->query($sql,__LINE__,__FILE__);
-
-if ($db->next_record())
-{
- $email_service = $db->f('config_value');
-}
-
-$sql = "SELECT * FROM phpgw_config WHERE config_app = 'sms' AND config_name =
'gateway_module'";
-
-$db->query($sql,__LINE__,__FILE__);
-
-if ($db->next_record())
-{
- $gateway_module =$db->f('config_value');
-}
-
-$sql = "SELECT * FROM phpgw_config WHERE config_app='sms' AND config_name =
'gateway_number'";
-$db->query($sql,__LINE__,__FILE__);
-
-if ($db->next_record())
-{
- $gateway_number = $db->f('config_value');
-}
-
-$sql = "SELECT * FROM phpgw_config WHERE config_app='sms' AND config_name =
'gnokii_cfg'";
-$db->query($sql,__LINE__,__FILE__);
-
-if ($db->next_record())
-{
- $gnokii_cfg = $db->f('config_value');
-}
-
- $web_title = 'test';
- $email_footer = 'Mobile Portal System';
-
-
-$GLOBALS['phpgw_info']['sms_config']['reserved_codes'] = $reserved_codes;
-$GLOBALS['phpgw_info']['sms_config']['web_title'] = $web_title;
-$GLOBALS['phpgw_info']['sms_config']['email_service'] = $email_service;
-$GLOBALS['phpgw_info']['sms_config']['email_footer'] = $email_footer;
-$GLOBALS['phpgw_info']['sms_config']['datetime_now'] = $datetime_now;
-$GLOBALS['phpgw_info']['sms_config']['apps_config'] = $apps_config;
-$GLOBALS['phpgw_info']['sms_config']['apps_path'] = $apps_path;
-$GLOBALS['phpgw_info']['sms_config']['feat_command_path'] = $feat_command_path;
-$GLOBALS['phpgw_info']['sms_config']['gateway_module'] = $gateway_module;
-$GLOBALS['phpgw_info']['sms_config']['gateway_number'] = $gateway_number;
-$GLOBALS['phpgw_info']['sms_config']['email_footer'] = $email_footer;
-$GLOBALS['phpgw_info']['sms_config']['gnokii_cfg'] = $gnokii_cfg;
-
-
-// protect from SQL injection when magic_quotes_gpc sets to "Off"
-function pl_addslashes($data)
-{
- global $db_type;
- if ($db_type=="mssql")
- {
- $data = str_replace("'", "''", $data);
- }
- else
- {
- $data = addslashes($data);
- }
- return $data;
-}
-if (!get_magic_quotes_gpc())
-{
- foreach($_GET as $key => $val){$_GET[$key]=pl_addslashes($_GET[$key]);}
- foreach($_POST as $key => $val){$_POST[$key]=pl_addslashes($_POST[$key]);}
- foreach($_COOKIE as $key =>
$val){$_COOKIE[$key]=pl_addslashes($_COOKIE[$key]);}
- foreach($_SERVER as $key =>
$val){$_SERVER[$key]=pl_addslashes($_SERVER[$key]);}
-}
+ include_once($path_to_phpgroupware . SEP . 'sms' . SEP . 'inc' . SEP .
'config.php');
?>
Index: sms/setup/default_records.inc.php
diff -u sms/setup/default_records.inc.php:1.1.1.1
sms/setup/default_records.inc.php:1.2
--- sms/setup/default_records.inc.php:1.1.1.1 Mon May 15 10:29:23 2006
+++ sms/setup/default_records.inc.php Tue May 16 19:45:49 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.1.1.1 2006/05/15 10:29:23
sigurdne Exp $
+ * @version $Id: default_records.inc.php,v 1.2 2006/05/16 19:45:49
sigurdne Exp $
*/
@@ -22,6 +22,10 @@
$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')");
+
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_featautoreply
(uid, autoreply_code) VALUES (1,'HELP')");
Index: sms/setup/setup.inc.php
diff -u sms/setup/setup.inc.php:1.1.1.1 sms/setup/setup.inc.php:1.2
--- sms/setup/setup.inc.php:1.1.1.1 Mon May 15 10:29:23 2006
+++ sms/setup/setup.inc.php Tue May 16 19:45:49 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.1.1.1 2006/05/15 10:29:23 sigurdne
Exp $
+ * @version $Id: setup.inc.php,v 1.2 2006/05/16 19:45:49 sigurdne Exp $
*/
$setup_info['sms']['name'] = 'sms';
@@ -65,7 +65,8 @@
$setup_info['sms']['hooks'] = array
(
// 'help',
-// 'preferences',
+ 'settings',
+ 'preferences',
'admin'
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] sms inc/class.bocommon.inc.php inc/class.bosms....,
Sigurd Nes <=