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


PHP CGroup::Delete方法代码示例

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


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

示例1: Delete

 /**
  * Delete
  * @param $CODE
  * @return array
  * @throws \Exception
  */
 public static function Delete($CODE)
 {
     $group = new \CGroup();
     $user = new \CUser();
     if (!empty($CODE)) {
         $by = "ID";
         $order = "asc";
         $dbGroup = $group->GetList($by, $order, array('STRING_ID' => $CODE));
         if ($arGroup = $dbGroup->Fetch()) {
             $arReturn = $arGroup;
         }
     } else {
         throw new BimException('Empty group code');
     }
     if (intval($arReturn['ID']) > 0) {
         $arUsers = $group->GetGroupUser($arReturn['ID']);
         foreach ($arUsers as $UserID) {
             $arGroup = $user->GetUserGroup($UserID);
             $arGroup[] = "3";
             $user->SetUserGroup($UserID, $arGroup);
         }
         $res = $group->Delete($arReturn['ID']);
         if (is_object($res)) {
             return $arReturn['ID'];
         } else {
             throw new BimException($group->LAST_ERROR);
         }
     } else {
         throw new BimException('Group not found');
     }
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:37,代码来源:GroupIntegrate.php

示例2: delete

 /**
  * Удаляет группу
  * @return bool
  */
 public function delete()
 {
     $id = $this->getAttribute('id')->getValue();
     if ($id > 0) {
         $group = new CGroup();
         $DB->StartTransaction();
         if (!$group->Delete($id)) {
             $DB->Rollback();
             throw new Exception('Delete error');
         }
         $DB->Commit();
     } else {
         return false;
     }
 }
开发者ID:marvin255,项目名称:bxar,代码行数:19,代码来源:Group.php

示例3: array

            {
                $PERM = array();
                @(include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/.access.php");
                return $PERM;
            }
            $arFPermsTmp = GetAccessArrTmp();
            $arFPerms = array_key_exists("admin", $arFPermsTmp) ? $arFPermsTmp["admin"] : array();
            $arFPerms[$groupId . ""] = "R";
            $APPLICATION->SetFileAccessPermission(array(SITE_ID, "/bitrix/admin"), $arFPerms);
        }
        LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANGUAGE_ID . "&success=Y&crm_imp_url=" . urlencode(($crmUrlScheme == 'ssl://' ? "https" : "http") . "://" . $crmUrlHost . ":" . $crmUrlPort . $crmUrl4Import) . "&crm_url=" . urlencode(($crmUrlScheme == 'ssl://' ? "https" : "http") . "://" . $crmUrlHost . ":" . $crmUrlPort));
    } else {
        if ($createNewSaleUser) {
            if ($groupId > 0) {
                $group = new CGroup();
                $group->Delete($groupId);
            }
            if ($userId > 0) {
                CUser::Delete($userId);
            }
        }
    }
}
if ($_SERVER["REQUEST_METHOD"] == "GET" && $_REQUEST["clear_crm_stat"] == "Y" && $saleModulePermissions >= "W" && check_bitrix_sessid()) {
    if (!isset($_REQUEST["clear_crm_stat_url"])) {
        COption::SetOptionString("sale", "~crm_integration", "");
    } else {
        $ar = array();
        foreach ($arCrmIntegration as $k => $v) {
            if ($k != $_REQUEST["clear_crm_stat_url"]) {
                $ar[$k] = $v;
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:crm.php

示例4: CGroup

	}

	foreach($arID as $ID)
	{
		if(strlen($ID)<=0)
			continue;

		switch($_REQUEST['action'])
		{
		case "delete":
			if($ID>2)
			{
				@set_time_limit(0);
				$DB->StartTransaction();
				$group = new CGroup();
				if(!$group -> Delete($ID))
				{
					$DB->Rollback();
					$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
				}
				$DB->Commit();
			}
			else
				$lAdmin->AddGroupError(GetMessage("MAIN_ERROR_GROUP").$ID.GetMessage("MAIN_ERROR_GROUP_DELETE"));
			break;
		case "activate":
		case "deactivate":
			if($ID>2)
			{
				$ob = new CGroup();
				$arFields["ACTIVE"] = ($_REQUEST['action']=="activate"?"Y":"N");
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:group_admin.php

示例5: UserGroupDelete

 /**
  * @var string $group
  */
 protected function UserGroupDelete($groupName)
 {
     $id = $this->UserGetGroupIdByCode($groupName);
     if ($id) {
         global $DB;
         $group = new \CGroup();
         $DB->StartTransaction();
         if (!$group->Delete($id)) {
             $DB->Rollback();
             $error = "Can't delete group {$groupName}";
         }
         $DB->Commit();
         echo "Delete group {$groupName}";
         if (isset($error)) {
             throw new \Exception($error);
         }
     }
 }
开发者ID:marvin255,项目名称:bxmigrate,代码行数:21,代码来源:Coded.php


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