]> jfr.im git - irc.git/blame - software/!RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2003/002026.html
RELEASE -> !RELEASE
[irc.git] / software / !RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2003 / 002026.html
CommitLineData
3bd189cb
JR
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2<HTML>
3 <HEAD>
4 <TITLE> AW: Re: [IRCServices Coding] Associating NickGroupInfo with
5 twonicksatonce
6 </TITLE>
7 <LINK REL="Index" HREF="index.html" >
8 <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=AW%3A%20Re%3A%20%5BIRCServices%20Coding%5D%20%20Associating%20NickGroupInfo%20with%0A%20twonicksatonce&In-Reply-To=200304252009.h3PK9pA25637%40localhost.localdomain">
9 <META NAME="robots" CONTENT="index,nofollow">
10 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
11 <LINK REL="Previous" HREF="002025.html">
12 <LINK REL="Next" HREF="002027.html">
13 </HEAD>
14 <BODY BGCOLOR="#ffffff">
15 <H1>AW: Re: [IRCServices Coding] Associating NickGroupInfo with
16 twonicksatonce</H1>
17 <B>Georges Berscheid</B>
18 <A HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=AW%3A%20Re%3A%20%5BIRCServices%20Coding%5D%20%20Associating%20NickGroupInfo%20with%0A%20twonicksatonce&In-Reply-To=200304252009.h3PK9pA25637%40localhost.localdomain"
19 TITLE="AW: Re: [IRCServices Coding] Associating NickGroupInfo with
20 twonicksatonce">georges at berscheid.lu
21 </A><BR>
22 <I>Sat Apr 26 02:54:37 PDT 2003</I>
23 <P><UL>
24 <LI>Previous message: <A HREF="002025.html">[IRCServices Coding] Associating NickGroupInfo with two
25 nicksatonce
26</A></li>
27 <LI>Next message: <A HREF="002027.html">[IRCServices Coding] feature suggestion...
28</A></li>
29 <LI> <B>Messages sorted by:</B>
30 <a href="date.html#2026">[ date ]</a>
31 <a href="thread.html#2026">[ thread ]</a>
32 <a href="subject.html#2026">[ subject ]</a>
33 <a href="author.html#2026">[ author ]</a>
34 </LI>
35 </UL>
36 <HR>
37<!--beginarticle-->
38<PRE>Hi,
39
40since services are a almost-regular server linked to your network, they
41know all of the network-relevant information, including /list. Just use
42
43Channel *chan;
44for(chan = first_channel(); chan; chan = next_channel()) {
45 &lt;your code&gt;
46}
47
48to get a list of all channels. There are similar commands for users,
49registered channels, registered nicks etc. Note that chan-&gt;users is a
50linked list of all users currently in the channel. Refer to channels.h,
51users.h, modules/nickserv/nickserv.h and modules/chanserv/chanserv.h for
52more information on structs.
53
54I suggest you have a look at
55<A HREF="http://www.luxusbuerg.lu/data/ircservices-luxusbuerg.tgz">http://www.luxusbuerg.lu/data/ircservices-luxusbuerg.tgz</A> in
56modules/httpd/accesslist.c. This is an example of how to dynamically
57include the accesslist of all registered channels into a php-script.
58Another example is modules/httpd/banlist.c.
59modules/nickserv/dbsynch.c shows how we linked services to the mysql
60database. This could also be a possibility, to write all information you
61need in constant intervals into a mysql table which you can read with
62you php script anytime you want. Choose what fits your needs the best
63;-)
64
65Georges
66
67
68-----Urspr&#252;ngliche Nachricht-----
69Von: <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">ircservices-coding-bounces at ircservices.za.net</A>
70[mailto:<A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">ircservices-coding-bounces at ircservices.za.net</A>] Im Auftrag von
71Craig Edwards
72Gesendet: Freitag, 25. April 2003 23:01
73An: IRC Services Coding Mailing List
74Betreff: Re: Re: [IRCServices Coding] Associating NickGroupInfo with
75twonicksatonce
76
77
78Good idea. We're taking the opposite route, only allowing users to
79register on irc. We believe that on our network, given the option to
80register on the website would create a whole bunch of pointless
81never-used nicks that are just used by clueless web users who have no
82idea what theyre doing with irc ;-)
83
84We're using our service to fetch certain information that is particular
85to the ircd and not services, e.g. output of /list, etc, so if there was
86a way to output this too -- i noticed chanserv only keeps a linked list
87of *registered* channels, which is the reverse of how our modified
88statserv works :)
89
90Anyhow, have fun,
91Brain :-)
92
93&gt;<i>Hi,
94</I>&gt;<i>
95</I>&gt;<i>we disabled all /ns {register|drop|link} etc. commands in services and
96</I>&gt;<i>force our users to register their nicknames via a web-interface (90 of
97</I>&gt;<i>our users use a java-web-interface to chat anyway). Services have a
98</I>&gt;<i>module that connects to the MySQL database and retrieves information
99</I>&gt;<i>from there, without needing any interaction of bots with services.
100</I>&gt;<i>To retrieve services-internal information, we use http-modules which
101</I>&gt;<i>output simple PHP-scripts that can be included using &lt;?php
102</I>&gt;<i>include(&quot;<A HREF="http://your.services.host/moduleurl&quot;">http://your.services.host/moduleurl&quot;</A>) ?&gt; Again, you won't need
103</I>
104&gt;<i>a bot that connects to your network, use any (possibly exploitable)
105</I>&gt;<i>commands and parse the output.
106</I>&gt;<i>
107</I>&gt;<i>Georges
108</I>&gt;<i>
109</I>&gt;<i>
110</I>&gt;<i>
111</I>&gt;<i>Craig McLure wrote:
112</I>&gt;<i>
113</I>&gt;&gt;<i>Could you give any other suggestions on how this could be done? I'll
114</I>go into a few details on what is trying to be accomplished...
115&gt;&gt;<i>
116</I>&gt;&gt;<i>For years now, people have been acking for use of MySQL databases, so
117</I>that they can have &quot;Web Interfaces&quot; to services, basically, we are
118creating a module that allows this &quot;su&quot; type command, which will allow
119use of the command from specific hosts to gain information on nicknames,
120then parse them into HTML, and be able to display on a website.. it
121would also be allowed to change some settings on the nickname (example,
122access lists, passwords) without having to talk to the service itself.
123&gt;&gt;<i>
124</I>&gt;&gt;<i>Theres an alpha running at <A HREF="http://www.chatspike.net/?page=ircadmin">http://www.chatspike.net/?page=ircadmin</A>
125</I>&gt;&gt;<i>Currently, you need to have a registered nickname on irc.chatspike.net
126</I>to use it.. If you wanna try exploiting it in some way.. feel free :p
127&gt;&gt;<i>
128</I>&gt;&gt;<i>So yeah, any other solutions would be great :)
129</I>&gt;&gt;<i>
130</I>&gt;&gt;<i>----------------------------------------------------------------------
131</I>-
132&gt;&gt;<i>Craig McLure - <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">Craig at chatspike.net</A>
133</I>&gt;&gt;<i>ChatSpike - The users network: <A HREF="http://www.chatspike.net">http://www.chatspike.net</A>
134</I>&gt;&gt;<i>InspIRCd - Modular IRC server: <A HREF="http://www.inspircd.org">http://www.inspircd.org</A>
135</I>&gt;&gt;<i>&lt;`RaSh&gt; how do i install linux i got the cd and i dont see the
136</I>setup.exe or install.exe
137&gt;&gt;<i>----------------------------------------------------------------------
138</I>-
139&gt;&gt;<i>
140</I>&gt;&gt;<i>============ Original Message ============
141</I>&gt;&gt;&gt;<i>From : &quot;Andrew Church&quot; &lt;<A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">achurch at achurch.org</A>&gt;
142</I>&gt;&gt;<i>
143</I>&gt;&gt;<i>
144</I>&gt;&gt;&gt;<i>Reply-To : <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">ircservices-coding at ircservices.za.net</A>
145</I>&gt;&gt;&gt;<i>To : <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">ircservices-coding at ircservices.za.net</A>
146</I>&gt;&gt;&gt;<i>Subject : Re: [IRCServices Coding] Associating NickGroupInfo with
147</I>two nicks atonce
148&gt;&gt;&gt;<i>Date : 2003-04-23
149</I>&gt;&gt;&gt;<i>
150</I>&gt;&gt;&gt;<i>
151</I>&gt;&gt;&gt;<i> The code currently assumes that at most one user will be
152</I>associated
153&gt;&gt;&gt;<i>with any particular nickname, that NickInfo.user will point at the
154</I>user
155&gt;&gt;&gt;<i>with nickname NickInfo.nick, that User.ni will point at the NickInfo
156</I>with
157&gt;&gt;&gt;<i>nickname User.nick (or NULL if the nickname is not registered), and
158</I>that
159&gt;&gt;&gt;<i>User.ngi will point to a nickname group containing User.ni (or NULL
160</I>or
161&gt;&gt;&gt;<i>NICKGROUPINFO_INVALID). Breaking any of these assumptions will
162</I>probably
163&gt;&gt;&gt;<i>cause many weird and dangerous things to happen.
164</I>&gt;&gt;&gt;<i>
165</I>&gt;&gt;&gt;<i> Note that two or more users can be associated with a single nick
166</I>group
167&gt;&gt;&gt;<i>(if, for example, someone has two clients open and using two linked
168</I>nicks).
169&gt;&gt;&gt;<i>However, if the user's nick is not in NickGroupInfo.nicks[], things
170</I>will
171&gt;&gt;&gt;<i>probably break.
172</I>&gt;&gt;&gt;<i>
173</I>&gt;&gt;&gt;<i> I'd strongly suggest finding another way to accomplish whatever
174</I>you're
175&gt;&gt;&gt;<i>trying to do without an &quot;su&quot;-like command.
176</I>&gt;&gt;&gt;<i>
177</I>&gt;&gt;&gt;<i> --Andrew Church
178</I>&gt;&gt;&gt;<i> <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">achurch at achurch.org</A>
179</I>&gt;&gt;&gt;<i> <A HREF="http://achurch.org/">http://achurch.org/</A>
180</I>&gt;&gt;&gt;<i>
181</I>&gt;&gt;&gt;<i>
182</I>&gt;&gt;&gt;<i>
183</I>&gt;&gt;&gt;&gt;<i>Hi, we're writing a module which allows a web interface to &quot;su&quot; to a
184</I>nickname, similar to the way the unix &quot;su&quot; command (dont ask! :)) heres
185how it works:
186&gt;&gt;&gt;&gt;<i>
187</I>&gt;&gt;&gt;&gt;<i>basically, /msg somepseudoclient su &lt;nick&gt; &lt;pass&gt;
188</I>&gt;&gt;&gt;&gt;<i>
189</I>&gt;&gt;&gt;&gt;<i>..and you gain the privilages of that nick, wether or not they are
190</I>using it at the time. What we're doing at the moment is associating the
191user's ngi and ni fields with the nickgroupinfo of the registered
192nickname, e.g.
193&gt;&gt;&gt;&gt;<i>
194</I>&gt;&gt;&gt;&gt;<i>NickInfo* MyNickInf = get_nickinfo(somenick);
195</I>&gt;&gt;&gt;&gt;<i>NickGroupInfo* MyNGroupInf = get_ngi(MyNickInf);
196</I>&gt;&gt;&gt;&gt;<i>
197</I>&gt;&gt;&gt;&gt;<i>u-&gt;ngi = MyNGroupInf;
198</I>&gt;&gt;&gt;&gt;<i>u-&gt;ni = MyNickInf;
199</I>&gt;&gt;&gt;&gt;<i>/* user u is now logged in with privilages of &quot;ngi&quot; nick, send +r as
200</I>a raw if neccessary */
201&gt;&gt;&gt;&gt;<i>
202</I>&gt;&gt;&gt;&gt;<i>sorry for any errors in this code, im typing it off the top of my
203</I>head.
204&gt;&gt;&gt;&gt;<i>Basically, the problem we have is, that only one nick can have
205</I>&quot;ownership&quot; of a groupinfo at any one time, if we associate user 'u'
206with MyNGroupInf, then if some other user online at the time (lets call
207them u2) has this same association (u2-&gt;ngi == MyNG
208&gt;&gt;&gt;&gt;<i>roupInf) than u2 is logged out (and has to re-identify using /msg
209</I>nickserv identify &lt;pass&gt;). Basically we cant give two people ownership
210of the same nickgroup at the same time. Is there any way we can get
211around this, e.g. by memcpy'ing the NickGroupInfo?
212&gt;&gt;&gt;&gt;<i>The ownership of the nick by the second user only needs to be
213</I>temporary, until disconnect, so there shouldnt be any corruption of
214services DB's by having two people pointing at the same nickgroup in the
215file, or anything as weird as that :)
216&gt;&gt;&gt;&gt;<i>
217</I>&gt;&gt;&gt;&gt;<i>If theres any way to solve this problem simply, without needing andy
218</I>to rewrite the core, or for us to approach the problem a different way,
219we'd be grateful of anyone could tell us how :)
220&gt;&gt;&gt;&gt;<i>
221</I>&gt;&gt;&gt;&gt;<i>Thanks,
222</I>&gt;&gt;&gt;&gt;<i>Brain
223</I>&gt;&gt;&gt;&gt;<i>ChatSpike Services-dev
224</I>&gt;&gt;&gt;&gt;<i>
225</I>&gt;&gt;&gt;&gt;<i>
226</I>&gt;&gt;&gt;&gt;<i>
227</I>&gt;&gt;&gt;&gt;<i>------------------------------------------------------------------
228</I>&gt;&gt;&gt;&gt;<i>
229</I>&gt;&gt;&gt;&gt;<i>
230</I>&gt;&gt;&gt;<i>------------------------------------------------------------------
231</I>&gt;&gt;&gt;<i>To unsubscribe or change your subscription options, visit:
232</I>&gt;&gt;&gt;<i><A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">http://www.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
233</I>&gt;&gt;&gt;<i>.
234</I>&gt;&gt;&gt;<i>
235</I>&gt;&gt;&gt;<i>
236</I>&gt;&gt;<i>========= End of Original Message =========
237</I>&gt;&gt;<i>
238</I>&gt;&gt;<i>
239</I>&gt;&gt;<i>
240</I>&gt;&gt;<i>------------------------------------------------------------------
241</I>&gt;&gt;<i>To unsubscribe or change your subscription options, visit:
242</I>&gt;&gt;<i><A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">http://www.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
243</I>&gt;&gt;<i>
244</I>&gt;&gt;<i>
245</I>&gt;&gt;<i>
246</I>&gt;&gt;<i>
247</I>&gt;<i>
248</I>&gt;<i>
249</I>&gt;<i>
250</I>&gt;<i>------------------------------------------------------------------
251</I>&gt;<i>To unsubscribe or change your subscription options, visit:
252</I>&gt;<i><A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">http://www.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
253</I>
254
255------------------------------------------------------------------
256To unsubscribe or change your subscription options, visit:
257<A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">http://www.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
258
259
260
261
262</PRE>
263
264<!--endarticle-->
265 <HR>
266 <P><UL>
267 <!--threads-->
268 <LI>Previous message: <A HREF="002025.html">[IRCServices Coding] Associating NickGroupInfo with two
269 nicksatonce
270</A></li>
271 <LI>Next message: <A HREF="002027.html">[IRCServices Coding] feature suggestion...
272</A></li>
273 <LI> <B>Messages sorted by:</B>
274 <a href="date.html#2026">[ date ]</a>
275 <a href="thread.html#2026">[ thread ]</a>
276 <a href="subject.html#2026">[ subject ]</a>
277 <a href="author.html#2026">[ author ]</a>
278 </LI>
279 </UL>
280
281</body></html>