Ejemplo n.º 1
0
void 
InitModule_NOTES
(void)
{
	RegisterCTX(CTX_VNOTE);

	RegisterReadLoopHandlerset(
		VIEW_NOTES,
		notes_GetParamsGetServerCall,
		NULL,
		NULL,
		NULL,
		notes_LoadMsgFromServer,
		NULL,
		notes_Cleanup,
		NULL);

	WebcitAddUrlHandler(HKEY("add_new_note"), "", 0, add_new_note, 0);
	WebcitAddUrlHandler(HKEY("ajax_update_note"), "", 0, ajax_update_note, 0);

	RegisterNamespace("VNOTE:POS:LEFT", 0, 0, tmpl_vcard_put_posleft, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:POS:TOP", 0, 0, tmpl_vcard_put_postop, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:POS:WIDTH", 0, 0, tmpl_vcard_put_poswidth, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:POS:HEIGHT", 0, 0, tmpl_vcard_put_posheight, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:POS:HEIGHT2", 0, 0, tmpl_vcard_put_posheight2, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:POS:WIDTH2", 0, 0, tmpl_vcard_put_width2, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:COLOR", 0, 0, tmpl_vcard_put_color, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:BGCOLOR", 0, 0,tmpl_vcard_put_bgcolor, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:MSG", 0, 1, tmpl_vcard_put_message, NULL, CTX_VNOTE);
	RegisterNamespace("VNOTE:UID", 0, 0, tmpl_vcard_put_uid, NULL, CTX_VNOTE);

	RegisterMimeRenderer(HKEY("text/vnote"), render_MIME_VNote, 1, 300);
}
Ejemplo n.º 2
0
void 
InitModule_WIKI
(void)
{
	RegisterReadLoopHandlerset(
		VIEW_WIKI,
		wiki_GetParamsGetServerCall,
		wiki_PrintHeaderPage,
		NULL,
		NULL,
		NULL,
		NULL,
		wiki_Cleanup
	);

	RegisterReadLoopHandlerset(
		VIEW_WIKIMD,
		wiki_GetParamsGetServerCall,
		wiki_PrintHeaderPage,
		NULL,
		NULL,
		NULL,
		NULL,
		wiki_Cleanup
	);

	WebcitAddUrlHandler(HKEY("wiki"), "", 0, display_wiki_page, 0);
	WebcitAddUrlHandler(HKEY("wiki_history"), "", 0, display_wiki_history, 0);
	WebcitAddUrlHandler(HKEY("wiki_pagelist"), "", 0, display_wiki_pagelist, 0);
	RegisterNamespace("WIKI:DISPLAYHISTORY", 0, 0, tmplput_display_wiki_history, NULL, CTX_NONE);
	RegisterNamespace("WIKI:DISPLAYPAGELIST", 0, 0, tmplput_display_wiki_pagelist, NULL, CTX_NONE);
	RegisterConditional("COND:WIKI:PAGE", 1, ConditionalHaveWikiPage, CTX_NONE);
	RegisterConditional("COND:WIKI:TYPE", 1, ConditionalHavewikiType, CTX_NONE);
}
Ejemplo n.º 3
0
void 
InitModule_PUSHMAIL
(void)
{
	WebcitAddUrlHandler(HKEY("display_pushemail"), "", 0, display_pushemail, 0);
	WebcitAddUrlHandler(HKEY("save_pushemail"), "", 0, save_pushemail, 0);
}
Ejemplo n.º 4
0
void 
InitModule_WEBCIT
(void)
{
	char dir[SIZ];
	WebcitAddUrlHandler(HKEY("blank"), "", 0, blank_page, ANONYMOUS|COOKIEUNNEEDED|ISSTATIC);
	WebcitAddUrlHandler(HKEY("landing"), "", 0, display_default_landing_page, ANONYMOUS|COOKIEUNNEEDED);
	WebcitAddUrlHandler(HKEY("do_template"), "", 0, url_do_template, ANONYMOUS);
	WebcitAddUrlHandler(HKEY("sslg"), "", 0, seconds_since_last_gexp, AJAX|LOGCHATTY);
	WebcitAddUrlHandler(HKEY("ajax_servcmd"), "", 0, ajax_servcmd, 0);
	WebcitAddUrlHandler(HKEY("webcit"), "", 0, blank_page, URLNAMESPACE);
	WebcitAddUrlHandler(HKEY("push"), "", 0, push_destination, AJAX);
	WebcitAddUrlHandler(HKEY("pop"), "", 0, pop_destination, 0);

	WebcitAddUrlHandler(HKEY("401"), "", 0, authorization_required, ANONYMOUS|COOKIEUNNEEDED);
	RegisterConditional("COND:IMPMSG", 0, ConditionalImportantMesage, CTX_NONE);
	RegisterConditional("COND:REST:DEPTH", 0, Conditional_REST_DEPTH, CTX_NONE);
	RegisterConditional("COND:IS_HTTPS", 0, Conditional_IS_HTTPS, CTX_NONE);

	RegisterNamespace("CSSLOCAL", 0, 0, tmplput_csslocal, NULL, CTX_NONE);
	RegisterNamespace("IMPORTANTMESSAGE", 0, 0, tmplput_importantmessage, NULL, CTX_NONE);
	RegisterNamespace("TRAILING_JAVASCRIPT", 0, 0, tmplput_trailing_javascript, NULL, CTX_NONE);
	RegisterNamespace("URL:DISPLAYNAME", 0, 1, tmplput_HANDLER_DISPLAYNAME, NULL, CTX_NONE);
	RegisterNamespace("PACKAGESTRING", 0, 1, tmplput_packagestring, NULL, CTX_NONE);

	
	snprintf(dir, SIZ, "%s/webcit.css", static_local_dir);
	if (!access(dir, R_OK)) {
		syslog(LOG_INFO, "Using local Stylesheet [%s]", dir);
		csslocal = NewStrBufPlain(HKEY("<link href=\"static.local/webcit.css\" rel=\"stylesheet\" type=\"text/css\" />"));
	}
	else
		syslog(LOG_INFO, "No Site-local Stylesheet [%s] installed.", dir);

}
Ejemplo n.º 5
0
void headers_brief_filter(long msgnum, void *userdata)
{
	long i, l;
	struct CtdlMessage *msg;
	msg_filter *flt = (msg_filter*) userdata;

	l = GetCount(flt->Filter);
	msg = CtdlFetchMessage(msgnum, 0, 1);
	StrBufPrintf(flt->buffer, "%ld", msgnum);
	if (msg == NULL) {
		for (i = 0; i < l; i++) {
			StrBufAppendBufPlain(flt->buffer, HKEY("|"), 0);
		}
	}
	else {
		const char *k;
		long len;
		void *v;
		RewindHashPos(flt->Filter, flt->p, 0);
		while (GetNextHashPos(flt->Filter, flt->p, &len, &k, &v)) {
			eMsgField f = (eMsgField) v;
			
			StrBufAppendBufPlain(flt->buffer, HKEY("|"), 0);
			if (!CM_IsEmpty(msg, f)) {
				StrBufAppendBufPlain(flt->buffer, CM_KEY(msg, f), 0);
			}
		}
	}
	StrBufAppendBufPlain(flt->buffer, HKEY("\n"), 0);
	cputbuf(flt->buffer);
}
Ejemplo n.º 6
0
void 
InitModule_OPENID
(void)
{
	WebcitAddUrlHandler(HKEY("display_openids"), "", 0, display_openids, 0);
	WebcitAddUrlHandler(HKEY("openid_attach"), "", 0, openid_attach, 0);
	WebcitAddUrlHandler(HKEY("openid_detach"), "", 0, openid_detach, 0);
}
Ejemplo n.º 7
0
void 
InitModule_ROOMCHAT
(void)
{
	WebcitAddUrlHandler(HKEY("chat"), "", 0, do_chat, 0);
	WebcitAddUrlHandler(HKEY("chat_recv"), "", 0, chat_recv, AJAX);
	WebcitAddUrlHandler(HKEY("chat_rwho"), "", 0, chat_rwho, AJAX);
	WebcitAddUrlHandler(HKEY("chat_exit"), "", 0, chat_exit, AJAX);
	WebcitAddUrlHandler(HKEY("chat_send"), "", 0, chat_send, 0);
}
Ejemplo n.º 8
0
int main(int argc, char* argv[])
{
	StrBuf *WFBuf;
	StrBuf *OutBuf;
	StrBuf *Info;
	int nWildfireHeaders = 0;

	StartLibCitadel(8);
	printf("%s == %d?\n", libcitadel_version_string(), libcitadel_version_number());
       
	
	WildFireInitBacktrace(argv[0], 0);

	WFBuf = NewStrBuf();
	OutBuf = NewStrBuf();
	Info = NewStrBufPlain(HKEY("this is just a test message"));
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	SerializeJson(WFBuf, WildFireException(HKEY(__FILE__), __LINE__, Info, 1), 1);
	
	WildFireSerializePayload(WFBuf, OutBuf, &nWildfireHeaders, NULL);

	CreateWildfireSampleMessage(OutBuf);
	printf("%s\n\n", ChrPtr(OutBuf));

	FreeStrBuf(&WFBuf);
	FreeStrBuf(&OutBuf);
	FreeStrBuf(&Info);
	ShutDownLibCitadel();
	return 0;
}
Ejemplo n.º 9
0
	static void read_setting( const std::wstring & subkey, const std::wstring & key, int & val ) {
		HKEY regkey = HKEY();
		if ( RegOpenKeyEx( HKEY_CURRENT_USER, ( L"Software\\libopenmpt\\" + subkey ).c_str(), 0, KEY_READ, &regkey ) == ERROR_SUCCESS ) {
			DWORD v = val;
			DWORD type = REG_DWORD;
			DWORD typesize = sizeof(v);
			if ( RegQueryValueEx( regkey, key.c_str(), NULL, &type, (BYTE *)&v, &typesize ) == ERROR_SUCCESS )
			{
				val = v;
			}
			RegCloseKey( regkey );
			regkey = HKEY();
		}
	}
