00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef OPEN_LOGIN_H
00012 #define OPEN_LOGIN_H
00013
00014 #include "openDB.hpp"
00015 #include "connectstring"
00016 #include "read_base.hpp"
00017 #include <map>
00018 #include <vector>
00019 #include "Session.hpp"
00020
00021 class openService
00022 {
00023 public:
00024
00025
00026 string id,cat_name,sequence,tree_depth,menu_name,
00027 uri,xml_params,xml_param1,xml_param2;
00028 bool local_uri, secure;
00029
00030 openService();
00031 virtual ~openService();
00032 openService(const openService&in);
00033 openService & operator = ( const openService & in );
00034 };
00035
00036 typedef map < string, openService > serviceMap;
00037 typedef vector < string > serviceVector;
00038
00039 class openLogin
00040 {
00041 protected:
00042
00043 string id,group_id,first,last,login,password,phone_number,email;
00044 bool site_admin;
00045 string sql;
00046 string lastError;
00047 serviceMap services;
00048 serviceVector serviceNames;
00049 string fieldTemp;
00050 quickQuery qqry;
00051 openRS & rs;
00052 Session_Obj session;
00053
00054 void setCookieValue( cgiCookie & cookie, string name, string & value );
00055 void setVars(void);
00056
00057 public:
00058 string token;
00059 openLogin();
00060 virtual ~openLogin();
00061
00062 virtual bool checkUser( const char * user, const char * password );
00063 virtual bool testLoginStatus( void );
00064
00065
00066 bool getUser(string & rId);
00067 bool fetchServices( string criteria = "" );
00068
00069
00070 serviceMap & Services( void );
00071 serviceVector & ServiceNames( void );
00072 string & Id( void );
00073 string myStaff( void );
00074 string & Last( void );
00075 string & First( void );
00076 string & Email ( void );
00077 string & PhoneNumber ( void );
00078 string & Login ( void );
00079 string & Password ( void );
00080 string & getSql( void );
00081 string & getLastError( void );
00082 string FullName( void );
00083 string & GroupId( void );
00084 bool SiteAdmin( void );
00085 Session_Obj & Session( void );
00086
00087 };
00088
00089 #ifdef ALTSLOGINSOURCE
00090
00091 #include ALTSLOGINSOURCE
00092 #else
00093
00094 #include "openLogin.cpp"
00095 #endif
00096
00097 #endif