Changeset 65

Show
Ignore:
Timestamp:
02/02/06 11:38:38
Author:
douglm
Message:

Previous change had broken preferences (hence subscriptiosn and views) for the admin client (and possibly the public client)

Added a run-as property to fix that. One step closer to departmental.

Also fixed admin subscriptions jsp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/bldfiles/buildwar.xml

    r2 r65  
    137137              value="${propval.app.guestmode}" /> 
    138138 
     139      <!-- Change this to be an app par --> 
     140      <filter token="RUN-AS-USER" 
     141              value="${org.bedework.syspar.public.user}" /> 
     142 
    139143              <!-- ??????? 
    140144      <filter token="CALFILE-NAME" 
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java

    r55 r65  
    18671867      } 
    18681868 
     1869      if (debug) { 
     1870        trace("PublicAdmin: " + pars.getPublicAdmin() + " user: " + 
     1871              pars.getUser()); 
     1872      } 
     1873 
     1874      if (pars.getPublicAdmin()) { 
     1875        /* We may be running as a different user. The prefeences we want to see 
     1876         * are those of the user we are running as - i.e. the 'run.as' user for 
     1877         * not those of the authenticated user. 
     1878         */ 
     1879        dbi.close(); 
     1880        BwUser user = cali.getUser(pars.getUser()); 
     1881        dbi = new CalSvcDb(this, user); 
     1882      } 
     1883 
    18691884      return cali; 
    18701885    } finally { 
  • trunk/calendar3/webadmin/war/WEB-INF/classes/servlet.properties

    r2 r65  
    2727# true if this application should run in guest mode only 
    2828org.bedework.guestmode=false 
     29 
     30# The user this application will run as. 
     31org.bedework.run.as=@RUN-AS-USER@ 
    2932 
    3033# This provides a reference to the public events calendar as a convenience 
  • trunk/calendar3/webadmin/war/docs/subs/modSubscription.jsp

    r60 r65  
    1717    <emailNotifications><bean:write name="peForm" property="subscription.emailNotifications" /></emailNotifications> 
    1818    <calendarDeleted><bean:write name="peForm" property="subscription.calendarDeleted" /></calendarDeleted> 
    19     <unremoveable><bean:write name="subscription" property="unremoveable" /></unremoveable> 
     19    <unremoveable><bean:write name="peForm" property="subscription.unremoveable" /></unremoveable> 
    2020  </subscription> 
    2121 
  • trunk/calendar3/webclient/war/WEB-INF/classes/servlet.properties

    r2 r65  
    2828# true if this application should run in guest mode only 
    2929org.bedework.guestmode=@APP-GUESTMODE@ 
     30 
     31# The user this application will run as. 
     32org.bedework.run.as=@RUN-AS-USER@ 
    3033 
    3134# true if this application is the public admin client 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java

    r55 r65  
    529529  } 
    530530 
     531  /** Return user we run as. 
     532   * 
     533   * @param frm 
     534   * @return String  run-as user name 
     535   * @throws Throwable 
     536   */ 
     537  public String getRunAsUser(UtilActionForm frm) throws Throwable { 
     538    return JspUtil.getReqProperty(frm.getMres(), "org.bedework.run.as"); 
     539  } 
     540 
    531541  /** get an env object initialised appropriately for our usage. 
    532542   * 
     
    764774      hsess.setAttribute(BwCallback.cbAttrName, cb); 
    765775 
    766       svci = new CalSvc(); 
    767       CalSvcIPars pars = new CalSvcIPars(user, access, user, publicAdmin, 
    768                                          false,    // caldav 
    769                                          null, // synchId 
    770                                          debug); 
    771       svci.init(pars); 
    772  
    773       BwWebUtil.setCalSvcI(request, svci); 
    774  
    775       form.setCalSvcI(svci); 
     776      String runAsUser = user; 
    776777 
    777778      try { 
     779        svci = new CalSvc(); 
     780        if (publicAdmin || (user == null)) { 
     781          runAsUser = getRunAsUser(form); 
     782        } 
     783        CalSvcIPars pars = new CalSvcIPars(user, access, runAsUser, publicAdmin, 
     784            false,    // caldav 
     785            null, // synchId 
     786            debug); 
     787        svci.init(pars); 
     788 
     789        BwWebUtil.setCalSvcI(request, svci); 
     790 
     791        form.setCalSvcI(svci); 
     792 
    778793        cb.in(true); 
     794      } catch (CalFacadeException cfe) { 
     795        throw cfe; 
    779796      } catch (Throwable t) { 
    780         if (t instanceof CalFacadeException) { 
    781           throw (CalFacadeException)t; 
    782         } 
    783797        throw new CalFacadeException(t); 
    784798      }