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
198 lines (195 loc) · 11.8 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?xml version="1.0" encoding="UTF-8"?>
<ajxpcore id="authfront.session_login" enabled="always" label="CONF_MESSAGE[Standard login screen]"
description="CONF_MESSAGE[Display a standard user/password login screen]"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
<class_definition filename="plugins/authfront.session_login/class.SessionLoginFrontend.php" classname="SessionLoginFrontend"/>
<server_settings>
<global_param name="ORDER" type="integer" label="Order" description="Order this plugin with other auth frontends" default="20"/>
<global_param name="PROTOCOL_TYPE" type="select"
choices="session_only|Sessions Only,no_session|REST Only,both|Session-based or Rest"
label="Protocol Type" description="Enable/disable automatically based on the protocol used" default="session_only"/>
</server_settings>
<registry_contributions>
<actions>
<action name="login">
<gui text="163" title="168" src="encrypted.png" iconClass="icon-signin"
accessKey="" hasAccessKey="false">
<context selection="false" dir="" recycle="false"
actionBar="true" contextMenu="false" infoPanel="false"
actionBarGroup="user,admin">
</context>
</gui>
<rightsContext noUser="false" userLogged="hidden" guestLogged="show" read="false" write="false" adminOnly=""/>
<processing>
<clientCallback prepareModal="true"><![CDATA[
var loginRedirect = AJXP_LOGIN_REDIRECT;
if(loginRedirect){
document.location.href=loginRedirect;
}else{
modal.setCloseValidation(function(){
return (!!ajaxplorer && !!ajaxplorer.user && ajaxplorer.user.id == "guest")
});
if(ajaxplorer.user && ajaxplorer.user.id == 'guest') $$('html')[0].addClassName('ajxp_guest_enabled');
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')
});
var authConfs = ajaxplorer.getPluginConfigs("auth");
if(!authConfs) authConfs = $H();
if(!Modernizr.input.placeholder) oForm.addClassName('no_placeholder');
if(window.ajxpBootstrap.parameters.get('PRESET_LOGIN')){
oForm.addClassName('ajxp_preset_login');
oForm.down('input[name="userid"]').setValue(window.ajxpBootstrap.parameters.get('PRESET_LOGIN'));
}
if(window.ajxpBootstrap.parameters.get('PRESET_PASSWORD')){
oForm.addClassName('ajxp_preset_password');
oForm.down('input[name="password"]').setValue(window.ajxpBootstrap.parameters.get('PRESET_PASSWORD'));
}
if(window.ajxpBootstrap.parameters.get('PASSWORD_AUTH_ONLY')){
oForm.addClassName('ajxp_password_auth');
authConfs.set('SECURE_LOGIN_FORM', true);
authConfs.set('ENABLE_FORGOT_PASSWORD', false);
}
$("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});
ajaxplorer.loadSeedOrCaptcha(oForm.down('#login_seed'), oForm.down('img#captcha_image'), oForm.down('div.dialogLegend'), 'before');
if(Prototype.Browser.IE && !Modernizr.borderradius && !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;
}
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_id="479">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');
connexion.addParameter('userid', window.ajxpBootstrap.parameters.get('PRESET_LOGIN')?window.ajxpBootstrap.parameters.get('PRESET_LOGIN'):oForm.userid.value);
connexion.addParameter('login_seed', oForm.login_seed.value);
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);
}
oForm.select('input[data-ajxpLoginAdditionalParameter]').each(function(i){
connexion.addParameter(i.name, i.getValue());
});
connexion.onComplete = function(transport){
var success = ajaxplorer.actionBar.parseXmlMessage(transport.responseXML);
if(transport.responseXML && XPathGetSingleNodeText(transport.responseXML.documentElement, "logging_result/@value") == "-4"){
ajaxplorer.loadSeedOrCaptcha(oForm.down('#login_seed'), oForm.down('img#captcha_image'), oForm.down('div.dialogLegend'), 'before');
}
if(success){
$("generic_dialog_box").down(".dialogTitle").writeAttribute("style", "");
oForm.up('.dialogContent').writeAttribute("style", "");
$("generic_dialog_box").select("#progressCustomMessage").invoke("remove");
}
};
connexion.setMethod('put');
connexion.sendAsync();
oForm.userid.value = '';
oForm.password.value = '';
return false;
}, function(){}, true);
}
]]></clientCallback>
<clientForm id="login_form_dynamic"><![CDATA[
<form id="login_form_dynamic" action="login" style="display:none;" box_width="320" box_padding="0" overlayStyle='{"backgroundColor":"white","opacity":10,"backgroundImage":"url(\"AJXP_THEME_FOLDER/images/grid_t.png\")"}'>
<input type="hidden" name="get_action" value="login">
<input type="hidden" name="login_seed" id="login_seed" value="">
<a style="float:right;font-size: 16px;" href="javascript:ajaxplorer.actionBar.fireAction('switch_language');" title="AJXP_MESSAGE[190]" alt="AJXP_MESSAGE[190]" class="icon-flag"> </a>
<div class="dialogLegend" style="margin-bottom: 3px;margin-top: 4px;" ajxp_message_id="180">AJXP_MESSAGE[180]</div>
<div style="width:100%;">
<div class="SF_element">
<div class="SF_label"><ajxp:message ajxp_message_id="181">AJXP_MESSAGE[181]</ajxp:message></div>
<div class="SF_input"><input type="text" name="userid" style="width: 100px; padding:0px;" class="dialogFocus" placeholder="AJXP_MESSAGE[181]"></div>
</div>
<div class="SF_element">
<div class="SF_label"><ajxp:message ajxp_message_id="182">AJXP_MESSAGE[182]</ajxp:message></div>
<div class="SF_input"><input type="password" name="password" style="width: 100px; padding:0px;" placeholder="AJXP_MESSAGE[182]"></div>
</div>
<div class="SF_element">
<input type="checkbox" class="radio" name="remember_me" style="border: none; width:20px !important;"/><ajxp:message ajxp_message_id="261">AJXP_MESSAGE[261]</ajxp:message>
</div>
</div>
</form>
]]></clientForm>
<serverCallback methodName="switchAction"></serverCallback>
</processing>
</action>
<action name="logout" expireDefault="true">
<gui text="164" title="169" src="decrypted.png" iconClass="icon-signout"
accessKey="" hasAccessKey="false">
<context selection="false" dir="" recycle="false"
contextMenu="false" actionBar="true" actionBarGroup="minisite" ajxpWidgets="UserWidget::logging_string">
</context>
</gui>
<rightsContext noUser="false" userLogged="only" guestLogged="hidden" read="false" write="false" adminOnly=""></rightsContext>
<processing>
<clientCallback prepareModal="false"><![CDATA[
clearRememberData();
var connexion = new Connexion();
connexion.addParameter('get_action', 'logout');
connexion.onComplete = function(transport){
ajaxplorer.actionBar.parseXmlMessage(transport.responseXML);
};
connexion.sendAsync();
]]></clientCallback>
<serverCallback methodName="switchAction"></serverCallback>
</processing>
</action>
<action name="back">
<processing>
<serverCallback methodName="switchAction"/>
</processing>
</action>
<action name="get_seed">
<processing>
<serverCallback methodName="switchAction"/>
</processing>
</action>
<action name="get_captcha">
<processing>
<serverCallback methodName="switchAction"/>
</processing>
</action>
</actions>
</registry_contributions>
</ajxpcore>