mirror of
https://github.com/haiwen/seahub.git
synced 2025-04-28 03:10:45 +00:00
Merge branch '6.3'
This commit is contained in:
commit
8e1d52ce10
@ -24,7 +24,7 @@ before_install:
|
||||
|
||||
# install seahub requirements
|
||||
install:
|
||||
- pip install -r requirements.txt --allow-all-external --allow-unverified PIL
|
||||
- pip install -r dev-requirements.txt --allow-all-external --allow-unverified PIL
|
||||
- pip install -r test-requirements.txt
|
||||
|
||||
before_scipt: true
|
||||
|
@ -5,5 +5,5 @@ transifex-client
|
||||
raven==5.0.0
|
||||
|
||||
mysqlclient==1.3.12
|
||||
pycrypto==2.6.1
|
||||
pycryptodome==3.7.2
|
||||
psd-tools==1.4
|
||||
|
@ -3958,18 +3958,22 @@ button.sf-dropdown-toggle:focus {
|
||||
}
|
||||
/*random password */
|
||||
#share-popup .passwd-wrapper,
|
||||
#update-webdav-passwd .passwd-wrapper,
|
||||
#add-user-form .passwd-wrapper {
|
||||
position:relative;
|
||||
width:268px;
|
||||
}
|
||||
#share-popup .passwd,
|
||||
#update-webdav-passwd .passwd,
|
||||
#add-user-form .passwd {
|
||||
width:188px;
|
||||
padding-right:75px;
|
||||
}
|
||||
#share-popup .generate-random-password,
|
||||
#add-user-form .generate-random-password,
|
||||
#update-webdav-passwd .generate-random-password,
|
||||
#share-popup .show-or-hide-password,
|
||||
#update-webdav-passwd .show-or-hide-password,
|
||||
#add-user-form .show-or-hide-password {
|
||||
position:absolute;
|
||||
top:4px;
|
||||
@ -3981,17 +3985,21 @@ button.sf-dropdown-toggle:focus {
|
||||
opacity:0.65;
|
||||
}
|
||||
#share-popup .show-or-hide-password,
|
||||
#update-webdav-passwd .show-or-hide-password,
|
||||
#add-user-form .show-or-hide-password {
|
||||
right:36px;
|
||||
background:#fff;
|
||||
}
|
||||
#share-popup .generate-random-password,
|
||||
#update-webdav-passwd .generate-random-password,
|
||||
#add-user-form .generate-random-password {
|
||||
background:#ccc;
|
||||
}
|
||||
#share-popup .generate-random-password:hover,
|
||||
#add-user-form .generate-random-password:hover,
|
||||
#update-webdav-passwd .show-or-hide-password:hover,
|
||||
#share-popup .show-or-hide-password:hover,
|
||||
#update-webdav-passwd .show-or-hide-password:hover,
|
||||
#add-user-form .show-or-hide-password:hover {
|
||||
opacity:1;
|
||||
}
|
||||
|
@ -13,12 +13,10 @@ openpyxl==2.3.0
|
||||
pytz==2015.7
|
||||
django-formtools==2.1
|
||||
qrcode==5.3
|
||||
requests==2.18.4
|
||||
requests==2.20.1
|
||||
requests_oauthlib==0.8.0
|
||||
django-simple-captcha==0.5.6
|
||||
gunicorn==19.8.1
|
||||
django-webpack-loader==0.6.0
|
||||
git+git://github.com/haiwen/python-cas.git@ffc49235fd7cc32c4fdda5acfa3707e1405881df#egg=python_cas
|
||||
|
||||
pycrypto==2.6.1
|
||||
futures==3.2.0
|
||||
|
@ -17,6 +17,10 @@
|
||||
<li class="tab"><a href="#update-user-passwd">{% trans "Password" %}</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% if ENABLE_WEBDAV_SECRET %}
|
||||
<li class="tab"><a href="#update-webdav-passwd">{% trans "WebDav Password" %}</a></li>
|
||||
{% endif %}
|
||||
|
||||
<li class="tab"><a href="#lang-setting">{% trans "Language" %}</a></li>
|
||||
|
||||
{% if two_factor_auth_enabled %}
|
||||
@ -81,12 +85,15 @@
|
||||
|
||||
{% if ENABLE_WEBDAV_SECRET %}
|
||||
<div id="update-webdav-passwd" class="setting-item">
|
||||
<h3>WebDav {% trans "Password" %}</h3>
|
||||
<label>{% trans "Password" %}</label><input type="text" name="password" value="{{ webdav_passwd }}" class="input" />
|
||||
<br/>
|
||||
<a href="#" class="update sf-btn-link">{% trans "Update" %}</a>
|
||||
<a href="#" class="delete sf-btn-link">{% trans "Delete" %}</a>
|
||||
|
||||
<h3>{% trans "WebDav Password" %}</h3>
|
||||
<label>{% trans "Password" %}</label>
|
||||
<div class="passwd-wrapper">
|
||||
<input type="password" name="password" value="{{ webdav_passwd }}" class="passwd input" />
|
||||
<span title="{% trans "Show" %}" class="icon-eye show-or-hide-password cspt" role="button" tabindex="0" aria-label="{% trans "Show" %}"></span>
|
||||
<span title="{% trans "Generate a random password" %}" class="icon-magic generate-random-password cspt" role="button" tabindex="0" aria-label="{% trans "Generate a random password" %}"></span>
|
||||
</div>
|
||||
<button class="update submit">{% trans "Update" %}</button>
|
||||
<button class="delete submit">{% trans "Delete" %}</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@ -246,29 +253,65 @@ $("#list-in-address-book input[type='checkbox']").on('change', function() {
|
||||
{% endif %}
|
||||
|
||||
{% if ENABLE_WEBDAV_SECRET %}
|
||||
function aj_update_webdav_secret(passwd) {
|
||||
function update_webdav_secret(passwd) {
|
||||
$.ajax({
|
||||
url: "{% url 'api-v2.1-webdav-secret' %}",
|
||||
type: 'PUT',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
beforeSend: prepareCSRFToken,
|
||||
data: "secret=" + passwd,
|
||||
success: function(data) {
|
||||
data: {'secret': passwd},
|
||||
success: function() {
|
||||
feedback("{% trans "Success" %}", 'success');
|
||||
},
|
||||
error: ajaxErrorHandler
|
||||
});
|
||||
}
|
||||
|
||||
$("#update-webdav-passwd a.update").click(function() {
|
||||
var passwd = $("#update-webdav-passwd input[type='text']").val();
|
||||
aj_update_webdav_secret(passwd);
|
||||
$("#update-webdav-passwd .update").click(function() {
|
||||
var passwd = $("#update-webdav-passwd [name='password']").val();
|
||||
update_webdav_secret(passwd);
|
||||
});
|
||||
|
||||
$("#update-webdav-passwd a.delete").click(function() {
|
||||
$("#update-webdav-passwd input[type='text']").val('');
|
||||
aj_update_webdav_secret('');
|
||||
$("#update-webdav-passwd .delete").click(function() {
|
||||
$("#update-webdav-passwd [name='password']").val('');
|
||||
update_webdav_secret('');
|
||||
});
|
||||
|
||||
$('#update-webdav-passwd .show-or-hide-password').click(function() {
|
||||
var $icon = $(this),
|
||||
$password = $('#update-webdav-passwd [name="password"]');
|
||||
|
||||
$icon.toggleClass('icon-eye icon-eye-slash');
|
||||
if ($icon.hasClass('icon-eye')) {
|
||||
$icon.attr({
|
||||
'title': '{% trans "Show" %}',
|
||||
'aria-label': '{% trans "Show" %}'
|
||||
});
|
||||
$password.attr('type', 'password');
|
||||
} else {
|
||||
$icon.attr({
|
||||
'title': '{% trans "Hide" %}',
|
||||
'aria-label': '{% trans "Hide" %}'
|
||||
});
|
||||
$password.attr('type', 'text');
|
||||
}
|
||||
});
|
||||
|
||||
$('#update-webdav-passwd .generate-random-password').click(function() {
|
||||
var random_password_length = 8;
|
||||
var random_password = '';
|
||||
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for (var i = 0; i < random_password_length; i++) {
|
||||
random_password += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
}
|
||||
|
||||
$('#update-webdav-passwd [name="password"]').attr('type', 'text').val(random_password);
|
||||
$('#update-webdav-passwd .show-or-hide-password')
|
||||
.attr({
|
||||
'title': '{% trans "Hide" %}',
|
||||
'aria-label': '{% trans "Hide" %}'
|
||||
}).removeClass('icon-eye').addClass('icon-eye-slash');
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
|
@ -143,11 +143,14 @@
|
||||
<% if (is_pro) { %>
|
||||
{% trans "Professional Edition" %}
|
||||
<% if (with_license) { %>
|
||||
{% if LANGUAGE_CODE == 'zh-cn' %}永久授权给{% else %}{% trans "licensed to" %}{% endif %} <%- license_to %>,
|
||||
<% if (license_mode == 'life-time') { %>
|
||||
{% if LANGUAGE_CODE == 'zh-cn' %}技术支持服务至{% else %}{% trans "upgrade service expired in" %}{% endif %} <%- license_expiration %> {% if LANGUAGE_CODE == 'zh-cn' %}到期{% endif %}
|
||||
{% if LANGUAGE_CODE == 'zh-cn' %}
|
||||
永久授权给 <%- license_to %>, 技术支持服务至 <%- license_expiration %> 到期
|
||||
{% else %}
|
||||
{% trans "licensed to" %} <%- license_to %>, {% trans "upgrade service expired in" %} <%- license_expiration %>
|
||||
{% endif %}
|
||||
<% } else { %>
|
||||
{% trans "expires on" %} <%- license_expiration %>
|
||||
{% trans "licensed to" %} <%- license_to %>, {% trans "expires on" %} <%- license_expiration %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
|
@ -7,6 +7,7 @@ except ImportError:
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.encoding import force_str
|
||||
|
||||
|
||||
class AESPasswordDecodeError(Exception):
|
||||
@ -35,9 +36,10 @@ class AESPasswordHasher:
|
||||
if not secret:
|
||||
secret = settings.SECRET_KEY[:BLOCK_SIZE]
|
||||
|
||||
self.cipher = AES.new(secret)
|
||||
self.cipher = AES.new(secret, AES.MODE_ECB)
|
||||
|
||||
def encode(self, password):
|
||||
password = force_str(password)
|
||||
return "%s$%s" % (self.algorithm, EncodeAES(self.cipher, password))
|
||||
|
||||
def verify(self, password, encoded):
|
||||
|
Loading…
Reference in New Issue
Block a user