本文整理汇总了PHP中smail::CommuneMemberAction方法的典型用法代码示例。如果您正苦于以下问题:PHP smail::CommuneMemberAction方法的具体用法?PHP smail::CommuneMemberAction怎么用?PHP smail::CommuneMemberAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smail
的用法示例。
在下文中一共展示了smail::CommuneMemberAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
break;
case 'do.Kill.member':
case 'do.Accept.member':
case 'do.Unaccept.member':
$commune_output = 'members.php';
$member_id = __paramInit('int', 'm', NULL);
$alert = NULL;
if (!$member_id) {
header("Location: /commune/?id={$id}&site=Admin.members");
exit;
}
if (!($user_id = commune::AcceptMember($member_id, $action == 'do.Accept.member' ? 0 : 1))) {
$alert = 'Ошибка!';
} else {
$sm = new smail();
$sm->CommuneMemberAction($user_id, $action, $comm);
header("Location: /commune/?id={$id}&site=Admin.members" . ($action == 'do.Kill.member' ? '' : '&mode=Asked'));
exit;
}
break;
case 'Create.post':
case 'Edit.post':
break;
case 'do.Create.post':
case 'do.Edit.post':
$alert = NULL;
$cur_user = new users();
$cur_user->GetUserByUID(get_uid(false));
if (!($comm['id'] != 5100 && $comm['id'] != 1008 || $cur_user->is_team == 't' && ($comm['id'] == 5100 || $comm['id'] == 1008))) {
header('Location: ' . getFriendlyURL('commune_commune', $comm['id']));
exit;
示例2: BanMember
function BanMember($backto, $member_id)
{
$objResponse = new xajaxResponse();
if (get_uid(false)) {
$comm = commune::GetCommuneByMember($member_id);
$status = commune::GetUserCommuneRel($comm['id'], get_uid(false));
}
if ($status['is_moderator'] == 1 || $status['is_admin'] == 1 || $status['is_author'] == 1 || hasPermissions('communes')) {
if ($r = commune::BanMember($member_id)) {
$objResponse->assign($backto, 'innerHTML', $r < 0 ? 'Забанить' : 'Разбанить');
$objResponse->script("document.getElementById('" . $backto . "').className = '" . ($r < 0 ? 'lnk-dot-red' : 'lnk-dot-green') . "'");
$objResponse->script("\$('user_row_{$member_id}')" . ($r < 0 ? '.removeClass(\'cau-banned\')' : '.addClass(\'cau-banned\')'));
$comm = commune::GetCommuneByMember($member_id);
$sm = new smail();
if ($r < 0) {
$sm->CommuneMemberAction($comm['member_user_id'], 'UnBanMember', $comm);
}
// else
// $sm->CommuneMemberAction($comm['member_user_id'], 'BanMember', $comm);
}
}
return $objResponse;
}
示例3: UpdateAdmin
/**
* Обновляем админов сообщества
*
* @param integer $member_id ИД обновления
* @param integer $note Заметка
* @param boolean $is_moderator Модератор или нет
* @param boolean $is_manager Менеджер или нет
* @return integer 1 - обновление прошло успешно, иначе 0
*/
function UpdateAdmin($member_id, $note, $is_moderator, $is_manager, $comm = false)
{
global $DB;
$info = $this->GetCommuneByMember($member_id);
$sql = "UPDATE commune_members\n SET note = ?,\n is_moderator=" . ($is_moderator ? 'true' : 'false') . ",\n is_manager=" . ($is_manager ? 'true' : 'false') . "\n WHERE id = ?i";
if ($DB->query($sql, $note, $member_id)) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/smail.php";
$sm = new smail();
if ($info['is_admin'] == 'f' && ($is_moderator == true || $is_manager == true)) {
$sm->CommuneMemberAction($info['member_user_id'], 'do.Add.admin', $comm);
}
if ($is_moderator == false && $is_manager == false) {
$sm->CommuneMemberAction($info['member_user_id'], 'do.Remove.admin', $comm);
}
return 1;
}
return 0;
}