Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure AJXP_ADMIN_LOGIN is not taken for a groupAdmin
Fix #278 in javascript
  • Loading branch information
cdujeu committed Sep 2, 2013
1 parent 125062f commit 6ee7460
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
Expand Up @@ -252,6 +252,9 @@ function switchAction($action, $httpVars, $fileVars){
}
$mess = ConfService::getMessages();
$currentUserIsGroupAdmin = (AuthService::getLoggedUser() != null && AuthService::getLoggedUser()->getGroupPath() != "/");
if($currentUserIsGroupAdmin && ConfService::getAuthDriverImpl()->isAjxpAdmin(AuthService::getLoggedUser()->getId())){
$currentUserIsGroupAdmin = false;
}

switch($action)
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

Expand Up @@ -205,11 +205,21 @@ Class.create("AjxpDataModel", {
if(this._contextNode && this._contextNode == ajxpDataNode && this._currentRep == ajxpDataNode.getPath() && !forceEvent){
return; // No changes
}
this._contextNode = ajxpDataNode;
if(!ajxpDataNode) return;
if(this._contextNodeReplacedObserver && this._contextNode){
this._contextNode.stopObserving("node_replaced", this._contextNodeReplacedObserver);
}
this._contextNode = ajxpDataNode;
this._currentRep = ajxpDataNode.getPath();
this.publish("context_changed", ajxpDataNode);
if(!this._contextNodeReplacedObserver) this._contextNodeReplacedObserver = this.contextNodeReplaced.bind(this);
ajxpDataNode.observe("node_replaced", this._contextNodeReplacedObserver);
},

contextNodeReplaced: function(newNode){
this.setContextNode(newNode);
},

/**
*
*/
Expand Down
15 changes: 11 additions & 4 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.AjxpNode.js
Expand Up @@ -166,6 +166,7 @@ Class.create("AjxpNode", {
this._isLeaf = ajxpNode._isLeaf;
if(ajxpNode.getPath() && this._path != ajxpNode.getPath()){
this._path = ajxpNode.getPath();
var pathChanged = true;
}
if(ajxpNode._label){
this._label = ajxpNode._label;
Expand All @@ -179,9 +180,6 @@ Class.create("AjxpNode", {
this._isRoot = ajxpNode._isRoot;
this._isLoaded = ajxpNode._isLoaded;
this.fake = ajxpNode.fake;
ajxpNode.getChildren().each(function(child){
this.addChild(child);
}.bind(this) );
var meta = ajxpNode.getMetadata();
if(metaMerge == "override") this._metadata = $H();
meta.each(function(pair){
Expand All @@ -194,7 +192,16 @@ Class.create("AjxpNode", {
this._metadata.set(pair.key, pair.value);
}
}.bind(this) );
this.notify("node_replaced", this);
if(pathChanged && !this._isLeaf && this.getChildren().length){
window.setTimeout(function(){
this.reload(this._iNodeProvider);
}.bind(this), 100);
return;
}
ajxpNode.getChildren().each(function(child){
this.addChild(child);
}.bind(this) );
this.notify("node_replaced", this);
},
/**
* Finds a child node by its path
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer_boot.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 6ee7460

Please sign in to comment.