includes/clientside/static/acl.js
changeset 218 e878bcf0227e
parent 184 d74ff822acc9
child 326 ab66d6d1f1f4
equal deleted inserted replaced
217:2b13497fe820 218:e878bcf0227e
    57   ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
    57   ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
    58       if(ajax.readyState == 4)
    58       if(ajax.readyState == 4)
    59       {
    59       {
    60         document.getElementById(aclManagerID+'_main').innerHTML = '';
    60         document.getElementById(aclManagerID+'_main').innerHTML = '';
    61         document.getElementById(aclManagerID + '_back').style.display = 'none';
    61         document.getElementById(aclManagerID + '_back').style.display = 'none';
    62         document.getElementById(aclManagerID + '_next').value = 'Next >';
    62         document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
    63         groups = parseJSON(ajax.responseText);
    63         groups = parseJSON(ajax.responseText);
    64         if ( groups.mode == 'error' )
    64         if ( groups.mode == 'error' )
    65         {
    65         {
    66           alert(groups.error);
    66           alert(groups.error);
    67           killACLManager();
    67           killACLManager();
   102   grpb.checked = 'checked';
   102   grpb.checked = 'checked';
   103   grpb.className = seed;
   103   grpb.className = seed;
   104   grpb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'block'; document.getElementById('enACL_usrbox_'+seed).style.display = 'none'; };
   104   grpb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'block'; document.getElementById('enACL_usrbox_'+seed).style.display = 'none'; };
   105   lbl = document.createElement('label');
   105   lbl = document.createElement('label');
   106   lbl.appendChild(grpb);
   106   lbl.appendChild(grpb);
   107   lbl.appendChild(document.createTextNode('A usergroup'));
   107   lbl.appendChild(document.createTextNode($lang.get('acl_radio_usergroup')));
   108   lbl.style.display = 'block';
   108   lbl.style.display = 'block';
   109   span.appendChild(grpsel);
   109   span.appendChild(grpsel);
   110   
   110   
   111   anoninfo = document.createElement('div');
   111   anoninfo = document.createElement('div');
   112   anoninfo.className = 'info-box-mini';
   112   anoninfo.className = 'info-box-mini';
   113   anoninfo.appendChild(document.createTextNode('To edit permissions for guests, select "a specific user", and enter Anonymous as the username.'));
   113   anoninfo.appendChild(document.createTextNode($lang.get('acl_msg_guest_howto')));
   114   span.appendChild(document.createElement('br'));
   114   span.appendChild(document.createElement('br'));
   115   span.appendChild(anoninfo);
   115   span.appendChild(anoninfo);
   116   
   116   
   117   usrb = document.createElement('input');
   117   usrb = document.createElement('input');
   118   usrb.type = 'radio';
   118   usrb.type = 'radio';
   120   usrb.value = '2'; // ACL_TYPE_USER
   120   usrb.value = '2'; // ACL_TYPE_USER
   121   usrb.className = seed;
   121   usrb.className = seed;
   122   usrb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'none'; document.getElementById('enACL_usrbox_'+seed).style.display = 'block'; };
   122   usrb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'none'; document.getElementById('enACL_usrbox_'+seed).style.display = 'block'; };
   123   lbl2 = document.createElement('label');
   123   lbl2 = document.createElement('label');
   124   lbl2.appendChild(usrb);
   124   lbl2.appendChild(usrb);
   125   lbl2.appendChild(document.createTextNode('A specific user'));
   125   lbl2.appendChild(document.createTextNode($lang.get('acl_radio_user')));
   126   lbl2.style.display = 'block';
   126   lbl2.style.display = 'block';
   127   
   127   
   128   usrsel = document.createElement('input');
   128   usrsel = document.createElement('input');
   129   usrsel.type = 'text';
   129   usrsel.type = 'text';
   130   usrsel.name = 'username';
   130   usrsel.name = 'username';
   165       scopeRadioGroup.className = '1048576';
   165       scopeRadioGroup.className = '1048576';
   166       if ( groups.page_groups.length > 0 ) scopeRadioGroup.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'block'; };
   166       if ( groups.page_groups.length > 0 ) scopeRadioGroup.onclick = function() { var id = 'enACL_pgsel_' + this.className; document.getElementById(id).style.display = 'block'; };
   167     lblPage = document.createElement('label');
   167     lblPage = document.createElement('label');
   168       lblPage.style.display = 'block';
   168       lblPage.style.display = 'block';
   169       lblPage.appendChild(scopeRadioPage);
   169       lblPage.appendChild(scopeRadioPage);
   170       lblPage.appendChild(document.createTextNode('Only this page'));
   170       lblPage.appendChild(document.createTextNode($lang.get('acl_radio_scope_thispage')));
   171     lblGlobal = document.createElement('label');
   171     lblGlobal = document.createElement('label');
   172       lblGlobal.style.display = 'block';
   172       lblGlobal.style.display = 'block';
   173       lblGlobal.appendChild(scopeRadioGlobal);
   173       lblGlobal.appendChild(scopeRadioGlobal);
   174       lblGlobal.appendChild(document.createTextNode('The entire website'));
   174       lblGlobal.appendChild(document.createTextNode($lang.get('acl_radio_scope_wholesite')));
   175     lblGroup = document.createElement('label');
   175     lblGroup = document.createElement('label');
   176       lblGroup.style.display = 'block';
   176       lblGroup.style.display = 'block';
   177       lblGroup.appendChild(scopeRadioGroup);
   177       lblGroup.appendChild(scopeRadioGroup);
   178       lblGroup.appendChild(document.createTextNode('A group of pages'));
   178       lblGroup.appendChild(document.createTextNode($lang.get('acl_radio_scope_pagegroup')));
   179     scopediv1.appendChild(lblPage);
   179     scopediv1.appendChild(lblPage);
   180     scopediv2.appendChild(lblGroup);
   180     scopediv2.appendChild(lblGroup);
   181     scopediv3.appendChild(lblGlobal);
   181     scopediv3.appendChild(lblGlobal);
   182     
   182     
   183     scopedesc = document.createElement('p');
   183     scopedesc = document.createElement('p');
   184     scopedesc.appendChild(document.createTextNode('What should this access rule control?'));
   184     scopedesc.appendChild(document.createTextNode($lang.get('acl_lbl_scope')));
   185     
   185     
   186     scopePGrp = document.createElement('select');
   186     scopePGrp = document.createElement('select');
   187     scopePGrp.style.marginLeft = '13px';
   187     scopePGrp.style.marginLeft = '13px';
   188     scopePGrp.style.display = 'none';
   188     scopePGrp.style.display = 'none';
   189     scopePGrp.id = "enACL_pgsel_1048576";
   189     scopePGrp.id = "enACL_pgsel_1048576";
   217   container.style.margin = 'auto';
   217   container.style.margin = 'auto';
   218   container.style.width = '360px';
   218   container.style.width = '360px';
   219   container.style.paddingTop = '50px';
   219   container.style.paddingTop = '50px';
   220   
   220   
   221   head = document.createElement('h2');
   221   head = document.createElement('h2');
   222   head.appendChild(document.createTextNode('Manage page access'));
   222   head.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_title')));
   223   
   223   
   224   desc = document.createElement('p');
   224   desc = document.createElement('p');
   225   desc.appendChild(document.createTextNode('Please select who should be affected by this access rule.'));
   225   desc.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_body')));
   226   
   226   
   227   container.appendChild(head);
   227   container.appendChild(head);
   228   container.appendChild(desc);
   228   container.appendChild(desc);
   229   container.appendChild(selector);
   229   container.appendChild(selector);
   230   
   230   
   317         {
   317         {
   318           case 'seltarget':
   318           case 'seltarget':
   319             
   319             
   320             // Build the ACL edit form
   320             // Build the ACL edit form
   321             // try {
   321             // try {
   322               act_desc = ( data.type == 'new' ) ? 'Create access rule' : 'Editing permissions';
   322             
   323               target_type_t = ( data.target_type == 1 ) ? 'group' : 'user';
   323               var act_desc = ( data.type == 'new' ) ? $lang.get('acl_lbl_editwin_title_create') : $lang.get('acl_lbl_editwin_title_edit');
   324               target_name_t = data.target_name;
   324               var target_type_t = ( data.target_type == 1 ) ? $lang.get('acl_target_type_group') : $lang.get('acl_target_type_user');
   325               var scope_type = ( data.page_id == false && data.namespace == false ) ? 'this entire site' : ( data.namespace == '__PageGroup' ) ? 'this group of pages' : 'this page';
   325               var target_name_t = data.target_name;
   326               html = '<h2>'+act_desc+'</h2><p>This panel allows you to edit what the '+target_type_t+' "<b>'+target_name_t+'</b>" can do on <b>' + scope_type + '</b>. Unless you set a permission to "Deny", these permissions may be overridden by other rules.</p>';
   326               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');
       
   327               
       
   328               html = '<h2>'+act_desc+'</h2>';
       
   329               html += '<p>' + $lang.get('acl_lbl_editwin_body', { target_type: target_type_t, target: target_name_t, scope_type: scope_type }) + '</p>';
   327               parser = new templateParser(data.template.acl_field_begin);
   330               parser = new templateParser(data.template.acl_field_begin);
   328               html += parser.run();
   331               html += parser.run();
   329               
   332               
   330               cls = 'row2';
   333               cls = 'row2';
   331               for(var i in data.acl_types)
   334               for(var i in data.acl_types)
   333                 if(typeof(data.acl_types[i]) == 'number')
   336                 if(typeof(data.acl_types[i]) == 'number')
   334                 {
   337                 {
   335                   cls = ( cls == 'row1' ) ? 'row2' : 'row1';
   338                   cls = ( cls == 'row1' ) ? 'row2' : 'row1';
   336                   p = new templateParser(data.template.acl_field_item);
   339                   p = new templateParser(data.template.acl_field_item);
   337                   vars = new Object();
   340                   vars = new Object();
   338                   vars['FIELD_DESC'] = data.acl_descs[i];
   341                   if ( data.acl_descs[i].match(/^([a-z0-9_]+)$/) )
       
   342                   {
       
   343                     vars['FIELD_DESC'] = $lang.get(data.acl_descs[i]);
       
   344                   }
       
   345                   else
       
   346                   {
       
   347                     vars['FIELD_DESC'] = data.acl_descs[i];
       
   348                   }
   339                   vars['FIELD_DENY_CHECKED'] = '';
   349                   vars['FIELD_DENY_CHECKED'] = '';
   340                   vars['FIELD_DISALLOW_CHECKED'] = '';
   350                   vars['FIELD_DISALLOW_CHECKED'] = '';
   341                   vars['FIELD_WIKIMODE_CHECKED'] = '';
   351                   vars['FIELD_WIKIMODE_CHECKED'] = '';
   342                   vars['FIELD_ALLOW_CHECKED'] = '';
   352                   vars['FIELD_ALLOW_CHECKED'] = '';
   343                   vars['FIELD_NAME'] = i;
   353                   vars['FIELD_NAME'] = i;
   365               
   375               
   366               var parser = new templateParser(data.template.acl_field_end);
   376               var parser = new templateParser(data.template.acl_field_end);
   367               html += parser.run();
   377               html += parser.run();
   368               
   378               
   369               if(data.type == 'edit')
   379               if(data.type == 'edit')
   370                 html += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'Do you really want to delete this rule?\')) __aclDeleteRule(); return false;" style="color: red;">Delete this rule</a></p>';
   380                 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>';
   371               
   381               
   372               var main = document.getElementById(aclManagerID + '_main');
   382               var main = document.getElementById(aclManagerID + '_main');
   373               main.innerHTML = html;
   383               main.innerHTML = html;
   374               
   384               
   375               var form = document.getElementById(aclManagerID + '_formobj_id');
   385               var form = document.getElementById(aclManagerID + '_formobj_id');
   381                 alert('modeobj is invalid: '+modeobj);
   391                 alert('modeobj is invalid: '+modeobj);
   382               
   392               
   383               aclPermList = array_keys(data.acl_types);
   393               aclPermList = array_keys(data.acl_types);
   384               
   394               
   385               document.getElementById(aclManagerID + '_back').style.display = 'inline';
   395               document.getElementById(aclManagerID + '_back').style.display = 'inline';
   386               document.getElementById(aclManagerID + '_next').value = 'Save Changes';
   396               document.getElementById(aclManagerID + '_next').value = $lang.get('etc_save_changes');
   387               
   397               
   388             // } catch(e) { alert(e); aclDebug(ajax.responseText); }
   398             // } catch(e) { alert(e); aclDebug(ajax.responseText); }
   389             
   399             
   390             break;
   400             break;
   391           case 'success':
   401           case 'success':
   392             var note = document.createElement('div');
   402             var note = document.createElement('div');
   393             note.className = 'info-box';
   403             note.className = 'info-box';
   394             note.style.marginLeft = '0';
   404             note.style.marginLeft = '0';
   395             var b = document.createElement('b');
   405             var b = document.createElement('b');
   396             b.appendChild(document.createTextNode('Permissions updated'));
   406             b.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_title')));
   397             note.appendChild(b);
   407             note.appendChild(b);
   398             note.appendChild(document.createElement('br'));
   408             note.appendChild(document.createElement('br'));
   399             note.appendChild(document.createTextNode('The permissions for '+data.target_name+' on this page have been updated successfully. If you changed permissions that affect your user account, you may not see changes until you reload the page.'));
   409             note.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_body', { target_name: data.target_name })));
   400             note.appendChild(document.createElement('br'));
   410             note.appendChild(document.createElement('br'));
   401             var a = document.createElement('a');
   411             var a = document.createElement('a');
   402             a.href = 'javascript:void(0);';
   412             a.href = 'javascript:void(0);';
   403             a.onclick = function() { this.parentNode.parentNode.removeChild(this.parentNode); return false; };
   413             a.onclick = function() { this.parentNode.parentNode.removeChild(this.parentNode); return false; };
   404             a.appendChild(document.createTextNode('[ dismiss :'));
   414             a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
   405             note.appendChild(a);
   415             note.appendChild(a);
   406             var a2 = document.createElement('a');
   416             var a2 = document.createElement('a');
   407             a2.href = 'javascript:void(0);';
   417             a2.href = 'javascript:void(0);';
   408             a2.onclick = function() { killACLManager(); return false; };
   418             a2.onclick = function() { killACLManager(); return false; };
   409             a2.appendChild(document.createTextNode(': close manager ]'));
   419             a2.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
   410             note.appendChild(a2);
   420             note.appendChild(a2);
   411             document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   421             document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   412             if(!document.getElementById(aclManagerID+'_deletelnk'))
   422             if(!document.getElementById(aclManagerID+'_deletelnk'))
   413               document.getElementById(aclManagerID + '_main').innerHTML += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'Do you really want to delete this rule?\')) __aclDeleteRule(); return false;" style="color: red;">Delete this rule</a></p>';
   423               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>';
   414             //fadeInfoBoxes();
   424             //fadeInfoBoxes();
   415             document.getElementById(aclManagerID+'_main').scrollTop = 0;
   425             document.getElementById(aclManagerID+'_main').scrollTop = 0;
   416             
   426             
   417             aclDataCache.mode = 'save_edit';
   427             aclDataCache.mode = 'save_edit';
   418             break;
   428             break;
   426           ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
   436           ajaxPost(stdAjaxPrefix+'&_mode=acljson', 'acl_params='+params, function() {
   427               if(ajax.readyState == 4)
   437               if(ajax.readyState == 4)
   428               {
   438               {
   429                 document.getElementById(aclManagerID+'_main').innerHTML = '';
   439                 document.getElementById(aclManagerID+'_main').innerHTML = '';
   430                 document.getElementById(aclManagerID + '_back').style.display = 'none';
   440                 document.getElementById(aclManagerID + '_back').style.display = 'none';
   431                 document.getElementById(aclManagerID + '_next').value = 'Next >';
   441                 document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
   432                 var thispage = strToPageID(title);
   442                 var thispage = strToPageID(title);
   433                 groups.page_id = thispage[0];
   443                 groups.page_id = thispage[0];
   434                 groups.namespace = thispage[1];
   444                 groups.namespace = thispage[1];
   435                 __aclBuildSelector(groups);
   445                 __aclBuildSelector(groups);
   436                 
   446                 
   439                 note.style.marginLeft = '0';
   449                 note.style.marginLeft = '0';
   440                 note.style.position = 'absolute';
   450                 note.style.position = 'absolute';
   441                 note.style.width = '558px';
   451                 note.style.width = '558px';
   442                 note.id = 'aclSuccessNotice_' + Math.floor(Math.random() * 100000);
   452                 note.id = 'aclSuccessNotice_' + Math.floor(Math.random() * 100000);
   443                 b = document.createElement('b');
   453                 b = document.createElement('b');
   444                 b.appendChild(document.createTextNode('Entry deleted'));
   454                 b.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_title')));
   445                 note.appendChild(b);
   455                 note.appendChild(b);
   446                 note.appendChild(document.createElement('br'));
   456                 note.appendChild(document.createElement('br'));
   447                 note.appendChild(document.createTextNode('The access rules for '+aclDataCache.target_name+' on this page have been deleted.'));
   457                 note.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_title', { target_name: aclDataCache.target_name })));
   448                 note.appendChild(document.createElement('br'));
   458                 note.appendChild(document.createElement('br'));
   449                 a = document.createElement('a');
   459                 a = document.createElement('a');
   450                 a.href = '#';
   460                 a.href = '#';
   451                 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; };
   461                 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; };
   452                 a.appendChild(document.createTextNode('[ dismiss :'));
   462                 a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
   453                 note.appendChild(a);
   463                 note.appendChild(a);
   454                 a = document.createElement('a');
   464                 a = document.createElement('a');
   455                 a.href = '#';
   465                 a.href = '#';
   456                 a.onclick = function() { killACLManager(); return false; };
   466                 a.onclick = function() { killACLManager(); return false; };
   457                 a.appendChild(document.createTextNode(': close manager ]'));
   467                 a.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
   458                 note.appendChild(a);
   468                 note.appendChild(a);
   459                 document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   469                 document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
   460                 //fadeInfoBoxes();
   470                 //fadeInfoBoxes();
   461                 
   471                 
   462               }
   472               }
   540   form.name = aclManagerID + '_formobj';
   550   form.name = aclManagerID + '_formobj';
   541   form.id   = aclManagerID + '_formobj_id';
   551   form.id   = aclManagerID + '_formobj_id';
   542   
   552   
   543   back = document.createElement('input');
   553   back = document.createElement('input');
   544   back.type = 'button';
   554   back.type = 'button';
   545   back.value = '< Back';
   555   back.value = $lang.get('etc_wizard_back');
   546   back.style.fontWeight = 'normal';
   556   back.style.fontWeight = 'normal';
   547   back.onclick = function() { ajaxACLSwitchToSelector(); return false; };
   557   back.onclick = function() { ajaxACLSwitchToSelector(); return false; };
   548   back.style.display = 'none';
   558   back.style.display = 'none';
   549   back.id = aclManagerID + '_back';
   559   back.id = aclManagerID + '_back';
   550   
   560   
   551   saver = document.createElement('input');
   561   saver = document.createElement('input');
   552   saver.type = 'submit';
   562   saver.type = 'submit';
   553   saver.value = 'Next >';
   563   saver.value = $lang.get('etc_wizard_next');
   554   saver.style.fontWeight = 'bold';
   564   saver.style.fontWeight = 'bold';
   555   saver.id = aclManagerID + '_next';
   565   saver.id = aclManagerID + '_next';
   556   
   566   
   557   closer = document.createElement('input');
   567   closer = document.createElement('input');
   558   closer.type = 'button';
   568   closer.type = 'button';
   559   closer.value = 'Cancel Changes';
   569   closer.value = $lang.get('etc_cancel_changes');
   560   closer.onclick = function() { if(!confirm('Do you really want to close the ACL manager?')) return false; killACLManager(); return false; }
   570   closer.onclick = function() { if(!confirm($lang.get('acl_msg_closeacl_confirm'))) return false; killACLManager(); return false; }
   561   
   571   
   562   spacer1 = document.createTextNode('  ');
   572   spacer1 = document.createTextNode('  ');
   563   spacer2 = document.createTextNode('  ');
   573   spacer2 = document.createTextNode('  ');
   564   
   574   
   565   panel.appendChild(back);
   575   panel.appendChild(back);
   622       break;
   632       break;
   623     case 'seltarget':
   633     case 'seltarget':
   624       var target_type = parseInt(getRadioState(thefrm, 'target_type', ['1', '2']));
   634       var target_type = parseInt(getRadioState(thefrm, 'target_type', ['1', '2']));
   625       if(isNaN(target_type))
   635       if(isNaN(target_type))
   626       {
   636       {
   627         alert('Please select a target type.');
   637         alert($lang.get('acl_err_pleaseselect_targettype'));
   628         return false;
   638         return false;
   629       }
   639       }
   630       target_id = ( target_type == 1 ) ? parseInt(thefrm.group_id.value) : thefrm.username.value;
   640       target_id = ( target_type == 1 ) ? parseInt(thefrm.group_id.value) : thefrm.username.value;
   631       
   641       
   632       obj = { 'mode' : mode, 'target_type' : target_type, 'target_id' : target_id };
   642       obj = { 'mode' : mode, 'target_type' : target_type, 'target_id' : target_id };
   664         obj['page_id'] = aclDataCache.page_id;
   674         obj['page_id'] = aclDataCache.page_id;
   665         obj['namespace'] = aclDataCache.namespace;
   675         obj['namespace'] = aclDataCache.namespace;
   666       }
   676       }
   667       if(target_id == '')
   677       if(target_id == '')
   668       {
   678       {
   669         alert('Please enter a username.');
   679         alert($lang.get('acl_err_pleaseselect_username'));
   670         return false;
   680         return false;
   671       }
   681       }
   672       __aclJSONSubmitAjaxHandler(obj);
   682       __aclJSONSubmitAjaxHandler(obj);
   673       break;
   683       break;
   674     case 'save_edit':
   684     case 'save_edit':