亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ldap.js

?? javascript source code part2
?? JS
字號:
/**
LDAP.js version 2.0
This library is designed to provide access to a LDAP server
from JavaScript primarily via the Netscape JAVA Directory SDK.
A middle-ware class is used to communicate with the Directory SDK.
This is primarily because JavaScript doesn't yet support exceptions
and to make sure that only valid JavaScript values are returned.


This version hopefully is easier to use. It also adds extra functions
like the ability to modify the LDAP database and to use your own search
filters.
I've also attempted to make it mimic more the Server Side JavaScript
Database object.

Hopefully you find this software useful. But as with any project of
this type, mileage may vary. Which means that I believe it will work, 
but there are no specified or implied warranties to the usefullness of 
this software.
**/

/**
Primary author: Mark Wilcox, mewilcox@unt.edu

Also thanks to:
Willy Mena wmena@phoenixgroup.com
Darrell Rials drials@sbti.com
Allan Anderson of Stonebridge Technologies
Raphael Luta luta@terra.fr
**/

/**
How to use:
You perform all actions through a LDAP object.
When you make a new LDAP object it automatically connects to
the server.

I also added a weak hack to deal with errors called
doError()
This function is called within each of these methods.
I've included it in a file called utils.js
You can write your own doError() by following the example
provided and by including it instead of my code when
you compile your code.

Here are the public methods:
//constructor
LDAP ()

//generic methods
authenticate()
getAttributeArray()
setAttribute()
addAttribute()

//search methods
getDN()
getSearchBase()
setSearchBase()
getSearchScope()
setSearchScope()
setSearchBase()
doSearch()     //use scope,base,filter specified in constructor
doFullSearch()  //specify scope,base,filter
doSearchTable() // do output as HTML table
doFullSearchTable() //do full search, output as HTML table
                           
//error handling
getErrorCode();
getErrorMessage();
getLDAPErrorCode();
  
//internal methods and those kept to keep older scripts from
connect()
disconnect()
**/

/* object constructor
*/

function LDAP(ldap_host,ldap_port,ldap_basedn,ldap_scope,ldap_MGR_DN,ldap_MGR_PW){
 //scope variables
this.SCOPE_BASE = Packages.mark.ldap.SSJSLDAP.SCOPE_BASE; // retrieve only 1 entry
this.SCOPE_ONE = Packages.mark.ldap.SSJSLDAP.SCOPE_ONE;   // all levels below baseDN, but not ldap_basedn
this.SCOPE_SUB = Packages.mark.ldap.SSJSLDAP.SCOPE_SUB;   // search entire dBase starting at ldap_basedn and continue below baseDN
this.duh = " "; //test value                                                                              
  this.host = ldap_host;
  this.port = ldap_port;
  this.base = ldap_basedn;
  if ((ldap_scope == null) || (ldap_scope=="")) {
      this.scope = this.SCOPE_BASE;
       }

  this.MGR_DN = ldap_MGR_DN;
  this.MGR_PW = ldap_MGR_PW;
  
  //set up function calls
  
  this.authenticate = authenticate;
  this.setAttribute = setAttribute;
  this.addAttribute = addAttribute;
  this.removeAttribute = removeAttribute;
  this.getSearchBase = getSearchBase;
  this.setSearchBase = setSearchBase;
  this.getSearchScope = getSearchScope;
  this.setSearchScope = setSearchScope;
  
  this.getDN = getDN;
  this.doSearch  = doSearch;
  this.doFullSearch = doFullSearch;
  this.doFullSearchTable = doFullSearchTable;

  this.addEntry = addEntry;

  this.getErrorCode = getErrorCode;
  this.getErrorMessage = getErrorMessage;
  this.getLDAPErrorCode = getLDAPErrorCode;
 


//private objects
/* This is our LDAP connection object
   Due to a bug in Enterprise 3 where it does not properly close LDAP
   connections internally, we must reduce the number of connections
   we open ourselves with this API.
   The JAVA LDAP SDK enables us to use the clone() method of the LDAPConnection
   class to also reduce the number of connections we have to initiate. Each connection
   is unique, but won't actually try to open an entirely new one unless we reauthenticate
   after creating the initial connection.
   So I recommend the following:
   1) When you use this package always authenticate as one user id for the entire life of the
   application. For example if you are going to only be doing searches, authenticate anonymously once.
   2) If you want to allow modifications from an SSJS application, again authenticate as one ID. To
   restrict access, use the ACL features built into the Enterprise server to do so.
   It's easier to manage and it reduces the number of connections. See the following article on how
   to do so: http://developer.netscape.com.....

*/
debug("calling this connection call");
this.connection =  connect(this.host,this.port,this.base,this.scope,this.MGR_DN,this.MGR_PW);

 
} 

