本文整理汇总了PHP中clladp::Ldap_read方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::Ldap_read方法的具体用法?PHP clladp::Ldap_read怎么用?PHP clladp::Ldap_read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::Ldap_read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Loadtemplate
function Loadtemplate()
{
$ou = $_GET["ou"];
$template_name = $_GET["template"];
writequeries();
$ldap = new clladp();
$dn = "cn=artica_quarantine_settings,ou={$ou},dc=organizations,{$ldap->suffix}";
if (isset($_GET["ArticaMaxDayTemplate"])) {
$template_data = "<SUBJECT>{$_GET["subject"]}</SUBJECT>\n\t\t<FROM>{$_GET["from"]}</FROM>\n\t\t<TEMPLATE>{$_GET["ArticaMaxDayTemplate"]}</TEMPLATE>";
$upd[$template_name][0] = $template_data;
if (!$ldap->Ldap_modify($dn, $upd)) {
echo "<H2>{$ldap->ldap_last_error}</H2>";
exit;
}
}
if (!$ldap->ExistsDN($dn)) {
$upd["cn"][] = "artica_quarantine_settings";
$upd["objectClass"][] = 'top';
$upd["objectClass"][] = 'ArticaQuarantineTemplates';
$upd["{$template_name}"][] = "DEFAULT";
$ldap->ldap_add($dn, $upd);
$template_data = "DEFAULT";
} else {
$hash = $ldap->Ldap_read($dn, '(ObjectClass=ArticaQuarantineTemplates)', array(strtolower($template_name)));
if (!is_array($hash[0][strtolower($template_name)])) {
unset($upd);
$upd[$template_name] = "DEFAULT";
$ldap->Ldap_add_mod($dn, $upd);
$hash = $ldap->Ldap_read($dn, '(ObjectClass=ArticaQuarantineTemplates)', array(strtolower($template_name)));
}
$template_data = $hash[0][strtolower($template_name)][0];
}
if ($template_data == "DEFAULT") {
$template_data = file_get_contents("ressources/databases/{$template_name}.cf");
}
if (preg_match('#<SUBJECT>(.+?)</SUBJECT>\\s+<FROM>(.+?)</FROM>\\s+<TEMPLATE>(.+?)</TEMPLATE>#is', $template_data, $reg)) {
$subject = $reg[1];
$from = $reg[2];
$template_d = $reg[3];
}
$tiny = TinyMce('ArticaMaxDayTemplate', $template_d);
$html = "\n\t<html>\n\t<head>\n\t<link href='css/styles_main.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_header.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_middle.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_forms.css' rel=\"styleSheet\" type='text/css' />\n\t<link href='css/styles_tables.css' rel=\"styleSheet\" type='text/css' />\n\t<script type='text/javascript' language='JavaScript' src='mouse.js'></script>\n\t<script type='text/javascript' language='javascript' src='XHRConnection.js'></script>\n\t<script type='text/javascript' language='javascript' src='default.js'></script>\n\t<script type='text/javascript' language='javascript' src='js/quarantine.ou.js'></script>\t\n\t</head>\n\t<body width=100% style='background-color:white'> \n\t\t<H5>{" . "{$template_name}}</H5>\n\t<form name='FFM1'>\n\t<table style='width:100%;margin:10px'>\n\t<tr>\n\t<td align='right'><strong>{from}:</strong></td>\n\t<td><input type='text' name='from' value='{$from}'></td>\n\t</tr>\n\t<tr>\n\t<td align='right'><strong>{subject}:</strong></td>\n\t<td><input type='text' name='subject' value='{$subject}'></td>\n\t</tr>\t\n\t</table>\n\t<div style='width:450px'>{$tiny}</div>\n\t<p class=caption>{template_token}</p>\n\t<input type='hidden' name='ou' value='{$ou}'>\n\t<input type='hidden' name='template' value='{$template_name}'>\n\t</form>\n\t</body>\n\t</html>";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}