当前位置: 首页>>代码示例>>PHP>>正文


PHP clladp::AddGroup方法代码示例

本文整理汇总了PHP中clladp::AddGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::AddGroup方法的具体用法?PHP clladp::AddGroup怎么用?PHP clladp::AddGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clladp的用法示例。


在下文中一共展示了clladp::AddGroup方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DeleteGroup

function DeleteGroup()
{
    if (isset($_GET["DeleteGroup"])) {
        $gpid = $_GET["DeleteGroup"];
    }
    if (isset($_GET["delgroup"])) {
        $gpid = $_GET["delgroup"];
    }
    $ou = $_GET["ou"];
    $ldap = new clladp();
    $tpl = new templates();
    $classGroup = new groups($gpid);
    $hashgroup = $ldap->GroupDatas($gpid);
    $default_dn_nogroup = "cn=nogroup,ou=groups,ou={$ou},dc=organizations,{$ldap->suffix}";
    if (!$ldap->ExistsDN($default_dn_nogroup)) {
        $ldap->AddGroup("nogroup", $ou);
    }
    $nogroup_id = $ldap->GroupIDFromName($ou, "nogroup");
    if (is_array($hashgroup["members"])) {
        while (list($num, $val) = each($hashgroup["members"])) {
            $ldap->AddUserToGroup($nogroup_id, $num);
        }
    }
    $users = new usersMenus();
    if ($users->KAV_MILTER_INSTALLED) {
        $sock = new sockets();
        $sock->getfile("KavMilterDeleteRule:{$classGroup->groupName}.{$classGroup->ou}");
    }
    $kas_dn = "cn={$gpid},cn=kaspersky Antispam 3 rules,cn=artica,{$ldap->suffix}";
    if ($ldap->ExistsDN($kas_dn)) {
        $ldap->ldap_delete($kas_dn, false);
    }
    $ldap->ldap_delete($hashgroup["dn"], false);
    if ($ldap->ldap_last_error != null) {
        echo $ldap->ldap_last_error;
    } else {
        echo $tpl->_ENGINE_parse_body('{success}');
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:39,代码来源:domains.edit.group.php

示例2: USER_ADD

function USER_ADD()
{
    $userid = $_REQUEST["new_userid"];
    $password = $_REQUEST["password"];
    $group_id = $_REQUEST["group_id"];
    if (isset($_GET["encpass"])) {
        $password = url_decode_special_tool($password);
    }
    $ou = $_REQUEST["ou"];
    $tpl = new templates();
    if (preg_match("#(.+?)@(.+)#", $_REQUEST["email"], $re)) {
        $_REQUEST["user_domain"] = $re[2];
        $_REQUEST["email"] = $re[1];
    }
    $email = $_REQUEST["email"] . "@" . $_REQUEST["user_domain"];
    $email = strtolower($email);
    $user = new usersMenus();
    if ($user->EnableVirtualDomainsInMailBoxes == 1) {
        writelogs("Adding change {$userid} to \"{$email}\" in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
        $userid = $email;
    }
    if (is_numeric($group_id)) {
        $gp = new groups($group_id);
        writelogs("privileges: {$group_id} -> AsComplexPassword = \"{$gp->Privileges_array["AsComplexPassword"]}\"", __FUNCTION__, __FILE__, __LINE__);
        if ($gp->Privileges_array["AsComplexPassword"] == "yes") {
            $ldap = new clladp();
            $hash = $ldap->OUDatas($ou);
            $privs = $ldap->_ParsePrivieleges($hash["ArticaGroupPrivileges"], array(), true);
            $policiespwd = unserialize(base64_decode($privs["PasswdPolicy"]));
            if (is_array($policiespwd)) {
                $priv = new privileges();
                if (!$priv->PolicyPassword($password, $policiespwd)) {
                    return false;
                }
            }
        } else {
            writelogs("privileges: {$group_id} -> AsComplexPassword = \"No\" -> continue", __FUNCTION__, __FILE__, __LINE__);
        }
    }
    $users = new user($userid);
    if ($users->UserExists) {
        echo $tpl->javascript_parse_text('ERROR: {account_already_exists}');
        return false;
    }
    writelogs("Adding {$userid} in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
    $email = $_REQUEST["email"] . "@" . $_REQUEST["user_domain"];
    if ($ou == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_ou}'));
        exit;
    }
    if ($userid == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_userid}'));
        exit;
    }
    if ($password == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_password}'));
        exit;
    }
    if ($email == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_email}'));
        exit;
    }
    $ldap = new clladp();
    if (!is_numeric($group_id)) {
        writelogs("Groupid is not numeric", __FUNCTION__, __FILE__, __LINE__);
        $default_dn_group = "cn=nogroup,ou={$ou},dc=organizations,{$ldap->suffix}";
        if (!$ldap->ExistsDN($default_dn_group)) {
            $ldap->AddGroup("nogroup", $ou);
        }
        $group_id = $ldap->GroupIDFromName($ou, "nogroup");
        if (!is_numeric($group_id)) {
            $group_id = 0;
        }
    }
    $emT = explode('@', $email);
    //Verify domains --------------------------------------------------------------- 2008 10 05,P3
    $hash_domains_table = $ldap->hash_get_domains_ou($ou);
    if (!isset($hash_domains_table[$_REQUEST["user_domain"]])) {
        writelogs("{$userid} have no domains", __FUNCTION__, __FILE__, __LINE__);
        writelogs("Create a new local domain by default", __FUNCTION__, __FILE__, __LINE__);
        $ldap->AddDomainEntity($ou, $_REQUEST["user_domain"]);
    }
    //------------------------------------------------------------------------------
    $domains = $ldap->domains_get_locals_domains($ou);
    $dn = "cn={$userid},ou={$ou},dc=organizations,{$ldap->suffix}";
    if ($ldap->ExistsDN($dn)) {
        writelogs("{$userid} ({$dn}) already exists", __FUNCTION__, __FILE__, __LINE__);
        echo $userid;
        exit;
    }
    $users = new user($userid);
    $users->mail = $email;
    $users->accountGroup = $group_id;
    $users->domainname = $_REQUEST["user_domain"];
    if ($password != null) {
        $users->password = $password;
    }
    $users->ou = $ou;
    if ($domains[$_REQUEST["user_domain"]] == true) {
        $upd = array();
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:domains.edit.user.php

示例3: add_entity

function add_entity()
{
    $entity = $_GET["add_entity"];
    $ldap = new clladp();
    $ldap->AddGroup($entity);
    echo List_entities(1);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:7,代码来源:domains.php

示例4: Tree_group_Add_New

function Tree_group_Add_New()
{
    $group = $_GET["Tree_group_Add_New"];
    $ou = $_GET["ou"];
    $ldap = new clladp();
    $ldap->AddGroup($group, $ou);
    LoadGroupsAjax($ou);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:8,代码来源:domains.manage.org.index.php

示例5: USER_ADD

function USER_ADD()
{
    $userid = $_GET["new_userid"];
    $password = $_GET["password"];
    $group_id = $_GET["group_id"];
    $tpl = new templates();
    $email = $_GET["email"] . "@" . $_GET["user_domain"];
    $user = new usersMenus();
    if ($user->EnableVirtualDomainsInMailBoxes == 1) {
        writelogs("Adding change {$userid} to \"{$email}\" in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
        $userid = $email;
    }
    $users = new user($userid);
    if ($users->UserExists) {
        echo $tpl->javascript_parse_text('ERROR: {account_already_exists}');
        return false;
    }
    writelogs("Adding {$userid} in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
    $email = $_GET["email"] . "@" . $_GET["user_domain"];
    $ou = $_GET["ou"];
    if ($ou == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_ou}'));
        exit;
    }
    if ($userid == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_userid}'));
        exit;
    }
    if ($password == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_password}'));
        exit;
    }
    if ($email == null) {
        echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_email}'));
        exit;
    }
    $ldap = new clladp();
    if ($group_id == null) {
        $default_dn_group = "cn=nogroup,ou={$ou},dc=organizations,{$ldap->suffix}";
        if (!$ldap->ExistsDN($default_dn_group)) {
            $ldap->AddGroup("nogroup", $ou);
        }
        $group_id = $ldap->GroupIDFromName($ou, "nogroup");
        if ($group_id == null) {
            $group_id = 0;
        }
    }
    $emT = explode('@', $email);
    //Verify domains --------------------------------------------------------------- 2008 10 05,P3
    $hash_domains_table = $ldap->hash_get_domains_ou($ou);
    if ($hash_domains_table[$_GET["user_domain"]] == null) {
        writelogs("{$userid} have no domains", __FUNCTION__, __FILE__, __LINE__);
        writelogs("Create a new local domain by default", __FUNCTION__, __FILE__, __LINE__);
        $ldap->AddDomainEntity($ou, $_GET["user_domain"]);
    }
    //------------------------------------------------------------------------------
    $domains = $ldap->domains_get_locals_domains($ou);
    $dn = "cn={$userid},ou={$ou},dc=organizations,{$ldap->suffix}";
    if ($ldap->ExistsDN($dn)) {
        writelogs("{$userid} ({$dn}) already exists", __FUNCTION__, __FILE__, __LINE__);
        echo $userid;
        exit;
    }
    $users = new user($userid);
    $users->mail = $email;
    $users->accountGroup = $group_id;
    $users->domainname = $_GET["user_domain"];
    if ($password != null) {
        $users->password = $password;
    }
    $users->ou = $ou;
    if ($domains[$_GET["user_domain"]] == true) {
        writelogs("is a local domain {$_GET["user_domain"]}={$domains[$_GET["user_domain"]]}", __FUNCTION__, __FILE__, __LINE__);
        $upd["ObjectClass"][] = 'ArticaSettings';
        $users->MailboxActive = "TRUE";
    }
    if (!$users->add_user()) {
        echo "ERROR:" . $users->ldap_error;
        exit;
    }
    if ($group_id > 0) {
        $ldap->AddUserToGroup($group_id, $users->uid);
    }
    echo $users->uid;
}
开发者ID:brucewu16899,项目名称:artica,代码行数:85,代码来源:domains.edit.user.php

示例6: CreateGroup

function CreateGroup()
{
    $tpl = new templates();
    $group = $_GET["group"];
    $ou = $_GET["ou"];
    $ldap = new clladp();
    if (!$ldap->AddGroup($group, $ou)) {
        if ($ldap->ldap_last_error != null) {
            echo "err:{$ldap->ldap_last_error}";
        }
    } else {
        echo $tpl->_ENGINE_parse_body("{$_GET["group"]} {added}");
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:14,代码来源:firstwizard.php


注:本文中的clladp::AddGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。