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


PHP CUser::Delete方法代码示例

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


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

示例1: delete

 /**
  * Удаляет пользователя
  * @return bool
  */
 public function delete()
 {
     $id = $this->getAttribute('id')->getValue();
     if ($id > 0) {
         $res = \CUser::Delete($id);
         if ($res) {
             $this->getAttribute('id')->setValue(0);
         }
         return $res;
     } else {
         return false;
     }
 }
开发者ID:marvin255,项目名称:bxar,代码行数:17,代码来源:User.php

示例2: GetAccessArrTmp

                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;
            }
        }
        COption::SetOptionString("sale", "~crm_integration", serialize($ar));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:crm.php

示例3: empty

                 }
             }
         }
     }
     if (!$strError) {
         $bEmptyEmail = empty($_POST["ADD_EMAIL"]);
         $ID_ADDED = CIntranetInviteDialog::AddNewUser($SITE_ID, $_POST, $strError);
         if ($ID_ADDED) {
             // mailbox
             if ($bMailInstalled) {
                 if (isset($_POST["ADD_MAILBOX_ACTION"]) && in_array($_POST["ADD_MAILBOX_ACTION"], array('create', 'connect'))) {
                     $arMailboxResult = CIntranetMailSetupHelper::createMailbox(true, $ID_ADDED, $_POST['ADD_MAILBOX_SERVICE'], $_POST['ADD_MAILBOX_DOMAIN'], $_POST['ADD_MAILBOX_USER'], null, $strError);
                     if (!$strError) {
                         $newEmail = $arMailboxResult;
                     } else {
                         CUser::Delete($ID_ADDED);
                         $strError = GetMessage("BX24_INVITE_DIALOG_WARNING_CREATE_MAILBOX_ERROR") . " " . $strError;
                     }
                     // update email?
                 }
             }
         }
     }
 }
 if (!$strError && ($ID_ADDED || $ID_INVITED)) {
     if ($ID_ADDED) {
         $arUserId = array($ID_ADDED);
     } else {
         $arUserId = $ID_INVITED;
     }
     $strError = CIntranetInviteDialog::RequestToSonetGroups($arUserId, $_POST["SONET_GROUPS_CODE"], $_POST["SONET_GROUPS_NAME"], intval($_POST["DEPARTMENT_ID"]) <= 0);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:invite_dialog.php

示例4: CUser

		if($ID <= 1)
			continue;

		$UGroups = CUser::GetUserGroup($ID);
		if(in_array(1, $UGroups) && !$USER->CanDoOperation('edit_php')) // not admin can't edit admins
			continue;

		if(!$USER->CanDoOperation('edit_all_users') && $USER->CanDoOperation('edit_subordinate_users') && count(array_diff($UGroups, $arUserSubordinateGroups))>0)
			continue;

		switch($_REQUEST['action'])
		{
			case "delete":
				@set_time_limit(0);
				$DB->StartTransaction();
				if(!CUser::Delete($ID))
				{
					$DB->Rollback();
					if($ex = $APPLICATION->GetException())
						$err .= '<br>'.$ex->GetString();
					$lAdmin->AddGroupError(GetMessage("DELETE_ERROR").$err, $ID);
				}
				$DB->Commit();
				break;
			case "activate":
			case "deactivate":
				$ob = new CUser();
				$arFields = Array("ACTIVE"=>($_REQUEST['action']=="activate"?"Y":"N"));
				if(!$ob->Update($ID, $arFields))
					$lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR").$ob->LAST_ERROR, $ID);
				break;
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:user_admin.php

示例5: InstallService

 function InstallService($serviceID, $serviceStage)
 {
     $wizard =& $this->GetWizard();
     if (CModule::IncludeModule("iblock")) {
         $type = substr($serviceID, 0, -1);
         if ($type == "iblockElement") {
             $dbItem = CIBlockElement::GetList(array(), array("=IBLOCK_CODE" => $serviceStage), false, false, array("ID"));
             while ($arItem = $dbItem->Fetch()) {
                 CIBlockElement::Delete($arItem["ID"]);
             }
         } elseif ($type == "iblockSectionElement") {
             $dbItem = CIBlockElement::GetList(array(), array("=IBLOCK_CODE" => $serviceStage), false, false, array("ID"));
             while ($arItem = $dbItem->Fetch()) {
                 CIBlockElement::Delete($arItem["ID"]);
             }
             $dbItem = CIBlockSection::GetList(array(), array("=IBLOCK_CODE" => $serviceStage), false, array("ID"));
             while ($arItem = $dbItem->Fetch()) {
                 CIBlockSection::Delete($arItem["ID"]);
             }
         } elseif ($serviceID == "iblockDepartmentsElement") {
             $dbItem = CIBlockSection::GetList(array(), array("=IBLOCK_CODE" => "departments"));
             while ($arItem = $dbItem->Fetch()) {
                 if ($arItem["DEPTH_LEVEL"] > 2) {
                     CIBlockSection::Delete($arItem["ID"]);
                 }
             }
         } elseif ($serviceID == "tasks") {
             if (CModule::IncludeModule("tasks")) {
                 $dbItem = CTasks::GetList(array(), array("SITE_ID" => $wizard->GetVar("siteID")));
                 while ($arItem = $dbItem->Fetch()) {
                     CTasks::Delete($arItem["ID"]);
                 }
             }
         } elseif ($serviceID == "calendar") {
             if (CModule::IncludeModule("calendar")) {
                 $dbItem = CCalendarEvent::GetList();
                 foreach ($dbItem as $arItem) {
                     CCalendarEvent::Delete(array("id" => $arItem["ID"]));
                 }
             }
         } elseif ($serviceID == "meeting") {
             if (CModule::IncludeModule("meeting")) {
                 $dbItem = CMeeting::GetList(array(), array());
                 while ($arItem = $dbItem->Fetch()) {
                     if ($arItem["ID"]) {
                         CMeeting::Delete($arItem["ID"]);
                     }
                 }
             }
         } elseif ($serviceID == "user") {
             if ($serviceStage == "user") {
                 $dbUser = CUser::GetList($by = "ID", $order = "DESC", array(">ID" => 1));
                 while ($arUser = $dbUser->Fetch()) {
                     CUser::Delete($arUser["ID"]);
                 }
             }
         } elseif ($serviceID == "crm") {
             if ($serviceStage == "crm") {
                 if (CModule::IncludeModule('crm')) {
                     $CCrmLead = new CCrmLead();
                     $resLead = CCrmLead::GetList(array(), array(), array(), false);
                     while ($rowLead = $resLead->Fetch()) {
                         $CCrmLead->Delete($rowLead["ID"]);
                     }
                     $CCrmContact = new CCrmContact();
                     $resContact = CCrmContact::GetList(array(), array(), array(), false);
                     while ($rowContact = $resContact->Fetch()) {
                         $CCrmContact->Delete($rowContact["ID"]);
                     }
                     $CCrmCompany = new CCrmCompany();
                     $resCompany = CCrmCompany::GetList(array(), array(), array(), false);
                     while ($rowCompany = $resCompany->Fetch()) {
                         $CCrmCompany->Delete($rowCompany["ID"]);
                     }
                     $CCrmDeal = new CCrmDeal();
                     $resDeal = CCrmDeal::GetList(array(), array(), array(), false);
                     while ($rowDeal = $resDeal->Fetch()) {
                         $CCrmDeal->Delete($rowDeal["ID"]);
                     }
                 }
             }
         } elseif ($serviceID == "cache") {
             require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/classes/general/cache_html.php";
             if ($serviceStage == "cache1") {
                 BXClearCache(true);
             } elseif ($serviceStage == "cache2") {
                 $GLOBALS["CACHE_MANAGER"]->CleanAll();
             } elseif ($serviceStage == "cache3") {
                 $GLOBALS["stackCacheManager"]->CleanAll();
             } elseif ($serviceStage == "cache4") {
                 CHTMLPagesCache::CleanAll();
             }
             COption::SetOptionString("main", "wizard_clear_exec", "Y", false, $wizard->GetVar("siteID"));
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:96,代码来源:wizard.php


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