summaryrefslogtreecommitdiff
path: root/src/mods/html
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:47 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:47 +0200
commit2860b03f00e48264ed15c132ad90b240ebe6070b (patch)
tree09ed88e28d4a83eb2b1cb17c2d424ba6467292f7 /src/mods/html
parenteab0b1c2d649fa16707b24cd2a91f195078167b0 (diff)
tagging ychat-0.7.9.5ychat-0.7.9.5
Diffstat (limited to 'src/mods/html')
-rw-r--r--[-rwxr-xr-x]src/mods/html/Makefile.in4
-rw-r--r--src/mods/html/yc_admin.cpp143
-rw-r--r--[-rwxr-xr-x]src/mods/html/yc_colors.cpp76
-rw-r--r--[-rwxr-xr-x]src/mods/html/yc_help.cpp100
-rw-r--r--[-rwxr-xr-x]src/mods/html/yc_loggedin.cpp24
-rw-r--r--[-rwxr-xr-x]src/mods/html/yc_options.cpp103
-rw-r--r--[-rwxr-xr-x]src/mods/html/yc_register.cpp189
7 files changed, 397 insertions, 242 deletions
diff --git a/src/mods/html/Makefile.in b/src/mods/html/Makefile.in
index 30f1782..4b7c728 100755..100644
--- a/src/mods/html/Makefile.in
+++ b/src/mods/html/Makefile.in
@@ -4,12 +4,12 @@ INCLUDES=`cat ../../includes.add`
CFLAGS=`cat ../cflags.add`
all: mods
$(MODS):
- @echo -n "Compiling html module `basename $@` "
@if ! test -d `dirname $@`; then mkdir -p `dirname $@`; fi
@$(CC) $(CFLAGS) $(INCLUDES) -shared -s -o $@ `echo $(notdir $@) | sed s/.so/.cpp/`
+ @echo -n "HTML module `basename $@ | sed s/\.so// | sed s/yc_//` "
@du -hc $@ | tail -n 1 | sed s/total// | sed "s/ //g"
infotext:
- @echo Compiling html modules
+ @echo Compiling HTML modules
mods: infotext $(MODS)
@echo "Num of html modules: "
@ls ../../../mods/html/*.so | wc -l
diff --git a/src/mods/html/yc_admin.cpp b/src/mods/html/yc_admin.cpp
index d93de4f..9201021 100644
--- a/src/mods/html/yc_admin.cpp
+++ b/src/mods/html/yc_admin.cpp
@@ -1,3 +1,27 @@
+/*:*
+ *: File: ./src/mods/html/yc_admin.cpp
+ *:
+ *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *:
+ *: Copyright (C) 2003 Paul C. Buetow, Volker Richter
+ *: Copyright (C) 2004 Paul C. Buetow
+ *: Copyright (C) 2005 EXA Digital Solutions GbR
+ *:
+ *: 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.
+ *:*/
+
#include "../../incl.h"
#include "../../tool/tool.h"
@@ -7,63 +31,66 @@
using namespace std;
-extern "C" {
- string replace_chars(string s_string) {
- s_string = tool::replace(s_string, "<", "&lt;");
- s_string = tool::replace(s_string, ">", "&gt;");
- s_string = tool::replace(s_string, "\n", "<br>");
- return s_string;
- }
-
- int extern_function(void *v_arg)
- {
- container* c = (container*) v_arg;
- dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
- user* p_user = (user*) c->elem[2];
- conf* p_conf = (conf*) p_wrap->CONF;
- string* p_content = &(*((map_string*) c->elem[1]))["content"];
-
- vector<string>* p_vec_keys = p_conf->get_key_vector();
- sort(p_vec_keys->begin(), p_vec_keys->end());
- vector<string>::iterator p_vec_keys_iter = p_vec_keys->begin();
-
-
- p_content->append( "Currently are " + tool::int2string(p_vec_keys->size()) + " options available!<br><br>\n");
-
- p_content->append( "<table bordercolor=\"1\">\n" );
-
- for( ;p_vec_keys_iter != p_vec_keys->end(); ++p_vec_keys_iter ) {
-
- if ( p_vec_keys_iter->find(".descr") != string::npos )
- continue;
-
- p_content->append( "<tr><td>\n<font color=\"#FFFFFF\"><b>" + *p_vec_keys_iter + "\n</b></font></td></tr>\n" );
-
- string s_descr = p_conf->get_elem(*p_vec_keys_iter + ".descr");
- if ( s_descr.length() > 0 )
- {
- p_content->append( "<tr><td><font color=\"#CCCCCC\">\n" );
- p_content->append( replace_chars(p_conf->get_elem(*p_vec_keys_iter + ".descr")) );
- p_content->append( "\n</font></td></tr>\n" );
- }
-
- p_content->append( "<tr><td>\n" );
-
- // Hide some fields!
- if ( p_vec_keys_iter->find(".password") != string::npos
- || p_vec_keys_iter->find("base.user") != string::npos
- || p_vec_keys_iter->find(".dbname") != string::npos )
- p_content->append( "X X X X X X X X X X" );
-
- else
- p_content->append( replace_chars(p_conf->get_elem(*p_vec_keys_iter)) );
-
- p_content->append( "<br><br></td></tr>\n" );
- } // while
-
- p_content->append( "</table>\n<br>\n" );
-
- return 0;
- }
+extern "C"
+{
+ string replace_chars(string s_string)
+ {
+ s_string = tool::replace(s_string, "<", "&lt;");
+ s_string = tool::replace(s_string, ">", "&gt;");
+ s_string = tool::replace(s_string, "\n", "<br>");
+ return s_string;
+ }
+
+ int extern_function(void *v_arg)
+ {
+ container* c = (container*) v_arg;
+ dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
+ user* p_user = (user*) c->elem[2];
+ conf* p_conf = (conf*) p_wrap->CONF;
+ string* p_content = &(*((map<string,string>*) c->elem[1]))["content"];
+
+ vector<string>* p_vec_keys = p_conf->get_key_vector();
+ sort(p_vec_keys->begin(), p_vec_keys->end());
+ vector<string>::iterator p_vec_keys_iter = p_vec_keys->begin();
+
+ p_content->append( "Currently are " + tool::int2string(p_vec_keys->size()) + " options available!<br><br>\n");
+ p_content->append( "<table bordercolor=\"1\">\n" );
+
+ for( ;p_vec_keys_iter != p_vec_keys->end(); ++p_vec_keys_iter )
+ {
+
+ if ( p_vec_keys_iter->find(".descr") != string::npos )
+ continue;
+
+ p_content->append( "<tr><td>\n<font color=\"#FFFFFF\"><b>" + *p_vec_keys_iter + "\n</b></font></td></tr>\n" );
+
+ string s_descr = p_conf->get_elem(*p_vec_keys_iter + ".descr");
+ if ( s_descr.length()
+ > 0 )
+ {
+ p_content->append( "<tr><td><font color=\"#CCCCCC\">\n" );
+ p_content->append( replace_chars(p_conf->get_elem(*p_vec_keys_iter + ".descr")) );
+ p_content->append( "\n</font></td></tr>\n" );
+ }
+
+ p_content->append( "<tr><td>\n" );
+
+ // Hide some fields!
+ if ( p_vec_keys_iter->find(".password")
+ != string::npos
+ || p_vec_keys_iter->find("base.user") != string::npos
+ || p_vec_keys_iter->find(".dbname") != string::npos )
+ p_content->append( "X X X X X X X X X X" );
+
+ else
+ p_content->append( replace_chars(p_conf->get_elem(*p_vec_keys_iter)) );
+
+ p_content->append( "<br><br></td></tr>\n" );
+ } // while
+
+ p_content->append( "</table>\n<br>\n" );
+
+ return 0;
+ }
}
diff --git a/src/mods/html/yc_colors.cpp b/src/mods/html/yc_colors.cpp
index 4bd20bf..4f717ad 100755..100644
--- a/src/mods/html/yc_colors.cpp
+++ b/src/mods/html/yc_colors.cpp
@@ -1,3 +1,27 @@
+/*:*
+ *: File: ./src/mods/html/yc_colors.cpp
+ *:
+ *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *:
+ *: Copyright (C) 2003 Paul C. Buetow, Volker Richter
+ *: Copyright (C) 2004 Paul C. Buetow
+ *: Copyright (C) 2005 EXA Digital Solutions GbR
+ *:
+ *: 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.
+ *:*/
+
#include "../../incl.h"
/*
@@ -6,30 +30,32 @@
using namespace std;
-extern "C" {
- int extern_function(void *v_arg)
- {
- container* c = (container*) v_arg;
- dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
- conf* p_conf = (conf*) p_wrap->CONF;
- string* p_col1 = &(*((map_string*) c->elem[1]))["col1"];
- string* p_col2 = &(*((map_string*) c->elem[1]))["col2"];
- string* p_flag = &(*((map_string*) c->elem[1]))["flag"];
- user* p_user = (user*) c->elem[2];
-
- p_col1->erase(0);
- p_col2->erase(0);
-
- p_col1->append( p_user->get_col1() );
- p_col2->append( p_user->get_col2() );
-
- if ( *p_flag == "submit" )
- {
- string* p_msgs = &(*((map_string*) c->elem[1]))["msgs"];
- p_msgs->append( p_conf->get_elem( "chat.msgs.optionschanged" ) );
- }
-
- return 0;
- }
+extern "C"
+{
+ int extern_function(void *v_arg)
+ {
+ container* c = (container*) v_arg;
+ dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
+ conf* p_conf = (conf*) p_wrap->CONF;
+ string* p_col1 = &(*((map<string,string>*) c->elem[1]))["col1"];
+ string* p_col2 = &(*((map<string,string>*) c->elem[1]))["col2"];
+ string* p_flag = &(*((map<string,string>*) c->elem[1]))["flag"];
+ user* p_user = (user*) c->elem[2];
+
+ p_col1->erase(0);
+ p_col2->erase(0);
+
+ p_col1->append( p_user->get_col1() );
+ p_col2->append( p_user->get_col2() );
+
+ if ( *p_flag == "submit" )
+ {
+ string* p_msgs = &(*((map<string,string>*) c->elem[1])
+ )["msgs"];
+ p_msgs->append( p_conf->get_elem( "chat.msgs.optionschanged" ) );
+ }
+
+ return 0;
+ }
}
diff --git a/src/mods/html/yc_help.cpp b/src/mods/html/yc_help.cpp
index 5612a50..b7a0237 100755..100644
--- a/src/mods/html/yc_help.cpp
+++ b/src/mods/html/yc_help.cpp
@@ -1,3 +1,27 @@
+/*:*
+ *: File: ./src/mods/html/yc_help.cpp
+ *:
+ *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *:
+ *: Copyright (C) 2003 Paul C. Buetow, Volker Richter
+ *: Copyright (C) 2004 Paul C. Buetow
+ *: Copyright (C) 2005 EXA Digital Solutions GbR
+ *:
+ *: 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.
+ *:*/
+
#include "../../incl.h"
/*
@@ -6,43 +30,45 @@
using namespace std;
-extern "C" {
- int extern_function(void *v_arg)
- {
- container* c = (container*) v_arg;
- dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
- user* p_user = (user*) c->elem[2];
- modl* p_modl = (modl*) p_wrap->MODL;
- conf* p_conf = (conf*) p_wrap->CONF;
- chat* p_chat = (chat*) p_wrap->CHAT;
- string* s_content = &(*((map_string*) c->elem[1]))["content"];
-
- vector<string>* p_vec_keys = p_modl->get_mod_vector();
-
- sort(p_vec_keys->begin(), p_vec_keys->end());
- vector<string>::iterator p_vec_keys_iter = p_vec_keys->begin();
-
- while( p_vec_keys_iter != p_vec_keys->end() ) {
-
- if ( p_vec_keys_iter->find( "mods/commands/", 0 ) != string::npos )
- {
-
- string s_command_name = p_vec_keys_iter->substr(17);
- s_command_name.erase( s_command_name.find( ".so" ) );
-
- if ( !p_chat->get_command_disabled( s_command_name ) &&
- p_chat->get_command_status( s_command_name ) >= p_user->get_status())
- {
- s_content->append( "<table bordercolor=\"1\">\n" );
- s_content->append( "<tr><td><font color=\"#FFFFFF\"><b>/" + s_command_name + "</b></font></td></tr>\n" );
- s_content->append( "<tr><td>" + p_conf->get_elem("chat.msgs.help." + s_command_name) + "</td></tr>\n" );
- s_content->append( "</table>\n<br>\n" );
- }
- }
- p_vec_keys_iter++;
- }
+extern "C"
+{
+ int extern_function(void *v_arg)
+ {
+ container* c = (container*) v_arg;
+ dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
+ user* p_user = (user*) c->elem[2];
+
+ modl* p_modl = (modl*) p_wrap->MODL;
+ conf* p_conf = (conf*) p_wrap->CONF;
+ chat* p_chat = (chat*) p_wrap->CHAT;
+ string* s_content = &(*((map<string,string>*) c->elem[1]))["content"];
+
+ vector<string>* p_vec_keys = p_modl->get_mod_vector();
+
+ sort(p_vec_keys->begin(), p_vec_keys->end());
+ vector<string>::iterator p_vec_keys_iter = p_vec_keys->begin();
- return 0;
- }
+ while( p_vec_keys_iter != p_vec_keys->end() )
+ {
+
+ if ( p_vec_keys_iter->find( "mods/commands/", 0 ) != string::npos )
+ {
+
+ string s_command_name = p_vec_keys_iter->substr(17);
+ s_command_name.erase( s_command_name.find( ".so" ) );
+
+ if ( !p_chat->get_command_disabled( s_command_name ) &&
+ p_chat->get_command_status( s_command_name ) >= p_user->get_status())
+ {
+ s_content->append( "<table bordercolor=\"1\">\n" );
+ s_content->append( "<tr><td><font color=\"#FFFFFF\"><b>/" + s_command_name + "</b></font></td></tr>\n" );
+ s_content->append( "<tr><td>" + p_conf->get_elem("chat.msgs.help." + s_command_name) + "</td></tr>\n" );
+ s_content->append( "</table>\n<br>\n" );
+ }
+ }
+ p_vec_keys_iter++;
+ }
+ return 0;
+ }
}
diff --git a/src/mods/html/yc_loggedin.cpp b/src/mods/html/yc_loggedin.cpp
index 2dcc9dc..6f7d020 100755..100644
--- a/src/mods/html/yc_loggedin.cpp
+++ b/src/mods/html/yc_loggedin.cpp
@@ -1,3 +1,27 @@
+/*:*
+ *: File: ./src/mods/html/yc_loggedin.cpp
+ *:
+ *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *:
+ *: Copyright (C) 2003 Paul C. Buetow, Volker Richter
+ *: Copyright (C) 2004 Paul C. Buetow
+ *: Copyright (C) 2005 EXA Digital Solutions GbR
+ *:
+ *: 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.
+ *:*/
+
#include "../../chat/chat.h"
/*
diff --git a/src/mods/html/yc_options.cpp b/src/mods/html/yc_options.cpp
index c209b93..71d5eef 100755..100644
--- a/src/mods/html/yc_options.cpp
+++ b/src/mods/html/yc_options.cpp
@@ -1,3 +1,27 @@
+/*:*
+ *: File: ./src/mods/html/yc_options.cpp
+ *:
+ *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *:
+ *: Copyright (C) 2003 Paul C. Buetow, Volker Richter
+ *: Copyright (C) 2004 Paul C. Buetow
+ *: Copyright (C) 2005 EXA Digital Solutions GbR
+ *:
+ *: 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.
+ *:*/
+
#include "../../incl.h"
/*
@@ -6,50 +30,51 @@
using namespace std;
-extern "C" {
- int extern_function(void *v_arg)
- {
- container* c = (container*) v_arg;
- dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
- conf* p_conf = (conf*) p_wrap->CONF;
- string* p_flag = &(*((map_string*) c->elem[1]))["flag"];
- string* p_email = &(*((map_string*) c->elem[1]))["email"];
- string* p_pass = &(*((map_string*) c->elem[1]))["pass"];
- string* p_newpass = &(*((map_string*) c->elem[1]))["newpass"];
- string* p_newpass2 = &(*((map_string*) c->elem[1]))["newpass2"];
- user* p_user = (user*) c->elem[2];
-
- if ( *p_flag == "submit" )
+extern "C"
+{
+ int extern_function(void *v_arg)
+ {
+ container* c = (container*) v_arg;
+ dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
+ conf* p_conf = (conf*) p_wrap->CONF;
+ string* p_flag = &(*((map<string,string>*) c->elem[1]))["flag"];
+ string* p_email = &(*((map<string,string>*) c->elem[1]))["email"];
+ string* p_pass = &(*((map<string,string>*) c->elem[1]))["pass"];
+ string* p_newpass = &(*((map<string,string>*) c->elem[1]))["newpass"];
+ string* p_newpass2 = &(*((map<string,string>*) c->elem[1]))["newpass2"];
+ user* p_user = (user*) c->elem[2];
+
+ if ( *p_flag == "submit" )
+ {
+ string* p_msgs = &(*((map<string,string>*) c->elem[1])
+ )["msgs"];
+
+ // If the password has to be changed:
+ if ( *p_pass != "" || *p_newpass != "" || *p_newpass2 != "" )
+ {
+ if ( p_user->get_pass() != *p_pass )
{
- string* p_msgs = &(*((map_string*) c->elem[1]))["msgs"];
-
- // If the password has to be changed:
- if ( *p_pass != "" || *p_newpass != "" || *p_newpass2 != "" )
- {
- if ( p_user->get_pass() != *p_pass )
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.changepassword" ) );
- return 0;
- }
-
- if ( *p_newpass != *p_newpass2 )
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.changepassword2" ) );
- return 0;
- }
- p_user->set_pass( *p_newpass );
- }
-
- p_user->set_email( *p_email );
- p_msgs->append( p_conf->get_elem( "chat.msgs.optionschanged" ) );
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.changepassword" ) );
+ return 0;
}
- else
+ if ( *p_newpass != *p_newpass2 )
{
- p_email->append( p_user->get_email() );
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.changepassword2" ) );
+ return 0;
}
+ p_user->set_pass( *p_newpass );
+ }
+
+ p_user->set_email( *p_email );
+ p_msgs->append( p_conf->get_elem( "chat.msgs.optionschanged" ) );
+ }
+ else
+ {
+ p_email->append( p_user->get_email() );
+ }
- return 0;
- }
+ return 0;
+ }
}
diff --git a/src/mods/html/yc_register.cpp b/src/mods/html/yc_register.cpp
index 016c932..e39deaf 100755..100644
--- a/src/mods/html/yc_register.cpp
+++ b/src/mods/html/yc_register.cpp
@@ -1,3 +1,27 @@
+/*:*
+ *: File: ./src/mods/html/yc_register.cpp
+ *:
+ *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE
+ *:
+ *: Copyright (C) 2003 Paul C. Buetow, Volker Richter
+ *: Copyright (C) 2004 Paul C. Buetow
+ *: Copyright (C) 2005 EXA Digital Solutions GbR
+ *:
+ *: 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.
+ *:*/
+
#include "../../incl.h"
/*
@@ -6,88 +30,91 @@
using namespace std;
-extern "C" {
- int extern_function(void *v_arg)
- {
+extern "C"
+{
+ int extern_function(void *v_arg)
+ {
#ifdef DATABASE
- container* c = (container*) v_arg;
- dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
- conf* p_conf = (conf*) p_wrap->CONF;
- data* p_data = (data*) p_wrap->DATA;
- string* p_msgs = &(*((map_string*) c->elem[1]))["INFO"];
- string* p_nick = &(*((map_string*) c->elem[1]))["nick"];
- string* p_email = &(*((map_string*) c->elem[1]))["email"];
- string* p_pass = &(*((map_string*) c->elem[1]))["pass"];
- string* p_pass2 = &(*((map_string*) c->elem[1]))["pass2"];
- string* p_request = &(*((map_string*) c->elem[1]))["request"];
- user* p_user = (user*) c->elem[2];
- string s_nick = *p_nick;
-
-
- p_user->set_name( "!" + s_nick );
- p_user->set_has_sess( false );
- *p_nick = tool::to_lower(*p_nick);
-
- if ( *p_pass != *p_pass2 )
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.registerpassword" ) );
- }
-
- // prove if the nick is alphanumeric:
- else if ( ! tool::is_alpha_numeric( *p_nick ) )
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.alpnum" ) );
- }
-
- // prove if the nick is too long:
- else if ( p_nick->length() > tool::string2int( p_conf->get_elem("chat.maxlength.username") ) )
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.nicklength" ) );
- }
-
- else if ( p_pass->length() > tool::string2int( p_conf->get_elem("chat.maxlength.password") ) )
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.passlength" ) );
- }
-
- else if ( p_email->length() > tool::string2int( p_conf->get_elem("chat.maxlength.emailaddress") ) )
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.emaillength" ) );
- }
-
- else
- {
- map_string result_map = p_data->select_user_data( *p_nick, "selectnick" );
- if (result_map["nick"] == *p_nick)
- {
- p_msgs->append( p_conf->get_elem( "chat.msgs.err.registerexists" ) );
- }
-
- else
- {
- p_user->set_name( s_nick );
- p_msgs->append( p_conf->get_elem( "chat.msgs.registernick" ) );
- p_request->replace( 0, p_request->length(), p_conf->get_elem("httpd.startsite") );
-
- map_string map_insert = *((map_string*) c->elem[1]);
- map_insert["password"] = *p_pass;
- map_insert["color1"] = p_conf->get_elem("chat.html.user.color1");
- map_insert["color2"] = p_conf->get_elem("chat.html.user.color2");
- map_insert["registerdate"] = tool::int2string((int)tool::unixtime());
-
- p_user->set_pass( map_insert["password"] );
- p_user->set_email( map_insert["email"] );
- p_user->set_col1( map_insert["color1"] );
- p_user->set_col2( map_insert["color2"] );
- p_user->set_is_reg( 1 );
- p_user->set_status( tool::string2int(p_conf->get_elem("chat.defaultrang") ) );
-
- p_data->insert_user_data( *p_nick, "registernick", map_insert );
- }
- }
-
- return 0;
+ container* c = (container*) v_arg;
+ dynamic_wrap* p_wrap = (dynamic_wrap*) c->elem[0];
+ conf* p_conf = (conf*) p_wrap->CONF;
+ data* p_data = (data*) p_wrap->DATA;
+ string* p_msgs = &(*((map<string,string>*) c->elem[1]))["INFO"];
+ string* p_nick = &(*((map<string,string>*) c->elem[1]))["nick"];
+ string* p_email = &(*((map<string,string>*) c->elem[1]))["email"];
+ string* p_pass = &(*((map<string,string>*) c->elem[1]))["pass"];
+ string* p_pass2 = &(*((map<string,string>*) c->elem[1]))["pass2"];
+ string* p_request = &(*((map<string,string>*) c->elem[1]))["request"];
+ user* p_user = (user*) c->elem[2];
+ string s_nick = *p_nick;
+
+
+ p_user->set_name( "!" + s_nick );
+ p_user->set_has_sess( false );
+ *p_nick = tool::to_lower(*p_nick);
+
+ if ( *p_pass != *p_pass2 )
+ {
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.registerpassword" ) )
+ ;
+ }
+
+ // prove if the nick is alphanumeric:
+ else if ( ! tool::is_alpha_numeric( *p_nick ) )
+ {
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.alpnum" ) )
+ ;
+ }
+
+ // prove if the nick is too long:
+ else if ( p_nick->length() > tool::string2int( p_conf->get_elem("chat.maxlength.username")
+ ) )
+ {
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.nicklength" ) );
+ }
+ else if ( p_pass->length() > tool::string2int( p_conf->get_elem("chat.maxlength.password")
+ ) )
+ {
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.passlength" ) );
+ }
+ else if ( p_email->length() > tool::string2int( p_conf->get_elem("chat.maxlength.emailaddress")
+ ) )
+ {
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.emaillength" ) );
+ }
+ else
+ {
+ hashmap<string> result_map = p_data->select_user_data( *p_nick, "selectnick" );
+ if (result_map["nick"] == *p_nick)
+ {
+ p_msgs->append( p_conf->get_elem( "chat.msgs.err.registerexists" ) );
+ }
+ else
+ {
+ p_user->set_name( s_nick );
+ p_msgs->append( p_conf->get_elem( "chat.msgs.registernick" ) );
+ p_request->replace( 0, p_request->length(), p_conf->get_elem("httpd.startsite") );
+
+ map<string,string> map_insert = *((map<string,string>*) c->elem[1]);
+ map_insert["password"] = *p_pass;
+ map_insert["color1"] = p_conf->get_elem("chat.html.user.color1");
+ map_insert["color2"] = p_conf->get_elem("chat.html.user.color2");
+ map_insert["registerdate"] = tool::int2string((int)tool::unixtime());
+
+ p_user->set_pass( map_insert["password"] );
+ p_user->set_email( map_insert["email"] );
+ p_user->set_col1( map_insert["color1"] );
+ p_user->set_col2( map_insert["color2"] );
+ p_user->set_is_reg( 1 );
+ p_user->set_status( tool::string2int(p_conf->get_elem("chat.defaultrang") ) );
+
+ p_data->insert_user_data( *p_nick, "registernick", map_insert );
+ }
+ }
+
+ return 0;
#endif
- }
+
+ }
}