~ubuntu-branches/ubuntu/karmic/sugar-web-activity/karmic

« back to all changes in this revision

Viewing changes to Web.activity/securitydialogs.py

  • Committer: Bazaar Package Importer
  • Author(s): Jani Monoses
  • Date: 2008-01-31 15:17:08 UTC
  • Revision ID: james.westby@ubuntu.com-20080131151708-4tegqfae3vdhiylk
Tags: upstream-85
ImportĀ upstreamĀ versionĀ 85

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2007, One Laptop Per Child
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
16
 
 
17
import logging
 
18
 
 
19
import xpcom
 
20
from xpcom import components
 
21
from xpcom.components import interfaces
 
22
from xpcom.server.factory import Factory
 
23
 
 
24
class SecurityDialogs:
 
25
    _com_interfaces_ = interfaces.nsIBadCertListener
 
26
 
 
27
    cid = '{267d2fc2-1810-11dc-8314-0800200c9a66}'
 
28
    description = 'Sugar Security Dialogs'
 
29
 
 
30
    def __init__(self):
 
31
        pass
 
32
    
 
33
    def confirmCertExpired(socketInfo, cert):
 
34
        logging.debug('UNIMPLEMENTED: SecurityDialogs.confirmCertExpired()')
 
35
        return interfaces.nsIBadCertListener.ADD_TRUSTED_FOR_SESSION, True
 
36
    
 
37
    def confirmMismatchDomain(socketInfo, targetURL, cert):
 
38
        logging.debug('UNIMPLEMENTED: SecurityDialogs.confirmMismatchDomain()')
 
39
        return interfaces.nsIBadCertListener.ADD_TRUSTED_FOR_SESSION, True
 
40
    
 
41
    def confirmUnknownIssuer(socketInfo, cert, certAddType):
 
42
        logging.debug('UNIMPLEMENTED: SecurityDialogs.confirmUnknownIssuer()')
 
43
        return interfaces.nsIBadCertListener.ADD_TRUSTED_FOR_SESSION, True
 
44
    
 
45
    def notifyCrlNextupdate(socketInfo, targetURL, cert):
 
46
        logging.debug('UNIMPLEMENTED: SecurityDialogs.notifyCrlNextupdate()')
 
47
 
 
48
"""
 
49
components.registrar.registerFactory(SecurityDialogs.cid,
 
50
                                     SecurityDialogs.description,
 
51
                                     '@mozilla.org/nsBadCertListener;1',
 
52
                                     Factory(SecurityDialogs))
 
53
"""