initial ProfileServ upload
This commit is contained in:
parent
5a98634c75
commit
c56efa2807
17 changed files with 6518 additions and 0 deletions
16
.gitattributes
vendored
16
.gitattributes
vendored
|
@ -1 +1,17 @@
|
|||
* text=auto !eol
|
||||
/AUTHORS -text
|
||||
/COPYING -text
|
||||
/ChangeLog -text
|
||||
/LICENSE -text
|
||||
/Makefile.in -text
|
||||
/NEWS -text
|
||||
/README.ProfileServ -text
|
||||
/RELNOTES -text
|
||||
/configure -text
|
||||
/configure.in -text
|
||||
/install-sh -text
|
||||
/modconfig.h.in -text
|
||||
/modconfigwin32.h -text
|
||||
/profileserv.c -text
|
||||
/profileserv.h -text
|
||||
/profileserv_help.c -text
|
||||
|
|
0
AUTHORS
Normal file
0
AUTHORS
Normal file
273
COPYING
Normal file
273
COPYING
Normal file
|
@ -0,0 +1,273 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2, June 1991
|
||||
Copyright © 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to
|
||||
share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free software--to
|
||||
make sure the software is free for all its users. This General Public
|
||||
License applies to most of the Free Software Foundation's software and to
|
||||
any other program whose authors commit to using it. (Some other Free
|
||||
Software Foundation software is covered by the GNU Library General Public
|
||||
License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom
|
||||
to distribute copies of free software (and charge for this service if you
|
||||
wish), that you receive source code or can get it if you want it, that you
|
||||
can change the software or use pieces of it in new free programs; and that
|
||||
you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to
|
||||
deny you these rights or to ask you to surrender the rights. These
|
||||
restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or
|
||||
for a fee, you must give the recipients all the rights that you have. You
|
||||
must make sure that they, too, receive or can get the source code. And you
|
||||
must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2)
|
||||
offer you this license which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that
|
||||
everyone understands that there is no warranty for this free software. If
|
||||
the software is modified by someone else and passed on, we want its
|
||||
recipients to know that what they have is not the original, so that any
|
||||
problems introduced by others will not reflect on the original authors'
|
||||
reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that redistributors of a free program will
|
||||
individually obtain patent licenses, in effect making the program
|
||||
proprietary. To prevent this, we have made it clear that any patent must be
|
||||
licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a
|
||||
notice placed by the copyright holder saying it may be distributed under
|
||||
the terms of this General Public License. The "Program", below, refers to
|
||||
any such program or work, and a "work based on the Program" means either
|
||||
the Program or any derivative work under copyright law: that is to say, a
|
||||
work containing the Program or a portion of it, either verbatim or with
|
||||
modifications and/or translated into another language. (Hereinafter,
|
||||
translation is included without limitation in the term "modification".)
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of running the
|
||||
Program is not restricted, and the output from the Program is covered only
|
||||
if its contents constitute a work based on the Program (independent of
|
||||
having been made by running the Program). Whether that is true depends on
|
||||
what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code
|
||||
as you receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this
|
||||
License and to the absence of any warranty; and give any other recipients
|
||||
of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you
|
||||
may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it,
|
||||
thus forming a work based on the Program, and copy and distribute such
|
||||
modifications or work under the terms of Section 1 above, provided that you
|
||||
also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any part
|
||||
thereof, to be licensed as a whole at no charge to all third parties
|
||||
under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when
|
||||
run, you must cause it, when started running for such interactive use
|
||||
in the most ordinary way, to print or display an announcement
|
||||
including an appropriate copyright notice and a notice that there is
|
||||
no warranty (or else, saying that you provide a warranty) and that
|
||||
users may redistribute the program under these conditions, and telling
|
||||
the user how to view a copy of this License. (Exception: if the
|
||||
Program itself is interactive but does not normally print such an
|
||||
announcement, your work based on the Program is not required to print
|
||||
an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Program, and can be
|
||||
reasonably considered independent and separate works in themselves, then
|
||||
this License, and its terms, do not apply to those sections when you
|
||||
distribute them as separate works. But when you distribute the same
|
||||
sections as part of a whole which is a work based on the Program, the
|
||||
distribution of the whole must be on the terms of this License, whose
|
||||
permissions for other licensees extend to the entire whole, and thus to
|
||||
each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise
|
||||
the right to control the distribution of derivative or collective works
|
||||
based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with
|
||||
the Program (or with a work based on the Program) on a volume of a storage
|
||||
or distribution medium does not bring the other work under the scope of
|
||||
this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under
|
||||
Section 2) in object code or executable form under the terms of Sections 1
|
||||
and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections 1
|
||||
and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years,
|
||||
to give any third party, for a charge no more than your cost of
|
||||
physically performing source distribution, a complete machine-readable
|
||||
copy of the corresponding source code, to be distributed under the
|
||||
terms of Sections 1 and 2 above on a medium customarily used for
|
||||
software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to
|
||||
distribute corresponding source code. (This alternative is allowed
|
||||
only for noncommercial distribution and only if you received the
|
||||
program in object code or executable form with such an offer, in
|
||||
accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making
|
||||
modifications to it. For an executable work, complete source code means all
|
||||
the source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and
|
||||
installation of the executable. However, as a special exception, the source
|
||||
code distributed need not include anything that is normally distributed (in
|
||||
either source or binary form) with the major components (compiler, kernel,
|
||||
and so on) of the operating system on which the executable runs, unless
|
||||
that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to
|
||||
copy from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place counts as distribution of the source code,
|
||||
even though third parties are not compelled to copy the source along with
|
||||
the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except
|
||||
as expressly provided under this License. Any attempt otherwise to copy,
|
||||
modify, sublicense or distribute the Program is void, and will
|
||||
automatically terminate your rights under this License. However, parties
|
||||
who have received copies, or rights, from you under this License will not
|
||||
have their licenses terminated so long as such parties remain in full
|
||||
compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed
|
||||
it. However, nothing else grants you permission to modify or distribute the
|
||||
Program or its derivative works. These actions are prohibited by law if you
|
||||
do not accept this License. Therefore, by modifying or distributing the
|
||||
Program (or any work based on the Program), you indicate your acceptance of
|
||||
this License to do so, and all its terms and conditions for copying,
|
||||
distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute or modify the Program subject to these terms
|
||||
and conditions. You may not impose any further restrictions on the
|
||||
recipients' exercise of the rights granted herein. You are not responsible
|
||||
for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot distribute so
|
||||
as to satisfy simultaneously your obligations under this License and any
|
||||
other pertinent obligations, then as a consequence you may not distribute
|
||||
the Program at all. For example, if a patent license would not permit
|
||||
royalty-free redistribution of the Program by all those who receive copies
|
||||
directly or indirectly through you, then the only way you could satisfy
|
||||
both it and this License would be to refrain entirely from distribution of
|
||||
the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents
|
||||
or other property right claims or to contest validity of any such claims;
|
||||
this section has the sole purpose of protecting the integrity of the free
|
||||
software distribution system, which is implemented by public license
|
||||
practices. Many people have made generous contributions to the wide range
|
||||
of software distributed through that system in reliance on consistent
|
||||
application of that system; it is up to the author/donor to decide if he or
|
||||
she is willing to distribute software through any other system and a
|
||||
licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original
|
||||
copyright holder who places the Program under this License may add an
|
||||
explicit geographical distribution limitation excluding those countries, so
|
||||
that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of
|
||||
the General Public License from time to time. Such new versions will be
|
||||
similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals of
|
||||
preserving the free status of all derivatives of our free software and of
|
||||
promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
|
||||
THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM
|
||||
PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
5
ChangeLog
Normal file
5
ChangeLog
Normal file
|
@ -0,0 +1,5 @@
|
|||
ProfileServ Module for NeoStats Changelog.
|
||||
Fish (F), Mark (M), DeadNotBuried (D)
|
||||
==============================================================================
|
||||
3.0.a3-dev
|
||||
- initial commit to SVN (D)
|
341
LICENSE
Normal file
341
LICENSE
Normal file
|
@ -0,0 +1,341 @@
|
|||
# $Id: LICENSE 28 2005-02-16 04:24:43Z DNB $
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
61
Makefile.in
Normal file
61
Makefile.in
Normal file
|
@ -0,0 +1,61 @@
|
|||
#Neostats Module Makefile!
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
LDFLAGS= @LDFLAGS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
DIRECTORY = @DIRINST@/modules/
|
||||
INCLUDES = -I@DIRINST@/include/ -I.
|
||||
|
||||
SRCS= profileserv.c profileserv_help.c
|
||||
OBJS= ${SRCS:.c=.o}
|
||||
TARGET= profileserv.so
|
||||
DOCS=README.ProfileServ
|
||||
DATA=
|
||||
SCRIPTS=
|
||||
DISTFILES=$(SRCS) $(DOCS) $(SCRIPTS) *.in configure install-sh ChangeLog *.h LICENSE RELNOTES profileserv.vcproj modconfigwin32.h
|
||||
DISTDIR= @PACKAGE@-@VERSION@
|
||||
|
||||
all: module
|
||||
@echo "Compilation complete."
|
||||
@echo "Run 'make install' (or 'gmake install' on some systems) to install."
|
||||
@echo "If you require support, see the README file."
|
||||
|
||||
# include dependency info
|
||||
@MAKEDEPENDENCIES@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(INCLUDES) $<
|
||||
$(CC) -MM $(INCLUDES) -c $< > $*.d
|
||||
|
||||
module: $(OBJS)
|
||||
$(LD) -shared -o $(TARGET) $(OBJS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
/bin/rm -rf $(TARGET) *.o *.d Makefile *.log modconfig.h
|
||||
|
||||
distclean:
|
||||
/bin/rm -rf $(TARGET) *.o *.d Makefile *.log modconfig.h config.status configure.scan
|
||||
|
||||
install: module
|
||||
$(INSTALL) -m 644 $(TARGET) $(DIRECTORY)
|
||||
$(INSTALL) -m 644 $(DOCS) $(DIRECTORY)../doc/
|
||||
@echo "Installation complete."
|
||||
@echo "See the README file for instructions on loading this module."
|
||||
|
||||
dist:
|
||||
@echo -n "Creating directories"
|
||||
@-rm -rf $(DISTDIR)
|
||||
@mkdir $(DISTDIR)
|
||||
@echo "Done"
|
||||
@echo -n "Copying distribution files"
|
||||
@for file in $(DISTFILES); do \
|
||||
echo -n "."; \
|
||||
cp -pr $$file $(DISTDIR)/$$file; \
|
||||
done
|
||||
@echo "Done"
|
||||
@tar -czf $(DISTDIR).tar.gz $(DISTDIR)/*
|
||||
@echo "Tar file $(DISTDIR).tar.gz created, Freshmeat Time"
|
||||
|
||||
$(OBJS): Makefile
|
0
NEWS
Normal file
0
NEWS
Normal file
84
README.ProfileServ
Normal file
84
README.ProfileServ
Normal file
|
@ -0,0 +1,84 @@
|
|||
|
||||
ProfileServ Manual
|
||||
_________________________________________________________________
|
||||
|
||||
1. Prerequisites and Installation.
|
||||
|
||||
1.1. Compiling and Installation
|
||||
|
||||
2. Basic Configuration
|
||||
|
||||
Welcome to the ProfileServ Manual. This document will aid you in
|
||||
setting up and running ProfileServ on your IRC network.
|
||||
|
||||
ProfileServ is a User Profile Service.
|
||||
|
||||
1. Prerequisites and Installation.
|
||||
|
||||
ProfileServ is designed to run on Top of NeoStats 3.
|
||||
Please refer to the NeoStats website for more
|
||||
information on the requirements for NeoStats.
|
||||
|
||||
ProfileServ requires the following:
|
||||
* NeoStats 3.0 or Higher correctly installed and Running
|
||||
* The time to read this entire document.
|
||||
|
||||
|
||||
1.1. Compiling and Installation
|
||||
|
||||
As long as you have successfully setup NeoStats, and installed it
|
||||
correctly, Compiling ProfileServ is very simple and straight forward.
|
||||
First you must extract the files from the download package. This
|
||||
is as simple as:
|
||||
bash$ tar -xzf ProfileServ-<ver>.tar.gz
|
||||
|
||||
This should then create a directory called ProfileServ-<version>
|
||||
where <version> is the Version of ProfileServ. Then Proceed to Change
|
||||
into the ProfileServ directory, and run Configure as follows:
|
||||
bash$./configure [--with-neostats=<dir>]
|
||||
|
||||
--with-neostats=<dir> should be used if your neostats directory is not
|
||||
in a standard location (~/NeoStats3.0/). Replace <dir> with the full path
|
||||
to your NeoStats installation directory (NOT SOURCE DIRECTORY)
|
||||
|
||||
If the configuration did not produce a error, you may then move onto
|
||||
Compiling ProfileServ. Compiling is simply just issuing the "make"
|
||||
command (or "gmake" if you are running BSD):
|
||||
|
||||
Again, check for Error messages. As long as there are not error
|
||||
messages, "make install" (or "gmake" if you are running BSD) will install
|
||||
ProfileServ, this README file, and any auxiluary files needed into your
|
||||
NeoStats directory:
|
||||
|
||||
Once Installation is complete, you can either configure NeoStats to
|
||||
load ProfileServ when it starts, or load ProfileServ via IRC.
|
||||
|
||||
To Configure NeoStats to automatically load ProfileServ when it boots,
|
||||
add the following line to your "neostats.conf" file in the NeoStats
|
||||
directory:
|
||||
|
||||
LOAD_MODULE ProfileServ
|
||||
|
||||
To load ProfileServ via IRC, you must make sure you have the
|
||||
appropriate permissions and issue the following command:
|
||||
|
||||
/msg neostats load ProfileServ
|
||||
|
||||
Thats it. ProfileServ is now loaded and ready for use (in fact, it
|
||||
will already be running now, but read on for futher information).
|
||||
|
||||
2. Basic Configuration
|
||||
|
||||
By default, ProfileServ will use the Global Exclusions, will ignore any
|
||||
profile viewing or adding commands.
|
||||
|
||||
To Disable the Global Exclusion list and only use the Local one (NOTE: Both
|
||||
can be used concurrently) use SET EXCLUSIONS OFF
|
||||
|
||||
To enable the Profile Channel (Defaults to #Profile) use
|
||||
"SETENABLEPROFILECHAN ON", ProfileServ will then join the Profile Channel to
|
||||
accept Commands in channel.
|
||||
|
||||
To Enable the Profile commands via Private message to ProfileServ, use
|
||||
"SET ENABLE ON"
|
||||
|
23
RELNOTES
Normal file
23
RELNOTES
Normal file
|
@ -0,0 +1,23 @@
|
|||
==============================================================================
|
||||
Important information you should know: (READ THIS!)
|
||||
==============================================================================
|
||||
|
||||
This is an alpha release. Not all features will work and there may be major
|
||||
bugs in the software. This release is purely for us to get feedback on the new
|
||||
version of NeoStats and should not be run on production networks. This release
|
||||
is ideal for users with test networks or those that want an opportunity to
|
||||
help us develop the new version with feedback and suggestions.
|
||||
|
||||
No support is provided for this release so if you have problems and are unable
|
||||
to resolve them using the provided documentation, you should use the supported
|
||||
stable 2.5 series instead until NeoStats 3.0 is further along.
|
||||
|
||||
Bugs, requests and suggestions should be reported using the bug tracking
|
||||
system. You must provide all information required as listed in the README
|
||||
section on support or your entry will be removed.
|
||||
|
||||
Settings and data files from 2.5.x will not work with 3.0. Settings for a1
|
||||
may not be compatible with this version. You should delete all files with
|
||||
"config" in the filename from the directory ~/NeoStats 3.0/data before
|
||||
using this version.
|
||||
|
93
configure.in
Normal file
93
configure.in
Normal file
|
@ -0,0 +1,93 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(profileserv.c)
|
||||
AC_CONFIG_HEADER(modconfig.h)
|
||||
|
||||
PACKAGE=ProfileServ
|
||||
MODULE_MAJOR=3
|
||||
MODULE_MINOR=0
|
||||
MODULE_REV=a3-dev
|
||||
VERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
|
||||
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
|
||||
AC_DEFINE_UNQUOTED(MODULE_REV, "$MODULE_REV")
|
||||
DIRINST=~/NeoStats3.0/
|
||||
AC_PREFIX_DEFAULT(~/NeoStats3.0/)
|
||||
CFLAGS="$CFLAGS -O2"
|
||||
|
||||
case "$host_os" in
|
||||
*openbsd*)
|
||||
MAKEDEPENDENCIES="";;
|
||||
*freebsd*)
|
||||
MAKEDEPENDENCIES="";;
|
||||
*)
|
||||
MAKEDEPENDENCIES="-include \$(OBJS:.o=.d)";;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(Location of NeoStats...)
|
||||
AC_ARG_WITH(neostats,
|
||||
[ --with-neostats=DIR Location of NeoStats installation],
|
||||
[DIRINST=$withval])
|
||||
AC_MSG_RESULT($DIRINST)
|
||||
|
||||
AC_CHECK_FILE($DIRINST/include/neostats.h,
|
||||
[INCLUDEDIR="$DIRINST/include/"],
|
||||
[AC_MSG_ERROR(Can't find existing NeoStats Installation please supply with --with-neostats option)])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -I$INCLUDEDIR"
|
||||
dnl Check we are running the latest supported version of NeoStats
|
||||
AC_MSG_CHECKING(Version of NeoStats...)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
int main(void) {
|
||||
if (MAJOR >= 3) {
|
||||
if (MINOR >= 0) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
], ns_version_ok='yes',
|
||||
ns_version_ok='no',
|
||||
ns_version_ok='no')
|
||||
if test "$ns_version_ok" = "yes"; then
|
||||
AC_MSG_RESULT(Compatible version);
|
||||
else
|
||||
AC_MSG_ERROR(This module requires NeoStats 3.0.a3 or higher)
|
||||
fi
|
||||
|
||||
dnl check if we are running with Debug....
|
||||
AC_MSG_CHECKING(Whether to Enable Debuging...)
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug - Enable Debuging],
|
||||
[ case "$enableval" in
|
||||
yes)
|
||||
CFLAGS="$CFLAGS -Wall -ggdb"
|
||||
AC_DEFINE(DEBUG,1)
|
||||
AC_MSG_RESULT(yes - Watch your Log Files)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_SUBST(DIRINST)
|
||||
AC_SUBST(MAKEDEPENDENCIES)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_SUBST(VERSION)
|
||||
AC_OUTPUT(Makefile)
|
||||
echo "Configuration complete."
|
||||
read -p "Press Enter key to read the release notes"
|
||||
clear
|
||||
more RELNOTES
|
||||
echo "Run 'make' (or 'gmake' on some systems) to compile."
|
||||
echo "If you require support, see the README file."
|
251
install-sh
Normal file
251
install-sh
Normal file
|
@ -0,0 +1,251 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
14
modconfig.h.in
Normal file
14
modconfig.h.in
Normal file
|
@ -0,0 +1,14 @@
|
|||
/* define this to enable debug code for this module */
|
||||
#undef DEBUG
|
||||
|
||||
/* Version number of package */
|
||||
#undef MODULE_VERSION
|
||||
|
||||
/* Major Version */
|
||||
#undef MODULE_MAJOR
|
||||
|
||||
/* Minor Version */
|
||||
#undef MODULE_MINOR
|
||||
|
||||
/* Revision */
|
||||
#undef MODULE_REV
|
15
modconfigwin32.h
Normal file
15
modconfigwin32.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* modconfig.h. Generated by configure. */
|
||||
/* define this to enable debug code for this module */
|
||||
/* #undef DEBUG */
|
||||
|
||||
/* Version number of package */
|
||||
#define MODULE_VERSION "3.0.a3-dev"
|
||||
|
||||
/* Major Version */
|
||||
#define MODULE_MAJOR "3"
|
||||
|
||||
/* Minor Version */
|
||||
#define MODULE_MINOR "0"
|
||||
|
||||
/* Revision */
|
||||
#define MODULE_REV "a3-dev"
|
810
profileserv.c
Normal file
810
profileserv.c
Normal file
|
@ -0,0 +1,810 @@
|
|||
/* ProfileServ - User Profile Service - NeoStats Addon Module
|
||||
** Copyright (c) 2005 Justin Hammond, Mark Hetherington, DeadNotBuried
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation; either version 2 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program; if not, write to the Free Software
|
||||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
** USA
|
||||
**
|
||||
** ProfileServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "profileserv.h"
|
||||
|
||||
/* data */
|
||||
char nicklower[MAXNICK];
|
||||
|
||||
/** Copyright info */
|
||||
const char *pfs_copyright[] = {
|
||||
"Copyright (c) 2005, NeoStats",
|
||||
"http://www.neostats.net/",
|
||||
NULL};
|
||||
|
||||
const char *pfs_about[] = {
|
||||
"\2Profile Service\2",
|
||||
"",
|
||||
"Provides User Profile Services.",
|
||||
"Allows saving of data provided by the user of the",
|
||||
"registered nickname, and viewing by other users.",
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* Commands and Settings
|
||||
*/
|
||||
static bot_cmd pfs_commands[]=
|
||||
{
|
||||
{"VIEW", pfs_cmd_view, 1, 0, pfs_help_view},
|
||||
{"REALNAME", pfs_cmd_realname, 1, 0, pfs_help_realname},
|
||||
{"BIRTHDAY", pfs_cmd_birthday, 3, 0, pfs_help_birthday},
|
||||
{"AGE", pfs_cmd_age, 1, 0, pfs_help_age},
|
||||
{"GENDER", pfs_cmd_gender, 1, 0, pfs_help_gender},
|
||||
{"MARITALSTATUS", pfs_cmd_maritalstatus, 1, 0, pfs_help_maritalstatus},
|
||||
{"LOCATION", pfs_cmd_location, 1, 0, pfs_help_location},
|
||||
{"HOBBIES", pfs_cmd_hobbies, 1, 0, pfs_help_hobbies},
|
||||
{"GENERAL", pfs_cmd_general, 2, 0, pfs_help_general},
|
||||
{"DEL", pfs_cmd_del, 1, 0, pfs_help_del},
|
||||
{NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
static bot_setting pfs_settings[]=
|
||||
{
|
||||
{"EXCLUSIONS", &ProfileServ.exclusions, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, pfs_help_set_exclusions, pfs_set_exclusions, (void *)1 },
|
||||
{"ENABLE", &ProfileServ.enable, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, pfs_help_set_enable, NULL, (void *)0 },
|
||||
{"ENABLEPROFILECHAN", &ProfileServ.enableprofilechan, SET_TYPE_BOOLEAN, 0, 0, NS_ULEVEL_ADMIN, NULL, pfs_help_set_enableprofilechan, pfs_set_enablechan, (void *)0 },
|
||||
{"PROFILECHANNAME", &ProfileServ.profilechan, SET_TYPE_CHANNEL, 0, MAXCHANLEN, NS_ULEVEL_ADMIN, NULL, pfs_help_set_profilechan, pfs_set_profilechan, (void *)"#Profile" },
|
||||
{"EXPIREDAYS", &ProfileServ.expiredays, SET_TYPE_INT, 0, 100000, NS_ULEVEL_ADMIN, NULL, pfs_help_set_expiredays, NULL, (void *)30 },
|
||||
{NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* Module Info definition
|
||||
*/
|
||||
ModuleInfo module_info = {
|
||||
"ProfileServ",
|
||||
"Profile Service Module For NeoStats",
|
||||
pfs_copyright,
|
||||
pfs_about,
|
||||
NEOSTATS_VERSION,
|
||||
"3.0",
|
||||
__DATE__,
|
||||
__TIME__,
|
||||
MODULE_FLAG_LOCAL_EXCLUDES,
|
||||
0,
|
||||
};
|
||||
|
||||
/*
|
||||
* Module event list
|
||||
*/
|
||||
ModuleEvent module_events[] = {
|
||||
{EVENT_UMODE, pfs_UmodeUser},
|
||||
{EVENT_NULL, NULL}
|
||||
};
|
||||
|
||||
/** BotInfo */
|
||||
static BotInfo pfs_botinfo =
|
||||
{
|
||||
"ProfileServ",
|
||||
"ProfileServ1",
|
||||
"Profiles",
|
||||
BOT_COMMON_HOST,
|
||||
"Profile Service",
|
||||
BOT_FLAG_SERVICEBOT|BOT_FLAG_PERSIST,
|
||||
pfs_commands,
|
||||
pfs_settings,
|
||||
};
|
||||
|
||||
/*
|
||||
* Online event processing
|
||||
*/
|
||||
int ModSynch (void)
|
||||
{
|
||||
/* Introduce a bot onto the network */
|
||||
pfs_bot = AddBot (&pfs_botinfo);
|
||||
if (!pfs_bot)
|
||||
return NS_FAILURE;
|
||||
if (ProfileServ.enableprofilechan) {
|
||||
irc_join (pfs_bot, ProfileServ.profilechan, "+o");
|
||||
irc_chanalert (pfs_bot, "Profile Channel Now Available in %s", ProfileServ.profilechan);
|
||||
} else {
|
||||
irc_chanalert (pfs_bot, "Profile Channel Not Enabled");
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
};
|
||||
|
||||
/*
|
||||
* Init module
|
||||
*/
|
||||
int ModInit( void )
|
||||
{
|
||||
ModuleConfig (pfs_settings);
|
||||
AddTimer (TIMER_TYPE_DAILY, pfs_expire_profiles, "pfs_expire_profiles", 0);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit module
|
||||
*/
|
||||
int ModFini( void )
|
||||
{
|
||||
DelTimer ("pfs_expire_profiles");
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable/Disable Global Exclusions
|
||||
*/
|
||||
int pfs_set_exclusions( CmdParams *cmdparams, SET_REASON reason )
|
||||
{
|
||||
if( reason == SET_LOAD || reason == SET_CHANGE )
|
||||
SetAllEventFlags( EVENT_FLAG_USE_EXCLUDE, ProfileServ.exclusions );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Profile Channel Enable/Disable
|
||||
*/
|
||||
int pfs_set_enablechan (CmdParams *cmdparams, SET_REASON reason)
|
||||
{
|
||||
if (!ProfileServ.profilechan)
|
||||
return NS_SUCCESS;
|
||||
if (reason == SET_CHANGE)
|
||||
{
|
||||
if (ProfileServ.enableprofilechan)
|
||||
{
|
||||
irc_join (pfs_bot, ProfileServ.profilechan, "+o");
|
||||
irc_chanalert (pfs_bot, "Profile functions now available in %s", ProfileServ.profilechan);
|
||||
return NS_SUCCESS;
|
||||
} else {
|
||||
irc_part (pfs_bot, ProfileServ.profilechan, NULL);
|
||||
irc_chanalert (pfs_bot, "Profile functions are no longer available in %s", ProfileServ.profilechan);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Profile Channel Setting
|
||||
*/
|
||||
int pfs_set_profilechan (CmdParams *cmdparams, SET_REASON reason)
|
||||
{
|
||||
if (!ProfileServ.enableprofilechan)
|
||||
return NS_SUCCESS;
|
||||
if (reason == SET_VALIDATE)
|
||||
{
|
||||
irc_prefmsg (pfs_bot, cmdparams->source, "Profile Channel changing from %s to %s", ProfileServ.profilechan, cmdparams->av[1]);
|
||||
irc_chanalert (pfs_bot, "Profile Channel Changing to %s , Parting %s (%s)", cmdparams->av[1], ProfileServ.profilechan, cmdparams->source->name);
|
||||
irc_chanprivmsg (pfs_bot, ProfileServ.profilechan, "\0039%s has changed Channels, Profile functions will now be available in %s", cmdparams->source->name, cmdparams->av[1]);
|
||||
irc_part (pfs_bot, ProfileServ.profilechan, NULL);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
if (reason == SET_CHANGE)
|
||||
{
|
||||
irc_join (pfs_bot, ProfileServ.profilechan, "+o");
|
||||
irc_chanalert (pfs_bot, "Profile functions now available in %s", ProfileServ.profilechan);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/** profile_report
|
||||
*
|
||||
* handles channel/user message selection
|
||||
*/
|
||||
static char profile_report_buf[BUFSIZE];
|
||||
|
||||
void profile_report( CmdParams *cmdparams, const char *fmt, ... )
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start( ap, fmt );
|
||||
ircvsnprintf( profile_report_buf, BUFSIZE, fmt, ap );
|
||||
va_end( ap );
|
||||
if( cmdparams->channel == NULL )
|
||||
irc_prefmsg (pfs_bot, cmdparams->source, profile_report_buf );
|
||||
else
|
||||
irc_chanprivmsg (pfs_bot, cmdparams->channel->name, profile_report_buf );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View Nicknames Profile
|
||||
*/
|
||||
int pfs_cmd_view (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if( ValidateNick( cmdparams->av[0] ) == NS_FAILURE )
|
||||
{
|
||||
profile_report( cmdparams, "Invalid Nickname Specified" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( nicklower, cmdparams->av[0], MAXNICK );
|
||||
if( DBAFetch( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) ) == NS_FAILURE )
|
||||
{
|
||||
profile_report( cmdparams, "No Profile exists for specified nickname" );
|
||||
}
|
||||
else
|
||||
{
|
||||
profile_report( cmdparams, "Profile For : %s", pu->nick );
|
||||
strlcpy( pd->typenick, "RNT" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, "Real Name : %s", pd->typedata );
|
||||
strlcpy( pd->typenick, "BDT" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, "Birthday : %s", pd->typedata );
|
||||
strlcpy( pd->typenick, "AGE" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, "Age : %s", pd->typedata );
|
||||
strlcpy( pd->typenick, "SEX" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, "Gender : %s", pd->typedata );
|
||||
strlcpy( pd->typenick, "MST" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, "Marital Status : %s", pd->typedata );
|
||||
strlcpy( pd->typenick, "LOC" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, "Location : %s", pd->typedata );
|
||||
strlcpy( pd->typenick, "HOB" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, "Hobbies : %s", pd->typedata );
|
||||
strlcpy( pd->typenick, "GT1" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, pd->typedata );
|
||||
strlcpy( pd->typenick, "GT2" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, pd->typedata );
|
||||
strlcpy( pd->typenick, "GT3" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, pd->typedata );
|
||||
strlcpy( pd->typenick, "GT4" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, pd->typedata );
|
||||
strlcpy( pd->typenick, "GT5" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
if( DBAFetch( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) ) != NS_FAILURE )
|
||||
profile_report( cmdparams, pd->typedata );
|
||||
profile_report( cmdparams, "End of Profile For : %s", pu->nick );
|
||||
}
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Real Name
|
||||
*/
|
||||
int pfs_cmd_realname (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
char *buf;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
buf= joinbuf(cmdparams->av, cmdparams->ac, 0);
|
||||
strlcpy( pd->typenick, "RNT" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
strlcpy( pd->typedata, buf, PFS_TEXTSIZE );
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "Real Name changed to : %s", pd->typedata );
|
||||
ns_free( buf );
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Birthday
|
||||
*/
|
||||
int pfs_cmd_birthday (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
int d, m, y;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
d = atoi(cmdparams->av[0]);
|
||||
m = atoi(cmdparams->av[1]);
|
||||
y = atoi(cmdparams->av[2]);
|
||||
if ( d < 1 || d > 31 || m < 1 || m > 12 )
|
||||
{
|
||||
profile_report( cmdparams, "Invalid Date Specifed (must be in the format 'dd mm yy')" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
strlcpy( pd->typenick, "BDT" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
ircsnprintf( pd->typedata, PFS_TEXTSIZE, "%d %s %d", d , (m == 1) ? "Jan" : (m == 2) ? "Feb" : (m == 3) ? "Mar" : (m == 4) ? "Apr" : (m == 5) ? "May" : (m == 6) ? "Jun" : (m == 7) ? "Jul" : (m == 8) ? "Aug" : (m == 9) ? "Sep" : (m == 10) ? "Oct" : (m == 11) ? "Nov" : "Dec", y);
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "Birthday changed to : %s", pd->typedata );
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Age
|
||||
*/
|
||||
int pfs_cmd_age (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
int userage;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
userage = atoi(cmdparams->av[0]);
|
||||
if ( userage < 5 || userage > 125 )
|
||||
{
|
||||
profile_report( cmdparams, "Invalid Age Specifed" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
strlcpy( pd->typenick, "AGE" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
ircsnprintf( pd->typedata, PFS_TEXTSIZE, "%d", userage);
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "Age changed to : %s", pd->typedata );
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Gender
|
||||
*/
|
||||
int pfs_cmd_gender (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
strlcpy( pd->typenick, "SEX" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
switch (cmdparams->av[0][0])
|
||||
{
|
||||
case 'm':
|
||||
case 'M':
|
||||
strlcpy( pd->typedata, "Male", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'f':
|
||||
case 'F':
|
||||
strlcpy( pd->typedata, "Female", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'a':
|
||||
case 'A':
|
||||
strlcpy( pd->typedata, "Alien", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'o':
|
||||
case 'O':
|
||||
strlcpy( pd->typedata, "Other", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'u':
|
||||
case 'U':
|
||||
strlcpy( pd->typedata, "Unknown", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'i':
|
||||
case 'I':
|
||||
strlcpy( pd->typedata, "I'm checking on that myself right now ;p", PFS_TEXTSIZE );
|
||||
break;
|
||||
default:
|
||||
pd->typedata[0] = '\0';
|
||||
break;
|
||||
}
|
||||
if( strlen( pd->typedata ) < 1 ) {
|
||||
profile_report( cmdparams, "Invalid Gender Specified");
|
||||
} else {
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "Gender changed to : %s", pd->typedata );
|
||||
}
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Marital Status
|
||||
*/
|
||||
int pfs_cmd_maritalstatus (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
strlcpy( pd->typenick, "MST" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
switch (cmdparams->av[0][0])
|
||||
{
|
||||
case 's':
|
||||
case 'S':
|
||||
strlcpy( pd->typedata, "Single", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'm':
|
||||
case 'M':
|
||||
strlcpy( pd->typedata, "Married", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'd':
|
||||
case 'D':
|
||||
strlcpy( pd->typedata, "Divorced", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'a':
|
||||
case 'A':
|
||||
strlcpy( pd->typedata, "Available", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'u':
|
||||
case 'U':
|
||||
strlcpy( pd->typedata, "Unavailable", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'w':
|
||||
case 'W':
|
||||
strlcpy( pd->typedata, "Getting rid of the Witch", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'b':
|
||||
case 'B':
|
||||
strlcpy( pd->typedata, "Getting rid of the Hubastard", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 't':
|
||||
case 'T':
|
||||
strlcpy( pd->typedata, "Too Bloody Picky", PFS_TEXTSIZE );
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
strlcpy( pd->typedata, "Waiting (because there is no Price Charming/Sleeping Beauty)", PFS_TEXTSIZE );
|
||||
break;
|
||||
default:
|
||||
pd->typedata[0] = '\0';
|
||||
break;
|
||||
}
|
||||
if( strlen( pd->typedata ) < 1 ) {
|
||||
profile_report( cmdparams, "Invalid Marital Status Specified");
|
||||
} else {
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "Marital Status changed to : %s", pd->typedata );
|
||||
}
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Location
|
||||
*/
|
||||
int pfs_cmd_location (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
char *buf;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
buf= joinbuf(cmdparams->av, cmdparams->ac, 0);
|
||||
strlcpy( pd->typenick, "LOC" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
strlcpy( pd->typedata, buf, PFS_TEXTSIZE );
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "Location changed to : %s", pd->typedata );
|
||||
ns_free( buf );
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Hobbies
|
||||
*/
|
||||
int pfs_cmd_hobbies (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
char *buf;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
buf= joinbuf(cmdparams->av, cmdparams->ac, 0);
|
||||
strlcpy( pd->typenick, "HOB" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
strlcpy( pd->typedata, buf, PFS_TEXTSIZE );
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "Hobbies changed to : %s", pd->typedata );
|
||||
ns_free( buf );
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set General Information Lines
|
||||
*/
|
||||
int pfs_cmd_general (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
ProfileData *pd;
|
||||
char *buf;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if ( !(cmdparams->source->user->Umode & UMODE_REGNICK) )
|
||||
{
|
||||
profile_report( cmdparams, "You must be Identified for your nickname to add data to the profile" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
if ( atoi(cmdparams->av[0]) < 1 || atoi(cmdparams->av[0]) > 5 || strlen(cmdparams->av[0]) > 1 )
|
||||
{
|
||||
profile_report( cmdparams, "Invalid General Line Number, Must be numbered 1 to 5" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) );
|
||||
buf= joinbuf(cmdparams->av, cmdparams->ac, 1);
|
||||
strlcpy( pd->typenick, "GT" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, cmdparams->av[0] , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
strlcpy( pd->typedata, buf, PFS_TEXTSIZE );
|
||||
DBAStore( "UserData", pd->typenick, ( void * )pd, sizeof( ProfileData ) );
|
||||
profile_report( cmdparams, "General Information Line %d changed to : %s", cmdparams->av[0], pd->typedata );
|
||||
ns_free( buf );
|
||||
ns_free( pu );
|
||||
ns_free( pd );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete Nicknames Profile Command
|
||||
*/
|
||||
int pfs_cmd_del (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if( ( !ProfileServ.enable && !cmdparams->channel ) || ( !ProfileServ.enableprofilechan && cmdparams->channel ) )
|
||||
return NS_SUCCESS;
|
||||
if( ValidateNick( cmdparams->av[0] ) == NS_FAILURE )
|
||||
{
|
||||
profile_report( cmdparams, "Invalid Nickname Specified" );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
/* only netadmins may delete others Profiles */
|
||||
if (ircstrcasecmp(cmdparams->av[0], cmdparams->source->name) && cmdparams->source->user->ulevel < NS_ULEVEL_ADMIN )
|
||||
{
|
||||
profile_report( cmdparams, "You may only delete your own Profile." );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
strlcpy( nicklower, cmdparams->av[0], MAXNICK );
|
||||
if( DBAFetch( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) ) == NS_FAILURE )
|
||||
{
|
||||
profile_report( cmdparams, "No Profile exists for specified nickname" );
|
||||
}
|
||||
else
|
||||
{
|
||||
pfs_delete_profile ( cmdparams, pu );
|
||||
}
|
||||
ns_free( pu );
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete Nicknames Profile
|
||||
*
|
||||
* removes passed ProfileUser
|
||||
* if cmdparams is NULL then delete called
|
||||
* from expire procedure
|
||||
*/
|
||||
void pfs_delete_profile ( CmdParams *cmdparams, ProfileUser *pu )
|
||||
{
|
||||
ProfileData *pd;
|
||||
|
||||
pd = ns_calloc( sizeof( ProfileData ) );
|
||||
strlcpy( pd->typenick, "RNT" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "BDT" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "AGE" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "SEX" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "MST" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "LOC" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "HOB" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "GT1" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "GT2" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "GT3" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "GT4" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
strlcpy( pd->typenick, "GT5" , PFS_TYPENICKSIZE );
|
||||
strlcat( pd->typenick, nicklower, PFS_TYPENICKSIZE );
|
||||
DBADelete( "UserData", pd->typenick );
|
||||
DBADelete( "UserList", nicklower );
|
||||
if (cmdparams)
|
||||
profile_report( cmdparams, "Profile for %s deleted.", pu->nick );
|
||||
ns_free( pd );
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Expire Old Profiles Timer
|
||||
*/
|
||||
int pfs_expire_profiles(void)
|
||||
{
|
||||
SET_SEGV_LOCATION();
|
||||
if( ProfileServ.expiredays > 0 )
|
||||
DBAFetchRows( "UserList", expireoldprofiles);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Expire Old Profiles
|
||||
*/
|
||||
int expireoldprofiles(void *data, int size)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
|
||||
pu = ns_calloc( sizeof ( ProfileUser ) );
|
||||
os_memcpy( pu, data, sizeof ( ProfileUser ) );
|
||||
if( ( me.now - pu->lastseen ) > ( ProfileServ.expiredays * TS_ONE_DAY ) )
|
||||
pfs_delete_profile ( NULL, pu );
|
||||
ns_free( pu );
|
||||
return NS_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* User Mode Change
|
||||
*/
|
||||
int pfs_UmodeUser (CmdParams *cmdparams)
|
||||
{
|
||||
ProfileUser *pu;
|
||||
|
||||
SET_SEGV_LOCATION();
|
||||
if (cmdparams->source->user->Umode & UMODE_REGNICK)
|
||||
{
|
||||
pu = ns_calloc( sizeof( ProfileUser ) );
|
||||
strlcpy( nicklower, cmdparams->source->name , MAXNICK );
|
||||
if( DBAFetch( "UserList", strlwr(nicklower), ( void * )pu, sizeof( ProfileUser ) ) != NS_FAILURE )
|
||||
{
|
||||
/* Profile Exists so update last seen time */
|
||||
strlcpy( pu->nick, cmdparams->source->name , MAXNICK );
|
||||
pu->lastseen = me.now;
|
||||
DBAStore( "UserList", nicklower, ( void * )pu, sizeof( ProfileUser ) );
|
||||
}
|
||||
ns_free( pu );
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
84
profileserv.h
Normal file
84
profileserv.h
Normal file
|
@ -0,0 +1,84 @@
|
|||
/* ProfileServ - User Profile Service - NeoStats Addon Module
|
||||
** Copyright (c) 2005 Justin Hammond, Mark Hetherington, DeadNotBuried
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation; either version 2 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program; if not, write to the Free Software
|
||||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
** USA
|
||||
**
|
||||
** ProfileServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
/* Defines */
|
||||
#define PFS_TYPESIZE 3 /* Type Field Size */
|
||||
#define PFS_TEXTSIZE 300 /* Text Field Size */
|
||||
#define PFS_TYPENICKSIZE PFS_TYPESIZE+MAXNICK /* Type and Nick Key Field Size */
|
||||
|
||||
/* Variables And Structs */
|
||||
Bot *pfs_bot;
|
||||
|
||||
struct ProfileServ {
|
||||
int exclusions;
|
||||
int enable;
|
||||
int enableprofilechan;
|
||||
char profilechan[MAXCHANLEN];
|
||||
int expiredays;
|
||||
} ProfileServ;
|
||||
|
||||
typedef struct ProfileUser {
|
||||
char nick[MAXNICK];
|
||||
int lastseen;
|
||||
} ProfileUser;
|
||||
|
||||
typedef struct ProfileData {
|
||||
char typenick[PFS_TYPENICKSIZE];
|
||||
char typedata[PFS_TEXTSIZE];
|
||||
} ProfileData;
|
||||
|
||||
/* ProfileServ Module Help - ProfileServ_help.c */
|
||||
extern const char *pfs_help_set_exclusions[];
|
||||
extern const char *pfs_help_set_enable[];
|
||||
extern const char *pfs_help_set_enableprofilechan[];
|
||||
extern const char *pfs_help_set_profilechan[];
|
||||
extern const char *pfs_help_set_expiredays[];
|
||||
extern const char *pfs_help_view[];
|
||||
extern const char *pfs_help_realname[];
|
||||
extern const char *pfs_help_birthday[];
|
||||
extern const char *pfs_help_age[];
|
||||
extern const char *pfs_help_gender[];
|
||||
extern const char *pfs_help_maritalstatus[];
|
||||
extern const char *pfs_help_location[];
|
||||
extern const char *pfs_help_hobbies[];
|
||||
extern const char *pfs_help_general[];
|
||||
extern const char *pfs_help_del[];
|
||||
|
||||
/* profileserv.c */
|
||||
int pfs_set_exclusions( CmdParams *cmdparams, SET_REASON reason );
|
||||
int pfs_set_enablechan (CmdParams *cmdparams, SET_REASON reason);
|
||||
int pfs_set_profilechan (CmdParams *cmdparams, SET_REASON reason);
|
||||
void profile_report( CmdParams *cmdparams, const char *fmt, ... );
|
||||
int pfs_cmd_view (CmdParams *cmdparams);
|
||||
int pfs_cmd_realname (CmdParams *cmdparams);
|
||||
int pfs_cmd_birthday (CmdParams *cmdparams);
|
||||
int pfs_cmd_age (CmdParams *cmdparams);
|
||||
int pfs_cmd_gender (CmdParams *cmdparams);
|
||||
int pfs_cmd_maritalstatus (CmdParams *cmdparams);
|
||||
int pfs_cmd_location (CmdParams *cmdparams);
|
||||
int pfs_cmd_hobbies (CmdParams *cmdparams);
|
||||
int pfs_cmd_general (CmdParams *cmdparams);
|
||||
int pfs_cmd_del (CmdParams *cmdparams);
|
||||
void pfs_delete_profile ( CmdParams *cmdparams, ProfileUser *pu );
|
||||
int pfs_expire_profiles(void);
|
||||
int expireoldprofiles(void *data, int size);
|
||||
int pfs_UmodeUser (CmdParams *cmdparams);
|
141
profileserv_help.c
Normal file
141
profileserv_help.c
Normal file
|
@ -0,0 +1,141 @@
|
|||
/* ProfileServ - User Profile Service - NeoStats Addon Module
|
||||
** Copyright (c) 2005 Justin Hammond, Mark Hetherington, DeadNotBuried
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation; either version 2 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program; if not, write to the Free Software
|
||||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
** USA
|
||||
**
|
||||
** ProfileServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "profileserv.h"
|
||||
|
||||
const char *pfs_help_set_exclusions[] = {
|
||||
"\2EXCLUSIONS <ON|OFF>\2",
|
||||
"Use global exclusion list in addition to local exclusion list",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_set_enable[] = {
|
||||
"\2ENABLE <ON|OFF>\2",
|
||||
"Enable or Disable ProfileServ usage via private message",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_set_enableprofilechan[] = {
|
||||
"\2ENABLEPROFILECHAN <ON|OFF>\2",
|
||||
"Enable ProfileServ to join the Profile Channel and accept commands in channel",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_set_profilechan[] = {
|
||||
"\2PROFILECHAN <#Channel>\2",
|
||||
"Set Channel ProfileServ accepts commands from in channel",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_set_expiredays[] = {
|
||||
"\2EXPIREDAYS <#>\2",
|
||||
"Sets the number of days after which profile data is",
|
||||
"removed, if the nickname has not been seen identified.",
|
||||
"Set to 0 to disable Profile expiry.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_view[] = {
|
||||
"View Profile",
|
||||
"Syntax: \2VIEW <nick>\2",
|
||||
"",
|
||||
"Displays infomation stored in ProfileServ for the entered Nickname.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_realname[] = {
|
||||
"Add Real Name to Profile",
|
||||
"Syntax: \2SETREALNAME <real name>\2",
|
||||
"",
|
||||
"Add your Real Name to ProfileServ for your current Nick.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_birthday[] = {
|
||||
"Add birthday to Profile",
|
||||
"Syntax: \2SETBIRTHDAY <day> <month> <year>\2",
|
||||
"",
|
||||
"Add your birthday to ProfileServ for your current Nick.",
|
||||
"NOTE: Age will be calculated automatically if entered.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_age[] = {
|
||||
"Add Age to Profile",
|
||||
"Syntax: \2SETAGE <age>\2",
|
||||
"",
|
||||
"Add your age (in years) to ProfileServ for your current Nick.",
|
||||
"NOTE: Age will not be used if birthday has been entered.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_gender[] = {
|
||||
"Add Gender to Profile",
|
||||
"Syntax: \2SETGENDER <M|MALE|F|FEMALE|A|ALIEN|O|OTHER>>\2",
|
||||
"",
|
||||
"Add your Gender to ProfileServ for your current Nick.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_maritalstatus[] = {
|
||||
"Add Marital Status to Profile",
|
||||
"Syntax: \2SETMARITAL <S|SINGLE|M|MARRIED|D|DIVORCED|A|AVAILABLE|U|UNAVAILABLE>>\2",
|
||||
"",
|
||||
"Add your Marital Status to ProfileServ for your current Nick.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_location[] = {
|
||||
"Add Location to Profile",
|
||||
"Syntax: \2SETLOCATION <Country / State / Province / City / Suburb>\2",
|
||||
"",
|
||||
"Add your Location to ProfileServ for your current Nick.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_hobbies[] = {
|
||||
"Add Hobbies to Profile",
|
||||
"Syntax: \2SETHOBBIES <Hobby List>\2",
|
||||
"",
|
||||
"Add your List of Hobbies to ProfileServ for your current Nick.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_general[] = {
|
||||
"Add General information to Profile",
|
||||
"Syntax: \2SETGENERAL <#> <text>\2",
|
||||
"",
|
||||
"Add General information to ProfileServ for your current Nick.",
|
||||
"Up to 5 lines of general Information may be entered.",
|
||||
"# MUST be a number from 1 to 5, being the line number for the General information.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *pfs_help_del[] = {
|
||||
"Delete a Profile",
|
||||
"Syntax: \2DEL <nick>\2",
|
||||
"",
|
||||
"Allows you to delete your profile.",
|
||||
"You must enter the nickname to remove the profile.",
|
||||
NULL
|
||||
};
|
Reference in a new issue