本文整理汇总了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');
}
}
示例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;
}
}
示例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;
示例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");
示例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);
}
}
}