$("#sidebar-content [redback-permissions]").each(function(element){
$(this).hide();
});
-
+ $.log("hideElementWithKarma");
}
checkSecurityLinks=function(){
+ $.log("checkSecurityLinks");
var user = userLogged();
$.log("checkSecurityLinks, user:"+user);
$.ajax("restServices/redbackServices/userService/isAdminUserExists", {
type: "GET",
dataType: 'json',
+ async: false,
success: function(data) {
var adminExists = JSON.parse(data);
if (adminExists == false) {
} else {
$("#create-admin-link").hide();
}
+ $.log("adminExists:"+adminExists);
}
});
}
$('#topbar-menu-container').html($("#topbar-menu"));
$('#sidebar-content').html($("#main-menu"));
+
+
checkCreateAdminLink();
hideElementWithKarma();
checkSecurityLinks();
this.availableLayouts = window.managedRepositoryTypes;
save=function(){
+ $.log("repositories.js#save");
var valid = $("#main-content #managed-repository-edit-form").valid();
if (valid==false) {
return;
</li>
<li id="login-link" style="display: none">
<a href="#" onclick="loginBox();" id="login-link-a">
- <span class="label success">${login}</span>
+ <span class="label success">${$.i18n.prop('login')}</span>
</a>
</li>
<li id="change-password-link" style="">
</li>
<li id="register-link" style="display: none">
<a href="#" onclick="registerBox();" id="register-link-a">
- <span class="label notice">${register}</span>
+ <span class="label notice">${$.i18n.prop('register')}</span>
</a>
</li>
</ul>
userLogged=function() {
// call restServices/redbackServices/loginService/isLogged to know
// if a session exists and check the cookie
+ $.log("userLogged");
var userLogged = true;
$.ajax("restServices/redbackServices/loginService/isLogged", {
type: "GET",
* validate the register form and call REST service
*/
register=function(){
+ $.log("register.js#register");
var valid = $("#user-register-form").valid();
if (!valid) {
return;
</form>
</div>
<div class="modal-footer" id="modal-login-footer">
- <button class="btn primary" onclick="return login();" id="modal-login-ok">${login}</button>
+ <button class="btn primary" onclick="login();" id="modal-login-ok">${$.i18n.prop('login)}</button>
</div>
</div>
</form>
</div>
<div class="modal-footer" id="modal-password-change-footer">
- <button class="btn primary" onclick="return" id="modal-change-password-ok">${register}</button>
+ <button class="btn primary" onclick="return" id="modal-change-password-ok">${$.i18n.prop('register')}</button>
</div>
</div>
\ No newline at end of file
</form>
</div>
<div class="modal-footer" id="modal-register-footer">
- <button class="btn primary" onclick="return register();" id="modal-register-ok">${register}</button>
+ <button class="btn primary" onclick="return register();" id="modal-register-ok">${$.i18n.prop('register')}</button>
</div>
</div>
\ No newline at end of file
};
this.createAdmin = function() {
+ $.log("user.js#createAdmin");
var valid = $("#user-create").valid();
$.log("create admin");
if (!valid) {
* open a modal box for login
*/
loginBox=function(){
+ $.log("loginBox");
screenChange();
if (window.modalLoginWindow==null) {
window.modalLoginWindow = $("#modal-login").modal({backdrop:'static',show:false});
});
$("#modal-login").delegate("#modal-login-ok", "click keydown keypress", function(e) {
e.preventDefault();
+ $.log("loginBox before login");
login();
});
$("#modal-login").focus();
* validate login box before ajax call
*/
login=function(){
+ $.log("user.js#login");
$("#modal-login-err-message").html("");
screenChange();
var valid = $("#user-login-form").valid();
})
$("#modal-user-edit #modal-user-edit-ok").on( "click keydown keypress", function(e) {
e.preventDefault();
+ $.log("user.js#editUserDetailsBox");
var valid = $("#user-edit-form").valid();
if (!valid) {
return;
* @param registration are we in registration mode ? if yes the user will be logged
*/
changePassword=function(previousPassword,registration,user){
+ $.log("user.js#changePassword");
var valid = $("#password-change-form").valid();
if (valid==false) {
return;
});
$("#main-content #user-create").delegate("#user-create-form-save-button", "click keydown", function(e) {
e.preventDefault();
+ $.log("users.js#editUserBox");
var valid = $("#user-create").valid();
if (!valid) {
return;