- removed functions isAdmin(), isContributor()
- some more changes needed due to new role-scheme
This commit is contained in:
parent
7a85b9ffef
commit
e395ff7767
1 changed files with 9 additions and 23 deletions
|
@ -1,24 +1,3 @@
|
||||||
/**
|
|
||||||
* function returns true if the member has admin-status
|
|
||||||
*/
|
|
||||||
|
|
||||||
function isAdmin() {
|
|
||||||
if (parseInt(this.level,10) == 2)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function returns true if the member has contributor-status
|
|
||||||
*/
|
|
||||||
|
|
||||||
function isContributor() {
|
|
||||||
if (parseInt(this.level,10) == 1)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function updates a membership
|
* function updates a membership
|
||||||
* @param Int Integer representing role of user
|
* @param Int Integer representing role of user
|
||||||
|
@ -31,10 +10,17 @@ function isContributor() {
|
||||||
function updateMember(lvl,modifier) {
|
function updateMember(lvl,modifier) {
|
||||||
var result = new Object();
|
var result = new Object();
|
||||||
if (!isNaN(lvl)) {
|
if (!isNaN(lvl)) {
|
||||||
this.level = lvl;
|
if (lvl == 1)
|
||||||
|
this.level = getContributorLvl();
|
||||||
|
else if (lvl == 2)
|
||||||
|
this.level = getContentManagerLvl();
|
||||||
|
else if (lvl == 3)
|
||||||
|
this.level = getAdminLvl();
|
||||||
|
else
|
||||||
|
this.level = 0;
|
||||||
this.modifytime = new Date();
|
this.modifytime = new Date();
|
||||||
this.modifier = modifier;
|
this.modifier = modifier;
|
||||||
this.sendConfirmationMail(modifier.email);
|
// FIXME: disabled for testing: this.sendConfirmationMail(modifier.email);
|
||||||
result.message = "Changes were saved successfully!";
|
result.message = "Changes were saved successfully!";
|
||||||
result.error = false;
|
result.error = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue