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

Commit

Permalink
Core.* plugins should be appended at the beginning of active lists.
Browse files Browse the repository at this point in the history
Fix compatibility of remote logout with 6.2.X : add a forbidOverride attribute to block further merge in registry, otherwise session_login logout action will always take precedency.
  • Loading branch information
cdujeu committed Nov 28, 2015
1 parent abbec09 commit 69edd0a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
13 changes: 13 additions & 0 deletions core/src/core/classes/class.AJXP_PluginsService.php
Expand Up @@ -475,6 +475,13 @@ public function setPluginActiveInst($type, $name, $active=true, $updateInstance
if(isSet($this->activePlugins[$type.".".$name])){
unset($this->activePlugins[$type.".".$name]);
}
if($type == "core"){
$act = array_reverse($this->activePlugins);
$act[$type.".".$name] = $active;
$this->activePlugins = array_reverse($act);
}else{
$this->activePlugins[$type.".".$name] = $active;
}
$this->activePlugins[$type.".".$name] = $active;
if (isSet($updateInstance) && isSet($this->registry[$type][$name])) {
$this->registry[$type][$name] = $updateInstance;
Expand Down Expand Up @@ -749,6 +756,9 @@ protected function mergeNodes(&$original, $parentName, $uuidAttr, $childrenNodes
if ($childrenSel->length) {
if($doNotOverrideChildren) continue;
foreach ($childrenSel as $existingNode) {
if($existingNode->getAttribute("forbidOverride") == "true"){
continue;
}
// Clone as many as needed
$clone = $original->importNode($child, true);
$this->mergeChildByTagName($clone, $existingNode);
Expand Down Expand Up @@ -795,6 +805,9 @@ protected function mergeChildByTagName($new, &$old)
if ($newChild->nodeName == "post_processing" || $newChild->nodeName == "pre_processing") {
$old->appendChild($newChild->cloneNode(true));
} else {
if($found->getAttribute("forbidOverride") == "true") {
continue;
}
$this->mergeChildByTagName($newChild->cloneNode(true), $found);
}
} else {
Expand Down
8 changes: 4 additions & 4 deletions core/src/plugins/auth.basic_http/manifest.xml
Expand Up @@ -11,17 +11,17 @@
</server_settings>
<class_definition filename="plugins/auth.basic_http/class.basic_httpAuthDriver.php" classname="basic_httpAuthDriver"/>
<registry_contributions>
<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*" exclude="actions/action[@name='logout']"/>
<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*"/>
<actions>
<action name="logout" expireDefault="true">
<gui text="164" title="169" src="decrypted.png" accessKey="" hasAccessKey="false">
<gui text="164" title="169" src="decrypted.png" accessKey="" hasAccessKey="false" forbidOverride="true">
<context selection="false" dir="" recycle="false"
actionBar="true" contextMenu="false" infoPanel="false"
actionBarGroup="user" ajxpWidgets="UserWidget::logging_string">
</context>
</gui>
<rightsContext noUser="false" userLogged="only" guestLogged="show" read="false" write="false" adminOnly=""/>
<processing>
<rightsContext noUser="false" userLogged="only" guestLogged="show" read="false" write="false" adminOnly="" forbidOverride="true"/>
<processing forbidOverride="true">
<clientCallback prepareModal="false"><![CDATA[
clearRememberData();
var connexion = new Connexion();
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/auth.remote/manifest.xml
Expand Up @@ -39,7 +39,7 @@
</server_settings>
<class_definition filename="plugins/auth.remote/class.remoteAuthDriver.php" classname="remoteAuthDriver"/>
<registry_contributions>
<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*" exclude="actions/action[@name='logout']"/>
<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*"/>
<external_file filename="plugins/auth.remote/remoteAuthActions.xml" include="actions/*"/>
</registry_contributions>
</authdriver>
8 changes: 4 additions & 4 deletions core/src/plugins/auth.remote/remoteAuthActions.xml
Expand Up @@ -2,14 +2,14 @@
<registry_contributions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
<actions>
<action name="logout" expireDefault="true">
<gui text="304" title="305" src="go_back.png" iconClass="icon-home" accessKey="" hasAccessKey="false">
<gui text="304" title="305" src="go_back.png" iconClass="icon-home" accessKey="" hasAccessKey="false" forbidOverride="true">
<context selection="false" dir="" recycle="false"
actionBar="false" contextMenu="false" infoPanel="false"
ajxpWidgets="UserWidget::logging_string">
</context>
</gui>
<rightsContext noUser="false" userLogged="only" guestLogged="show" read="false" write="false" adminOnly=""/>
<processing>
<rightsContext noUser="false" userLogged="only" guestLogged="show" read="false" write="false" adminOnly="" forbidOverride="true"/>
<processing forbidOverride="true">
<clientCallback prepareModal="false"><![CDATA[
clearRememberData();
var connexion = new Connexion();
Expand All @@ -20,7 +20,7 @@
};
connexion.sendAsync();
]]></clientCallback>
<serverCallback methodName="switchAction"></serverCallback>
<serverCallback methodName="switchAction"/>
</processing>
</action>
</actions>
Expand Down
12 changes: 6 additions & 6 deletions core/src/plugins/authfront.cas/manifest.xml
Expand Up @@ -53,14 +53,14 @@
</server_settings>

<registry_contributions>
<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*" exclude="actions/action[@name='logout']"/>
<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*"/>
<actions>
<action name="logout" expireDefault="true">
<gui text="164" title="169" src="decrypted.png" accessKey="" iconClass="icon-signout" hasAccessKey="false">
<context selection="false" dir="" recycle="false" contextMenu="false" infoPanel="false" actionBarGroup="user" ajxpWidgets="UserWidget::logging_string"></context>
<gui text="164" title="169" src="decrypted.png" accessKey="" iconClass="icon-signout" hasAccessKey="false" forbidOverride="true">
<context selection="false" dir="" recycle="false" contextMenu="false" infoPanel="false" actionBarGroup="user" ajxpWidgets="UserWidget::logging_string"/>
</gui>
<rightsContext noUser="false" userLogged="only" guestLogged="show" read="false" write="false" adminOnly=""></rightsContext>
<processing>
<rightsContext noUser="false" userLogged="only" guestLogged="show" read="false" write="false" adminOnly="" forbidOverride="true"/>
<processing forbidOverride="true">
<clientCallback prepareModal="false"><![CDATA[
clearRememberData();
var connexion = new Connexion();
Expand All @@ -82,7 +82,7 @@
connexion.sendAsync();
]]></clientCallback>

<serverCallback methodName="logOutCAS"></serverCallback>
<serverCallback methodName="logOutCAS"/>
</processing>
</action>
</actions>
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/core.ajaxplorer/ajxp_registry.xsd
Expand Up @@ -46,6 +46,7 @@
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attribute name="skipSecureToken" type="xs:boolean"/>
<xs:attribute name="contentTypedProvider" type="xs:boolean"/>
<xs:attribute name="forbidOverride" type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="gui">
Expand Down

0 comments on commit 69edd0a

Please sign in to comment.