Changeset 5d2768 in indico


Ignore:
Timestamp:
09/15/11 15:07:52 (20 months ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 4c7d4152dff271ba5df5a8606605969cab454080
Children:
82d302
Parents:
1f14ef
git-author:
Jose Benito <jose.benito.gonzalez@…> (09/15/11 15:06:19)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (09/15/11 15:07:52)
Message:

[FIX] Using https for JS,CSS when https page

  • profiting to do some refactor on rh._getBaseURL
  • after login go to https if BaseSecureURL defined
  • cleaning up some non-used code
  • changing old url to indico-software.org
Location:
indico/MaKaC
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/RSSinterface/conference.py

    r6c9393 r5d2768  
    8585            confs = calIdx.getObjectsInDay(self._categ.getId(), self._date) 
    8686 
    87         sconfs = set() 
    88  
    8987        sconfs = set(ACLfiltered(confs, self._req.getHostIP(), self._req.getAW())) 
    9088        res = list(sconfs) 
  • indico/MaKaC/webinterface/pages/base.py

    r453220 r5d2768  
    7979 
    8080    def _getBaseURL( self ): 
    81         return Config.getInstance().getBaseURL() 
     81        if self._rh._req.is_https() and Config.getInstance().getBaseSecureURL(): 
     82            baseurl = Config.getInstance().getBaseSecureURL() 
     83        else: 
     84            baseurl = Config.getInstance().getBaseURL() 
     85        return baseurl 
    8286 
    8387    def _getTitle( self ): 
     
    136140        from MaKaC.webinterface.rh.admins import RHAdminBase 
    137141 
    138         baseurl = self._getBaseURL() 
    139         if ((isinstance(self, WPSignIn) or isinstance(self, WPConfSignIn) or isinstance(self, WPRegistrationFormSignIn)) and \ 
    140             Config.getInstance().getLoginURL().startswith("https")) or \ 
    141             self._rh._req.is_https() or self._rh.use_https(): 
    142             baseurl = baseurl.replace("http://","https://") 
    143             baseurl = urlHandlers.setSSLPort( baseurl ) 
    144  
    145142        area="" 
    146143        if isinstance(self._rh, RHModificationBaseProtected): 
     
    158155        return wcomponents.WHTMLHeader().getHTML({ 
    159156                            "area": area, 
    160                             "baseurl": baseurl, 
     157                            "baseurl": self._getBaseURL(), 
    161158                            "conf": Config.getInstance(), 
    162159                            "page": self, 
  • indico/MaKaC/webinterface/pages/conferences.py

    r48e36f r5d2768  
    447447        #And also the modificated uploaded css 
    448448 
    449         path = baseurl = self._getBaseURL() 
     449        path = self._getBaseURL() 
    450450        printCSS = """ 
    451451        <link rel="stylesheet" type="text/css" href="%s/css/Conf_Basic.css" > 
     
    864864    def _getHeadContent( self ): 
    865865        #This is used for fetching the css file for conference page 
    866         path = baseurl = self._getBaseURL() 
     866        path = self._getBaseURL() 
    867867        printCSS = """ 
    868868        <link rel="stylesheet" type="text/css" href="%s/css/Conf_Basic.css" > 
     
    12261226        styleMgr = info.HelperMaKaCInfo.getMaKaCInfoInstance().getStyleManager() 
    12271227        htdocs = Config.getInstance().getHtdocsDir() 
    1228         if self._rh._req.is_https() or self._rh._tohttps: 
    1229             baseurl = Config.getInstance().getBaseSecureURL() 
    1230         else: 
    1231             baseurl = self._getBaseURL() 
     1228        baseurl = self._getBaseURL() 
    12321229        # First include the default Indico stylesheet 
    12331230        styleText = """<link rel="stylesheet" href="%s/css/%s">\n""" % \ 
     
    15001497    def _getHeadContent( self ): 
    15011498        headContent=WPConferenceDefaultDisplayBase._getHeadContent(self) 
    1502         baseurl = Config.getInstance().getBaseURL() 
     1499        baseurl = self._getBaseURL() 
    15031500        return """ 
    15041501                 %s 
     
    55145511    def _setActiveSideMenuItem( self ): 
    55155512        self._layoutMenuItem.setActive() 
    5516  
    5517 class WPConfModifDisplay( WPConfModifDisplayBase ): 
    5518  
    5519     def __init__(self, rh, conf, linkId, formatOption=None, optionalParams={}): 
    5520         WPConfModifDisplayBase.__init__(self, rh, conf) 
    5521         self._linkId = linkId 
    5522         self._formatOption = formatOption 
    5523         self._menu=displayMgr.ConfDisplayMgrRegistery().getDisplayMgr(self._conf).getMenu() 
    5524         if linkId: 
    5525             self._link = self._menu.getLinkById(linkId) 
    5526         else: 
    5527             self._link = self._menu 
    5528         self._optionalParams=optionalParams 
    5529  
    5530     def _getTabContent( self, params ): 
    5531         wc = WConfModifDisplay( self._conf, self._linkId, self._formatOption ) 
    5532         return wc.getHTML(self._optionalParams) 
    5533  
    5534     def _getHeadContent( self ): 
    5535         #This is used for fetching the css file for management - display 
    5536         path = baseurl = self._getBaseURL() 
    5537         saveurl = urlHandlers.UHSavePic.getURL(self._conf) 
    5538         printCSS = """ 
    5539         <link rel="stylesheet" type="text/css" href="%s/css/ModifDisplay.css" > 
    5540             """ %(path) 
    5541         return printCSS 
    55425513 
    55435514class WPConfModifDisplayCustomization( WPConfModifDisplayBase ): 
     
    1129811269 
    1129911270class WPConfModifPreviewCSS( WPConferenceDefaultDisplayBase ): 
    11300     #from MaKaC.webinterface.pages import base 
    11301    # from MaKaC.webinterface import wcomponents 
    1130211271 
    1130311272    def __init__( self, rh, conf, selectedCSSId): 
     
    1132011289 
    1132111290    def _getBody( self, params ): 
    11322         path = self._getBaseURL() 
    11323         htdocs = Config.getInstance().getHtdocsDir() 
    1132411291        params["URL2Back"] = urlHandlers.UHConfModifDisplay.getURL(self._conf) 
    1132511292        params["cssurl"] = "" 
  • indico/MaKaC/webinterface/pages/signIn.py

    rbdd862 r5d2768  
    2020 
    2121import MaKaC.webinterface.pages.base as base 
    22 import MaKaC.webinterface.pages.conferences as conferences 
    2322import MaKaC.webinterface.urlHandlers as urlHandlers 
    2423import MaKaC.webinterface.wcomponents as wcomponents 
     
    2726 
    2827class WPSignIn( base.WPDecorated ): 
    29      
     28 
    3029    def __init__(self, rh, login="", msg = ""): 
    3130        self._login = login 
    3231        self._msg = msg 
    3332        base.WPDecorated.__init__( self, rh) 
    34      
     33 
    3534    def _getBody( self, params ): 
    3635        wc = wcomponents.WSignIn() 
     
    4544 
    4645class WPAccountAlreadyActivated( base.WPDecorated ): 
    47      
     46 
    4847    def __init__(self, rh, av): 
    4948        base.WPDecorated.__init__( self, rh) 
    5049        self._av = av 
    51      
     50 
    5251    def _getBody( self, params ): 
    5352        wc = wcomponents.WAccountAlreadyActivated( self._av) 
    5453        params["mailLoginURL"] = urlHandlers.UHSendLogin.getURL(self._av) 
    55          
     54 
    5655        return wc.getHTML( params ) 
    5756 
    5857 
    5958class WPAccountActivated( base.WPDecorated ): 
    60      
     59 
    6160    def __init__(self, rh, av): 
    6261        base.WPDecorated.__init__( self, rh) 
    6362        self._av = av 
    64      
     63 
    6564    def _getBody( self, params ): 
    6665        wc = wcomponents.WAccountActivated( self._av) 
    6766        params["mailLoginURL"] = urlHandlers.UHSendLogin.getURL(self._av) 
    6867        params["loginURL"] = urlHandlers.UHSignIn.getURL() 
    69          
     68 
    7069        return wc.getHTML( params ) 
    7170 
    7271 
    7372class WPAccountDisabled( base.WPDecorated ): 
    74      
     73 
    7574    def __init__(self, rh, av): 
    7675        base.WPDecorated.__init__( self, rh) 
    7776        self._av = av 
    78      
     77 
    7978    def _getBody( self, params ): 
    8079        wc = wcomponents.WAccountDisabled( self._av) 
    8180        #params["mailLoginURL"] = urlHandlers.UHSendLogin.getURL(self._av) 
    82          
     81 
    8382        return wc.getHTML( params ) 
    8483 
    8584 
    8685class WPUnactivatedAccount( base.WPDecorated ): 
    87      
     86 
    8887    def __init__(self, rh, av): 
    8988        base.WPDecorated.__init__( self, rh) 
    9089        self._av = av 
    91      
     90 
    9291    def _getBody( self, params ): 
    9392        wc = wcomponents.WUnactivatedAccount( self._av) 
    9493        params["mailActivationURL"] = urlHandlers.UHSendActivation.getURL(self._av) 
    95          
     94 
    9695        return wc.getHTML( params ) 
  • indico/MaKaC/webinterface/rh/conferenceDisplay.py

    r1f14ef r5d2768  
    5858class RHConfSignIn( conferenceBase.RHConferenceBase ): 
    5959 
     60    _tohttps = True 
     61 
    6062    def _checkParams( self, params ): 
    6163        conferenceBase.RHConferenceBase._checkParams( self, params ) 
     
    7072 
    7173    def _process( self ): 
    72         self._tohttps = True 
    7374        #Check for automatic login 
    7475        auth = AuthenticatorMgr() 
     
    7778            url = self._returnURL 
    7879            self._getSession().setUser( av ) 
     80            if Config.getInstance().getBaseSecureURL().startswith('https://'): 
     81                url = str(url).replace('http://', 'https://') 
    7982            self._redirect( url ) 
    8083        if not self._signIn: 
     
    99102                tz = tzUtil.getSessionTZ() 
    100103                self._getSession().setVar("ActiveTimezone",tz) 
     104            if Config.getInstance().getBaseSecureURL().startswith('https://'): 
     105                url = str(url).replace('http://', 'https://') 
    101106            self._redirect( url ) 
    102107 
  • indico/MaKaC/webinterface/rh/conferenceModif.py

    r250e54 r5d2768  
    41554155#------------------------------------------------------------------------------------- 
    41564156 
    4157 class RHConfModifDisplay( RHConferenceModifBase ): 
    4158     _uh = urlHandlers.UHConfModifDisplay 
    4159  
    4160     def _checkParams( self, params ): 
    4161         RHConferenceModifBase._checkParams( self, params ) 
    4162         self._linkId = params.get("linkId", "") 
    4163         self._formatOption = params.get("formatOption", "") 
    4164         self._optionalParams={} 
    4165         if params.has_key("modifiedText"): 
    4166             self._optionalParams["modifiedText"]=params.has_key("modifiedText") 
    4167  
    4168     def _process( self ): 
    4169         p = conferences.WPConfModifDisplay(self, self._target, self._linkId, self._formatOption, optionalParams=self._optionalParams ) 
    4170         return p.display() 
    4171  
    41724157class RHConfModifDisplayCustomization( RHConferenceModifBase ): 
    41734158    _uh = urlHandlers.UHConfModifDisplayCustomization 
  • indico/MaKaC/webinterface/rh/evaluationDisplay.py

    rbdd862 r5d2768  
    3434        RHConferenceBaseDisplay._checkParams(self, params) 
    3535        self._evaluation = self._conf.getEvaluation() 
    36      
    37     def _processIfActive( self ): 
    38         """ only override this method if the Evaluation must be activated for  
     36 
     37    def _processIfActive( self ): 
     38        """ only override this method if the Evaluation must be activated for 
    3939            carrying on the handler execution. 
    4040        """ 
     
    4949        else: 
    5050            return self._processIfActive() 
    51              
     51 
    5252    def _wpEvaluation(self, pageToShow): 
    5353        """redirection to the right class, dependending on conference type. 
     
    6565    """General information display.""" 
    6666    _uh = urlHandlers.UHConfEvaluationMainInformation 
    67      
     67 
    6868    def _processIfActive( self ): 
    6969        if self.getWebFactory()!=None : #Event == Meeting/Lecture 
     
    7676    """Invite user to login/signin.""" 
    7777    _uh = urlHandlers.UHConfEvaluationSignIn 
    78      
     78    _tohttps = True 
     79 
     80 
    7981    def _processIfActive( self ): 
    8082        return self._wpEvaluation("SignIn").display() 
     
    9395            urlLogin = urlLogin.replace("http://", "https://") 
    9496        return urlLogin 
    95          
     97 
    9698    def _checkProtection( self ): 
    9799        RHBaseEvaluation._checkProtection(self) 
     
    99101            self._redirect( self._getLoginURL() ) 
    100102            self._doProcess = False 
    101          
     103 
    102104 
    103105class RHEvaluationDisplay( RHEvaluationDisplayBase ): 
    104106    """Evaluation display.""" 
    105      
     107 
    106108    def _processIfActive( self ): 
    107109        if self._getUser()!=None and self._getUser().hasSubmittedEvaluation(self._evaluation): 
    108110            return self._wpEvaluation("DisplayModif").display() 
    109         else:       
     111        else: 
    110112            return self._evaluationDisplay().display() 
    111      
     113 
    112114    def _evaluationDisplay(self): 
    113115        """What to display.""" 
     
    123125    """Submitted evaluation modification.""" 
    124126    _uh = urlHandlers.UHConfEvaluationDisplayModif 
    125      
     127 
    126128    def _processIfActive( self ): 
    127129        if self._getUser()!=None and self._getUser().hasSubmittedEvaluation(self._conf.getEvaluation()): 
     
    135137class RHEvaluationSubmit (RHBaseEvaluation): 
    136138    """Submit the evaluation.""" 
    137      
     139 
    138140    def _checkParams( self, params ): 
    139141        RHBaseEvaluation._checkParams( self, params ) 
     
    150152            else : #Event == Conference 
    151153                self._redirect(urlHandlers.UHConfEvaluationMainInformation.getURL(self._conf)) 
    152          
     154 
    153155        ######## 
    154156        #SUBMIT# 
    155157        ######## 
    156158        if self._submit: 
    157              
     159 
    158160            #################### 
    159161            #get some variables# 
     
    163165            mode = params.get("mode","") 
    164166            user = self._getUser() 
    165              
     167 
    166168            ########## 
    167169            #Checking# 
     
    182184            elif evaluation.isMandatoryAccount() or mode==Evaluation._EDIT : 
    183185                    self._userShouldBeLoggedIn() 
    184              
     186 
    185187            ########## 
    186188            #Add mode# 
     
    197199                #notification 
    198200                submission.notifySubmissionSubmitted() 
    199                          
     201 
    200202            ########### 
    201203            #Edit mode# 
     
    219221                elif HelperMaKaCInfo.getMaKaCInfoInstance().isDebugActive() : 
    220222                    raise Exception("Evaluation - Strange error... the submission of this user was not found!") 
    221              
     223 
    222224            ########## 
    223225            #Redirect# 
    224226            ########## 
    225227            self._redirect(urlHandlers.UHConfEvaluationSubmitted.getURL(self._conf, mode=mode)) 
    226              
     228 
    227229    def _userShouldBeLoggedIn(self): 
    228230        """Strange error: the logged user is no more logged in...""" 
     
    237239    """Show message : Evaluation submitted.""" 
    238240    _uh = urlHandlers.UHConfEvaluationMainInformation 
    239      
     241 
    240242    def _processIfActive( self ): 
    241243        mode = self.getRequestParams().get("mode","") or Evaluation._SUBMIT 
  • indico/MaKaC/webinterface/rh/login.py

    rb2f346 r5d2768  
    3737class RHSignIn( base.RH ): 
    3838 
     39    _tohttps = True 
     40 
    3941    def _checkParams( self, params ): 
    4042        self._signIn = params.get("signIn", "").strip() 
     
    5759            self._getSession().setVar("ActiveTimezone",tz) 
    5860            self._getSession().setUser( av ) 
     61            if Config.getInstance().getBaseSecureURL().startswith('https://'): 
     62                url = str(url).replace('http://', 'https://') 
    5963            self._redirect( url, noCache = True ) 
    6064        if not self._signIn: 
     
    8690                else: 
    8791                    url += "?userId=%s"%self._userId 
     92            if Config.getInstance().getBaseSecureURL().startswith('https://'): 
     93                url = str(url).replace('http://', 'https://') 
    8894            self._redirect( url, noCache = True ) 
    8995 
     
    107113            self._redirect(autoLogoutRedirect) 
    108114        else: 
    109             # if not all the site is HTTPS, try moving user to plain HTTP 
    110             if not Config.getInstance().getBaseURL().startswith('https'): 
    111                 self._redirect(str(self._returnURL).replace('https', 'http')) 
    112             else: 
    113                 self._redirect(self._returnURL) 
     115            self._redirect(self._returnURL) 
    114116 
    115117 
  • indico/MaKaC/webinterface/rh/registrationFormDisplay.py

    rf4804a r5d2768  
    6262class RHRegistrationFormSignIn( RHBaseRegistrationForm ): 
    6363    _uh = urlHandlers.UHConfRegistrationFormSignIn 
     64    _tohttps = True 
    6465 
    6566    def _checkParams( self, params ): 
     
    7172 
    7273    def _processIfActive( self ): 
    73         self._tohttps = True 
    7474        #Check for automatic login 
    7575        auth = AuthenticatorMgr() 
     
    7878            url = self._returnURL 
    7979            self._getSession().setUser( av ) 
     80            if Config.getInstance().getBaseSecureURL().startswith('https://'): 
     81                url = str(url).replace('http://', 'https://') 
    8082            self._redirect( url ) 
    8183        p = registrationForm.WPRegistrationFormSignIn(self, self._conf) 
  • indico/MaKaC/webinterface/tpls/Footer.tpl

    r988cfe r5d2768  
    2929 
    3030            <img src="${ systemIcon("indico_small") }" alt="${ _("Indico - Integrated Digital Conference")}" style="vertical-align: middle; margin-right: 2px;"/> 
    31             <span style="vertical-align: middle;">${ _("Powered by ")} <a href="http://cdsware.cern.ch/indico/">Indico</a></span> 
     31            <span style="vertical-align: middle;">${ _("Powered by ")} <a href="http://indico-software.org">Indico</a></span> 
    3232 
    3333            % if Configuration.Config.getInstance().getWorkerName()!="": 
  • indico/MaKaC/webinterface/tpls/Help.tpl

    r4a0dcc r5d2768  
    273273 
    274274    <br/> 
    275     <p><em>${ _("You can find more user guides, in different languages, provided by external collaborators") } <a href="http://cdswaredev.cern.ch/indico/wiki/User/UserGuides">here</a>.</em></p> 
     275    <p><em>${ _("You can find more user guides, in different languages, provided by external collaborators") } <a href="http://indico-software.org/wiki/User/UserGuides">here</a>.</em></p> 
    276276 
    277277</div> 
  • indico/MaKaC/webinterface/tpls/Search.tpl

    rc0de5a r5d2768  
    2727<div style="float: right; margin-top:10px;"> 
    2828<span style="color:#777">Search powered by</span> 
    29 <a href="http://cdsware.cern.ch/invenio/"><img src="${ systemIcon('invenio') }" alt="CDS Invenio" title="${ _("IndicoSearch is powered by CDS Invenio")}" style="vertical-align: middle; border: 0px;" /></a> 
     29<a href="http://invenio-software.org"><img src="${ systemIcon('invenio') }" alt="CDS Invenio" title="${ _("IndicoSearch is powered by CDS Invenio")}" style="vertical-align: middle; border: 0px;" /></a> 
    3030</div> 
    3131 
  • indico/MaKaC/webinterface/urlHandlers.py

    r250e54 r5d2768  
    6868        rh = ContextManager.get('currentRH', None) 
    6969 
    70         if (cls in [UHSignIn, UHSignOut, UHConfSignIn, UHConfRegistrationFormSignIn] and \ 
    71             Config.getInstance().getBaseSecureURL()) or rh and (rh._req.is_https() or rh.use_https()): 
     70        if rh._req.is_https() and Config.getInstance().getBaseSecureURL(): 
    7271            baseURL = Config.getInstance().getBaseSecureURL() 
    7372        else: 
Note: See TracChangeset for help on using the changeset viewer.