aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/nntp/camel-nntp-auth.c
diff options
context:
space:
mode:
authornobody <nobody@localhost>2000-11-07 05:40:14 +0800
committernobody <nobody@localhost>2000-11-07 05:40:14 +0800
commitb32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3 (patch)
tree786145ed8b82796d89e41d2ed37058c0097ace13 /camel/providers/nntp/camel-nntp-auth.c
parentb4c61eba8055f666fd8a2270879a6f9722faa2b3 (diff)
downloadgsoc2013-evolution-b32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3.tar
gsoc2013-evolution-b32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3.tar.gz
gsoc2013-evolution-b32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3.tar.bz2
gsoc2013-evolution-b32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3.tar.lz
gsoc2013-evolution-b32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3.tar.xz
gsoc2013-evolution-b32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3.tar.zst
gsoc2013-evolution-b32d5bdc1994a9c0e4aa53c5ee6a492e4b36dba3.zip
This commit was manufactured by cvs2svn to create tag 'BALSA_1_0_0'.BALSA_1_0_0
svn path=/tags/BALSA_1_0_0/; revision=6429
Diffstat (limited to 'camel/providers/nntp/camel-nntp-auth.c')
-rw-r--r--camel/providers/nntp/camel-nntp-auth.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/camel/providers/nntp/camel-nntp-auth.c b/camel/providers/nntp/camel-nntp-auth.c
deleted file mode 100644
index 1f1e6ab2d8..0000000000
--- a/camel/providers/nntp/camel-nntp-auth.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-nntp-auth.c : authentication for nntp */
-
-/*
- *
- * Copyright (C) 2000 Helix Code, Inc. <toshok@helixcode.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#include <camel-nntp-auth.h>
-#include <camel-nntp-store.h>
-#include <camel-nntp-resp-codes.h>
-#include <camel-exception.h>
-#include <camel-session.h>
-
-int
-camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex)
-{
- CamelService *service = CAMEL_SERVICE (store);
- CamelSession *session = camel_service_get_session (service);
- int resp;
-
- if (!service->url->authmech && !service->url->passwd) {
- gchar *prompt;
-
- prompt = g_strdup_printf (_("Please enter the NNTP password for %s@%s"),
- service->url->user, service->url->host);
- service->url->passwd =
- camel_session_query_authenticator (session,
- CAMEL_AUTHENTICATOR_ASK, prompt,
- TRUE, service, "password", ex);
- g_free (prompt);
-
- if (!service->url->passwd) {
- camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
- "You didn\'t enter a password.");
- resp = 666;
- goto done;
- }
- }
-
- /* first send username */
- resp = camel_nntp_command (store, ex, NULL, "AUTHINFO USER %s", service->url->user);
-
- if (resp == NNTP_AUTH_REJECTED) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server rejected username"));
- goto done;
-
- }
- else if (resp != NNTP_AUTH_CONTINUE) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Failed to send username to server"));
- goto done;
- }
-
- /* then send the username if the server asks for it */
- resp = camel_nntp_command (store, ex, NULL, "AUTHINFO PASS %s", service->url->passwd);
-
- if (resp == NNTP_AUTH_REJECTED) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
- _("Server rejected username/password"));
- goto done;
- }
-
- done:
-
- if (service->url->passwd) {
- /* let's be paranoid */
- memset (service->url->passwd, 0, strlen (service->url->passwd));
- g_free (service->url->passwd);
- service->url->passwd = NULL;
- }
- return resp;
-}