|
|
|
@@ -53,18 +53,18 @@ class rpdb_t : public sqlite3_t { |
53 | class example_rp_t : public opkele::prequeue_RP { |
53 | class example_rp_t : public opkele::prequeue_RP { |
54 | public: |
54 | public: |
55 | mutable rpdb_t db; |
55 | mutable rpdb_t db; |
56 | kingate::cookie htc; |
56 | kingate::cookie htc; |
57 | long as_id; |
57 | long as_id; |
58 | int ordinal; |
58 | int ordinal; |
59 | kingate::cgi_gateway& gw; |
59 | kingate::cgi_gateway& gw; |
60 | |
60 | |
61 | example_rp_t(kingate::cgi_gateway& gw) |
61 | example_rp_t(kingate::cgi_gateway& g) |
62 | : ordinal(0), have_eqtop(false), gw(gw), as_id(-1) { |
62 | : as_id(-1), ordinal(0), gw(g), have_eqtop(false) { |
63 | try { |
63 | try { |
64 | htc = gw.cookies.get_cookie("ht_session"); |
64 | htc = gw.cookies.get_cookie("ht_session"); |
65 | as_id = opkele::util::string_to_long(gw.get_param("asid")); |
65 | as_id = opkele::util::string_to_long(gw.get_param("asid")); |
66 | }catch(kingate::exception_notfound& kenf) { |
66 | }catch(kingate::exception_notfound& kenf) { |
67 | uuid_t uuid; uuid_generate(uuid); |
67 | uuid_t uuid; uuid_generate(uuid); |
68 | htc = kingate::cookie("ht_session",util::encode_base64(uuid,sizeof(uuid))); |
68 | htc = kingate::cookie("ht_session",util::encode_base64(uuid,sizeof(uuid))); |
69 | sqlite3_mem_t<char*> S = sqlite3_mprintf( |
69 | sqlite3_mem_t<char*> S = sqlite3_mprintf( |
70 | "INSERT INTO ht_sessions (hts_id) VALUES (%Q)", |
70 | "INSERT INTO ht_sessions (hts_id) VALUES (%Q)", |
@@ -346,17 +346,17 @@ class example_rp_t : public opkele::prequeue_RP { |
346 | |
346 | |
347 | #ifdef DUMB_RP |
347 | #ifdef DUMB_RP |
348 | virtual assoc_t associate(const string& OP) { |
348 | virtual assoc_t associate(const string& OP) { |
349 | DUMBTHROW; |
349 | DUMBTHROW; |
350 | } |
350 | } |
351 | #endif |
351 | #endif |
352 | }; |
352 | }; |
353 | |
353 | |
354 | int main(int argc,char *argv[]) { |
354 | int main(int,char **) { |
355 | try { |
355 | try { |
356 | kingate::plaincgi_interface ci; |
356 | kingate::plaincgi_interface ci; |
357 | kingate::cgi_gateway gw(ci); |
357 | kingate::cgi_gateway gw(ci); |
358 | string op; |
358 | string op; |
359 | try { op = gw.get_param("op"); }catch(kingate::exception_notfound&) { } |
359 | try { op = gw.get_param("op"); }catch(kingate::exception_notfound&) { } |
360 | if(op=="initiate") { |
360 | if(op=="initiate") { |
361 | example_rp_t rp(gw); |
361 | example_rp_t rp(gw); |
362 | string usi = gw.get_param("openid_identity"); |
362 | string usi = gw.get_param("openid_identity"); |
|