##// END OF EJS Templates
auth: don't break hashing in case of user with empty password....
auth: don't break hashing in case of user with empty password. In some cases such as LDAP user created via external scripts users might set the passwords to empty. The hashing uses the md5(password_hash) to store reference to detect password changes and forbid using the same password. In case of pure LDAP users this is not valid, and we shouldn't raise Errors in such case. This change makes it work for empty passwords now.

File last commit:

r2105:4ad1a937 default
r2203:8a18c3c3 default
Show More
settings_hooks.mako
93 lines | 3.2 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 <div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_('Built in Mercurial hooks - read only')}</h3>
</div>
<div class="panel-body">
<div class="form">
<div class="fields">
% for hook in c.hooks:
<div class="field">
<div class="label label">
<label for="${hook.ui_key}">${hook.ui_key}</label>
</div>
<div class="input" >
${h.text(hook.ui_key,hook.ui_value,size=59,readonly="readonly")}
</div>
</div>
% endfor
</div>
<span class="help-block">${_('Hooks can be used to trigger actions on certain events such as push / pull. They can trigger Python functions or external applications.')}</span>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_('Custom hooks')}</h3>
</div>
<div class="panel-body">
% if c.visual.allow_custom_hooks_settings:
forms: unified usage of h.secure_form. Make sure we ALWAYS pass in...
r2105 ${h.secure_form(h.url('admin_settings_hooks'), request=request)}
templating: use .mako as extensions for template files.
r1282 <div class="form">
<div class="fields">
% for hook in c.custom_hooks:
<div class="field" id="${'id%s' % hook.ui_id }">
<div class="label label">
<label for="${hook.ui_key}">${hook.ui_key}</label>
</div>
<div class="input" >
${h.hidden('hook_ui_key',hook.ui_key)}
${h.hidden('hook_ui_value',hook.ui_value)}
${h.text('hook_ui_value_new',hook.ui_value,size=59)}
<span class="btn btn-danger"
onclick="ajaxActionHook(${hook.ui_id},'${'id%s' % hook.ui_id }')">
${_('Delete')}
</span>
</div>
</div>
% endfor
<div class="field customhooks">
<div class="label">
<div class="input-wrapper">
${h.text('new_hook_ui_key',size=30)}
</div>
</div>
<div class="input">
${h.text('new_hook_ui_value',size=59)}
</div>
</div>
<div class="buttons">
${h.submit('save',_('Save'),class_="btn")}
</div>
</div>
</div>
${h.end_form()}
%else:
DISABLED
% endif
</div>
</div>
<script type="text/javascript">
function ajaxActionHook(hook_id,field_id) {
var sUrl = "${h.url('admin_settings_hooks')}";
var callback = function (o) {
var elem = $("#"+field_id);
elem.remove();
};
var postData = {
'_method': 'delete',
'hook_id': hook_id,
'csrf_token': CSRF_TOKEN
};
var request = $.post(sUrl, postData)
.done(callback)
.fail(function (data, textStatus, errorThrown) {
alert("Error while deleting hooks.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(this)[0].url));
});
};
</script>