Index: gw/smsbox.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsbox.c,v
retrieving revision 1.283
diff -a -u -r1.283 smsbox.c
--- gw/smsbox.c	20 May 2009 10:12:46 -0000	1.283
+++ gw/smsbox.c	14 Jun 2009 19:00:06 -0000
@@ -2436,13 +2436,26 @@
     URLTranslation *t = NULL;
 
     if (username == NULL || password == NULL)
-	return NULL;
+    {
+       warning(0, "Missing authorization credentials");
+       return NULL;
+    }
 
     if ((t = urltrans_find_username(translations, username))==NULL)
-	return NULL;
+    {
+       warning(0, "Couldn't match username \"%s\" in sendsms-user List",
+               octstr_get_cstr(username));
+       return NULL;
+    }
 
     if (octstr_compare(password, urltrans_password(t))!=0)
-	return NULL;
+    {
+       warning(0, "Bad password \"%s\" for username \"%s\". Expected "
+               "\"%s\"", octstr_get_cstr(password),
+               octstr_get_cstr(urltrans_username(t)),
+               octstr_get_cstr(urltrans_password(t)));
+       return NULL;
+    }
     else {
 	Octstr *allow_ip = urltrans_allow_ip(t);
 	Octstr *deny_ip = urltrans_deny_ip(t);
@@ -2867,7 +2880,8 @@
     }
         
     /* check does we have an external XML source for configuration */
-    if ((ota_doc = http_cgi_variable(list, "text")) != NULL) {
+    if ((ota_doc = http_cgi_variable(list, "text")) != NULL &&
+			 (ota_doc = octstr_read_file(octstr_get_cstr(ota_doc)))) {
         Octstr *sec, *pin;
         
         /*
