$dom->addItem(new HTML_TreeNode(array('text' => 'A Records', 'link' => $conf['baseurl']."/index.php?".Session::getSID()."&domain=". $domain['associateddomain'][0]."&record=a", 'icon' => ''))); $dom->addItem(new HTML_TreeNode(array('text' => 'CNAME Records', 'link' => $conf['baseurl']."/index.php?".Session::getSID()."&domain=". $domain['associateddomain'][0]."&record=cname", 'icon' => ''))); $dom->addItem(new HTML_TreeNode(array('text' => 'Additional MX Records', 'link' => $conf['baseurl']."/index.php?".Session::getSID()."&domain=". $domain['associateddomain'][0]."&record=mx", 'icon' => ''))); } else { //It is an IN-ADDR.ARPA Domain $dom->addItem(new HTML_TreeNode(array('text' => 'PTR Records', 'link' => $conf['baseurl']."/index.php?".Session::getSID()."&domain=". $domain['associateddomain'][0]."&record=ptr", 'icon' => ''))); } } } } $level_count++; } } } /* $node1->addItem(new HTML_TreeNode(array('text' => "Second level, item 3", 'link' => "test.php", 'icon' => $icon)));
/style/images/stock_ok.gif" alt="Save @ A" title="Save @ ARecord"> <input type="image" name="DELETE_DOMAIN_A" value="Delete @A" style="border-style: none;" src="<?php echo $conf['baseurl']; ?> /style/images/stock_remove.gif" alt="Delete @ A" title="Delete @ ARecord"></td> </tr> </table> </form> </td> </tr> </table> </fieldset> </td></tr> <tr><td> <fieldset><legend>Quickadd host A Record</legend> <form action=<? echo $conf['baseurl']."/index.php?".Session::getSID()."&domain=".$_GET['domain']?> method="post" name="QUICK_ADD"> <? include APP_BASE."/dnsmgr/quick_add_arecord.php"; ?> </form> </fieldset> </td></tr> <?}?> </table> </table> <? } ?>
} ?> </table> </td><tr> </table> </fieldset> <fieldset><legend>Add A Record</legend> <p class="light"> Add New A Record </p> <table width="100%"> <tr><td> <table align="left" cellpadding="0" cellspacing="0" border="0"> <tr> <form action=<? echo $conf['baseurl']."/index.php?".Session::getSID()."&domain=".$_GET['domain']."&record=a"?> method="post" name="ARecords"> <td class="light"><input type="text" size="30" tabindex="1" name="RDN" value=""></td> <td class="light" align="center" width="70">IN A</td> <td class="light"><input type="text" size="20" tabindex="1" name="ARecord" value=""></td> <td class="light"><input type="image" name="SAVE_ARecord" value="Save" style="border-style: none;" src="<?php echo $conf['baseurl']; ?> /style/images/stock_ok.gif" alt="Save ARecord" title="Save ARecord"></td> </form> </tr> </table> </td></tr> </table> </fieldset>
function authenticateLDAP($userID, $pass) { /* Ensure we've been provided with all of the necessary parameters. */ if (!isset($this->params['host'])) { Basic::fatalError(10, __FILE__, __LINE__); } if (!isset($this->params['port'])) { Basic::fatalError(10, __FILE__, __LINE__); } if (!isset($this->params['basedn'])) { Basic::fatalError(10, __FILE__, __LINE__); } if (!isset($this->params['uid'])) { Basic::fatalError(10, __FILE__, __LINE__); } if (!isset($pass) || $pass == '') { Basic::fatalError(11, __FILE__, __LINE__); } if (!isset($userID) || $userID == '') { Basic::fatalError(11, __FILE__, __LINE__); } /* Connect to the LDAP server. */ $ldap = @ldap_connect($this->params['host']); if (!$ldap) { Basic::fatalError(12, __FILE__, __LINE__); } // Set LDAPv3 ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); if ($this->params['logfile']) { // Logfile ist gesetzt also schreib es auch! // Set file for opening $fp = fopen($this->params['logfile'], 'a'); // Check if can write to file if ($fp) { fwrite($fp, date("M d Y H:i:s") . " Login: User with ID (" . $userID . ") logged in. Session (" . Session::getSID() . ") created.\n"); } // Close the written file fclose($fp); } /* Search for the user's full DN. Administrative Attributes only set here not in config */ $search = @ldap_search($ldap, $this->params['basedn'], $this->params['uid'] . '=' . $userID, array($this->params['uid'], $this->params['cn'])); $result = @ldap_get_entries($ldap, $search); if (is_array($result) && count($result) > 1) { $dn = $result[0]['dn']; $cn = $result[0][$this->params['cn']][0]; } else { @ldap_close($ldap); Basic::fatalError(13, __FILE__, __LINE__); } /* Attempt to bind to the LDAP server as the user. */ $bind = @ldap_bind($ldap, $dn, $pass); if ($bind != false) { @ldap_close($ldap); Auth::setAuth($userID, $dn, $cn); return true; } if ($this->params['logfile']) { // Logfile ist gesetzt also schreib es auch! // Set file for opening $fp = fopen($this->params['logfile'], 'a'); // Check if can write to file if ($fp) { fwrite($fp, date("M d Y H:i:s") . " Login: User with ID (" . $userID . ") failed to log in.\n"); } // Close the written file fclose($fp); } @ldap_close($ldap); return false; }