/*************PRIVATE FUNCTIONS**************************************/

// connect to the server, for life of the application
// returns a "ldap" object that represents how JavaScript will communicate with the LDAP SDK. 
function connect(host,port,searchBase,searchScope,mgr_DN,mgr_PW){
 ld = new Packages.mark.ldap.SSJSLDAP(host,parseInt(port),searchBase,parseInt(searchScope),mgr_DN,mgr_PW);
debug("in connect\n");
  var conn = ld.connect();


  if (conn != void(0)){
 debug("this.conn oK!");
    return(ld);
  }
  else{
    return null;
  }  
}

//needed because the SDK isConnected will return true until you call disconnect()
function isConnected(ldap){
  var v = java.util.Vector();
  v.addElement("cn");  
 //search for anything we're testing connections, not results :-)
  ldap.connection.getAttributes(this.base,parseInt(this.scope),"(cn=John Doe)",v,1);
  if (this.getLDAPErrorCode() == 0) { return true;}
  else{ return false;}
 }
function disconnect(){
    this.connection.disconnect();
    }

/*****************END PRIVATE FUNCTIONS******************************/

/*function getSearchBase()
 returns a string that reprents the current base of searches
*/
 function getSearchBase(){
  return this.basedn;
  }

/* function getSearchScope
  returns the current scope used for searches
*/
function getSearchScope(){
  return this.scope;
  }

/* function setSearchBase()
  pass it a string that represents the base DN to start
  sets a new base to use for searches
*/
function setSearchBase(baseDN){
  this.base = baseDN;
  }

 /* function setSearchScope()
  pass it a number that represents the scope of the search
  sets a new scope to use for searches
 */
function setSearchScope(new_scope){
    this.scope = parseInt(new_scope);
    }

/* function getDN
 pass it a search filter and it returns the Distinguished Name
 of that entry
 */

function getDN(searchFilter) {
return  this.connection.getDN(this.base,parseInt(this.scope),searchFilter);
 }


 
 function setAttribute(entryDN,modifierDN,attribute,value){
    this.connection.setAttribute(entryDN,modifierDN,attribute,value)
   }


 function addAttribute(entryDN,modifierDN,attribute,value){
     this.connection.addAttribute(entryDN,modifierDN,attribute,value);
    }

 function removeAttribute(entryDN,modifierDN,attribute,value){
    this.connection.removeAttribute(entryDN,modifierDN,attribute,value)
   }
  
 function authenticate(userDN,password){
   return this.connection.authenticate(userDN,password);
  }

//set maxResults to 0 if you want unlimted return
 function doFullSearch(searchFilter,attributes,maxResults){
    return (this.connection.getAttributes(this.base,parseInt(this.scope),searchFilter,attributes,parseInt(maxResults)));
 }
 
  function doFullSearchTable(searchFilter,attributes,maxResults){
    var tempArray = this.doFullSearch(searchFilter,attributes,maxResults);
      write("<TABLE border=1>");
           
      for(var i=0;i<tempArray.length;i++){
           valueString = tempArray[i];
      var st = java.util.StringTokenizer(valueString,"|");
      var attributeName;
      var attributeValue;
    while(st.hasMoreElements()){
       attributeName = st.nextElement();
       attributeValue = st.nextElement();
       write("<TR><TD>"+attributeName+"</TD><TD>"+attributeValue+"</TD></TR>")
        }
        } 
         write("</TABLE>");
          }

 
 function doSearch(searchFilter,attributes,maxResults){
    var javaArray = this.connection.getAttributes(this.base,parseInt(this.scope),searchFilter,attributes,parseInt(maxResults));
    var jsArray = new Array();
   
    //possible kludge here because on my system it returns a Java String type not JS String
   for(var i=0;i<javaArray.length;i++){
      valueString = javaArray[i];
      var st = java.util.StringTokenizer(valueString,"|");
      var attributeName;
      var attributeValue;
    while(st.hasMoreElements()){
       attributeName = st.nextElement();
       attributeValue = st.nextElement();
       jsArray[i]=attributeValue;
        }
        } 
      return (jsArray);
   }

