Browse code

- cvs id added in top of files

Daniel-Constantin Mierla authored on 02/06/2003 15:41:21
Showing 45 changed files
... ...
@@ -1,3 +1,5 @@
1
+# $Id$
2
+
1 3
 DBTEXT module
2 4
 -------------
3 5
 
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText module core functions
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText module core functions
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText module core functions
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText library
4 5
  *
... ...
@@ -1,4 +1,5 @@
1
-/* 
1
+/*
2
+ * $Id$
2 3
  *
3 4
  * DBText module interface
4 5
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * DBText module core functions
4 5
  *
... ...
@@ -11,6 +11,7 @@ NAME=jabber.so
11 11
 
12 12
 # extra debug messages
13 13
 DEFS+=-DXJ_EXTRA_DEBUG
14
+# -DHAVE_IHTTP
14 15
 
15 16
 # expat.h location
16 17
 DEFS+=-I$(LOCALBASE)/include -I/usr/pkg/include
... ...
@@ -8,8 +8,9 @@ include ("libjab.php");
8 8
 $jserver = "127.0.0.1";   # Jabber server address
9 9
 $jport = "5222";     # Jabber server port
10 10
 $jcid  = 0;      # Jabber communication ID
11
-
12
-# main SER database - users profile table
11
+#
12
+/* **************************************
13
+# main SER database - users profile table - used for authentication
13 14
 $sip_db_srv="127.0.0.1";  # database server
14 15
 $sip_db_usr="ser";  # database user
15 16
 $sip_db_pas="***";  # database user's password
... ...
@@ -17,7 +18,8 @@ $sip_db_db="ser";   # database name
17 17
 $sip_db_tab="subscriber";  # name of users table
18 18
 $sip_db_cusr="user"; # column name for username
19 19
 $sip_db_cpas="password"; # column name for user's password
20
-
20
+*************************************** */
21
+#
21 22
 # Jabber module database
22 23
 $jab_db_srv="127.0.0.1";  # database server
23 24
 $jab_db_usr="ser";  # database user
