Commits

Zhang Huangbin committed ca46cdd

Code cleanup.

  • Participants
  • Parent commits f7e47c5

Comments (0)

Files changed (4)

File controllers/dbmail_mysql/alias.py

     @decorators.csrf_protected
     @decorators.require_login
     def POST(self, domain):
-        i = web.input(_unicode=False, username=[])
+        i = web.input(_unicode=False, mail=[])
 
         self.domain = str(domain)
         if not iredutils.isDomain(self.domain):
             raise web.seeother('/domains?msg=INVALID_DOMAIN_NAME')
 
-        self.mails = i.get('username', [])
+        self.mails = i.get('mail', [])
         self.action = i.get('action', None)
         msg = i.get('msg', None)
 

File controllers/dbmail_mysql/user.py

     @decorators.csrf_protected
     @decorators.require_login
     def POST(self, domain):
-        i = web.input(_unicode=False, username=[])
+        i = web.input(_unicode=False, mail=[])
 
         self.domain = str(domain)
 
             raise web.seeother('/domains?msg=INVALID_DOMAIN_NAME')
 
         self.mails = [str(v)
-                      for v in i.get('username', [])
+                      for v in i.get('mail', [])
                       if iredutils.isEmail(v)
                       and str(v).endswith('@' + self.domain)
                      ]
         if session.get('enablePolicyd'):
             # Get sender/recipient throttle data from policyd database.
             throttleLib = throttle.Throttle()
-            result_throttle = throttleLib.list(sender=mail, recipient=mail)
+            result_throttle = throttleLib.getThrottling(sender=self.mail, recipient=self.mail)
             if result_throttle[0] is True:
                 throttleOfSender = result_throttle[1]
                 throttleOfRecipient = result_throttle[2]

File templates/default/dbmail_mysql/alias/list.html

             {% set address = r.alias |e %}
             {% set name = r.name |e %}
             <tr>
-                <td class="checkbox"><input type="checkbox" name="username" value="{{ address }}" /></td>
+                <td class="checkbox"><input type="checkbox" name="mail" value="{{ address }}" /></td>
                 <td>
                     <a href="{{ctx.homepath}}/profile/alias/general/{{address}}"><img src="{{ctx.homepath}}/static/{{skin}}/images/action_edit.png" class="fr-space" title="{{ _('Edit account profile') }}" /></a>
                     {#{{ set_account_status_img(r.active) }}#}

File templates/default/dbmail_mysql/user/list.html

             {% for r in users %}
                 {% set username = r.userid |e %}
                 <tr>
-                    <td class="checkbox"><input type="checkbox" name="username" value="{{username}}" /></td>
+                    <td class="checkbox"><input type="checkbox" name="mail" value="{{username}}" /></td>
                     <td class="vcenter">
                         <a href="{{ctx.homepath}}/profile/user/general/{{username}}"><img src="{{ctx.homepath}}/static/{{skin}}/images/action_edit.png" title="{{ _('Edit account profile') }}" class="fr-space"/></a>
                         {{ set_account_activity_img('sent', 'user', username) }}