Esempio n. 1
0
//公用HTML头部
include '../prog.fc/dialog.php';
//对话框函数
include '../prog.fc/daolian.php';
//防盗链功能
include 'syslogin.php';
//用户验证功能
?>
  

<?php 
$xmlDoc = new DOMDocument('1.0', 'UTF-8');
//创建DOM指定编码
$xmlDoc->load('../comm.fc/server-users.xml');
//载入XML配置文件
$usertotal = $xmlDoc->getElementsbyTagName('usertotal')->item(0)->nodeValue;
//读取用户总数
$user = $xmlDoc->getElementsbyTagName('user');
//user节点读入
?>
<body class="dialogbody"><center>
    <form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" enctype="multipart/form-data" method="post">
        <input name="update" type="hidden" value="go" />
        <?php 
dialogbegin('查看用户');
?>
     <!--   对话框标题   -->
            <table border="0">
 /**
  * Request a Security Token from the ADFS server using Username & Password authentication 
  * @ignore
  */
 protected function requestSecurityToken($securityServerURI, $loginEndpoint, $loginUsername, $loginPassword)
 {
     /* Generate the Security Token Request XML */
     $loginSoapRequest = self::getLoginXML($securityServerURI, $loginEndpoint, $loginUsername, $loginPassword);
     /* Send the Security Token request */
     $security_xml = self::getSoapResponse($securityServerURI, $loginSoapRequest);
     /* Convert the XML into a DOMDocument */
     $securityDOM = new DOMDocument();
     $securityDOM->loadXML($security_xml);
     /* Get the two CipherValue keys */
     $cipherValues = $securityDOM->getElementsbyTagName("CipherValue");
     $securityToken0 = $cipherValues->item(0)->textContent;
     $securityToken1 = $cipherValues->item(1)->textContent;
     /* Get the KeyIdentifier */
     $keyIdentifier = $securityDOM->getElementsbyTagName("KeyIdentifier")->item(0)->textContent;
     /* Get the BinarySecret */
     $binarySecret = $securityDOM->getElementsbyTagName("BinarySecret")->item(0)->textContent;
     /* Make life easier - get the entire RequestedSecurityToken section */
     $requestedSecurityToken = $securityDOM->saveXML($securityDOM->getElementsByTagName("RequestedSecurityToken")->item(0));
     preg_match('/<trust:RequestedSecurityToken>(.*)<\\/trust:RequestedSecurityToken>/', $requestedSecurityToken, $matches);
     $requestedSecurityToken = $matches[1];
     /* Find the Expiry Time */
     $expiryTime = $securityDOM->getElementsByTagName("RequestSecurityTokenResponse")->item(0)->getElementsByTagName('Expires')->item(0)->textContent;
     /* Convert it to a PHP Timestamp */
     $expiryTime = self::parseTime(substr($expiryTime, 0, -5), '%Y-%m-%dT%H:%M:%S');
     /* Return an associative Array */
     $securityToken = array('securityToken' => $requestedSecurityToken, 'securityToken0' => $securityToken0, 'securityToken1' => $securityToken1, 'binarySecret' => $binarySecret, 'keyIdentifier' => $keyIdentifier, 'expiryTime' => $expiryTime);
     /* DEBUG logging */
     if (self::$debugMode) {
         echo 'Got Security Token - Expires at: ' . date('r', $securityToken['expiryTime']) . PHP_EOL;
         echo "\tKey Identifier\t: " . $securityToken['keyIdentifier'] . PHP_EOL;
         echo "\tSecurity Token 0\t: " . substr($securityToken['securityToken0'], 0, 25) . '...' . substr($securityToken['securityToken0'], -25) . ' (' . strlen($securityToken['securityToken0']) . ')' . PHP_EOL;
         echo "\tSecurity Token 1\t: " . substr($securityToken['securityToken1'], 0, 25) . '...' . substr($securityToken['securityToken1'], -25) . ' (' . strlen($securityToken['securityToken1']) . ')' . PHP_EOL;
         echo "\tBinary Secret\t: " . $securityToken['binarySecret'] . PHP_EOL . PHP_EOL;
     }
     /* Return an associative Array */
     return $securityToken;
 }