* Fixed reference to parent site in Archive
* Fixed _children.filter in Archive * Added missing permission checks * Modified global defineConstants() method to return the getter function instead of automatically defining it with given argument * Added HopObject.macro_macro() method to display userland macro code * Removed colorpicker (will be replaced by third-party library) * Removed obsolete global constants and functions * Overhauled and tested global userland macros like story_macro(), image_macro() etc. * Implemented global list_macro() to replace any special listFoobar_macro() methods * Moved global autoLogin() method into User prototype * Overhauled global randomize_macro() * Renamed global evalURL() method to validateUrl() as well as evalEmail() to validateEmail() * Re-added accidentally removed subskins to Members.skin * Fixed some skin names which were changed recently * Remove delete_action() from Membership * Fixed foreign key of images collection in Membership * Removed global username_macro() and replaced it with appropriate membership macros * Moved contents of systemscripts.skin into javascript.skin in Root prototype * Removed main_css_action(), main_js_action() and sitecounter_macro() methods from Root * Added accessname to sites collection in Root * Upgraded jQuery to version 1.2.1 * Replaced call for global history_macro() with corresponding list_macro() call * Renamed "public" collection of Stories prototype to "featured" * Moved a lot of styles from Root's style.skin to the one in Site * Added comments collection to Site * Moved embed.skin as subskin #embed into Site.skin * Fixed some minor issues in Story.js (removed check for creator before setting the story's mode) * Defined cookie names as constants of User which can be overriden via app.properties userCookie and hashCookie * Moved a lot of code into compatibility module
This commit is contained in:
parent
ded7f5fcea
commit
df9017ab77
38 changed files with 1154 additions and 1736 deletions
|
@ -62,9 +62,10 @@ Members.prototype.link_macro = function(param, action, text) {
|
|||
|
||||
Members.prototype.main_action = function() {
|
||||
res.data.title = gettext("Members of {0}", this._parent.title);
|
||||
res.data.list = renderList(this, "mgrlistitem", 10, req.data.page);
|
||||
res.data.pager = renderPageNavigation(this, this.href(req.action), 10,
|
||||
req.data.page);
|
||||
res.data.list = renderList(this, "Membership#members",
|
||||
10, req.queryParams.page);
|
||||
res.data.pager = renderPageNavigation(this, this.href(req.action),
|
||||
10, req.queryParams.page);
|
||||
res.data.body = this.renderSkinAsString("Members#main");
|
||||
res.handlers.site.renderSkin("page");
|
||||
return;
|
||||
|
@ -136,8 +137,8 @@ Members.prototype.logout_action = function() {
|
|||
session.user.name);
|
||||
session.logout();
|
||||
delete session.data.referrer;
|
||||
res.setCookie("avUsr", "");
|
||||
res.setCookie("avPw", "");
|
||||
res.setCookie(User.COOKIE, String.EMPTY);
|
||||
res.setCookie(User.HASHCOOKIE, String.EMPTY);
|
||||
}
|
||||
res.redirect(this._parent.href());
|
||||
return;
|
||||
|
|
|
@ -11,6 +11,128 @@
|
|||
<% response.list %>
|
||||
<% response.pager %>
|
||||
|
||||
<% #login %>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#submit").click(function() {
|
||||
var token = "<% session.token %>";
|
||||
var name = $("#name").val();
|
||||
var password = $("#password").val();
|
||||
$("input:password").val("");
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: '<% members.href salt.js %>',
|
||||
data: "user=" + encodeURIComponent(name),
|
||||
dataType: "json",
|
||||
success: function(salt) {
|
||||
$("#digest").val($.md5($.md5(password + salt) + token));
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<form id="login" method="post" action="<% response.action %>">
|
||||
<input type="hidden" name="digest" id="digest" />
|
||||
<table border="0" cellspacing="0" cellpadding="3">
|
||||
<tr>
|
||||
<td class="small">Username:</td>
|
||||
<td nowrap="nowrap">
|
||||
<input type="text" name="name" id="name" size="15" tabindex="1"
|
||||
value="<% request.name %>" />
|
||||
</td>
|
||||
<td rowspan="4" nowrap="nowrap"> </td>
|
||||
<td class="small">
|
||||
<% members.link register "Not registered yet" %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small" nowrap="nowrap">Password:</td>
|
||||
<td>
|
||||
<input type="password" name="password" id="password" size="15" tabindex="2" />
|
||||
</td>
|
||||
<td class="small">
|
||||
<% members.link sendpwd "Forgot your password?" %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"> </td>
|
||||
<td colspan="2" class="small">
|
||||
<input type="checkbox" id="remember" name="remember" tabindex="3"
|
||||
<% if <% request.remember %> is "on" then 'checked="checked"' %> />
|
||||
<label for="remember">Remember me</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"> </td>
|
||||
<td colspan="2"><br />
|
||||
<button type="submit" id="submit" name="login" value="1"
|
||||
tabindex="4">login</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<% #register %>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#submit").click(function() {
|
||||
var token = "<% session.token %>";
|
||||
var password = $("#password").val();
|
||||
var passwordConfirm = $("#passwordConfirm").val();
|
||||
$("input:password").val("");
|
||||
// Check both passwords but let the server do the error handling
|
||||
if (!password || !passwordConfirm) {
|
||||
return true;
|
||||
} else if (password !== passwordConfirm) {
|
||||
$("#password1").val(0);
|
||||
$("#password2").val(1);
|
||||
return true;
|
||||
}
|
||||
var hash = $.md5(password + token);
|
||||
$("#hash").val(hash);
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<form method="post" action="<% response.action %>">
|
||||
<input type="hidden" name="hash" id="hash" />
|
||||
<table border="0" cellspacing="0" cellpadding="3">
|
||||
<tr>
|
||||
<td class="small" nowrap="nowrap">Username:</td>
|
||||
<td nowrap="nowrap">
|
||||
<input type="text" name="name" value="<% request.name %>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small" valign="top" nowrap="nowrap">e-mail:</td>
|
||||
<td>
|
||||
<input type="text" name="email" value="<% request.email %>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small" nowrap="nowrap">Password:</td>
|
||||
<td nowrap="nowrap">
|
||||
<input type="password" name="password" id="password" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small" nowrap="nowrap">Confirm password:</td>
|
||||
<td nowrap="nowrap">
|
||||
<input type="password" name="passwordConfirm" id="passwordConfirm" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"> </td>
|
||||
<td nowrap="nowrap"><br />
|
||||
<button type="submit" id="submit" name="register"
|
||||
value="register">Register</button>
|
||||
<button type="submit" name="cancel" value="cancel">Cancel</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<% #add %>
|
||||
<form method="post" action="<% response.action %>">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue