]> jfr.im git - irc.git/blob - software/RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2003/002019.html
rename -> *.git
[irc.git] / software / RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2003 / 002019.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> [IRCServices Coding]
5 Associating NickGroupInfo with two nicks at once
6 </TITLE>
7 <LINK REL="Index" HREF="index.html" >
8 <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20%0A%09Associating%20NickGroupInfo%20with%20two%20nicks%20at%20once&In-Reply-To=">
9 <META NAME="robots" CONTENT="index,nofollow">
10 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
11 <LINK REL="Previous" HREF="002018.html">
12 <LINK REL="Next" HREF="002020.html">
13 </HEAD>
14 <BODY BGCOLOR="#ffffff">
15 <H1>[IRCServices Coding]
16 Associating NickGroupInfo with two nicks at once</H1>
17 <B>Craig Edwards</B>
18 <A HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20%0A%09Associating%20NickGroupInfo%20with%20two%20nicks%20at%20once&In-Reply-To="
19 TITLE="[IRCServices Coding]
20 Associating NickGroupInfo with two nicks at once">brain at brainbox.winbot.co.uk
21 </A><BR>
22 <I>Tue Apr 22 08:24:03 PDT 2003</I>
23 <P><UL>
24 <LI>Previous message: <A HREF="002018.html">[IRCServices Coding] join channel on register
25 </A></li>
26 <LI>Next message: <A HREF="002020.html">[IRCServices Coding] Associating NickGroupInfo with two nicks
27 at once
28 </A></li>
29 <LI> <B>Messages sorted by:</B>
30 <a href="date.html#2019">[ date ]</a>
31 <a href="thread.html#2019">[ thread ]</a>
32 <a href="subject.html#2019">[ subject ]</a>
33 <a href="author.html#2019">[ author ]</a>
34 </LI>
35 </UL>
36 <HR>
37 <!--beginarticle-->
38 <PRE>Hi, we're writing a module which allows a web interface to &quot;su&quot; to a nickname, similar to the way the unix &quot;su&quot; command (dont ask! :)) heres how it works:
39
40 basically, /msg somepseudoclient su &lt;nick&gt; &lt;pass&gt;
41
42 ..and you gain the privilages of that nick, wether or not they are using it at the time. What we're doing at the moment is associating the user's ngi and ni fields with the nickgroupinfo of the registered nickname, e.g.
43
44 NickInfo* MyNickInf = get_nickinfo(somenick);
45 NickGroupInfo* MyNGroupInf = get_ngi(MyNickInf);
46
47 u-&gt;ngi = MyNGroupInf;
48 u-&gt;ni = MyNickInf;
49 /* user u is now logged in with privilages of &quot;ngi&quot; nick, send +r as a raw if neccessary */
50
51 sorry for any errors in this code, im typing it off the top of my head.
52 Basically, the problem we have is, that only one nick can have &quot;ownership&quot; of a groupinfo at any one time, if we associate user 'u' with MyNGroupInf, then if some other user online at the time (lets call them u2) has this same association (u2-&gt;ngi == MyNGroupInf) than u2 is logged out (and has to re-identify using /msg nickserv identify &lt;pass&gt;). Basically we cant give two people ownership of the same nickgroup at the same time. Is there any way we can get around this, e.g. by memcpy'ing the NickGroupInfo? The ownership of the nick by the second user only needs to be temporary, until disconnect, so there shouldnt be any corruption of services DB's by having two people pointing at the same nickgroup in the file, or anything as weird as that :)
53
54 If theres any way to solve this problem simply, without needing andy to rewrite the core, or for us to approach the problem a different way, we'd be grateful of anyone could tell us how :)
55
56 Thanks,
57 Brain
58 ChatSpike Services-dev
59
60
61
62 </PRE>
63
64 <!--endarticle-->
65 <HR>
66 <P><UL>
67 <!--threads-->
68 <LI>Previous message: <A HREF="002018.html">[IRCServices Coding] join channel on register
69 </A></li>
70 <LI>Next message: <A HREF="002020.html">[IRCServices Coding] Associating NickGroupInfo with two nicks
71 at once
72 </A></li>
73 <LI> <B>Messages sorted by:</B>
74 <a href="date.html#2019">[ date ]</a>
75 <a href="thread.html#2019">[ thread ]</a>
76 <a href="subject.html#2019">[ subject ]</a>
77 <a href="author.html#2019">[ author ]</a>
78 </LI>
79 </UL>
80
81 </body></html>