Matthew Kettlewell | 20 Apr 01:34
Favicon
Gravatar

secure login code?

Has anyone put together a secure login form using cgicc?

I'm not really sure of the best way to start...

I've been looking at a lot of PHP login scripts (and WordPress logins), and I see roughly what I should be doing

but if someone has something to start with that they would be willing to share, that would be great...

Thanks

Matt

-- Matthew Kettlewell http://www.Kettlewell.net/ Free Job Hunting Guide http://www.kettlewell.net/how-to-find-a-job-in-2009-complete-manual/ Follow me: Twitter: http://www.twitter.com/kettlewell Linkedin: http://www.linkedin.com/in/kettlewell Skype: kettlewell-enterprises-inc
_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Frank Büttner | 22 Mar 19:44

cgicc and Qt

Hallo,
I try to use cgicc with the Qt Framework.
But my problem is, to connect it with the QTextStream class of qt.
Have anybody try it`on an idea how to do it?

Attachment (smime.p7s): application/x-pkcs7-signature, 5024 bytes
_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
xamiw | 23 Jan 16:15
Favicon

HTTP-ACCEPT-LANGUAGE and cgicc

Can somebody tell me how to get the environment variable HTTP_ACCEPT_LANGUAGE with cgicc?

Thanks in advance

Goran
Vedro | 9 Jan 09:25

how access to HTML controls atributes ?

Hi,
 
I am new to cgicc library and I have a following problem.
I defined <select> HTML control like this:
 
cgicc::select sel1 = cgicc::select();

sel1.set("name","someName").set("class","selectfield").set("SIZE","1");sel1.add(br());

sel1.add(option(

"0/1").set("class","selectfield").set("value","1"));sel1.add(br());

sel1.add(option(

"0/2").set("class","selectfield").set("value","2"));sel1.add(br());

sel1.add(option(

"0/3").set("class","selectfield").set("value","3"));sel1.add(br());

sel1.add(option(

"0/4").set("class","selectfield").set("value","4"));sel1.add(br());
 
I would like to access to every embedded object (each option) inside sel1 object going through some loop, check value of
each option object and set "selected" atribute if needed.
 
I see that  HTMLElement object has HTMLElementList data which contains embedded object but it is private and it's possible to add new object into this list only.
There is no interface which provide accessing  i.e. reading and seting different atribute inside particular object ( in this case in "options" object inside "select" object) and I do not understand why it's like that.
 
Are there any other ways to access (and changes) atributes inside defined objects ?
 
Thanks in advance
 
V.
 
_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Artyom Beilis | 6 Jan 12:05
Favicon

Interface to Remove Cookies


CgiCC HTTPCookies supports MaxAge that may be 0 (browser) or positive
according to RFC,

Other very important options Expires is not supported. This option is mostly
useless because requires
definition of absolute time. However one special case exists: Cookies
Removal.

In many cases it is very useful to remove cookies by setting Expiration date
in past.

I've written a little patch to fix this problem, please consider to merge it
into upstream

Artyom

--- cgicc-3.2.7/cgicc/HTTPCookie.cpp	2008-07-06 18:27:18.000000000 +0300
+++ cgicc-3.2.7-patched/cgicc/HTTPCookie.cpp	2009-01-05 14:12:07.972561100
+0200
@@ -33,7 +33,8 @@
 // ============================================================
 cgicc::HTTPCookie::HTTPCookie()
   : fMaxAge(0),
-    fSecure(false)
+    fSecure(false),
+    fRemoved(false)
 {}

 cgicc::HTTPCookie::HTTPCookie(const std::string& name, 
@@ -41,7 +42,20 @@
   : fName(name),
     fValue(value),
     fMaxAge(0),
-    fSecure(false)
+    fSecure(false),
+    fRemoved(false)
+{}
+
+cgicc::HTTPCookie::HTTPCookie(const std::string& name, 
+			      const std::string& domain, 
+			      const std::string& path,
+			      bool secure)
+  : fName(name),
+    fDomain(domain), 
+    fMaxAge(0),
+    fPath(path), 
+    fSecure(secure),
+    fRemoved(false)
 {}

 cgicc::HTTPCookie::HTTPCookie(const std::string& name, 
@@ -57,7 +71,8 @@
     fDomain(domain), 
     fMaxAge(maxAge),
     fPath(path), 
-    fSecure(secure)
+    fSecure(secure),
+    fRemoved(false)
 {}

 cgicc::HTTPCookie::HTTPCookie(const HTTPCookie& cookie)
@@ -94,8 +109,10 @@
     out << "; Comment=" << fComment;
   if(false == fDomain.empty())
     out << "; Domain=" << fDomain;
-  if(0 != fMaxAge)
-    out << "; Max-Age=" << fMaxAge;
+  if(fRemoved)
+    out << "; Expires=Fri, 01-Jan-1971 01:00:00 GMT;";
+  else if(0 != fMaxAge)
+      out << "; Max-Age=" << fMaxAge;
   if(false == fPath.empty())
     out << "; Path=" << fPath;
   if(true == fSecure)
--- cgicc-3.2.7/cgicc/HTTPCookie.h	2008-07-06 18:27:18.000000000 +0300
+++ cgicc-3.2.7-patched/cgicc/HTTPCookie.h	2009-01-05 14:08:30.729184100
+0200
@@ -104,6 +104,22 @@
 	       bool secure);

     /*!
+     * \brief Create a new partially-spefified HTTPCookie for deletion 
+     *
+     * 
+     * \param name The name of the cookie.
+     * \param domain The domain for which this cookie is valid- an empty
string
+     * will use the hostname of the server which generated the cookie
response.
+     * If specified, the domain <em>must</em> start with a period('.'). 
+     * \param path The subset of URLS in a domain for which the cookie is 
+     * valid, for example \c /
+     * @param secure Specifies whether this is a secure cookie.
+     */
+    HTTPCookie(const std::string& name, 
+	       const std::string& domain, 
+	       const std::string& path,
+	       bool secure);
+    /*!
      * \brief Copy constructor
      *
      * Set the name, value, comment, domain, age and path of this cookie
@@ -303,6 +319,16 @@
     setSecure(bool secure)
     { fSecure = secure; }
     //@}    
+
+    /*!
+     * \brief Mark this cookie as secure or unsecure.
+     *
+     * \param secure Whether this is a secure cookie.
+     */
+    inline void 
+    remove()
+    { fRemoved = true; }
+    //@}    

     // ============================================================

@@ -320,6 +346,7 @@
     unsigned long 	fMaxAge;
     std::string 	fPath;
     bool 		fSecure;
+    bool		fRemoved;
   };

 } // namespace cgicc

--

-- 
View this message in context: http://www.nabble.com/Interface-to-Remove-Cookies-tp21308545p21308545.html
Sent from the cgicc - General mailing list archive at Nabble.com.
Artyom Beilis | 6 Jan 11:52
Favicon

Sending Redirect and Status Headers


Hello,

There is two headers: HTTPRedirectHeader and HTTPStatusHeader. On of the
problems
with them is a fact that sometimes you should send them both

---------------------
Status: 302 Found
Location: /some/new/place

-------------------

Otherwise apache and nginx  would not redirect (only lighttpd works for me
without status header).
The problem is that each one of these headers adds "\n\n" at the and and you
can send them as is
So I should add Status header manually 

cout<<"Status: 302 Found"<<endl;
cout<<HTTPRedirectHeader("/some/new/place");

Is there way to send both headers together?

I don't see this option in the code, all render() virtual functions send
final "\n\n".

Thanks,
Artyom
--

-- 
View this message in context: http://www.nabble.com/Sending-Redirect-and-Status-Headers-tp21308353p21308353.html
Sent from the cgicc - General mailing list archive at Nabble.com.
Angus | 24 Nov 18:36
Favicon

getElements().begin causes seg fault


I have this problem where as soon as I call begin() on the array returned by
getElements() I register a segmentation fault. Here's my code:
int main(int argc, const char *argv[]) {
	int nReturn = EXIT_FAILURE;
	try {
		{
			Cgicc cgi;
			for(const_form_iterator iter = cgi.getElements().begin(); iter !=
cgi.getElements().end(); ++iter) {

and that's all there is to it. Valgrind registers a bunch of "conditional
jump or move depends on uninitialized values"s and then finally an "invalid
read". I've got what appears to be the latest cgicc (3.2.7). What am I doing
wrong?
--

-- 
View this message in context: http://www.nabble.com/getElements%28%29.begin-causes-seg-fault-tp20665728p20665728.html
Sent from the cgicc - General mailing list archive at Nabble.com.
Jay Sprenkle | 14 Nov 23:38

compile errors in release

In the latest release in

HTTPXHTMLHeader.cpp, line 25, the following include:

#include "HTTPXHTMLHeader.h"

Should be:

#include "cgicc/HTTPXHTMLHeader.h"

Since all the other include files, including that one, are in the cgicc sub directory.


_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Douglas Diniz | 7 Oct 22:05

Ajax with Cgi. Please help

Hi.....  (Sorry for my english)

I'm working in a project (a WiFi terminal) where I want to create a page where the people can set all the wifi parameters by the web page. The page will have several buttons and textbox/combobox, where the user can set the parameters individually and on-the-fly. To accomplish that I will use Ajax to send the requests to server.
On the server I must have a C/C++ program that will receive this ajax commands and send then to Wifi main program (where the commands will be set or get) (This communication use Linux Named Pipe).

The problem is: How I send this individual commands and values to the server program, and how the server program will handle this information to see what command was sent? Using Cgi, how can I know the button that was pressed and how is the better way to send/receive this values?

Could you help me?

Thanks......
_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc
Jay Sprenkle | 3 Sep 03:18
Favicon

debugging fcgx, or how I learned to love sockets...

Evening all,

Is anyone really familiar with the fcgx/cgicc library or sockets 
programming (windows vs. *nix )?
I'm trying to make this library work with apache or lighttp and having a 
lot of trouble.
I'm not familiar enough with sockets programming to know if the code 
won't work or I'm using it wrong.
I have a lot of questions so I won't enumerate them all unless someone 
has time to help.

Thanks for your time!

Jay
Jean-Christophe Roux | 24 Aug 21:35
Favicon

3-2-7 compilation error

Hello,

The OS is Centos 5.0 and the compiler is:
g++ (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)

I downloaded a few minutes ago cgicc from:
http://ftp.gnu.org/gnu/cgicc/cgicc-3.2.7.tar.gz

I typed:
./configure
but  make return an error

Thanks for any clue of what I should do to make it work


I am pasting the end of the feedback and at the bottom of the email, i added the output of ./configure

 g++ -DHAVE_CONFIG_H -I. -I. -I. -I.. -I.. -x c++ -Wall -W -pedantic -g -O2 -MT libcgicc_la-XMLPI.lo -MD -MP -MF .deps/libcgicc_la-XMLPI.Tpo -c XMLPI.cpp -o libcgicc_la-XMLPI. o >/dev/null 2>&1
/bin/sh ../libtool --tag=CXX --mode=link g++  -Wall -W -pedantic -g -O2   -o libcgicc.la -rpath /usr/lib -lstdc++  -version-info 5:2:0    libcgicc_la-CgiEnvironment.lo libcgicc_la-CgiInput.lo libcgicc_la-CgiUtils.lo libcgicc_la-Cgicc.lo libcgicc_la-FormEntry.lo libcgicc_la-FormFile.lo libcgicc_la-HTMLAttribute.lo libcgicc_la-HTMLAttributeList.lo libcgicc_la-HTMLDoctype.lo libcgicc_la-HTMLElement.lo libcgicc_la-HTMLElementList.lo libcgicc_la-HTTPContentHeader.lo libcgicc_la-HTTPCookie.lo libcgicc_la-HTTPHTMLHeader.lo libcgicc_la-HTTPHeader.lo libcgicc_la-HTTPPlainHeader.lo libcgicc_la-HTTPRedirectHeader.lo libcgicc_la-HTTPResponseHeader.lo libcgicc_la-HTTPStatusHeader.lo libcgicc_la-MStreamable.lo libcgicc_la-HTTPXHTMLHeader.lo libcgicc_la-XHTMLDoctype.lo libcgicc_la-XMLPI.lo 
g++ -shared -nostdlib /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-lin ux/4.1.2/crtbeginS.o  .libs/libcgicc_la-CgiEnvironment.o .libs/libcgicc_la-CgiInput.o .libs/libcgicc_la-CgiUtils.o .libs/libcgicc_la-Cgicc.o .libs/libcgicc_la-FormEntry.o .libs/libcgicc_la-FormFile.o .libs/libcgicc_la-HTMLAttribute.o .libs/libcgicc_la-HTMLAttributeList.o .libs/libcgicc_la-HTMLDoctype.o .libs/libcgicc_la-HTMLElement.o .libs/libcgicc_la-HTMLElementList.o .libs/libcgicc_la-HTTPContentHeader.o .libs/libcgicc_la-HTTPCookie.o .libs/libcgicc_la-HTTPHTMLHeader.o .libs/libcgicc_la-HTTPHeader.o .libs/libcgicc_la-HTTPPlainHeader.o .libs/libcgicc_la-HTTPRedirectHeader.o .libs/libcgicc_la-HTTPResponseHeader.o .libs/libcgicc_la-HTTPStatusHeader.o .libs/libcgicc_la-MStreamable.o .libs/libcgicc_la-HTTPXHTMLHeader.o .libs/libcgicc_la-XHTMLDoctype.o .libs/libcgicc_la-XMLPI.o  -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i386-redhat-linux/4.1.2/ crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o  -Wl,-soname -Wl,libcgicc.so.5 -o .libs/libcgicc.so.5.0.2
(cd .libs && rm -f libcgicc.so.5 && ln -s libcgicc.so.5.0.2 libcgicc.so.5)
(cd .libs && rm -f libcgicc.so && ln -s libcgicc.so.5.0.2 libcgicc.so)
ar cru .libs/libcgicc.a  libcgicc_la-CgiEnvironment.o libcgicc_la-CgiInput.o libcgicc_la-CgiUtils.o libcgicc_la-Cgicc.o libcgicc_la-FormEntry.o libcgicc_la-FormFile.o libcgicc_la-HTMLAttribute.o libcgicc_la-HTMLAttributeList.o libcgicc_la-HTMLDoctype.o libcgicc_la-HTMLElement.o libcgicc_la-HTMLElementList.o libcgicc_la-HTTPContentHeader.o libcgicc_la-HTTPCookie.o libcgicc_la-HTTPHTMLHeader.o libcgicc_la-HTTPHeader.o libcgicc_la-HTTPPlainHeader.o libcgicc_la-HTTPRedirectHeader.o libcgicc_la-HTTPResponseHeader.o libcgicc_la-HTTPStatusHeader.o libcgicc_la-MStreamable.o libcgicc_la-HTTPXHTMLHeader.o libcgicc_la-XHTMLDoctype.o libcgic c_la-XMLPI.o
ranlib .libs/libcgicc.a
creating libcgicc.la
(cd .libs && rm -f libcgicc.la && ln -s ../libcgicc.la libcgicc.la)
make[2]: Leaving directory `/websites/libraries/cgicc/cgicc-3.2.7/cgicc'
make[1]: Leaving directory `/websites/libraries/cgicc/cgicc-3.2.7/cgicc'
Making all in doc
make[1]: Entering directory `/websites/libraries/cgicc/cgicc-3.2.7/doc'
make html-doc
make[2]: Entering directory `/websites/libraries/cgicc/cgicc-3.2.7/doc'
if test ! -d html; then \
        mkdir html; \
    fi;
DATE=`date '+%-d %b %Y'` VERSION=3.2.7 /bin/echo Doxyfile
Doxyfile
cp cgicc.png gnu-head-sm.jpg cgicc-doc.css html
mv html/index.html html/index.html.bak
mv: cannot stat `html/index.html': No such file or directory
make[2]: *** [html-doc] Error 1
make[2]: Leaving directory `/websites/libraries/cgicc/cgicc-3.2.7/doc'
make[1]: *** [stamp ] Error 2
make[1]: Leaving directory `/websites/libraries/cgicc/cgicc-3.2.7/doc'
make: *** [all-recursive] Error 1



./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... i686-pc-linux-gnu
checking host system type... i686 -pc-linux-gnu
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
check ing for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping librarie s is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for doxygen... /bin/echo
checking for gethos tbyaddr in -lnsl... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking whether the C++ compiler (g++) is aCC... no
checking whether the compiler implements namespaces... yes
checking whether the compiler supports Standard Template Library... yes
checking maximum C++ compiler warning level... -Wall -W -pedantic
checking for gettimeofday... yes
checking for uname... yes
checking whether to build the cgicc demos... yes
checking whether to build the cgicc fcgi demos... no
configure: creating ./config.status
config.status: creating demo/Makefile
config.status: creating contrib/Makefile
config.status: creating Makefile
config.status: creating cgicc/Makefile
config.status: creating cgicc/CgiDefs.h
config.status: creat ing support/Makefile
config.status: creating support/cgicc-config
config.status: creating doc/Makefile
config.status: creating doc/Doxyfile
config.status: creating cgicc/config.h
config.status: executing depfiles commands


_______________________________________________
help-cgicc mailing list
help-cgicc <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-cgicc

Gmane