* mixi.el (mixi-login-use-ssl): New user option.
authorbg66 <bg66>
Tue, 16 Jan 2007 01:44:27 +0000 (01:44 +0000)
committerbg66 <bg66>
Tue, 16 Jan 2007 01:44:27 +0000 (01:44 +0000)
(mixi-login): Use it.

ChangeLog
mixi.el

index 7c0cd5d..883e792 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-16  OHASHI Akira  <bg66@koka-in.org>
+
+       * mixi.el (mixi-login-use-ssl): New user option.
+       (mixi-login): Use it.
+
 2007-01-15  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi.el (mixi-diary-list-regexp): Fix regexp.
diff --git a/mixi.el b/mixi.el
index 789ba27..03a4c28 100644 (file)
--- a/mixi.el
+++ b/mixi.el
                (symbol :tag "The other backend"))
   :group 'mixi)
 
+(defcustom mixi-login-use-ssl nil
+  "*If non-ni, login using SSL."
+  :type 'boolean
+  :group 'mixi)
+
 (defcustom mixi-default-email nil
   "*Default E-mail address that is used to login automatically."
   :type '(radio (string :tag "E-mail address")
@@ -381,17 +386,20 @@ Increase this value when unexpected error frequently occurs."
                   (read-from-minibuffer (mixi-message "Login Email: "))))
        (password (or password mixi-default-password
                      (read-passwd (mixi-message "Login Password: ")))))
-    (let ((buffer (mixi-retrieve "/login.pl"
-                                (concat "email=" email
-                                        "&password=" password
-                                        "&next_url=/home.pl"
-                                        "&sticky=on"))))
-      (unless (string-match "url=/check\\.pl\\?n=" buffer)
-       (error (mixi-message "Cannot login")))
-      (setq buffer (mixi-retrieve "/check.pl?n=home.pl"))
-      (if (string-match mixi-my-id-regexp buffer)
-         (setq mixi-me (mixi-make-friend (match-string 1 buffer)))
-       (error (mixi-message "Cannot login"))))))
+    (let ((url "/login.pl"))
+      (when mixi-login-use-ssl
+       (setq url (concat "https://mixi.jp" url)))
+      (let ((buffer (mixi-retrieve url
+                                  (concat "email=" email
+                                          "&password=" password
+                                          "&next_url=/home.pl"
+                                          "&sticky=on"))))
+       (unless (string-match "url=/check\\.pl\\?n=" buffer)
+         (error (mixi-message "Cannot login")))
+       (setq buffer (mixi-retrieve "/check.pl?n=home.pl"))
+       (if (string-match mixi-my-id-regexp buffer)
+           (setq mixi-me (mixi-make-friend (match-string 1 buffer)))
+         (error (mixi-message "Cannot login")))))))
 
 (defun mixi-logout ()
   (mixi-retrieve "/logout.pl"))