473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Re: XMPP xmpppy - User Authorization

On Wed, Nov 5, 2008 at 11:28 AM, James Mills
<pr******@shortcircuit.net.auwrote:
Can anyone shed any light on how I might
be able to react to "User Authorization Requests"
from other users on an XMPP server/network
using teh xmlpp [1] library ?
[SOLVED}:

I found out from having a peek at jabberbot [1]
that it was as simple as parsing the message.

Here's a code snippet:

<code>
def messageHandler(self, cnx, message):
text = message.getBody()
user = message.getFrom()

if text is not None:
self.env.log.debug("<%s%s" % (user, text))

if " " in text:
command, args = text.split(" ", 1)
else:
command, text = text, ""

command = command.upper()

if command == "SUBSCRIBE":
self._client.Roster.Authorize(user)
reply = "Authorized."
</code>

--JamesMills

--
--
-- "Problems are solved by method"
Nov 5 '08 #1
0 1377

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark | last post by:
hey, i'm trying to get the current windows user and the groups they are in. Intergrated windows auth on and annoymous access turned off on IIS. However when trying to compile the following code...
2
by: Dan | last post by:
hi ng, i have a problem with windows authentification. i want to forward every user who 1. is not authorized 2. or could not be authenticated to a login page -------------------
6
by: Antonios Christofides | last post by:
Hi, I've prepared a test case about this, which I include below. I have tables "a" and "b"; "b" has a foreign key to "a", on delete cascade. In addition, there is a "before delete on b" trigger,...
2
by: mark4asp | last post by:
This is a simplified version of my site. There are Premium users who have access to the Premium directory. Anyone else attempting to access it should be logged and then redirected to the...
2
by: antonyliu2002 | last post by:
I am testing ASP.NET 2.0 Forms athentication with user credentials in SQL Server 2005. I don't want to put user credentials in web.config, so the credentials section is commented out. The...
5
by: linksterman | last post by:
everywhere i look, the only example i can find on how to use gtalk with xmpppy is how to send a message, which does no good unless you can recieve... anyone have any thing?
0
by: ronscottlangham | last post by:
I have a web page that any authenticated user can access, but I dynamically enable/disable other asp.net controls on the web page based on the Role that they are in via C# code behind. My web...
5
by: Max2006 | last post by:
Hi, I am trying to limit my wcf service endpoint to response to only given windows user or group. How can I do that? Is there any way to configure that in the .config file? Thank you, Max
0
by: James Mills | last post by:
Hi all, Can anyone shed any light on how I might be able to react to "User Authorization Requests" from other users on an XMPP server/network using teh xmlpp library ? Thanks, cheers
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.