1
+ − 1
// Javascript routines for the ACL editor
+ − 2
+ − 3
var aclManagerID = 'enano_aclmanager_' + Math.floor(Math.random() * 1000000);
+ − 4
var aclPermList = false;
+ − 5
var aclDataCache = false;
+ − 6
+ − 7
function ajaxOpenACLManager(page_id, namespace)
+ − 8
{
+ − 9
if(IE)
+ − 10
return true;
585
+ − 11
586
234ddd896555
Made encryption work in form-based logon again; modified load_component() to fetch compressed versions when possible
Dan
diff
changeset
+ − 12
load_component('l10n');
582
+ − 13
load_component('messagebox');
+ − 14
load_component('fadefilter');
+ − 15
load_component('template-compiler');
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
diff
changeset
+ − 16
load_component('autofill');
582
+ − 17
1
+ − 18
if(!page_id || !namespace)
+ − 19
{
+ − 20
var data = strToPageID(title);
+ − 21
var page_id = data[0];
+ − 22
var namespace = data[1];
+ − 23
}
+ − 24
var params = {
+ − 25
'mode' : 'listgroups',
+ − 26
'page_id' : page_id,
+ − 27
'namespace' : namespace
+ − 28
};
+ − 29
params = toJSONString(params);
+ − 30
params = ajaxEscape(params);
+ − 31
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
407
+ − 32
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 33
{
327
+ − 34
var response = String(ajax.responseText + '');
651
ce9d78d7251d
Improved JSON validation and error interface when validation fails; made rank manager support custom CSS
Dan
diff
changeset
+ − 35
if ( !check_json_response(response) )
327
+ − 36
{
+ − 37
handle_invalid_json(ajax.responseText);
+ − 38
return false;
+ − 39
}
+ − 40
try {
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 41
var groups = parseJSON(ajax.responseText);
327
+ − 42
} catch(e) {
+ − 43
handle_invalid_json(ajax.responseText);
+ − 44
}
1
+ − 45
__aclBuildWizardWindow();
40
+ − 46
if ( groups.mode == 'error' )
+ − 47
{
+ − 48
alert(groups.error);
+ − 49
killACLManager();
+ − 50
return false;
+ − 51
}
1
+ − 52
aclDataCache = groups;
+ − 53
__aclBuildSelector(groups);
+ − 54
}
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
+ − 55
}, true);
1
+ − 56
return false;
+ − 57
}
+ − 58
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 59
function ajaxOpenDirectACLRule(rule_id)
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 60
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 61
var params = {
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 62
target_id: rule_id,
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 63
mode: 'seltarget_id'
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 64
};
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 65
params = ajaxEscape(toJSONString(params));
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 66
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 67
if ( ajax.readyState == 4 && ajax.status == 200 )
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 68
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 69
var response = String(ajax.responseText + '');
651
ce9d78d7251d
Improved JSON validation and error interface when validation fails; made rank manager support custom CSS
Dan
diff
changeset
+ − 70
if ( !check_json_response(response) )
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 71
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 72
handle_invalid_json(ajax.responseText);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 73
return false;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 74
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 75
try
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 76
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 77
response = parseJSON(response);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 78
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 79
catch(e)
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 80
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 81
handle_invalid_json(response);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 82
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 83
if ( !document.getElementById(aclManagerID) )
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 84
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 85
__aclBuildWizardWindow();
513
+ − 86
var main = document.getElementById(aclManagerID + '_main');
+ − 87
main.style.padding = '10px';
+ − 88
}
+ − 89
else
+ − 90
{
+ − 91
var main = document.getElementById(aclManagerID + '_main');
+ − 92
main.style.backgroundImage = 'none';
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 93
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 94
if ( response.mode == 'error' )
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 95
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 96
alert(response.error);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 97
killACLManager();
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 98
return false;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 99
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 100
aclDataCache = response;
513
+ − 101
aclBuildRuleEditor(response, true);
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 102
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 103
}, true);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 104
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 105
1
+ − 106
function ajaxACLSwitchToSelector()
+ − 107
{
+ − 108
params = {
+ − 109
'mode' : 'listgroups'
+ − 110
};
+ − 111
if ( aclDataCache.page_id && aclDataCache.namespace )
+ − 112
{
+ − 113
params.page_id = aclDataCache.page_id;
+ − 114
params.namespace = aclDataCache.namespace;
+ − 115
}
+ − 116
params = toJSONString(params);
+ − 117
params = ajaxEscape(params);
+ − 118
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
407
+ − 119
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 120
{
+ − 121
document.getElementById(aclManagerID+'_main').innerHTML = '';
+ − 122
document.getElementById(aclManagerID + '_back').style.display = 'none';
218
+ − 123
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
1
+ − 124
groups = parseJSON(ajax.responseText);
40
+ − 125
if ( groups.mode == 'error' )
+ − 126
{
+ − 127
alert(groups.error);
+ − 128
killACLManager();
+ − 129
return false;
+ − 130
}
1
+ − 131
aclDataCache = groups;
+ − 132
thispage = strToPageID(title);
+ − 133
groups.page_id = thispage[0];
+ − 134
groups.namespace = thispage[1];
+ − 135
__aclBuildSelector(groups);
+ − 136
}
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
+ − 137
}, true);
1
+ − 138
}
+ − 139
+ − 140
function __aclBuildSelector(groups)
+ − 141
{
+ − 142
thispage = strToPageID(title);
+ − 143
do_scopesel = ( thispage[0] == groups.page_id && thispage[1] == groups.namespace );
+ − 144
513
+ − 145
document.getElementById(aclManagerID + '_next').style.display = 'inline';
+ − 146
1
+ − 147
seed = Math.floor(Math.random() * 1000000);
+ − 148
+ − 149
main = document.getElementById(aclManagerID + '_main');
+ − 150
main.style.padding = '10px';
513
+ − 151
main.style.backgroundImage = 'none';
+ − 152
+ − 153
// the "edit existing" button
+ − 154
var editbtn_wrapper = document.createElement('div');
+ − 155
editbtn_wrapper.style.styleFloat = 'right';
+ − 156
editbtn_wrapper.style.cssFloat = 'right';
+ − 157
editbtn_wrapper.style.fontSize = 'smaller';
+ − 158
var editbtn = document.createElement('a');
+ − 159
editbtn.href = '#';
+ − 160
editbtn.innerHTML = $lang.get('acl_btn_show_existing');
+ − 161
editbtn_wrapper.appendChild(editbtn);
+ − 162
main.appendChild(editbtn_wrapper);
+ − 163
+ − 164
editbtn.onclick = function()
+ − 165
{
+ − 166
aclSetViewListExisting();
+ − 167
return false;
+ − 168
}
1
+ − 169
+ − 170
selector = document.createElement('div');
+ − 171
+ − 172
grpsel = __aclBuildGroupsHTML(groups);
+ − 173
grpsel.name = 'group_id';
+ − 174
+ − 175
span = document.createElement('div');
+ − 176
span.id = "enACL_grpbox_"+seed+"";
+ − 177
+ − 178
// Build the selector
+ − 179
grpb = document.createElement('input');
+ − 180
grpb.type = 'radio';
+ − 181
grpb.name = 'target_type';
40
+ − 182
grpb.value = '1'; // ACL_TYPE_GROUP
1
+ − 183
grpb.checked = 'checked';
+ − 184
grpb.className = seed;
+ − 185
grpb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'block'; document.getElementById('enACL_usrbox_'+seed).style.display = 'none'; };
+ − 186
lbl = document.createElement('label');
+ − 187
lbl.appendChild(grpb);
218
+ − 188
lbl.appendChild(document.createTextNode($lang.get('acl_radio_usergroup')));
1
+ − 189
lbl.style.display = 'block';
+ − 190
span.appendChild(grpsel);
+ − 191
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 192
anoninfo = document.createElement('div');
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 193
anoninfo.className = 'info-box-mini';
218
+ − 194
anoninfo.appendChild(document.createTextNode($lang.get('acl_msg_guest_howto')));
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 195
span.appendChild(document.createElement('br'));
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 196
span.appendChild(anoninfo);
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 197
1
+ − 198
usrb = document.createElement('input');
+ − 199
usrb.type = 'radio';
+ − 200
usrb.name = 'target_type';
40
+ − 201
usrb.value = '2'; // ACL_TYPE_USER
1
+ − 202
usrb.className = seed;
+ − 203
usrb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'none'; document.getElementById('enACL_usrbox_'+seed).style.display = 'block'; };
+ − 204
lbl2 = document.createElement('label');
+ − 205
lbl2.appendChild(usrb);
218
+ − 206
lbl2.appendChild(document.createTextNode($lang.get('acl_radio_user')));
1
+ − 207
lbl2.style.display = 'block';
+ − 208
+ − 209
usrsel = document.createElement('input');
+ − 210
usrsel.type = 'text';
+ − 211
usrsel.name = 'username';
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
diff
changeset
+ − 212
usrsel.className = 'autofill username';
1
+ − 213
usrsel.id = 'userfield_' + aclManagerID;
+ − 214
try {
+ − 215
usrsel.setAttribute("autocomplete","off");
+ − 216
} catch(e) {};
+ − 217
+ − 218
span2 = document.createElement('div');
+ − 219
span2.id = "enACL_usrbox_"+seed+"";
+ − 220
span2.style.display = 'none';
+ − 221
span2.appendChild(usrsel);
+ − 222
+ − 223
// Scope selector
+ − 224
if(do_scopesel)
+ − 225
{
+ − 226
scopediv1 = document.createElement('div');
+ − 227
scopediv2 = document.createElement('div');
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 228
scopediv3 = document.createElement('div');
1
+ − 229
scopeRadioPage = document.createElement('input');
+ − 230
scopeRadioPage.type = 'radio';
+ − 231
scopeRadioPage.name = 'scope';
+ − 232
scopeRadioPage.value = 'page';
+ − 233
scopeRadioPage.checked = 'checked';
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 234
scopeRadioPage.className = '1048576';
76
+ − 235
if ( groups.page_groups.length > 0 ) scopeRadioPage.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'none'; };
1
+ − 236
scopeRadioGlobal = document.createElement('input');
+ − 237
scopeRadioGlobal.type = 'radio';
+ − 238
scopeRadioGlobal.name = 'scope';
+ − 239
scopeRadioGlobal.value = 'global';
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 240
scopeRadioGlobal.className = '1048576';
76
+ − 241
if ( groups.page_groups.length > 0 ) scopeRadioGlobal.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'none'; };
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 242
scopeRadioGroup = document.createElement('input');
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 243
scopeRadioGroup.type = 'radio';
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 244
scopeRadioGroup.name = 'scope';
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 245
scopeRadioGroup.value = 'group';
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 246
scopeRadioGroup.className = '1048576';
76
+ − 247
if ( groups.page_groups.length > 0 ) scopeRadioGroup.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'block'; };
1
+ − 248
lblPage = document.createElement('label');
+ − 249
lblPage.style.display = 'block';
+ − 250
lblPage.appendChild(scopeRadioPage);
218
+ − 251
lblPage.appendChild(document.createTextNode($lang.get('acl_radio_scope_thispage')));
1
+ − 252
lblGlobal = document.createElement('label');
+ − 253
lblGlobal.style.display = 'block';
+ − 254
lblGlobal.appendChild(scopeRadioGlobal);
218
+ − 255
lblGlobal.appendChild(document.createTextNode($lang.get('acl_radio_scope_wholesite')));
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 256
lblGroup = document.createElement('label');
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 257
lblGroup.style.display = 'block';
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 258
lblGroup.appendChild(scopeRadioGroup);
218
+ − 259
lblGroup.appendChild(document.createTextNode($lang.get('acl_radio_scope_pagegroup')));
1
+ − 260
scopediv1.appendChild(lblPage);
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 261
scopediv2.appendChild(lblGroup);
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 262
scopediv3.appendChild(lblGlobal);
1
+ − 263
+ − 264
scopedesc = document.createElement('p');
218
+ − 265
scopedesc.appendChild(document.createTextNode($lang.get('acl_lbl_scope')));
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 266
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 267
scopePGrp = document.createElement('select');
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 268
scopePGrp.style.marginLeft = '13px';
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 269
scopePGrp.style.display = 'none';
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 270
scopePGrp.id = "enACL_pgsel_1048576";
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 271
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 272
var opt;
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 273
for ( var i = 0; i < groups.page_groups.length; i++ )
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 274
{
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 275
opt = document.createElement('option');
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 276
opt.value = groups.page_groups[i].id;
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 277
opt.appendChild(document.createTextNode(groups.page_groups[i].name));
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 278
scopePGrp.appendChild(opt);
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 279
}
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 280
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 281
scopediv2.appendChild(scopePGrp);
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 282
1
+ − 283
}
+ − 284
+ − 285
// Styles
+ − 286
span.style.marginLeft = '13px';
+ − 287
span.style.padding = '5px 0';
+ − 288
span2.style.marginLeft = '13px';
+ − 289
span2.style.padding = '5px 0';
+ − 290
+ − 291
selector.appendChild(lbl);
+ − 292
selector.appendChild(span);
+ − 293
+ − 294
selector.appendChild(lbl2);
+ − 295
selector.appendChild(span2);
+ − 296
+ − 297
container = document.createElement('div');
+ − 298
container.style.margin = 'auto';
+ − 299
container.style.width = '360px';
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 300
container.style.paddingTop = '50px';
1
+ − 301
+ − 302
head = document.createElement('h2');
218
+ − 303
head.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_title')));
1
+ − 304
+ − 305
desc = document.createElement('p');
218
+ − 306
desc.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_body')));
1
+ − 307
+ − 308
container.appendChild(head);
+ − 309
container.appendChild(desc);
+ − 310
container.appendChild(selector);
+ − 311
+ − 312
if(do_scopesel)
+ − 313
{
+ − 314
container.appendChild(scopedesc);
+ − 315
container.appendChild(scopediv1);
76
+ − 316
if ( groups.page_groups.length > 0 )
+ − 317
{
+ − 318
container.appendChild(scopediv2);
+ − 319
}
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 320
container.appendChild(scopediv3);
1
+ − 321
}
+ − 322
+ − 323
main.appendChild(container);
+ − 324
+ − 325
var mode = document.createElement('input');
+ − 326
mode.name = 'mode';
+ − 327
mode.type = 'hidden';
+ − 328
mode.id = aclManagerID + '_mode';
+ − 329
mode.value = 'seltarget';
+ − 330
+ − 331
var theform = document.getElementById(aclManagerID + '_formobj_id');
+ − 332
if ( !theform.mode )
+ − 333
{
+ − 334
theform.appendChild(mode);
+ − 335
}
+ − 336
else
+ − 337
{
+ − 338
theform.removeChild(theform.mode);
+ − 339
theform.appendChild(mode);
+ − 340
}
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
diff
changeset
+ − 341
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
diff
changeset
+ − 342
autofill_init_element(usrsel, {
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
diff
changeset
+ − 343
allow_anon: true
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
diff
changeset
+ − 344
});
1
+ − 345
}
+ − 346
+ − 347
var aclDebugWin = false;
+ − 348
+ − 349
function aclDebug(text)
+ − 350
{
+ − 351
if(!aclDebugWin)
+ − 352
aclDebugWin = pseudoWindowOpen("data:text/html;plain,<html><head><title>debug win</title></head><body><h1>Debug window</h1></body></html>", "aclDebugWin");
+ − 353
setTimeout(function() {
+ − 354
aclDebugWin.pre = aclDebugWin.document.createElement('pre');
+ − 355
aclDebugWin.pre.appendChild(aclDebugWin.document.createTextNode(text));
+ − 356
aclDebugWin.b = aclDebugWin.document.getElementsByTagName('body')[0];
+ − 357
aclDebugWin.b.appendChild(aclDebugWin.pre);}, 1000);
+ − 358
}
+ − 359
+ − 360
var pseudoWindows = new Object();
+ − 361
+ − 362
function pseudoWindowOpen(url, id)
+ − 363
{
+ − 364
if(pseudoWindows[id])
+ − 365
{
+ − 366
document.getElementById('pseudowin_ifr_'+id).src = url;
+ − 367
}
+ − 368
else
+ − 369
{
+ − 370
win = document.createElement('iframe');
+ − 371
win.style.position='fixed';
+ − 372
win.style.width = '640px';
+ − 373
win.style.height = '480px';
+ − 374
win.style.top = '0px';
+ − 375
win.style.left = '0px';
+ − 376
win.style.zIndex = getHighestZ() + 1;
+ − 377
win.style.backgroundColor = '#FFFFFF';
+ − 378
win.name = 'pseudo_ifr_'+id;
+ − 379
win.id = 'pseudowindow_ifr_'+id;
+ − 380
win.src = url;
+ − 381
body = document.getElementsByTagName('body')[0];
+ − 382
body.appendChild(win);
+ − 383
}
+ − 384
win_obj = eval("( pseudo_ifr_"+id+" )");
+ − 385
return win_obj;
+ − 386
}
+ − 387
+ − 388
function __aclJSONSubmitAjaxHandler(params)
+ − 389
{
+ − 390
params = toJSONString(params);
+ − 391
params = ajaxEscape(params);
+ − 392
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
407
+ − 393
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 394
{
327
+ − 395
var response = String(ajax.responseText + '');
651
ce9d78d7251d
Improved JSON validation and error interface when validation fails; made rank manager support custom CSS
Dan
diff
changeset
+ − 396
if ( !check_json_response(response) )
327
+ − 397
{
+ − 398
handle_invalid_json(ajax.responseText);
+ − 399
return false;
+ − 400
}
513
+ − 401
try
+ − 402
{
+ − 403
var data = parseJSON(ajax.responseText);
+ − 404
}
+ − 405
catch(e)
+ − 406
{
327
+ − 407
handle_invalid_json(ajax.responseText);
513
+ − 408
return false;
1
+ − 409
}
+ − 410
aclDataCache = data;
+ − 411
switch(data.mode)
+ − 412
{
+ − 413
case 'seltarget':
+ − 414
+ − 415
// Build the ACL edit form
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 416
aclBuildRuleEditor(data);
1
+ − 417
+ − 418
break;
+ − 419
case 'success':
+ − 420
var note = document.createElement('div');
+ − 421
note.className = 'info-box';
+ − 422
note.style.marginLeft = '0';
+ − 423
var b = document.createElement('b');
218
+ − 424
b.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_title')));
1
+ − 425
note.appendChild(b);
+ − 426
note.appendChild(document.createElement('br'));
218
+ − 427
note.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_body', { target_name: data.target_name })));
1
+ − 428
note.appendChild(document.createElement('br'));
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 429
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 430
/*
1
+ − 431
var a = document.createElement('a');
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
+ − 432
a.href = '#';
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
diff
changeset
+ − 433
a.id = aclManagerID + '_btn_dismiss';
218
+ − 434
a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
1
+ − 435
note.appendChild(a);
+ − 436
var a2 = document.createElement('a');
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
+ − 437
a2.href = '#';
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
diff
changeset
+ − 438
a.id = aclManagerID + '_btn_close';
218
+ − 439
a2.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
1
+ − 440
note.appendChild(a2);
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 441
*/
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 442
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 443
var a_dismiss = document.createElement('a');
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 444
a_dismiss.href = '#';
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 445
a_dismiss.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 446
note.appendChild(a_dismiss);
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 447
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 448
var a_close = document.createElement('a');
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 449
a_close.href = '#';
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 450
a_close.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 451
note.appendChild(a_close);
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 452
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 453
document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
diff
changeset
+ − 454
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 455
a_dismiss.setAttribute('onclick', 'var parent = this.parentNode.parentNode; parent.removeChild(this.parentNode); return false;');
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 456
a_close.setAttribute('onclick', 'killACLManager(); return false;');
419
b8b4e38825db
Unsuccessful attempt at fixing "dismiss"/"close manager" buttons in ACL editor; non-breaking change to template API to allow plugins to add "normal" sidebar widgets in addition to the special "raw" block type, specified as the third parameter to $template->sidebar_widget(). Defaults to false, which is old behavior; new behavior (enabled by passing TRUE as the 3rd param) means that the content of the block is primarily block-level links.
Dan
diff
changeset
+ − 457
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 458
if ( !document.getElementById(aclManagerID+'_deletelnk') )
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 459
document.getElementById(aclManagerID + '_main').innerHTML += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>';
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 460
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 461
document.getElementById(aclManagerID+'_main').scrollTop = 0;
513
+ − 462
document.getElementById(aclManagerID+'_main').style.backgroundImage = 'none';
472
bc4b58034f4d
Implemented password reset (albeit hackishly) into the new login API; added dummy window.console object to hopefully reduce errors when Firebug isn't around; fixed the longstanding ACL dismiss/close button bug; fixed a couple undefined variables in mailer; fixed PHP error on attempted opening of /dev/(u)random in rijndael.php; clarified documentation for PageProcessor::update_page(); fixed some logic problems in theme ACL code; disabled CAPTCHA debug
Dan
diff
changeset
+ − 463
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 464
aclDataCache.mode = 'save_edit';
1
+ − 465
break;
+ − 466
case 'delete':
+ − 467
+ − 468
params = {
+ − 469
'mode' : 'listgroups'
+ − 470
};
+ − 471
params = toJSONString(params);
+ − 472
params = ajaxEscape(params);
+ − 473
ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
407
+ − 474
if ( ajax.readyState == 4 && ajax.status == 200 )
1
+ − 475
{
+ − 476
document.getElementById(aclManagerID+'_main').innerHTML = '';
+ − 477
document.getElementById(aclManagerID + '_back').style.display = 'none';
218
+ − 478
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
1
+ − 479
var thispage = strToPageID(title);
+ − 480
groups.page_id = thispage[0];
+ − 481
groups.namespace = thispage[1];
+ − 482
__aclBuildSelector(groups);
+ − 483
+ − 484
note = document.createElement('div');
+ − 485
note.className = 'info-box';
+ − 486
note.style.marginLeft = '0';
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 487
note.style.position = 'absolute';
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 488
note.style.width = '558px';
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 489
note.id = 'aclSuccessNotice_' + Math.floor(Math.random() * 100000);
1
+ − 490
b = document.createElement('b');
218
+ − 491
b.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_title')));
1
+ − 492
note.appendChild(b);
+ − 493
note.appendChild(document.createElement('br'));
336
+ − 494
note.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_body', { target_name: aclDataCache.target_name })));
1
+ − 495
note.appendChild(document.createElement('br'));
+ − 496
a = document.createElement('a');
+ − 497
a.href = '#';
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 498
a.onclick = function() { opacity(this.parentNode.id, 100, 0, 1000); setTimeout('var div = document.getElementById("' + this.parentNode.id + '"); div.parentNode.removeChild(div);', 1100); return false; };
218
+ − 499
a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
1
+ − 500
note.appendChild(a);
+ − 501
a = document.createElement('a');
+ − 502
a.href = '#';
+ − 503
a.onclick = function() { killACLManager(); return false; };
218
+ − 504
a.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
1
+ − 505
note.appendChild(a);
+ − 506
document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
+ − 507
//fadeInfoBoxes();
+ − 508
+ − 509
}
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
+ − 510
}, true);
1
+ − 511
+ − 512
break;
+ − 513
case 'error':
+ − 514
alert("Server side processing error:\n"+data.error);
+ − 515
break;
+ − 516
case 'debug':
+ − 517
aclDebug(data.text);
+ − 518
break;
513
+ − 519
case 'list_existing':
+ − 520
aclSetViewListExistingRespond(data);
+ − 521
break;
1
+ − 522
default:
327
+ − 523
handle_invalid_json(ajax.responseText);
1
+ − 524
break;
+ − 525
}
+ − 526
}
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
+ − 527
}, true);
1
+ − 528
}
+ − 529
513
+ − 530
function aclBuildRuleEditor(data, from_direct)
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 531
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 532
var act_desc = ( data.type == 'new' ) ? $lang.get('acl_lbl_editwin_title_create') : $lang.get('acl_lbl_editwin_title_edit');
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 533
var target_type_t = ( data.target_type == 1 ) ? $lang.get('acl_target_type_group') : $lang.get('acl_target_type_user');
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 534
var target_name_t = data.target_name;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 535
var scope_type = ( data.page_id == false && data.namespace == false ) ? $lang.get('acl_scope_type_wholesite') : ( data.namespace == '__PageGroup' ) ? $lang.get('acl_scope_type_pagegroup') : $lang.get('acl_scope_type_thispage');
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 536
513
+ − 537
document.getElementById(aclManagerID + '_next').style.display = 'inline';
+ − 538
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 539
html = '<h2>'+act_desc+'</h2>';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 540
html += '<p>' + $lang.get('acl_lbl_editwin_body', { target_type: target_type_t, target: target_name_t, scope_type: scope_type }) + '</p>';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 541
parser = new templateParser(data.template.acl_field_begin);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 542
html += parser.run();
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 543
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 544
cls = 'row2';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 545
for(var i in data.acl_types)
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 546
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 547
if(typeof(data.acl_types[i]) == 'number')
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 548
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 549
cls = ( cls == 'row1' ) ? 'row2' : 'row1';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 550
p = new templateParser(data.template.acl_field_item);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 551
vars = new Object();
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 552
if ( data.acl_descs[i].match(/^([a-z0-9_]+)$/) )
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 553
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 554
vars['FIELD_DESC'] = $lang.get(data.acl_descs[i]);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 555
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 556
else
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 557
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 558
vars['FIELD_DESC'] = data.acl_descs[i];
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 559
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 560
vars['FIELD_INHERIT_CHECKED'] = '';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 561
vars['FIELD_DENY_CHECKED'] = '';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 562
vars['FIELD_DISALLOW_CHECKED'] = '';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 563
vars['FIELD_WIKIMODE_CHECKED'] = '';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 564
vars['FIELD_ALLOW_CHECKED'] = '';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 565
vars['FIELD_NAME'] = i;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 566
if ( !data.current_perms[i] )
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 567
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 568
data.current_perms[i] = 'i';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 569
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 570
switch(data.current_perms[i])
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 571
{
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 572
case 'i':
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 573
default:
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 574
vars['FIELD_INHERIT_CHECKED'] = 'checked="checked"';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 575
break;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 576
case 1:
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 577
vars['FIELD_DENY_CHECKED'] = 'checked="checked"';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 578
break;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 579
case 2:
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 580
vars['FIELD_DISALLOW_CHECKED'] = 'checked="checked"';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 581
break;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 582
case 3:
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 583
vars['FIELD_WIKIMODE_CHECKED'] = 'checked="checked"';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 584
break;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 585
case 4:
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 586
vars['FIELD_ALLOW_CHECKED'] = 'checked="checked"';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 587
break;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 588
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 589
vars['ROW_CLASS'] = cls;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 590
p.assign_vars(vars);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 591
html += p.run();
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 592
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 593
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 594
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 595
var parser = new templateParser(data.template.acl_field_end);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 596
html += parser.run();
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 597
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 598
if(data.type == 'edit')
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 599
html += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 600
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 601
var main = document.getElementById(aclManagerID + '_main');
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 602
main.innerHTML = html;
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 603
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 604
var form = document.getElementById(aclManagerID + '_formobj_id');
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 605
513
+ − 606
if ( from_direct )
+ − 607
{
+ − 608
var modeobj = document.getElementById(aclManagerID + '_mode');
+ − 609
modeobj.value = 'save_edit';
+ − 610
}
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 611
else
513
+ − 612
{
+ − 613
var modeobj = form_fetch_field(form, 'mode');
+ − 614
if ( modeobj )
+ − 615
modeobj.value = 'save_' + data.type;
+ − 616
else
+ − 617
alert('modeobj is invalid: '+modeobj);
+ − 618
}
512
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 619
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 620
aclPermList = array_keys(data.acl_types);
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 621
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 622
document.getElementById(aclManagerID + '_back').style.display = 'inline';
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 623
document.getElementById(aclManagerID + '_next').value = $lang.get('etc_save_changes');
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 624
}
13532b0a223f
ACL: Added API call to edit rule based only on numeric rule ID; to be used later with lister for existing rules and effective permissions viewer
Dan
diff
changeset
+ − 625
1
+ − 626
function __aclBuildGroupsHTML(groups)
+ − 627
{
+ − 628
groups = groups.groups;
+ − 629
select = document.createElement('select');
+ − 630
for(var i in groups)
+ − 631
{
+ − 632
if(typeof(groups[i]['name']) == 'string' && i != 'toJSONString')
+ − 633
{
+ − 634
o = document.createElement('option');
+ − 635
o.value = groups[i]['id'];
+ − 636
t = document.createTextNode(groups[i]['name']);
+ − 637
o.appendChild(t);
+ − 638
select.appendChild(o);
+ − 639
}
+ − 640
}
+ − 641
return select;
+ − 642
}
+ − 643
+ − 644
function __aclBuildWizardWindow()
+ − 645
{
151
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 646
darken(aclDisableTransitionFX);
1
+ − 647
box = document.createElement('div');
+ − 648
box.style.width = '640px'
+ − 649
box.style.height = '440px';
+ − 650
box.style.position = 'fixed';
+ − 651
width = getWidth();
+ − 652
height = getHeight();
+ − 653
box.style.left = ( width / 2 - 320 ) + 'px';
+ − 654
box.style.top = ( height / 2 - 250 ) + 'px';
+ − 655
box.style.backgroundColor = 'white';
+ − 656
box.style.zIndex = getHighestZ() + 1;
+ − 657
box.id = aclManagerID;
+ − 658
box.style.opacity = '0';
+ − 659
box.style.filter = 'alpha(opacity=0)';
+ − 660
box.style.display = 'none';
+ − 661
+ − 662
mainwin = document.createElement('div');
+ − 663
mainwin.id = aclManagerID + '_main';
+ − 664
mainwin.style.clip = 'rect(0px,640px,440px,0px)';
+ − 665
mainwin.style.overflow = 'auto';
+ − 666
mainwin.style.width = '620px';
+ − 667
mainwin.style.height = '420px';
+ − 668
+ − 669
panel = document.createElement('div');
+ − 670
panel.style.width = '620px';
+ − 671
panel.style.padding = '10px';
+ − 672
panel.style.lineHeight = '40px';
+ − 673
panel.style.textAlign = 'right';
+ − 674
panel.style.position = 'fixed';
+ − 675
panel.style.left = ( width / 2 - 320 ) + 'px';
+ − 676
panel.style.top = ( height / 2 + 190 ) + 'px';
+ − 677
panel.style.backgroundColor = '#D0D0D0';
+ − 678
panel.style.opacity = '0';
+ − 679
panel.style.filter = 'alpha(opacity=0)';
+ − 680
panel.id = aclManagerID + '_panel';
+ − 681
+ − 682
form = document.createElement('form');
+ − 683
form.method = 'post';
+ − 684
form.action = 'javascript:void(0)';
+ − 685
form.onsubmit = function() { if(this.username && !submitAuthorized) return false; __aclSubmitManager(this); return false; };
+ − 686
form.name = aclManagerID + '_formobj';
+ − 687
form.id = aclManagerID + '_formobj_id';
+ − 688
+ − 689
back = document.createElement('input');
+ − 690
back.type = 'button';
218
+ − 691
back.value = $lang.get('etc_wizard_back');
1
+ − 692
back.style.fontWeight = 'normal';
+ − 693
back.onclick = function() { ajaxACLSwitchToSelector(); return false; };
+ − 694
back.style.display = 'none';
+ − 695
back.id = aclManagerID + '_back';
+ − 696
+ − 697
saver = document.createElement('input');
+ − 698
saver.type = 'submit';
218
+ − 699
saver.value = $lang.get('etc_wizard_next');
1
+ − 700
saver.style.fontWeight = 'bold';
+ − 701
saver.id = aclManagerID + '_next';
+ − 702
+ − 703
closer = document.createElement('input');
+ − 704
closer.type = 'button';
218
+ − 705
closer.value = $lang.get('etc_cancel_changes');
541
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 706
closer.onclick = function()
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 707
{
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 708
miniPromptMessage({
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 709
title: $lang.get('acl_msg_closeacl_confirm_title'),
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 710
message: $lang.get('acl_msg_closeacl_confirm_body'),
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 711
buttons: [
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 712
{
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 713
text: $lang.get('acl_btn_close'),
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 714
color: 'red',
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 715
style: {
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 716
fontWeight: 'bold'
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 717
},
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 718
onclick: function(e)
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 719
{
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 720
killACLManager();
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 721
miniPromptDestroy(this);
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 722
}
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 723
},
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 724
{
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 725
text: $lang.get('etc_cancel'),
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 726
onclick: function(e)
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 727
{
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 728
miniPromptDestroy(this);
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 729
}
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 730
}
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 731
]
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 732
});
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 733
return false;
acb7e23b6ffa
Massive commit with various changes. Added user ranks system (no admin interface yet) and ability for users to have custom user titles. Made cron framework accept fractions of hours through floating-point intervals. Modifed ACL editor to use miniPrompt framework for close confirmation box. Made avatar system use a special page as opposed to fetching the files directly for caching reasons.
Dan
diff
changeset
+ − 734
}
1
+ − 735
+ − 736
spacer1 = document.createTextNode(' ');
+ − 737
spacer2 = document.createTextNode(' ');
+ − 738
+ − 739
panel.appendChild(back);
+ − 740
panel.appendChild(spacer1);
+ − 741
panel.appendChild(saver);
+ − 742
panel.appendChild(spacer2);
+ − 743
panel.appendChild(closer);
+ − 744
form.appendChild(mainwin);
+ − 745
form.appendChild(panel);
+ − 746
box.appendChild(form);
+ − 747
+ − 748
body = document.getElementsByTagName('body')[0];
+ − 749
body.appendChild(box);
151
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 750
if ( aclDisableTransitionFX )
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 751
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 752
document.getElementById(aclManagerID).style.display = 'block';
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 753
changeOpac(100, aclManagerID);
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 754
changeOpac(100, aclManagerID + '_panel');
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 755
}
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 756
else
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 757
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 758
setTimeout("document.getElementById('"+aclManagerID+"').style.display = 'block'; opacity('"+aclManagerID+"', 0, 100, 500); opacity('"+aclManagerID + '_panel'+"', 0, 100, 500);", 1000);
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 759
}
1
+ − 760
}
+ − 761
+ − 762
function killACLManager()
+ − 763
{
+ − 764
el = document.getElementById(aclManagerID);
+ − 765
if(el)
+ − 766
{
151
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 767
if ( aclDisableTransitionFX )
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 768
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 769
enlighten(true);
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 770
el.parentNode.removeChild(el);
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 771
}
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 772
else
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 773
{
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 774
opacity(aclManagerID, 100, 0, 500);
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 775
setTimeout('var el = document.getElementById(aclManagerID); el.parentNode.removeChild(el); enlighten();', 750);
824821224153
Added a new Javascript variable, aclDisableTransitionFX, that will switch off effects on message boxes and the ACL editor when set to true
Dan
diff
changeset
+ − 776
}
1
+ − 777
}
+ − 778
}
+ − 779
+ − 780
function __aclSubmitManager(form)
+ − 781
{
+ − 782
var thefrm = document.forms[form.name];
+ − 783
var modeobj = form_fetch_field(thefrm, 'mode');
+ − 784
if ( typeof(modeobj) == 'object' )
+ − 785
{
+ − 786
var mode = (thefrm.mode.value) ? thefrm.mode.value : 'cant_get';
+ − 787
}
+ − 788
else
+ − 789
{
+ − 790
var mode = '';
+ − 791
}
+ − 792
switch(mode)
+ − 793
{
+ − 794
case 'cant_get':
+ − 795
alert('BUG: can\'t get the state value from the form field.');
+ − 796
break;
+ − 797
case 'seltarget':
40
+ − 798
var target_type = parseInt(getRadioState(thefrm, 'target_type', ['1', '2']));
1
+ − 799
if(isNaN(target_type))
+ − 800
{
218
+ − 801
alert($lang.get('acl_err_pleaseselect_targettype'));
1
+ − 802
return false;
+ − 803
}
+ − 804
target_id = ( target_type == 1 ) ? parseInt(thefrm.group_id.value) : thefrm.username.value;
+ − 805
+ − 806
obj = { 'mode' : mode, 'target_type' : target_type, 'target_id' : target_id };
+ − 807
+ − 808
thispage = strToPageID(title);
+ − 809
do_scopesel = ( thispage[0] == aclDataCache.page_id && thispage[1] == aclDataCache.namespace );
+ − 810
+ − 811
if(do_scopesel)
+ − 812
{
535
+ − 813
scope = getRadioState(thefrm, 'scope', ['page', 'group', 'global']);
1
+ − 814
if(scope == 'page')
+ − 815
{
+ − 816
pageid = strToPageID(title);
+ − 817
obj['page_id'] = pageid[0];
+ − 818
obj['namespace'] = pageid[1];
+ − 819
}
+ − 820
else if(scope == 'global')
+ − 821
{
+ − 822
obj['page_id'] = false;
+ − 823
obj['namespace'] = false;
+ − 824
}
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 825
else if(scope == 'group')
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 826
{
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 827
obj['page_id'] = document.getElementById('enACL_pgsel_1048576').value;
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 828
obj['namespace'] = '__PageGroup';
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 829
}
1
+ − 830
else
+ − 831
{
+ − 832
alert('Invalid scope');
+ − 833
return false;
+ − 834
}
+ − 835
}
+ − 836
else
+ − 837
{
+ − 838
obj['page_id'] = aclDataCache.page_id;
+ − 839
obj['namespace'] = aclDataCache.namespace;
+ − 840
}
+ − 841
if(target_id == '')
+ − 842
{
218
+ − 843
alert($lang.get('acl_err_pleaseselect_username'));
1
+ − 844
return false;
+ − 845
}
+ − 846
__aclJSONSubmitAjaxHandler(obj);
+ − 847
break;
+ − 848
case 'save_edit':
+ − 849
case 'save_new':
+ − 850
var form = document.forms[aclManagerID + '_formobj'];
+ − 851
selections = new Object();
40
+ − 852
var dbg = '';
511
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 853
var warned_everyone = false;
1
+ − 854
for(var i in aclPermList)
+ − 855
{
40
+ − 856
selections[aclPermList[i]] = getRadioState(form, aclPermList[i], [1, 2, 3, 4]);
511
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 857
// If we're editing permissions for everyone on the entire site and the
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 858
// admin selected to deny privileges, give a stern warning about it.
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 859
if ( selections[aclPermList[i]] == 1 && aclDataCache.target_type == 1 /* ACL_TYPE_GROUP */ && aclDataCache.target_id == 1 && !warned_everyone )
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 860
{
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 861
warned_everyone = true;
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 862
if ( !confirm($lang.get('acl_msg_deny_everyone_confirm')) )
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 863
{
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 864
return false;
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 865
}
f88c8c79d784
Made some improvements to ACL system including: warning on setting Deny for Everyone on the entire site, added ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL, and changed behavior as noted in the docs so that Deny for Everyone is no longer able to be overridden
Dan
diff
changeset
+ − 866
}
40
+ − 867
dbg += aclPermList[i] + ': ' + selections[aclPermList[i]] + "\n";
+ − 868
if(!selections[aclPermList[i]])
1
+ − 869
{
40
+ − 870
alert("Invalid return from getRadioState: "+i+": "+selections[i]+" ("+typeof(selections[i])+")");
+ − 871
return false;
1
+ − 872
}
+ − 873
}
+ − 874
obj = new Object();
+ − 875
obj['perms'] = selections;
+ − 876
obj['mode'] = mode;
+ − 877
obj['target_type'] = aclDataCache.target_type;
+ − 878
obj['target_id'] = aclDataCache.target_id;
+ − 879
obj['target_name'] = aclDataCache.target_name;
+ − 880
obj['page_id'] = aclDataCache.page_id;
+ − 881
obj['namespace'] = aclDataCache.namespace;
+ − 882
__aclJSONSubmitAjaxHandler(obj);
+ − 883
break;
+ − 884
default:
+ − 885
alert("JSON form submit: invalid mode string "+mode+", stopping execution");
+ − 886
return false;
+ − 887
break;
+ − 888
}
+ − 889
}
+ − 890
40
+ − 891
function getRadioState(form, name, valArray)
1
+ − 892
{
40
+ − 893
// Konqueror/Safari fix
+ − 894
if ( form[name] )
+ − 895
{
+ − 896
var formitem = form[name];
+ − 897
if ( String(formitem) == '[object DOMNamedNodesCollection]' || is_Safari )
+ − 898
{
+ − 899
var i = 0;
+ − 900
var radios = new Array();
+ − 901
var radioids = new Array();
+ − 902
while(true)
+ − 903
{
+ − 904
var elem = formitem[i];
+ − 905
if ( !elem )
+ − 906
break;
+ − 907
radios.push(elem);
+ − 908
if ( !elem.id )
+ − 909
{
+ − 910
elem.id = 'autoRadioBtn_' + Math.floor(Math.random() * 1000000);
+ − 911
}
+ − 912
radioids.push(elem.id);
+ − 913
i++;
+ − 914
}
+ − 915
var cr;
+ − 916
for ( var i = 0; i < radios.length; i++ )
+ − 917
{
+ − 918
cr = document.getElementById(radioids[i]);
+ − 919
if ( cr.value == 'on' || cr.checked == true )
+ − 920
{
+ − 921
try {
+ − 922
return ( typeof ( valArray[i] ) != 'undefined' ) ? valArray[i] : false;
+ − 923
} catch(e) {
+ − 924
// alert('Didn\'t get value for index: ' + i);
+ − 925
return false;
+ − 926
}
+ − 927
}
+ − 928
}
+ − 929
return false;
+ − 930
}
+ − 931
}
1
+ − 932
inputs = form.getElementsByTagName('input');
+ − 933
radios = new Array();
+ − 934
for(var i in inputs)
+ − 935
{
+ − 936
if(inputs[i]) if(inputs[i].type == 'radio')
+ − 937
radios.push(inputs[i]);
+ − 938
}
+ − 939
for(var i in radios)
+ − 940
{
+ − 941
if(radios[i].checked && radios[i].name == name)
+ − 942
return radios[i].value;
+ − 943
}
+ − 944
return false;
+ − 945
}
+ − 946
40
+ − 947
function __aclSetAllRadios(val, valArray)
1
+ − 948
{
40
+ − 949
val = String(val);
+ − 950
var form = document.forms[aclManagerID + '_formobj'];
1
+ − 951
if (!form)
40
+ − 952
{
1
+ − 953
return false;
40
+ − 954
}
+ − 955
var inputs = form.getElementsByTagName('input');
+ − 956
var radios = new Array();
+ − 957
var dbg = '';
+ − 958
for(var i = 0; i < inputs.length; i++)
1
+ − 959
{
40
+ − 960
dbg += String(inputs[i]) + "\n";
1
+ − 961
if(inputs[i].type == 'radio')
+ − 962
radios.push(inputs[i]);
+ − 963
}
+ − 964
for(var i in radios)
+ − 965
{
+ − 966
if(radios[i].value == val)
+ − 967
radios[i].checked = true;
+ − 968
else
+ − 969
radios[i].checked = false;
+ − 970
}
+ − 971
}
+ − 972
+ − 973
function __aclDeleteRule()
+ − 974
{
42
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 975
if(!aclDataCache)
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 976
{
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 977
if ( window.console )
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 978
{
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 979
try{ console.error('ACL editor: can\'t load data cache on delete'); } catch(e) {};
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 980
}
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 981
return false;
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 982
}
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 983
if(aclDataCache.mode != 'seltarget' && aclDataCache.mode != 'save_new' && aclDataCache.mode != 'save_edit')
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 984
{
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 985
if ( window.console )
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 986
{
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 987
try{ console.error('ACL editor: wrong mode on aclDataCache: ' + aclDataCache.mode); } catch(e) {};
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 988
}
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 989
return false;
45ebe475ff75
I dunno how many times I'm gonna have to fix the "problem seems to be the hex conversion" bug, but this is at least the fourth try.
Dan
diff
changeset
+ − 990
}
1
+ − 991
parms = {
+ − 992
'target_type' : aclDataCache.target_type,
+ − 993
'target_id' : aclDataCache.target_id,
+ − 994
'target_name' : aclDataCache.target_name,
+ − 995
'page_id' : aclDataCache.page_id,
+ − 996
'namespace' : aclDataCache.namespace,
+ − 997
'mode' : 'delete'
+ − 998
};
+ − 999
__aclJSONSubmitAjaxHandler(parms);
+ − 1000
}
+ − 1001
513
+ − 1002
function aclSetViewListExisting()
+ − 1003
{
+ − 1004
if ( !document.getElementById(aclManagerID) )
+ − 1005
{
+ − 1006
return false;
+ − 1007
}
+ − 1008
+ − 1009
var main = document.getElementById(aclManagerID + '_main');
+ − 1010
main.innerHTML = '';
+ − 1011
main.style.backgroundImage = 'url(' + scriptPath + '/images/loading-big.gif)';
+ − 1012
main.style.backgroundRepeat = 'no-repeat';
+ − 1013
main.style.backgroundPosition = 'center center';
+ − 1014
+ − 1015
var parms = {
+ − 1016
'mode' : 'list_existing'
+ − 1017
};
+ − 1018
__aclJSONSubmitAjaxHandler(parms);
+ − 1019
}
+ − 1020
+ − 1021
function aclSetViewListExistingRespond(data)
+ − 1022
{
+ − 1023
var main = document.getElementById(aclManagerID + '_main');
+ − 1024
main.style.padding = '10px';
+ − 1025
main.innerHTML = '';
+ − 1026
+ − 1027
var heading = document.createElement('h3');
+ − 1028
heading.appendChild(document.createTextNode($lang.get('acl_msg_scale_intro_title')));
+ − 1029
main.appendChild(heading);
+ − 1030
+ − 1031
var p = document.createElement('p');
+ − 1032
p.appendChild(document.createTextNode($lang.get('acl_msg_scale_intro_body')));
+ − 1033
main.appendChild(p);
+ − 1034
+ − 1035
+ − 1036
main.innerHTML += data.key;
+ − 1037
main.style.backgroundImage = 'none';
+ − 1038
+ − 1039
document.getElementById(aclManagerID + '_back').style.display = 'inline';
+ − 1040
document.getElementById(aclManagerID + '_next').style.display = 'none';
+ − 1041
+ − 1042
for ( var i = 0; i < data.rules.length; i++ )
+ − 1043
{
+ − 1044
var rule = data.rules[i];
+ − 1045
// build the rule, this is just more boring DOM crap.
+ − 1046
var div = document.createElement('div');
+ − 1047
div.style.padding = '5px 3px';
+ − 1048
div.style.backgroundColor = '#' + rule.color;
+ − 1049
div.style.cursor = 'pointer';
+ − 1050
div.rule_id = rule.rule_id;
+ − 1051
div.onclick = function()
+ − 1052
{
+ − 1053
var main = document.getElementById(aclManagerID + '_main');
+ − 1054
main.innerHTML = '';
+ − 1055
main.style.backgroundImage = 'url(' + scriptPath + '/images/loading-big.gif)';
+ − 1056
ajaxOpenDirectACLRule(parseInt(this.rule_id));
+ − 1057
}
+ − 1058
div.innerHTML = rule.score_string;
+ − 1059
main.appendChild(div);
+ − 1060
}
+ − 1061
}
+ − 1062
1
+ − 1063
function array_keys(obj)
+ − 1064
{
+ − 1065
keys = new Array();
+ − 1066
for(var i in obj)
+ − 1067
keys.push(i);
+ − 1068
return keys;
+ − 1069
}