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


PHP CGroup::Update方法代码示例

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


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

示例1: updateGroupIfExists

 public function updateGroupIfExists($code, $fields = array())
 {
     $groupId = $this->getGroupId($code);
     if (!$groupId) {
         return false;
     }
     if (empty($fields)) {
         $this->throwException(__METHOD__, 'Set fields for group %s', $code);
     }
     $group = new \CGroup();
     if ($group->Update($groupId, $fields)) {
         return intval($groupId);
     }
     $this->throwException(__METHOD__, $group->LAST_ERROR);
 }
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:15,代码来源:UserGroupHelper.php

示例2: CSite

$obSite = new CSite();
$obSite->Update("s1", array("NAME" => COption::GetOptionString("main", "site_name", GetMessage("DEFAULT_SITE_NAME"))));
//Edit profile task
$editProfileTask = false;
$dbResult = CTask::GetList(array(), array("NAME" => "main_change_profile"));
if ($arTask = $dbResult->Fetch()) {
    $editProfileTask = $arTask["ID"];
}
//admin security policy
$z = CGroup::GetByID(1);
if ($res = $z->Fetch()) {
    if ($res["SECURITY_POLICY"] == "") {
        $group = new CGroup();
        $arGroupPolicy = array("SESSION_TIMEOUT" => 15, "SESSION_IP_MASK" => "255.255.255.255", "MAX_STORE_NUM" => 1, "STORE_IP_MASK" => "255.255.255.255", "STORE_TIMEOUT" => 60 * 24 * 3, "CHECKWORD_TIMEOUT" => 60, "PASSWORD_LENGTH" => 10, "PASSWORD_UPPERCASE" => "Y", "PASSWORD_LOWERCASE" => "Y", "PASSWORD_DIGITS" => "Y", "PASSWORD_PUNCTUATION" => "Y", "LOGIN_ATTEMPTS" => 3);
        $arFields = array("SECURITY_POLICY" => serialize($arGroupPolicy));
        $group->Update(1, $arFields);
    }
}
//Registered users group
$dbResult = CGroup::GetList($by, $order, array("STRING_ID" => "REGISTERED_USERS"));
if ($dbResult->Fetch()) {
    return;
}
$group = new CGroup();
$arFields = array("ACTIVE" => "Y", "C_SORT" => 3, "NAME" => GetMessage("REGISTERED_GROUP_NAME"), "STRING_ID" => "REGISTERED_USERS");
$groupID = $group->Add($arFields);
if ($groupID > 0) {
    COption::SetOptionString("main", "new_user_registration_def_group", $groupID);
    if ($editProfileTask) {
        CGroup::SetTasks($groupID, array($editProfileTask), true);
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:settings.php

示例3: CGroup

				{
					$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");
				if(!$ob->Update($ID, $arFields))
					$lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR").":".$ob->LAST_ERROR, $ID);
			}
			else
				$lAdmin->AddGroupError(GetMessage("MAIN_ERROR_GROUP").$ID.GetMessage("MAIN_ERROR_GROUP_EDIT"));
			break;
		}
	}
}

// инициализация списка - выборка данных
$rsData = CGroup::GetList($by, $order, $arFilter, "Y");
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();

// установке параметров списка
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:group_admin.php

示例4: intval

             $ind++;
             $USER_ID[$ind]["USER_ID"] = intval(${"USER_ID_" . $i});
             $USER_ID[$ind]["DATE_ACTIVE_FROM"] = ${"USER_ID_FROM_" . $i};
             $USER_ID[$ind]["DATE_ACTIVE_TO"] = ${"USER_ID_TO_" . $i};
         }
     }
     if ($ID == 1 && $COPY_ID <= 0) {
         $ind++;
         $USER_ID[$ind]["USER_ID"] = 1;
         $USER_ID[$ind]["DATE_ACTIVE_FROM"] = false;
         $USER_ID[$ind]["DATE_ACTIVE_TO"] = false;
     }
     $arFields["USER_ID"] = $USER_ID;
 }
 if ($ID > 0 && $COPY_ID <= 0) {
     $res = $group->Update($ID, $arFields);
 } else {
     $ID = $group->Add($arFields);
     $res = $ID > 0;
     $new = "Y";
 }
 $strError .= $group->LAST_ERROR;
 if (strlen($strError) <= 0) {
     if (intval($ID) != 1 || COption::GetOptionString("main", "controller_member", "N") == "Y" && COption::GetOptionString("main", "~controller_limited_admin", "N") == "Y") {
         // set per module rights
         $arTasks = array();
         foreach ($arModules as $MID) {
             $moduleName = str_replace(".", "_", $MID);
             if (isset(${"TASKS_" . $moduleName})) {
                 $arTasks[$MID] = ${"TASKS_" . $moduleName};
                 $rt = CTask::GetLetter($arTasks[$MID]);
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:group_edit.php

示例5: save

 /**
  * Сохраняет группу
  * @return bool
  */
 public function save()
 {
     $values = $this->getValues();
     $arFields = array();
     foreach ($values as $key => $value) {
         $arFields[strtoupper($key)] = $value;
     }
     $group = new CGroup();
     //записываем поля пользователя
     if (!$this->isNew()) {
         $id = $this->getAttribute('id')->getValue();
         //при обновлении элемента сначала записываем базовые поля
         $res = $group->Update($id, $arFields);
         if (!$res) {
             throw new Exception($group->LAST_ERROR);
         }
         $this->riseEvent('afterSave');
     } else {
         $new = $group->Add($arFields);
         if ($new) {
             $this->getAttribute('id')->setValue($new);
             $this->riseEvent('afterSave');
         } else {
             throw new Exception($group->LAST_ERROR);
         }
     }
 }
开发者ID:marvin255,项目名称:bxar,代码行数:31,代码来源:Group.php


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