本文整理汇总了PHP中clladp::StripSpecialsChars方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::StripSpecialsChars方法的具体用法?PHP clladp::StripSpecialsChars怎么用?PHP clladp::StripSpecialsChars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::StripSpecialsChars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_form
function post_form()
{
$_POST["email"] = strtolower(trim($_POST["email"]));
$_POST["password"] = trim($_POST["password"]);
$tpl = new templates();
$sock = new sockets();
$ldap = new clladp();
$EnableVirtualDomainsInMailBoxes = $sock->GET_INFO("EnableVirtualDomainsInMailBoxes");
if (!ValidateMail($_POST["email"])) {
echo "<H2>" . $tpl->_ENGINE_parse_body("{ERROR_INVALID_EMAIL_ADDR}: ({original_mail}:{$_POST["email"]})") . "</H2>";
exit;
}
$domain = trim(strtolower($_POST["domain"]));
$company = $_POST["company"];
$password = $_POST["password"];
$uid = trim(strtolower($_POST["username"]));
$ou = $_POST["organization"];
if ($ou == null) {
$ou = $_POST["company"];
}
if ($company == null) {
echo $tpl->_ENGINE_parse_body("<H2>{company}:{ERROR_VALUE_MISSING_PLEASE_FILL_THE_FORM}</H2>");
exit;
}
if ($password == null) {
echo $tpl->_ENGINE_parse_body("<H2>{password}:{ERROR_VALUE_MISSING_PLEASE_FILL_THE_FORM}</H2>");
exit;
}
if ($_POST["domain"] == null) {
echo $tpl->_ENGINE_parse_body("<H2>{domain}:{ERROR_VALUE_MISSING_PLEASE_FILL_THE_FORM}</H2>");
exit;
}
if ($uid == null) {
echo $tpl->_ENGINE_parse_body("<H2>{username}:{ERROR_VALUE_MISSING_PLEASE_FILL_THE_FORM}</H2>");
exit;
}
if (isset($_POST["subdomain"])) {
$_POST["subdomain"] = trim(strtolower($_POST["subdomain"]));
if ($_POST["subdomain"] == null) {
echo $tpl->_ENGINE_parse_body("<H2>{subdomain}:{ERROR_VALUE_MISSING_PLEASE_FILL_THE_FORM}</H2>");
exit;
}
$domain = $_POST["subdomain"] . ".{$domain}";
}
$hashdoms = $ldap->hash_get_all_domains();
if ($hashdoms[$domain] != null) {
echo $tpl->_ENGINE_parse_body("<H2>{error_domain_exists} »<strong>{$domain}</strong></H2");
exit;
}
$ou = $ldap->StripSpecialsChars($ou);
$uid = $ldap->StripSpecialsChars($uid);
if ($ou == "users") {
echo "<H2>Error: Adding\n{$ou} words not permitted\n</H2>";
exit;
}
if ($ou == "groups") {
echo "<H2>Error: Adding\n{$ou} words not permitted\n</H2>";
exit;
}
if ($ou == "computers") {
echo "<H2>Error: Adding\n{$ou} words not permitted\n</H2>";
exit;
}
if ($ou == "pureftpd") {
echo "<H2>Error: Adding\n{$ou} words not permitted\n</H2>";
exit;
}
$ldap = new clladp();
$dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
if ($ldap->ExistsDN($dn)) {
echo $tpl->_ENGINE_parse_body("<H2>{organization}:{ERROR_OBJECT_ALREADY_EXISTS}</H2>");
exit;
}
if ($EnableVirtualDomainsInMailBoxes == 1) {
$uidtests = "{$uid}@{$domain}";
$u = new user($uidtests);
if (!$u->DoesNotExists) {
echo $tpl->_ENGINE_parse_body("<H2>{member}: «{$uid}» {ERROR_OBJECT_ALREADY_EXISTS}</H2>");
exit;
}
}
$u = new user($uid);
if (!$u->DoesNotExists) {
echo $tpl->_ENGINE_parse_body("<H2>{member}: «{$uid}» {ERROR_OBJECT_ALREADY_EXISTS}</H2>");
exit;
}
$zmd5 = md5("{$_POST["email"]}{$ou}{$company}{$domain}{$uid}");
$password = addslashes($password);
$company = addslashes($company);
$uid = addslashes($uid);
$sql = "INSERT IGNORE INTO register_orgs(`email`,`ou`,`company`,`domain`,`username`,`password`,`zmd5`)\n\tVALUES('{$_POST["email"]}','{$ou}','{$company}','{$domain}','{$uid}','{$password}','{$zmd5}')\n\t";
$q = new mysql();
$q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
echo "<H2>{$q->mysql_error}</H2>";
return;
}
$prefix = "http://";
if ($_SERVER["HTTPS"] == "on") {
$prefix = "https://";
//.........这里部分代码省略.........
示例2: autofs_connect
function autofs_connect()
{
$auto = new autofs();
$ldap = new clladp();
$sock = new sockets();
$_GET["LOCAL_DIR"] = strtolower($ldap->StripSpecialsChars($_GET["LOCAL_DIR"]));
$upd = array();
$dn = "cn={$_GET["LOCAL_DIR"]},ou=auto.automounts,ou=mounts,{$ldap->suffix}";
if ($_GET["fs"] == null) {
$prefix_pattern = "-fstype=auto,check=none,noatime";
}
if ($_GET["fs"] == "ext2") {
$prefix_pattern = "-fstype=ext2,check=none,noatime";
}
if ($_GET["fs"] == "ext3") {
$prefix_pattern = "-fstype=ext3,check=none,noatime,nodiratime,data=journal,user";
}
if ($_GET["fs"] == "ext4") {
$prefix_pattern = "-fstype=ext4,check=none,noatime,commit=60,nodiratime,data=journal,user";
}
if ($_GET["fs"] == "vfat") {
$prefix_pattern = "-fstype=vfat,uid=1000,gid=1010";
}
if ($_GET["fs"] == "ntfs") {
$prefix_pattern = "-fstype=ntfs-3g,uid=1000,gid=1010";
}
if ($prefix_pattern == null) {
$prefix_pattern = "-fstype=auto,check=none,noatime";
}
$pattern = "{$prefix_pattern} :{$_GET["dev"]}";
if (!$ldap->ExistsDN($dn)) {
$upd["ObjectClass"][] = 'top';
$upd["ObjectClass"][] = 'automount';
$upd["cn"][] = "{$_GET["LOCAL_DIR"]}";
$upd["automountInformation"][] = $pattern;
if (!$ldap->ldap_add($dn, $upd)) {
echo "function: " . __FUNCTION__ . "\n" . "file: " . __FILE__ . "\nline: " . __LINE__ . "\n" . $ldap->ldap_last_error;
return;
}
$sock->getFrameWork("cmd.php?autofs-reload=yes");
return;
}
$upd["automountInformation"][] = $pattern;
if (!$ldap->Ldap_modify($dn, $upd)) {
echo "function: " . __FUNCTION__ . "\n" . "file: " . __FILE__ . "\nline: " . __LINE__ . "\n" . $ldap->ldap_last_error;
return false;
}
$sock->getFrameWork("cmd.php?autofs-reload=yes");
}
示例3: cgroup_save
function cgroup_save()
{
$ID = $_POST["ID"];
unset($_POST["ID"]);
$_POST["cpu_shares"] = $_POST["cpu_shares"] / 100;
$_POST["cpu_shares"] = round(1024 * $_POST["cpu_shares"]);
$ldap = new clladp();
$_POST["groupname"] = $ldap->StripSpecialsChars($_POST["groupname"]);
while (list($num, $ligne) = each($_POST)) {
if (preg_match("#cpuset_cpus_([0-9]+)#", $num, $re)) {
if ($ligne == 1) {
$cpuset_cpus_tb[] = $re[1];
}
unset($_POST[$num]);
}
}
if (!is_array($cpuset_cpus_tb)) {
$cpuset_cpus_tb = array(0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8);
}
$_POST["cpuset_cpus"] = @implode(",", $cpuset_cpus_tb);
reset($_POST);
while (list($num, $ligne) = each($_POST)) {
$fields[] = "`{$num}`";
$values[] = "'" . addslashes($ligne) . "'";
$upd[] = "`{$num}`='" . addslashes($ligne) . "'";
}
$sql_edit = "UPDATE cgroups_groups SET " . @implode(",", $upd) . " WHERE ID={$ID}";
$sql = "INSERT INTO cgroups_groups (" . @implode(",", $fields) . ") VALUES (" . @implode(",", $values) . ")";
if ($ID > 0) {
$sql = $sql_edit;
}
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$q = new mysql();
$q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
echo $q->mysql_error;
return;
}
$sock = new sockets();
$sock->SET_INFO("cgroupsMustCompile", 1);
}
示例4: category_save
function category_save()
{
include_once dirname(__FILE__) . "/ressources/class.ldap.inc";
$ldap = new clladp();
$dans = new dansguardian_rules();
$_POST["category-to-add"] = url_decode_special_tool($_POST["category-to-add"]);
$_POST["category_text"] = url_decode_special_tool($_POST["category_text"]);
if ($_POST["category-to-add"] == "security") {
$_POST["category-to-add"] = "security2";
}
if ($_POST["CatzByGroupA"] != null) {
$_POST["group"] = $_POST["CatzByGroupA"];
}
$_POST["CatzByGroupL"] = mysql_escape_string2($_POST["CatzByGroupL"]);
$_POST["category_text"] = mysql_escape_string2($_POST["category_text"]);
$q = new mysql_squid_builder();
$sql = "SELECT category FROM personal_categories WHERE category='" . mysql_escape_string2($_POST["category-to-add"]) . "'";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql));
if ($ligne["category"] != null) {
$sql = "UPDATE personal_categories\n\t\t\tSET category_description='{$_POST["category_text"]}',\n\t\t\tmaster_category='{$_POST["group"]}'\n\t\t\tWHERE category='{$_POST["category-to-add"]}'";
} else {
$_POST["category-to-add"] = strtolower($ldap->StripSpecialsChars($_POST["category-to-add"]));
if (isset($dans->array_blacksites[$_POST["category-to-add"]])) {
$tpl = new templates();
echo $tpl->javascript_parse_text("{$_POST["category-to-add"]}:: {category_already_exists}");
return;
}
$sql = "INSERT IGNORE INTO personal_categories (category,category_description,master_category)\n\t\tVALUES ('{$_POST["category-to-add"]}','{$_POST["category_text"]}','{$_POST["group"]}');";
}
$q->QUERY_SQL($sql);
if (!$q->ok) {
echo $q->mysql_error;
return;
}
$q->CreateCategoryTable($_POST["category-to-add"]);
$sql = "TRUNCATE TABLE webfilters_categories_caches";
$dans->CategoriesTableCache();
$dans->CleanCategoryCaches();
$sock = new sockets();
$sock->getFrameWork("squid.php?clean-catz-cache=yes");
$sock->getFrameWork("squid.php?export-web-categories=yes");
}