(function(m){var n=new function(){this.AccessRights=function(){this.category="Software";this.name="AccessRights";this.subnavigationicon="sec-nav-access.png";var c=void 0;this.Init=function(){c=this;if(void 0==c||null==c)return!1;c.setCycleTime(2E3);c.setCommunicationObj(m.DevMan.getCommunicationModule(m.DevMan.CommunicationType.mdp));c.addParameter("Management_Username_Property_Len",!0);c.addParameter("Management_Domain_Property_Len",!0);c.addParameter("Management_Group_Membership_Property_Len",!0);
c.addParameter("Management_Local_Groups_Property_Len",!0);c.addParameter("GENERAL_Device_Name",!1);c.setOnInitStaticPage(n);c.setOnDisplayValues(s);c.setOnServiceTransferFailed(t);c.setOnServiceTransferResult(u);return!0};var n=function(a){a='<h3>NTLM Configuration</h3><table style="margin-bottom: 5px">';a+='<tr><td class="td_trans"><h4>Add User</h4></td><td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnAddUser","save","Add User")+(new ControlLib.SmallButton).Create("btnAddUser_Cancel",
"delete","Discard Changes")+"</td></tr>";a+="</table>";a+="<table>";a+='<tr><td class="td_FirstColumn">Username</td><td>'+(new ControlLib.Textbox).Create("txtAddUser_Username")+"</td></tr>";winxp&&(a+='<tr><td class="td_FirstColumn">Domain</td><td>'+(new ControlLib.Textbox).Create("txtAddUser_Domain")+"</td></tr>");a+='<tr><td class="td_FirstColumn">Password</td><td>'+(new ControlLib.Textbox).Create("txtAddUser_Password")+"</td></tr>";a+="</table>";a+="<br>";a+='<table style="margin-bottom: 5px">';
a+='<tr><td class="td_trans"><h4>Add Local Group</h4></td><td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnAddLocalGroup","save","Add Local Group")+(new ControlLib.SmallButton).Create("btnAddLocalGroup_Cancel","delete","Discard Changes")+"</td></tr>";a+="</table>";a+="<table>";a+='<tr><td class="td_FirstColumn">Groupname</td><td>'+(new ControlLib.Textbox).Create("txtAddGroup_Groupname")+"</td></tr>";a+="</table>";a+="<br>";a+='<table style="margin-bottom: 5px">';a+='<tr><td class="td_trans"><h4>Set Local Group Membership</h4></td><td class="td_Action_trans">'+
(new ControlLib.SmallButton).Create("btnSetGroupMembership","save","Set Local Group Membership")+(new ControlLib.SmallButton).Create("btnSetGroupMembership_Cancel","delete","Discard Changes")+"</td></tr>";a+="</table>";a+="<table>";a+='<tr><td class="td_FirstColumn">Membership</td><td>'+(new ControlLib.Radiobutton).Create("chkSetGroupMembership_Membership",1,"Add",!0)+(new ControlLib.Radiobutton).Create("chkSetGroupMembership_Membership",0,"Delete",!1)+"</td></tr>";a+='<tr><td class="td_FirstColumn">Username</td><td>'+
(new ControlLib.Textbox).Create("txtSetGroupMembership_Username")+"</td></tr>";a+='<tr><td class="td_FirstColumn">Groupname</td><td>'+(new ControlLib.Textbox).Create("txtSetGroupMembership_Groupname")+"</td></tr>";a+="</table>";a+="<br>";a+="<h3>Configured Users</h3>";a+='<div id="users">No Items available</div>';a+="<br>";a+="<h3>Configured Local Groups</h3>";a+='<div id="local_groups">No Items available</div>';a+="<br>";a+='<div id="status"></div>';c.writeActivePage(a);c.setElementOnClick("btnAddUser",
function(a){return function(){var a=c.getElementValue("txtAddUser_Username"),b="";winxp&&(b=c.getElementValue("txtAddUser_Domain"));var g=c.getElementValue("txtAddUser_Password"),e=c.getCommunicationObj().getServiceTransferParameterSize("Management_Function_Add_User")+a.length+b.length+g.length,h=[];h.push(e);h.push(a.length);h.push(b.length);h.push(g.length);h.push(a);h.push(b);h.push(g);c.executeCommand("Management_Function_Add_User",0,h);Helper.ShowLoading()}}(0));c.setElementOnClick("btnAddUser_Cancel",
function(a){return function(){p(a)}}(0));c.setElementOnClick("btnAddLocalGroup",function(a){return function(){var a=c.getRequestParamIDs(),b=c.getElementValue("txtAddGroup_Groupname"),a=a[4].values[0].data,g=c.getCommunicationObj().getServiceTransferParameterSize("Management_Function_Create_Group")+b.length+a.length,e=[];e.push(g);e.push(b.length);e.push(a.length);e.push(b);e.push(a);c.executeCommand("Management_Function_Create_Group",0,e);Helper.ShowLoading()}}(0));c.setElementOnClick("btnAddLocalGroup_Cancel",
function(a){return function(){q(a)}}(0));c.setElementOnClick("btnSetGroupMembership",function(a){return function(){var a=c.getRequestParamIDs(),b=c.getCheckedRadioButtonValue("chkSetGroupMembership_Membership"),g=c.getElementValue("txtSetGroupMembership_Username"),e=c.getElementValue("txtSetGroupMembership_Groupname"),a=a[4].values[0].data,h=c.getCommunicationObj().getServiceTransferParameterSize("Management_Function_Set_Group_Membership")+g.length+e.length+a.length,k=[];k.push(h);k.push(g.length);
k.push(e.length);k.push(a.length);k.push(b);k.push(g);k.push(e);k.push(a);c.executeCommand("Management_Function_Set_Group_Membership",0,k);Helper.ShowLoading()}}(0));c.setElementOnClick("btnSetGroupMembership_Cancel",function(a){return function(){r(a)}}(0));return!0},s=function(a){if(a[0].getHasValues()||a[1].getHasValues()||a[2].getHasValues()){var b;b="<table><tr><th>User Name</th><th>Domain</th><th>Group Membership</th><th></th></tr>";var l=0;a[0].getHasValues()&&(l=a[0].values[0].length);var d=
0;a[1].getHasValues()&&(d=a[1].values[0].length);var g=0;a[2].getHasValues()&&(g=a[2].values[0].length);l=Math.max(l,d,g);for(d=0;d<l;d++){b+="<tr>";try{b+='<td><div id="'+a[0].parameterName+d+'">'+a[0].values[0][d].getOutput()+"</div></td>"}catch(e){b+="<td></td>"}try{b+='<td><div id="'+a[1].parameterName+d+'">'+a[1].values[0][d].getOutput()+"</div></td>"}catch(h){b+="<td></td>"}try{b+='<td><div id="'+a[2].parameterName+d+'">'+a[2].values[0][d].getOutput()+"</div></td>"}catch(k){b+="<td></td>"}try{b+=
'<td><div align="right" id="">'+(new ControlLib.SmallButton).Create("DeleteUser"+d,"delete","")+"</div></td>"}catch(m){b+="<td></td>"}b+="</tr>"}b+="</table>";c.writeElement("users",b);for(d=0;d<l;d++)try{c.setElementOnClick("DeleteUser"+d,function(a){return function(){var b=c.getRequestParamIDs(),d=c.readElement(b[0].parameterName+a),b=c.readElement(b[1].parameterName+a);if(confirm("Do you really want to delete the user "+d+"?")){var e=c.getCommunicationObj().getServiceTransferParameterSize("Management_Function_Del_User")+
d.length+b.length,f=[];f.push(e);f.push(d.length);f.push(b.length);f.push(d);f.push(b);c.executeCommand("Management_Function_Del_User",0,f);Helper.ShowLoading()}}}(d))}catch(n){}}else c.writeElement("users","No items available");if(a[3].getHasValues()){b="<table>";b+="<tr><th>Local Group</th><th></th></tr>";l=0;a[3].getHasValues()&&(l=a[3].values[0].length);for(d=0;d<l;d++){b+="<tr>";try{b+='<td><div id="'+a[3].parameterName+d+'">'+a[3].values[0][d].getOutput()+"</div></td>"}catch(p){b+="<td></td>"}try{b+=
'<td><div align="right" id="">'+(new ControlLib.SmallButton).Create("DeleteLocalGroup"+d,"delete","")+"</div></td>"}catch(q){b+="<td></td>"}b+="</tr>"}b+="</table>";c.writeElement("local_groups",b);for(d=0;d<l;d++)try{c.setElementOnClick("DeleteLocalGroup"+d,function(a){return function(){var b=c.getRequestParamIDs(),d=c.readElement(b[3].parameterName+a),b=b[4].values[0].data;if(confirm("Do you really want to delete the group "+d+"?")){var e=c.getCommunicationObj().getServiceTransferParameterSize("Management_Function_Delete_Group")+
d.length+b.length,f=[];f.push(e);f.push(d.length);f.push(b.length);f.push(d);f.push(b);c.executeCommand("Management_Function_Delete_Group",0,f);Helper.ShowLoading()}}}(d))}catch(r){}}else c.writeElement("local_groups","No items available")},t=function(a){Helper.HideLoading();m.DevMan.getErrorQueue().AddError(a.requestStatus,a.requestStatusText)},u=function(a){Helper.HideLoading();a.hasError?(1378==a.errCode?a.errCode=3970368866:1388==a.errCode?a.errCode=3970368876:1377==a.errCode&&(a.errCode=3970368865),
m.DevMan.getErrorQueue().AddError(a.errCode)):"Management_Function_Add_User"==a.moduleItem.name?p(0):"Management_Function_Create_Group"==a.moduleItem.name?q(0):"Management_Function_Set_Group_Membership"==a.moduleItem.name&&r(0)},p=function(a){c.setElementValue("txtAddUser_Username","");winxp&&c.setElementValue("txtAddUser_Domain","");c.setElementValue("txtAddUser_Password","")},q=function(a){c.setElementValue("txtAddGroup_Groupname","")},r=function(a){c.setElementChecked("chkSetGroupMembership_Membership_Add");
c.setElementValue("txtSetGroupMembership_Username","");c.setElementValue("txtSetGroupMembership_Groupname","")}};this.AccessRights.prototype=new m.Page_Template.Template};m.DevMan.RegisterModule(new n.AccessRights,m.DevMan.ModuleType.Website)})(window);
