本文整理汇总了PHP中CUser::updateMedia方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::updateMedia方法的具体用法?PHP CUser::updateMedia怎么用?PHP CUser::updateMedia使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::updateMedia方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
if (!isset($messages['sounds.recovery'])) {
$messages['sounds.recovery'] = 0;
}
if (!isset($messages['triggers.recovery'])) {
$messages['triggers.recovery'] = 0;
}
if (!isset($messages['triggers.severities'])) {
$messages['triggers.severities'] = array();
}
DBstart();
updateMessageSettings($messages);
$result = CUser::updateProfile($user);
if ($result && $USER_DETAILS['type'] > USER_TYPE_ZABBIX_USER) {
$data = array('users' => $user, 'medias' => $user['user_medias']);
$result = CUser::updateMedia($data);
}
$result = DBend($result);
if (!$result) {
error(CUser::resetErrors());
}
if ($result) {
add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_USER, 'User alias [' . $USER_DETAILS['alias'] . '] Name [' . $USER_DETAILS['name'] . ']' . ' Surname [' . $USER_DETAILS['surname'] . '] profile id [' . $USER_DETAILS['userid'] . ']');
ob_end_clean();
redirect($USER_DETAILS['last_page']['url']);
} else {
show_messages($result, S_USER_UPDATED, S_CANNOT_UPDATE_USER);
}
}
}
}
示例2: get_request
$usrgrps = get_request('user_groups', array());
$usrgrps = zbx_toObject($usrgrps, 'usrgrpid');
$user['usrgrps'] = $usrgrps;
if (isset($_REQUEST['userid'])) {
$action = AUDIT_ACTION_UPDATE;
$user['userid'] = $_REQUEST['userid'];
DBstart();
$result = CUser::update($user);
if (!$result) {
error(CUser::resetErrors());
}
// if($result) $result = CUserGroup::updateUsers(array('users' => $user, 'usrgrps' => $usrgrps));
// if($result === false)
// error(CUserGroup::resetErrors());
if ($result !== false) {
$result = CUser::updateMedia(array('users' => $user, 'medias' => $user['user_medias']));
}
$result = $result === false ? false : true;
$result = DBend($result);
show_messages($result, S_USER_UPDATED, S_CANNOT_UPDATE_USER);
} else {
$action = AUDIT_ACTION_ADD;
DBstart();
$result = CUser::create($user);
if (!$result) {
error(CUser::resetErrors());
}
// if($result) $result = CUserGroup::updateUsers(array('users' => $result, 'usrgrps' => $usrgrps));
// if($result === false)
// error(CUserGroup::resetErrors());
$result = $result === false ? false : true;