Changeset 173


Ignore:
Timestamp:
06/28/11 14:51:32 (12 years ago)
Author:
merek
Message:

Backport ecm-rate from branch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/changelog.txt

    r172 r173  
    2929- Added: DreamboxPlugin (csp-agent) support for more/older dm500 images. Basic (unsecured) file upload support.
    3030- Added: proxy-reference.html updated with highlighting for important elements and additional examples.
    31 - Added: Ability to set start and expiration date for user accounts.
     31- Added: Ability to set start and expiration date for user accounts (only Simple and XmlUsermanager).
     32- Added: Ability to set minimum interval between ecm's in seconds (ecm-rate).
    3233
    3334- Changes to proxy.xml:
  • trunk/config/proxy-reference.html

    r172 r173  
    793793
    794794<a name="user-manager/auth-config/user">
    795 <div class='indent'><strong>user-manager/auth-config/user (attributes: *name, *password, display-name, ip-mask, profiles, max-connections, admin, enabled, map-exclude, start-date, expiration-date, debug)</strong></div><br />
     795<div class='indent'><strong>user-manager/auth-config/user (attributes: *name, *password, display-name, ip-mask, profiles, max-connections, admin, enabled, map-exclude, start-date, expiration-date, ecm-rate, debug)</strong></div><br />
    796796One user definition for the SimpleUserManager (also used by the XmlUserManager, see <strong>README.XmlUserManager.txt</strong> for more details):<br /><br />
    797797- <strong class='bold'>name</strong>: User name, avoid long names, spaces and special characters. There are no particular limitations as far as the proxy is concerned, but the camd clients may have them.<br />
     
    805805- <strong class='bold'>map-exclude</strong>: true/false (default: false). Set to true to prevent the user from causing changes to the service maps. If a particular user is sending bad ecms or is otherwise misbehaving, this will protect the service mappings and ensure no other users are affected. Only use this if you are sure a particular client is misbehaving, the service mapping can't work if no clients are allowed to update the map.<br />
    806806- <strong class='bold'>start-date</strong>: (dd-mm-yyyy) Start date for user account.<br />
     807- <strong class='bold'>ecm-rate</strong>: Minimum interval between ecm's in seconds (disabled by default).<br />
    807808- <strong class='bold'>expiration-date</strong>: (dd-mm-yyyy) Expiration date for the user account.<br />
    808809- <strong class='bold'>debug</strong>: true/false (default: false). Set to true to enable ecm/emm/zap logging for this user only (has no effect if these are already enabled globally).<br />
  • trunk/src/com/bowman/cardserv/SimpleUserManager.java

    r172 r173  
    8080    } catch (ConfigException e) {}
    8181
     82    int EcmRate = -1;
     83    try {
     84      EcmRate = xml.getIntValue("ecm-rate");
     85    } catch (ConfigException e) {}
     86
    8287    int maxConnections = xml.getIntValue("max-connections", -1);
    8388
     
    8893
    8994    UserEntry user = new UserEntry(xml.getStringValue("name"), xml.getStringValue("password"), ipMask, emailAddr,
    90         maxConnections, enabled, admin, exclude, startDate, expirationDate, debug);
     95        maxConnections, enabled, admin, exclude, startDate, expirationDate, EcmRate, debug);
    9196
    9297    try {
     
    249254
    250255  public int getAllowedEcmRate(String user) {
    251     return -1; // return minimum interval between ecm in seconds, -1 for no limit
     256    UserEntry entry = getUser(user);
     257    if(entry == null) return -1; // return minimum interval between ecm in seconds, -1 for no limit
     258    else return entry.EcmRate;
    252259  }
    253260
     
    258265    String email, displayName;
    259266    String startDate, expirationDate;
    260     int maxConnections;
     267    int maxConnections, EcmRate;
    261268    boolean enabled, admin, exclude, debug;
    262269    Set profiles = new HashSet();
    263270
    264271    public UserEntry(String name, String password, String ipMask, String email, int maxConnections, boolean enabled,
    265                      boolean admin, boolean exclude, String startDate, String expirationDate, boolean debug)
     272                     boolean admin, boolean exclude, String startDate, String expirationDate, int EcmRate, boolean debug)
    266273    {
    267274      this.name = name;
     
    276283      this.startDate = startDate;
    277284      this.expirationDate = expirationDate;
     285      this.EcmRate = EcmRate;
    278286      this.debug = debug;
    279287    }
Note: See TracChangeset for help on using the changeset viewer.