/* addEntry function
  creates a new entry in the LDAP server.
  give it the distinguished name of the new entry
  the distinguished name of the modifier
  and an ldapEntry JS object*/

function addEntry(entryDN,modifierDN,myAttributes){
  this.connection.addEntry(entryDN,modifierDN,myAttributes.attrs);
 }

function getErrorCode(){
 return this.connection.ERROR_CODE;
  }

 
function getErrorMessage(){
  if (this.getErrorCode() != "0"){
    return this.connection.ERROR_MESSAGE;
    }
  else return "Application OK!";
  }


function getLDAPErrorCode(){
  return this.connection.LDAP_ERROR_CODE;
  }

/**********************************************************************************/
//This is the LDAPAttributes JavaScript object correlates with a Netscape LDAPAttributes object


function LDAPAttributes(){
this.attrs = new Packages.netscape.ldap.LDAPAttributeSet();
this.addAttributes = addAttributes;
}


function addAttributes(attribute,attributeArray){
// returns an array of Java Strings the size of the attributeArray
var attr = new netscape.ldap.LDAPAttribute(attribute);
 //copy from JavaScript psuedo-array to attribute
   for (var i=0;i<attributeArray.length;i++){
        attr.addValue(new java.lang.String(attributeArray[i]));
          }
      this.attrs.add(attr);
   
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费观看成人短视频| 波多野结衣视频一区| 国产精品传媒在线| 91精品国产色综合久久不卡蜜臀 | 91精品国产91久久综合桃花| 在线视频观看一区| gogo大胆日本视频一区| 成人sese在线| 97久久超碰国产精品电影| 国产一区二区免费视频| 久久99国产精品久久99 | 国产日韩影视精品| 精品国产1区二区| 精品少妇一区二区| 亚洲精品在线三区| 久久众筹精品私拍模特| 精品精品国产高清a毛片牛牛 | 日韩视频免费观看高清完整版| 在线不卡免费av| 日韩欧美一级在线播放| 日韩欧美一区二区视频| 精品久久久久久最新网址| 国产日产欧美一区| 国产精品免费丝袜| 亚洲视频一区二区在线| 亚洲精品视频自拍| 亚洲va韩国va欧美va| 久久精品国产亚洲一区二区三区| 韩国女主播一区| 国产盗摄精品一区二区三区在线| 国产精品一二一区| av电影在线观看一区| 在线一区二区三区四区五区| 欧美中文字幕久久| 欧美一区二区三区性视频| 久久精品视频一区二区三区| 亚洲免费观看高清| 久久99九九99精品| 99久久99精品久久久久久 | 亚州成人在线电影| 国产一区在线观看麻豆| 国产成人精品www牛牛影视| 色婷婷av一区二区三区大白胸| 91麻豆精品国产91久久久资源速度 | 狠狠色丁香婷婷综合久久片| 成人h动漫精品一区二区| 色婷婷国产精品| 久久久亚洲午夜电影| 一区二区三区四区蜜桃| 国产一区二区三区免费观看| 色综合天天综合网天天看片| 精品国产乱码久久久久久老虎| 亚洲日本在线a| 国产毛片精品一区| 91精品国产综合久久久久久久| 欧美激情综合在线| 久久国产日韩欧美精品| 欧美午夜片在线看| 国产精品美女www爽爽爽| 美女视频网站黄色亚洲| 色婷婷久久久综合中文字幕| 久久久久久9999| 亚洲成av人片一区二区梦乃| 91老师片黄在线观看| 久久精品视频在线看| 美腿丝袜亚洲一区| 在线播放欧美女士性生活| 亚洲欧洲综合另类在线| 粉嫩av亚洲一区二区图片| 欧美一级高清大全免费观看| 亚洲国产美女搞黄色| 99精品1区2区| 国产精品乱子久久久久| 丁香亚洲综合激情啪啪综合| 欧美一区二区三区免费在线看| 亚洲精品成a人| 99国产精品一区| 中文字幕在线不卡| 成人免费视频视频在线观看免费 | 欧洲人成人精品| 中文字幕乱码亚洲精品一区| 国产精品一区二区黑丝| 久久久久久免费| 狠狠色狠狠色综合| 久久五月婷婷丁香社区| 国产乱人伦偷精品视频不卡| 欧美精品一区二区三区蜜臀| 久久成人av少妇免费| 精品成人免费观看| 国产成人在线网站| 国产精品国产三级国产有无不卡 | ㊣最新国产の精品bt伙计久久| 国产成人免费视| 中文字幕一区二区三区不卡| 91同城在线观看| 亚洲精品中文在线| 在线观看av不卡| 亚洲欧美日韩国产综合| www.爱久久.com| 亚洲免费观看高清完整版在线观看| 91小视频在线| 亚洲福利一区二区三区| 91麻豆精品91久久久久久清纯| 日韩精品1区2区3区| 精品久久久久久久久久久久久久久久久 | 色香蕉久久蜜桃| 亚洲高清不卡在线| 亚洲精品一区二区三区蜜桃下载| 国模一区二区三区白浆| 国产亚洲一区二区在线观看| 91麻豆精品一区二区三区| 亚洲18女电影在线观看| 精品88久久久久88久久久| 成人毛片在线观看| 亚洲国产一区视频| 久久久久久一二三区| 日本高清无吗v一区| 精品一区二区三区的国产在线播放| 国产女人aaa级久久久级| 色哟哟一区二区三区| 日本视频一区二区| 国产精品视频麻豆| 欧美巨大另类极品videosbest| 国产麻豆9l精品三级站| 亚洲国产精品久久艾草纯爱| 日韩精品在线看片z| 91亚洲永久精品| 国产专区综合网| 亚洲福利视频一区二区| 中文在线一区二区| 91精品国产综合久久国产大片| 成人avav在线| 国内不卡的二区三区中文字幕| 亚洲与欧洲av电影| 日本一区二区三区免费乱视频| 欧美日本在线观看| av在线不卡观看免费观看| 久久成人麻豆午夜电影| 亚洲国产成人av| 亚洲欧美一区二区三区久本道91| 日韩欧美自拍偷拍| 欧美怡红院视频| 99久久99久久精品国产片果冻| 蜜桃视频免费观看一区| 亚洲一二三区在线观看| 中国av一区二区三区| 久久午夜羞羞影院免费观看| 日韩一本二本av| 欧美美女黄视频| 91美女在线看| 成人免费观看视频| 国产精品1024| 国产精品一区二区三区乱码| 蜜臀av性久久久久蜜臀av麻豆| 亚洲第一激情av| 亚洲精品乱码久久久久| 国产精品女同一区二区三区| 国产精品久久久久久久久免费相片 | av不卡一区二区三区| 国产精品123区| 国产一区二区导航在线播放| 久久精品国产在热久久| 蜜臀av性久久久久蜜臀aⅴ四虎| 天堂va蜜桃一区二区三区漫画版| 一区二区在线观看免费 | 舔着乳尖日韩一区| 亚洲一区视频在线观看视频| 亚洲精品中文在线影院| 亚洲欧美日韩国产综合| 一区二区三区日韩精品视频| 亚洲精品免费播放| 亚洲一二三级电影| 日韩成人一区二区三区在线观看| 无码av中文一区二区三区桃花岛| 亚洲成人av一区二区三区| 午夜亚洲国产au精品一区二区| 午夜免费久久看| 久久er精品视频| 国产乱人伦偷精品视频免下载| 国产精品亚洲一区二区三区妖精| 国产一区二区三区久久久| 大美女一区二区三区| 99久久精品国产一区二区三区| 欧美中文字幕不卡| 日韩一区二区三区电影| 久久婷婷综合激情| 国产精品国产自产拍高清av| 亚洲国产美国国产综合一区二区| 日韩不卡一区二区三区| 国产成人在线视频网址| 日本高清视频一区二区| 欧美一区二区高清| 国产欧美日韩综合精品一区二区| 国产精品毛片高清在线完整版| 亚洲一区二区三区三| 国产尤物一区二区| 欧美性色黄大片手机版| 精品av综合导航| 亚洲精选一二三| 国产一区二三区|