Ejemplo n.º 10
0
	static void write_setting( const std::wstring & subkey, const std::wstring & key, int val ) {
		HKEY regkey = HKEY();
		if ( RegCreateKeyEx( HKEY_CURRENT_USER, ( L"Software\\libopenmpt\\" + subkey ).c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &regkey, NULL ) == ERROR_SUCCESS ) {
			DWORD v = val;
			DWORD type = REG_DWORD;
			DWORD typesize = sizeof(v);
			if ( RegSetValueEx( regkey, key.c_str(), NULL, type, (const BYTE *)&v, typesize ) == ERROR_SUCCESS )
			{
				// ok
			}
			RegCloseKey( regkey );
			regkey = HKEY();
		}
	}
Ejemplo n.º 11
0
void 
InitModule_GRAPHICS
(void)
{
	WebcitAddUrlHandler(HKEY("display_editpic"), "", 0, display_editpic, 0);
	WebcitAddUrlHandler(HKEY("editpic"), "", 0, editpic, 0);
	WebcitAddUrlHandler(HKEY("display_editroompic"), "", 0, display_editroompic, 0);
	WebcitAddUrlHandler(HKEY("editroompic"), "", 0, editroompic, 0);
	WebcitAddUrlHandler(HKEY("display_edithello"), "", 0, display_edithello, 0);
	WebcitAddUrlHandler(HKEY("edithellopic"), "", 0, edithellopic, 0);
	WebcitAddUrlHandler(HKEY("display_editgoodbuye"), "", 0, display_editgoodbyepic, 0);
	WebcitAddUrlHandler(HKEY("editgoodbuyepic"), "", 0, editgoodbuyepic, 0);
	WebcitAddUrlHandler(HKEY("display_editfloorpic"), "", 0, display_editfloorpic, 0);
	WebcitAddUrlHandler(HKEY("editfloorpic"), "", 0, editfloorpic, 0);
}
Ejemplo n.º 12
0
void
ServerStartModule_CONTEXT
(void)
{
	long *v;
	HttpReqTypes = NewHash(1, NULL);
	HttpHeaderHandler = NewHash(1, NULL);

	v = malloc(sizeof(long));
	*v = eGET;
	Put(HttpReqTypes, HKEY("GET"), v, NULL);

	v = malloc(sizeof(long));
	*v = ePOST;
	Put(HttpReqTypes, HKEY("POST"), v, NULL);

	v = malloc(sizeof(long));
	*v = eOPTIONS;
	Put(HttpReqTypes, HKEY("OPTIONS"), v, NULL);

	v = malloc(sizeof(long));
	*v = ePROPFIND;
	Put(HttpReqTypes, HKEY("PROPFIND"), v, NULL);

	v = malloc(sizeof(long));
	*v = ePUT;
	Put(HttpReqTypes, HKEY("PUT"), v, NULL);

	v = malloc(sizeof(long));
	*v = eDELETE;
	Put(HttpReqTypes, HKEY("DELETE"), v, NULL);

	v = malloc(sizeof(long));
	*v = eHEAD;
	Put(HttpReqTypes, HKEY("HEAD"), v, NULL);

	v = malloc(sizeof(long));
	*v = eMOVE;
	Put(HttpReqTypes, HKEY("MOVE"), v, NULL);

	v = malloc(sizeof(long));
	*v = eCOPY;
	Put(HttpReqTypes, HKEY("COPY"), v, NULL);

	v = malloc(sizeof(long));
	*v = eREPORT;
	Put(HttpReqTypes, HKEY("REPORT"), v, NULL);
}
Ejemplo n.º 13
0
/*TODO: wrong hook */
int notes_LoadMsgFromServer(SharedMessageStatus *Stat, 
			    void **ViewSpecific, 
			    message_summary* Msg, 
			    int is_new, 
			    int i)
{
	struct vnote *v;
	WCTemplputParams TP;

	memset(&TP, 0, sizeof(WCTemplputParams));
	TP.Filter.ContextType = CTX_VNOTE;
	v = vnote_new_from_msg(Msg->msgnum, is_new);
	if (v) {
		TP.Context = v;
		DoTemplate(HKEY("vnoteitem"),
			   WC->WBuf, &TP);
			

		/* uncomment these lines to see ugly debugging info 
		StrBufAppendPrintf(WC->trailing_javascript,
			"document.write('L: ' + $('note-%s').style.left + '; ');", v->uid);
		StrBufAppendPrintf(WC->trailing_javascript,
			"document.write('T: ' + $('note-%s').style.top + '; ');", v->uid);
		StrBufAppendPrintf(WC->trailing_javascript,
			"document.write('W: ' + $('note-%s').style.width + '; ');", v->uid);
		StrBufAppendPrintf(WC->trailing_javascript,
			"document.write('H: ' + $('note-%s').style.height + '<br>');", v->uid);
		*/

		vnote_free(v);
	}
	return 0;
}
Ejemplo n.º 14
0
static void StrBufRFC2047encodeMessageStdin(void)
{
	int fdin = 0;// STDIN
	const char *Err;
	StrBuf *Target;
	StrBuf *Source;
	StrBuf *Src;

	Source = NewStrBuf();
	Src = NewStrBuf();

	printf("[");
	while (fdin == 0) {

		StrBufTCP_read_line(Source, &fdin, 0, &Err);
		StrBufAppendBuf(Src, Source, 0);
		StrBufAppendBufPlain(Src, HKEY("\n"), 0);
				
	}

	Target = StrBufRFC2047encodeMessage(Src);

	printf("Target: \n%s\n", ChrPtr(Target));
	FreeStrBuf(&Source);
	FreeStrBuf(&Src);
	FreeStrBuf(&Target);
}
Ejemplo n.º 15
0
static void TestEncodeEmail(void)
{
	StrBuf *Target;
	StrBuf *Source;
	StrBuf *UserName = NewStrBuf();
	StrBuf *EmailAddress = NewStrBuf();
	StrBuf *EncBuf = NewStrBuf();
	
	Source = NewStrBuf();
 
// 	Source = NewStrBufPlain(HKEY("Art Cancro <*****@*****.**>, Art Cancro <*****@*****.**>"));

	Source = NewStrBufPlain(HKEY("\"Alexandra Weiz, Restless GmbH\" <*****@*****.**>, \"NetIN\" <*****@*****.**>, \" יריב ברקאי, מולטימדי\" <*****@*****.**>"));	
	Target = StrBufSanitizeEmailRecipientVector(
		Source,
		UserName, 
		EmailAddress,
		EncBuf
		);		
	
	TestRevalidateStrBuf(Target);
	printf("the source:>%s<\n", ChrPtr(Source));
	printf("the target:>%s<\n", ChrPtr(Target));
	FreeStrBuf(&Target);
	FreeStrBuf(&UserName);
	FreeStrBuf(&EmailAddress);
	FreeStrBuf(&EncBuf);

	FreeStrBuf(&Source);
}
Ejemplo n.º 16
0
static void
set_start_callback(struct ev_loop *loop, AsyncIO *IO, int revents)
{
	ev_timer_stop(event_base, &IO->conn_fail);
	ev_timer_start(event_base, &IO->rw_timeout);

	switch(IO->NextState) {
	case eReadMore:
	case eReadMessage:
	case eReadFile:
		StrBufAppendBufPlain(IO->ErrMsg, HKEY("[while waiting for greeting]"), 0);
		ev_io_start(event_base, &IO->recv_event);
		break;
	case eSendReply:
	case eSendMore:
	case eReadPayload:
	case eSendFile:
		become_session(IO->CitContext);
		IO_send_callback(loop, &IO->send_event, revents);
		break;
	case eDBQuery:
	case eSendDNSQuery:
	case eReadDNSReply:
	case eConnect:
	case eTerminateConnection:
	case eAbort:
		/// TODO: WHUT?
		break;
	}
}
Ejemplo n.º 17
0
eNextState SMTPC_send_authplain_2(SmtpOutMsg *Msg)
{
	AsyncIO *IO = &Msg->IO;
	char buf[SIZ];
	char encoded[1024];
	long encodedlen;

	sprintf(buf, "%s",
		Msg->pCurrRelay->Pass);
	
	encodedlen = CtdlEncodeBase64(
		encoded,
		Msg->pCurrRelay->Pass,
		strlen(Msg->pCurrRelay->Pass),
		0);

	if (encoded[encodedlen - 1] == '\n') {
		encodedlen --;
		encoded[encodedlen] = '\0';
	}

	StrBufPlain(Msg->IO.SendBuf.Buf,
		    encoded,
		    encodedlen);

	StrBufAppendBufPlain(Msg->IO.SendBuf.Buf,
			     HKEY("\r\n"), 0);

	SMTP_DBG_SEND();

	return eReadMessage;
}
Ejemplo n.º 18
0
void render_MIME_VNote(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset)
{
	wc_mime_attachment *Mime = CTX(CTX_MIME_ATACH);

	if (StrLength(Mime->Data) == 0)
		MimeLoadData(Mime);
	if (StrLength(Mime->Data) > 0) {
		struct vnote *v;
		StrBuf *Buf;
		char *vcard;

		Buf = NewStrBuf();
		vcard = SmashStrBuf(&Mime->Data);
		v = vnote_new_from_str(vcard);
		free (vcard);
		if (v) {
			WCTemplputParams TP;
			
			memset(&TP, 0, sizeof(WCTemplputParams));
			TP.Filter.ContextType = CTX_VNOTE;
			TP.Context = v;
			DoTemplate(HKEY("mail_vnoteitem"),
				   Buf, &TP);
			
			vnote_free(v);
			Mime->Data = Buf;
		}
		else {
			if (Mime->Data == NULL)
				Mime->Data = NewStrBuf();
			else
				FlushStrBuf(Mime->Data);
		}
	}
}
Ejemplo n.º 19
0
eNextState SMTP_C_Shutdown(AsyncIO *IO)
{
	EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
	SmtpOutMsg *Msg = IO->Data;

	switch (IO->NextState) {
	case eSendDNSQuery:
	case eReadDNSReply:

		/* todo: abort c-ares */
	case eConnect:
	case eSendReply:
	case eSendMore:
	case eSendFile:
	case eReadMessage:
	case eReadMore:
	case eReadPayload:
	case eReadFile:
		StopClientWatchers(IO, 1);
		break;
	case eDBQuery:

		break;
	case eTerminateConnection:
	case eAbort:
		break;
	}
	Msg->MyQEntry->Status = 3;
	StrBufPlain(Msg->MyQEntry->StatusMessage,
		    HKEY("server shutdown during message submit."));
	return FinalizeMessageSend(Msg);
}
Ejemplo n.º 20
0
static void TestRFC822DecodeStdin(void)
{
	int fdin = 0;// STDIN
	const char *Err;
	StrBuf *Target;
	StrBuf *Source;
	StrBuf *DefaultCharset;
	StrBuf *FoundCharset;
	
	DefaultCharset = NewStrBufPlain(HKEY("iso-8859-1"));
	FoundCharset = NewStrBuf();
	Source = NewStrBuf();

	while (fdin == 0) {

		StrBufTCP_read_line(Source, &fdin, 0, &Err);
		Target = NewStrBuf();
		
		StrBuf_RFC822_to_Utf8(Target, Source, DefaultCharset, FoundCharset);
		
		TestRevalidateStrBuf(Target);
		printf("the ugly multi:>%s<\n", ChrPtr(Target));
		FreeStrBuf(&Target);
	}
	FreeStrBuf(&Source);
	FreeStrBuf(&FoundCharset);
	FreeStrBuf(&DefaultCharset);
}
Ejemplo n.º 21
0
/**
 * this one has to have the context for loading the message via the redirect buffer...
 */
