This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 293
/
manifest.xml
executable file
·141 lines (140 loc) · 10.9 KB
/
manifest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="UTF-8"?>
<authdriver name="multi" mixins="authdriver_commons" label="CONF_MESSAGE[Multiple]" description="CONF_MESSAGE[Encapsulate the use of other drivers]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
<plugin_info>
<plugin_author>Charles du Jeu, Thomas Oettli</plugin_author>
</plugin_info>
<client_settings>
<resources>
<i18n namespace="multi_auth" path="plugins/auth.multi/i18n"/>
</resources>
</client_settings>
<server_settings>
<param name="MODE" type="select" label="CONF_MESSAGE[Mode]" description="CONF_MESSAGE[Master/slave will assume that the master is read-only, and the slave is a local alternative to allow sharing features.]" mandatory="true" default="MASTER_SLAVE" choices="MASTER_SLAVE|Master/Slave,USER_CHOICE|User Choice"/>
<param name="MASTER_DRIVER" type="string" label="CONF_MESSAGE[Master]" description="CONF_MESSAGE[The name of the master driver to use, generally serial.]" mandatory="true"/>
<param name="USER_BASE_DRIVER" type="select" choices="master|Master,slave|Slave,both|Both" label="CONF_MESSAGE[Listing]" description="CONF_MESSAGE[In Master_Slave mode, use this option to limit the users listing in the administration to one driver only (leave empty if you want to see all users)]" mandatory="false"/>
<param name="CACHE_MASTER_USERS_TO_SLAVE" type="boolean" label="CONF_MESSAGE[Cache master users]" description="CONF_MESSAGE[Create a local copy (at login time) of master users inside slave base]" mandatory="false" default="true"/>
<param name="USER_ID_SEPARATOR" type="string" label="CONF_MESSAGE[Separator]" description="CONF_MESSAGE[This is necessary to discriminate users data loaded from various sources. Warning, use foldername compliant characters. For example :: does not work!]" mandatory="true" default="_-_"/>
<param name="DRIVERS" type="array" label="CONF_MESSAGE[Drivers]" description="CONF_MESSAGE[The auth drivers definition, see detailed documenation for more info.]" mandatory="true"/>
</server_settings>
<class_definition filename="plugins/auth.multi/class.multiAuthDriver.php" classname="multiAuthDriver"/>
<registry_contributions>
<external_file filename="plugins/core.auth/standard_auth_actions.xml" include="actions/*" exclude=""/>
<actions>
<action name="login">
<processing>
<clientCallback prepareModal="true"><![CDATA[
var loginRedirect = AJXP_LOGIN_REDIRECT;
var authSources = AJXP_MULTIAUTH_SOURCES;
var masterAuthSource = 'AJXP_MULTIAUTH_MASTER';
var userIdSeparator = 'AJXP_USER_ID_SEPARATOR';
if(loginRedirect){
document.location.href=loginRedirect;
}else{
modal.showDialogForm('Log In', ($('login_form')?'login_form':'login_form_dynamic'),
function(oForm){
$("generic_dialog_box").setStyle({
top:$("progressBox").getStyle('top'),
left:$("progressBox").getStyle('left')
});
if(!Modernizr.input.placeholder) oForm.addClassName('no_placeholder');
$("generic_dialog_box").down(".titleString").hide();
$("generic_dialog_box").down("#modalCloseBtn").hide();
$("generic_dialog_box").down(".dialogTitle").setAttribute("style", $("progressBox").down(".dialogTitle").getAttribute("style"));
if(!$("generic_dialog_box").down("#progressCustomMessage")){
if($("progressBox").down("#progressCustomMessage")) $("generic_dialog_box").down(".dialogContent").insert({top:$("progressBox").down("#progressCustomMessage").cloneNode(true)});
}
oForm.setStyle({display:'block'});
oForm.up(".dialogContent").setStyle({backgroundImage:'none', borderWidth:0});
if(!$('auth_source')){
var auth_chooser = '<div class="SF_element"> \
<div class="SF_label"><ajxp:message ajxp_message_id="396">'+MessageHash[396]+'</ajxp:message></div> \
<div class="SF_input"><select id="auth_source" name="auth_source" style="width: 210px; height:28px; padding:3px 0px; font-size:14px;" class="dialogFocus"></select></div> \
</div>';
oForm.down('div.SF_element').insert({before:auth_chooser});
$H(authSources).each(function(pair){
$('auth_source').insert(new Element("option", {value:pair.key}).update(pair.value));
});
}
ajaxplorer.loadSeedOrCaptcha(oForm.down('#login_seed'), oForm.down('img#captcha_image'), oForm.down('div.dialogLegend'), 'before');
if(Prototype.Browser.IE && !oForm.down('input[type="text"]').key_enter_attached){
oForm.select('input').invoke("observe", "keydown", function(event){
if(event.keyCode == Event.KEY_RETURN){
var el = Event.findElement(event);
if(el.hasClassName('dialogButton')){
el.click();
}else{
el.form.down('input.dialogButton').click();
}
}
});
oForm.down('input[type="text"]').key_enter_attached = true;
}
var authConfs = ajaxplorer.getPluginConfigs("auth");
if(authConfs && authConfs.get("SECURE_LOGIN_FORM")){
try{
oForm.down('input[name="remember_me"]').up("div.SF_element").remove();
oForm.down('input[name="userid"]').setAttribute("autocomplete", "off");
oForm.down('input[name="password"]').setAttribute("autocomplete", "off");
oForm.setAttribute("autocomplete", "off");
}catch(e){}
}
if(authConfs && authConfs.get("ENABLE_FORGOT_PASSWORD") && !oForm.down('a.forgot-password-link')){
try{
oForm.down('input[name="password"]').up("div.SF_element").insert({after:'<div class="SF_element"><a href="#" class="forgot-password-link">AJXP_MESSAGE[479]</a></div>'});
oForm.down('a.forgot-password-link').observe("click", function(e){
Event.stop(e);
ajaxplorer.actionBar.fireAction(authConfs.get("FORGOT_PASSWORD_ACTION"));
});
}catch(e){ if(console) console.log(e); }
}
modal.refreshDialogPosition();
},
function(){
var oForm = modal.getForm();
var connexion = new Connexion();
connexion.addParameter('get_action', 'login');
var selectedSource = oForm.auth_source.value;
if(selectedSource == masterAuthSource){
connexion.addParameter('userid', oForm.userid.value);
}else{
connexion.addParameter('userid', selectedSource+userIdSeparator+oForm.userid.value);
}
connexion.addParameter('login_seed', oForm.login_seed.value);
connexion.addParameter('auth_source', selectedSource);
connexion.addParameter('remember_me', (oForm.remember_me && oForm.remember_me.checked?"true":"false"));
if(oForm.login_seed.value != '-1'){
connexion.addParameter('password', hex_md5(hex_md5(oForm.password.value)+oForm.login_seed.value));
}else{
connexion.addParameter('password', oForm.password.value);
}
if(oForm.captcha_code){
connexion.addParameter('captcha_code', oForm.captcha_code.value);
}
connexion.onComplete = function(transport){
ajaxplorer.actionBar.parseXmlMessage(transport.responseXML);
if(XPathGetSingleNodeText(transport.responseXML.documentElement, "logging_result/@value") == "-4"){
ajaxplorer.loadSeedOrCaptcha(oForm.down('#login_seed'), oForm.down('img#captcha_image'), oForm.down('div.dialogLegend'), 'before');
}
};
connexion.setMethod('put');
document.observeOnce("ajaxplorer:user_logged", function(){
if($('logging_string') && $('logging_string').down('i')){
var ht = $('logging_string').down('i').innerHTML;
var exp = ht.split(userIdSeparator);
if(exp.length > 1){
$('logging_string').down('i').update(exp[1]);
}
}
});
connexion.sendAsync();
oForm.userid.value = '';
oForm.password.value = '';
return false;
});
}
]]></clientCallback>
</processing>
</action>
</actions>
</registry_contributions>
</authdriver>