Changeset - 2aeaf6367929
[Not reviewed]
default
0 7 0
Mads Kiilerich - 11 years ago 2015-05-13 01:27:50
madski@unity3d.com
spelling: more consistent casing of 'IP'
7 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
docs/installation_win_old.rst
Show inline comments
 
@@ -208,13 +208,13 @@ You have to use the same Visual Studio 2
 
if you closed it reopen it following the same commands (including the
 
"activate" one). When ready, just type::
 

	
 
  cd C:\Kallithea\Bin
 
  paster make-config Kallithea production.ini
 

	
 
Then, you must edit production.ini to fit your needs (ip address, ip
 
Then, you must edit production.ini to fit your needs (network address and
 
port, mail settings, database, whatever). I recommend using NotePad++
 
(free) or similar text editor, as it handles well the EndOfLine
 
character differences between Unix and Windows
 
(http://notepad-plus-plus.org/)
 

	
 
For the sake of simplicity lets run it with the default settings. After
kallithea/controllers/admin/users.py
Show inline comments
 
@@ -496,11 +496,11 @@ class UsersController(BaseController):
 
        """DELETE /user_ips_delete/id: Delete an existing item"""
 
        # url('user_ips_delete', id=ID, method='delete')
 
        ip_id = request.POST.get('del_ip_id')
 
        user_model = UserModel()
 
        user_model.delete_extra_ip(id, ip_id)
 
        Session().commit()
 
        h.flash(_("Removed ip address from user whitelist"), category='success')
 
        h.flash(_("Removed IP address from user whitelist"), category='success')
 

	
 
        if 'default_user' in request.POST:
 
            return redirect(url('admin_permissions_ips'))
 
        return redirect(url('edit_user_ips', id=id))
kallithea/lib/recaptcha.py
Show inline comments
 
@@ -52,13 +52,13 @@ def submit(recaptcha_challenge_field, re
 
    Submits a reCAPTCHA request for verification. Returns RecaptchaResponse
 
    for the request
 

	
 
    recaptcha_challenge_field -- The value of recaptcha_challenge_field from the form
 
    recaptcha_response_field -- The value of recaptcha_response_field from the form
 
    private_key -- your reCAPTCHA private key
 
    remoteip -- the user's ip address
 
    remoteip -- the user's IP address
 
    """
 

	
 
    if not (recaptcha_response_field and recaptcha_challenge_field and
 
                len(recaptcha_response_field) and len(
 
            recaptcha_challenge_field)):
 
        return RecaptchaResponse(is_valid=False,
kallithea/lib/utils.py
Show inline comments
 
@@ -158,13 +158,13 @@ def action_logger(user, action, repo, ip
 
    :param user: user that made this action, can be a unique username string or
 
        object containing user_id attribute
 
    :param action: action to log, should be on of predefined unique actions for
 
        easy translations
 
    :param repo: string name of repository or object containing repo_id,
 
        that action was made on
 
    :param ipaddr: optional ip address from what the action was made
 
    :param ipaddr: optional IP address from what the action was made
 
    :param sa: optional sqlalchemy session
 

	
 
    """
 

	
 
    if not sa:
 
        sa = meta.Session()
kallithea/model/user.py
Show inline comments
 
@@ -444,13 +444,13 @@ class UserModel(BaseModel):
 
        obj = UserEmailMap.query().get(email_id)
 
        if obj:
 
            self.sa.delete(obj)
 

	
 
    def add_extra_ip(self, user, ip):
 
        """
 
        Adds ip address to UserIpMap
 
        Adds IP address to UserIpMap
 

	
 
        :param user:
 
        :param ip:
 
        """
 
        from kallithea.model import forms
 
        form = forms.UserExtraIpForm()()
 
@@ -462,13 +462,13 @@ class UserModel(BaseModel):
 
        obj.ip_addr = data['ip']
 
        self.sa.add(obj)
 
        return obj
 

	
 
    def delete_extra_ip(self, user, ip_id):
 
        """
 
        Removes ip address from UserIpMap
 
        Removes IP address from UserIpMap
 

	
 
        :param user:
 
        :param ip_id:
 
        """
 
        user = self._get_user(user)
 
        obj = UserIpMap.query().get(ip_id)
kallithea/templates/admin/permissions/permissions_ips.html
Show inline comments
 
@@ -7,13 +7,13 @@
 
              <td><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
 
              <td>
 
                ${h.form(url('edit_user_ips', id=c.user.user_id),method='delete')}
 
                    ${h.hidden('del_ip_id',ip.ip_id)}
 
                    ${h.hidden('default_user', 'True')}
 
                    <i class="icon-minus-circled" style="color:#FF4444"></i> ${h.submit('remove_',_('delete'),id="remove_ip_%s" % ip.ip_id,
 
                    class_="action_button", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")}
 
                    class_="action_button", onclick="return confirm('"+_('Confirm to delete this IP address: %s') % ip.ip_addr+"');")}
 
                ${h.end_form()}
 
              </td>
 
          </tr>
 
        %endfor
 
       %else:
 
        <tr><td><div class="ip">${_('All IP addresses are allowed.')}</div></td></tr>
 
@@ -24,13 +24,13 @@
 
${h.form(url('edit_user_ips', id=c.user.user_id),method='put')}
 
    <div class="form">
 
        <!-- fields -->
 
        <div class="fields">
 
             <div class="field">
 
                <div class="label">
 
                    <label for="new_ip">${_('New ip address')}:</label>
 
                    <label for="new_ip">${_('New IP address')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.hidden('default_user', 'True')}
 
                    ${h.text('new_ip', class_='medium')}
 
                </div>
 
             </div>
kallithea/templates/admin/users/user_edit_ips.html
Show inline comments
 
@@ -17,13 +17,13 @@
 
            <td><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
 
            <td>
 
                ${h.form(url('edit_user_ips', id=c.user.user_id),method='delete')}
 
                    ${h.hidden('del_ip_id',ip.ip_id)}
 
                    <i class="icon-minus-circled" style="color:#FF4444"></i>
 
                    ${h.submit('remove_',_('delete'),id="remove_ip_%s" % ip.ip_id,
 
                    class_="action_button", onclick="return  confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")}
 
                    class_="action_button", onclick="return  confirm('"+_('Confirm to delete this IP address: %s') % ip.ip_addr+"');")}
 
                ${h.end_form()}
 
            </td>
 
          </tr>
 
        %endfor
 
    %endif
 
    %if not c.default_user_ip_map and not c.user_ip_map:
 
@@ -36,13 +36,13 @@
 
    ${h.form(url('edit_user_ips', id=c.user.user_id),method='put')}
 
    <div class="form">
 
        <!-- fields -->
 
        <div class="fields">
 
             <div class="field">
 
                <div class="label">
 
                    <label for="new_ip">${_('New ip address')}:</label>
 
                    <label for="new_ip">${_('New IP address')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('new_ip', class_='medium')}
 
                </div>
 
             </div>
 
            <div class="buttons">
0 comments (0 inline, 0 general)