StrBuf *smtp_load_msg(OneQueItem *MyQItem, int n, char **Author, char **Address)
{
	CitContext *CCC=CC;
	StrBuf *SendMsg;

	CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
	CtdlOutputMsg(MyQItem->MessageID,
		      MT_RFC822, HEADERS_ALL,
		      0, 1, NULL,
		      (ESC_DOT|SUPPRESS_ENV_TO),
		      Author,
		      Address,
			NULL);

	SendMsg = CCC->redirect_buffer;
	CCC->redirect_buffer = NULL;
	if ((StrLength(SendMsg) > 0) &&
	    ChrPtr(SendMsg)[StrLength(SendMsg) - 1] != '\n') {
		SMTPC_syslog(LOG_WARNING,
			     "[%d] Possible problem: message did not "
			     "correctly terminate. (expecting 0x10, got 0x%02x)\n",
			     MsgCount, //yes uncool, but best choice here...
			     ChrPtr(SendMsg)[StrLength(SendMsg) - 1] );
		StrBufAppendBufPlain(SendMsg, HKEY("\r\n"), 0);
	}
	return SendMsg;
}
Ejemplo n.º 22
0
/*
 * Go to the URL saved by push_destination()
 */
void pop_destination(void) {
	wcsession *WCC = WC;

	/*
	 * If we are in the middle of a new user signup, the server may request that
	 * we first pass through a registration screen.
	 */
	if ((WCC) && (WCC->need_regi)) {
		if ((WCC->PushedDestination != NULL) && (StrLength(WCC->PushedDestination) > 0)) {
			/* Registering will take us to the My Citadel Config room, so save our place */
			StrBufAppendBufPlain(WCC->PushedDestination, HKEY("?go="), 0);
			StrBufUrlescAppend(WCC->PushedDestination, WCC->CurRoom.name, NULL);
		}
		WCC->need_regi = 0;
		display_reg(1);
		return;
	}

	/*
	 * Do something reasonable if we somehow ended up requesting a pop without
	 * having first done a push.
	 */
	if ( (!WCC) || (WCC->PushedDestination == NULL) || (StrLength(WCC->PushedDestination) == 0) ) {
		do_welcome();
		return;
	}

	/*
	 * All righty then!  We have a destination saved, so go there now.
	 */
	if (verbose)
		syslog(LOG_DEBUG, "Pop: %s", ChrPtr(WCC->PushedDestination));
	http_redirect(ChrPtr(WCC->PushedDestination));
}
Ejemplo n.º 23
0
int CUtil::GetSystemPorts(CString *pNameList, CString *pPortList)
{
	CRegKey RegKey;
	int nCount = 0;
	
	if(RegKey.Open(HKEY_LOCAL_MACHINE, "Hardware\\DeviceMap\\SerialComm") == ERROR_SUCCESS)
	{
		while(true)
		{
			char ValueName[_MAX_PATH];
			unsigned char ValueData[_MAX_PATH];
			DWORD nValueSize = _MAX_PATH;
			DWORD nDataSize = _MAX_PATH;
			DWORD nType;
			
			if(::RegEnumValue(HKEY(RegKey), nCount, ValueName, &nValueSize, NULL, &nType, ValueData, &nDataSize) == ERROR_NO_MORE_ITEMS)
			{
				break;
			}
			
			if(pNameList)
				pNameList[nCount] = ValueName;
			
			if(pPortList)
				pPortList[nCount] = ValueData;
			
			nCount++;
		}
	}
	
	return nCount;
}
Ejemplo n.º 24
0
void 
InitModule_RSS
(void)
{
	WebcitAddUrlHandler(HKEY("feed_rss"), "", 0, feed_rss, ANONYMOUS|COOKIEUNNEEDED);
	RegisterNamespace("THISROOM:FEED:RSS", 0, 0, tmplput_rssbutton, NULL, CTX_NONE);
	RegisterNamespace("THISROOM:FEED:RSSMETA", 0, 0, tmplput_rssmeta, NULL, CTX_NONE);
}
Ejemplo n.º 25
0
eNextState SMTPC_send_QUIT(SmtpOutMsg *Msg)
{
	AsyncIO *IO = &Msg->IO;
	StrBufPlain(Msg->IO.SendBuf.Buf,
		    HKEY("QUIT\r\n"));

	SMTP_DBG_SEND();
	return eReadMessage;
}
inline int hash(int key) {
    int i = 0, j;
    do {
        j = HKEY(key, i);
        if(a[j] == NIL) { a[j] = key; return j; }
        i++;
    } while(i < M);
    return -1;
}
// key is encoded string(e.g. abc => 012, xyz => 232425) 
inline int find(int key) {
    int i = 0, j;
    do {
        j = HKEY(key, i);
        if(a[j] == key) return j;
        i++;
    } while(a[j] != NIL and i < M);
    return -1;
}
Ejemplo n.º 28
0
void AppendImportantMessage(const char *pch, long len)
{
	wcsession *WCC = WC;

	if (StrLength(WCC->ImportantMsg) > 0) {
		StrBufAppendBufPlain(WCC->ImportantMsg, HKEY("\n"), 0);
	}
		
	StrBufAppendBufPlain(WCC->ImportantMsg, pch, len, 0);
}
Ejemplo n.º 29
0
eNextState POP3C_SendListCommand(pop3aggr *RecvMsg)
{
	AsyncIO *IO = &RecvMsg->IO;
	SetPOP3State(IO, eListing);

	/* Get the list of messages */
	StrBufPlain(RecvMsg->IO.SendBuf.Buf, HKEY("LIST\r\n"));
	POP3C_DBG_SEND();
	return eReadMessage;
}
Ejemplo n.º 30
0
void display_editfloorpic(void) {
	StrBuf *PicAction;

	PicAction = NewStrBuf();
	StrBufPrintf(PicAction, "_floorpic_|%s", bstr("which_floor"));
	putbstr("__WHICHPIC", PicAction);
	putbstr("__PICDESC", NewStrBufPlain(_("the icon for this floor"), -1));
	putbstr("__UPLURL", NewStrBufPlain(HKEY("editfloorpic")));
	display_graphics_upload("editfloorpic");
}