... ...
@@ -62,6 +64,17 @@ if(!isset($action) || $action=="" || !isset($sipname) || $sipname=="" || !isset(
62 62
 		<TR>
63 63
 		<TD COLSPAN="2"><b><i><hr></i></b></TD>
64 64
 		</TR>
65
+		<TR>
66
+		<TD>My Jabber account:</TD>
67
+		<TD align="right">
68
+		    <INPUT type="submit" name="action" value="Enable">
69
+			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
70
+			<INPUT type="submit" name="action" value="Disable">
71
+		</TD>
72
+		</TR>
73
+		<TR>
74
+		<TD COLSPAN="2"><b><i><hr></i></b></TD>
75
+		</TR>
65 76
 
66 77
 		<TR>
67 78
 		<TD>IM service:</TD>
... ...
@@ -143,23 +156,44 @@ if(!isset($action) || $action=="" || !isset($sipname) || $sipname=="" || !isset(
143 143
 else
144 144
 {
145 145
 	# -----
146
-	# verify username and password
146
+	# AUTHENTICATION - verify username and password
147 147
 	# -----
148
+	/* ****************************************
148 149
 	echo "<br><h2>Instant Messaging Gateway</h2><hr size=\"1\" width=\"60%\"><br>";
149
-	$dblink = mysql_connect($sip_db_srv, $sip_db_usr, $sip_db_pas) or html_die("Could not connect to SIP database server");
150
-	mysql_select_db($sip_db_db, $dblink) or html_die("Could not select SIP database");
150
+	$dblink = mysql_connect($sip_db_srv, $sip_db_usr, $sip_db_pas) or
151
+		html_die("Could not connect to SIP database server");
152
+	mysql_select_db($sip_db_db, $dblink) 
153
+		or html_die("Could not select SIP database");
151 154
 	$query = "SELECT $sip_db_cusr FROM $sip_db_tab WHERE $sip_db_cusr='$sipname' AND $sip_db_cpas='$sippasswd'";
152 155
 	dbg_msg("$query <BR>");
153 156
 	$result = mysql_query($query) or html_die("Invalid SQL query");
154 157
 	if(mysql_num_rows($result) == 0)
155 158
 		html_die("Invalid SIP username or password");
156 159
 	mysql_close($dblink);
160
+	***************************************** */
161
+	#
162
+	#------------------------------------------------------
163
+	#
157 164
 	# -----
158 165
 	# check if is already registered to Jabber gateway
159 166
 	# -----
160 167
 	$sipuri = "sip:".$sipname."@iptel.org";
161 168
 	$dblink = mysql_connect($jab_db_srv, $jab_db_usr, $jab_db_pas) or html_die("Could not connect to Jabber database");
162 169
 	mysql_select_db($jab_db_db, $dblink) or html_die("Could not use Jabber database");
170
+	# ----
171
+	if($action == "Disable")
172
+	{
173
+		$query = "UPDATE jusers SET tyep=1 WHERE sip_id='$sipuri'";
174
+		$result = mysql_query($query, $dblink);
175
+		if(mysql_affected_rows() != 1)
176
+		{
177
+			mysql_close($dblink);
178
+			html_die("<br>Cannot find Jabber ID of '$sipname' in database");
179
+		}
180
+		mysql_close($dblink);
181
+		html_die("<br>Your IM account was updated");
182
+	}
183
+	# ----
163 184
 	$query = "SELECT jab_id FROM jusers WHERE sip_id='$sipuri'";
164 185
 	$result = mysql_query($query, $dblink) or html_die("Invalid SQL query");
165 186
 	if(mysql_num_rows($result) == 0)
... ...
@@ -221,17 +255,34 @@ else
221 221
 		jab_disconnect($fd);
222 222
 	}
223 223
 	# -----
224
-	$query = "SELECT juid, jab_id, jab_passwd FROM jusers WHERE sip_id='$sipuri'";
224
+	if($action == "Enable")
225
+	{
226
+		$query = "UPDATE jusers SET type=0 WHERE sip_id='$sipuri'";
227
+		$result = mysql_query($query, $dblink);
228
+		if(mysql_affected_rows() != 1)
229
+		{
230
+			mysql_close($dblink);
231
+			html_die("<br>Cannot find Jabber ID of '$sipname' in database");
232
+		}
233
+		mysql_close($dblink);
234
+		html_die("<br>Your IM account was updated");
235
+	}
236
+	# -----
237
+	$query="SELECT juid,jab_id,jab_passwd,type FROM jusers WHERE
238
+	sip_id='$sipuri' and type=0";
225 239
 	$result = mysql_query($query, $dblink) or html_die("Invalid SQL query");
226 240
 	if(mysql_num_rows($result) != 1 || (!($row = mysql_fetch_array($result))))
227 241
 	{
228 242
 		mysql_close($dblink);
229
-		html_die("<br>Can not find Jabber ID of '$sipname' in database");
243
+		html_die("<br>You do not have an associated Jabber account or it is
244
+		disabled!<br>Press 'Enable' in order to create a new one or to activate an
245
+		old one.<br>If error persists, please inform the administrator.");
230 246
 	}
231 247
 
232 248
 	$juid = $row[0];
233 249
 	$jab_id = $row[1];
234 250
 	$jab_passwd = $row[2];
251
+	$jab_type = $row[3];
235 252
 	dbg_msg("Jabber User ID: $juid<BR>");
236 253
 	$fd = jab_connect($jserver, $jport);
237 254
 	if(!$fd)
... ...
@@ -20,6 +20,7 @@ rev_dns=off       # (cmd. line: -R)
20 20
 port=5060
21 21
 #listen=10.0.0.179
22 22
 listen=193.175.135.68
23
+fifo="/tmp/ser_fifo"
23 24
 
24 25
 # for more info: sip_router -h
25 26
 
... ...
@@ -30,7 +31,6 @@ loadmodule "../sip_router/modules/print/print.so"
30 30
 loadmodule "../sip_router/modules/textops/textops.so"
31 31
 loadmodule "../sip_router/modules/tm/tm.so"
32 32
 
33
-loadmodule "../sip_router/modules/im/im.so"
34 33
 loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
35 34
 loadmodule "../sip_router/modules/sl/sl.so"
36 35
 loadmodule "../sip_router/modules/mysql/mysql.so"
... ...
@@ -57,7 +57,7 @@ modparam("jabber","jaddress","jabber.server.com")
57 57
 modparam("jabber","jport",5222)
58 58
 modparam("jabber","workers",2)
59 59
 modparam("jabber","max_jobs",10)
60
-modparam("jabber","cache_time",600)
60
+modparam("jabber","cache_time",200)
61 61
 modparam("jabber","delay_time",60)
62 62
 modparam("jabber","jdomain","jabber.server.com=*")
63 63
 modparam("jabber","aliases","4;aim.jabber.server.com;icq.jabber.server.com;msn.jabber.server.com=%;yahoo.jabber.server.com;")
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * tree234.c: reasonably generic counted 2-3-4 tree routines.
3 5
  * 
4 6
  * This file is copyright 1999-2001 Simon Tatham.
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * tree234.h: header defining functions in tree234.c.
3 5
  * 
4 6
  * This file is copyright 1999-2001 Simon Tatham.
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module - Jabber connections pool
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /**
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * eXtended JABber module
4 5
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module - functions used for SIP 2 JABBER communication
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module - headers for functions used for JABBER srv conection
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * Copyright (C) 2001-2003 Fhg Fokus
3 5
  *
4 6
  * This file is part of ser, a free SIP server.
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * XJAB module
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * XJAB module
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module - Jabber connections pool
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module - worker implemetation
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  * eXtended JABber module - worker implemetation
3 5
  *
4 6
  *
... ...
@@ -1,4 +1,5 @@
1 1
 /*
2
+ * $Id$
2 3
  *
3 4
  * eXtended JABber module
4 5
  *
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  *  This program is free software; you can redistribute it and/or modify
3 5
  *  it under the terms of the GNU General Public License as published by
4 6
  *  the Free Software Foundation; either version 2 of the License, or
... ...
@@ -1,3 +1,23 @@
1
+/*
2
+ * $Id$
3
+ *
4
+ *  This program is free software; you can redistribute it and/or modify
5
+ *  it under the terms of the GNU General Public License as published by
6
+ *  the Free Software Foundation; either version 2 of the License, or
7
+ *  (at your option) any later version.
8
+ *
9
+ *  This program is distributed in the hope that it will be useful,
10
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+ *  GNU General Public License for more details.
13
+ *
14
+ *  You should have received a copy of the GNU General Public License
15
+ *  along with this program; if not, write to the Free Software
16
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
+ *
18
+ *  Jabber
19
+ *  Copyright (C) 1998-1999 The Jabber Team http://jabber.org/
20
+ */
1 21
 #include <string.h>
2 22
 #include <stdlib.h>
3 23
 #include <sys/types.h>
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  *  This program is free software; you can redistribute it and/or modify
3 5
  *  it under the terms of the GNU General Public License as published by
4 6
  *  the Free Software Foundation; either version 2 of the License, or
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  *  This program is free software; you can redistribute it and/or modify
3 5
  *  it under the terms of the GNU General Public License as published by
4 6
  *  the Free Software Foundation; either version 2 of the License, or
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  *  This program is free software; you can redistribute it and/or modify
3 5
  *  it under the terms of the GNU General Public License as published by
4 6
  *  the Free Software Foundation; either version 2 of the License, or
... ...
@@ -1,4 +1,6 @@
1 1
 /* ====================================================================
2
+ * $Id$
3
+ *
2 4
  * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
3 5
  *
4 6
  * Redistribution and use in source and binary forms, with or without
... ...
@@ -1,4 +1,6 @@
1 1
 /*
2
+ * $Id$
3
+ *
2 4
  *  This program is free software; you can redistribute it and/or modify
3 5
  *  it under the terms of the GNU General Public License as published by
4 6
  *  the Free Software Foundation; either version 2 of the License, or
... ...
@@ -1,3 +1,5 @@
1
+# $Id$
2
+
1 3
 MSILO - offline messages service - SER module
2 4
 =============================================
3 5
 
... ...
@@ -1,4 +1,6 @@
1 1
 /**
2
+ * $Id$
3
+ *
2 4
  * MSILO module
3 5
  *
4 6
  * Copyright (C) 2001-2003 Fhg Fokus
... ...
@@ -1,4 +1,6 @@
1 1
 /**
2
+ * $Id$
3
+ *
2 4
  * MSILO module
3 5
  *
4 6
  * Copyright (C) 2001-2003 Fhg Fokus
... ...
@@ -1,4 +1,6 @@
1 1
 /**
2
+ * $Id$
3
+ *
2 4
  * MSILO module
3 5
  *
4 6
  * Copyright (C) 2001-2003 Fhg Fokus