本文整理汇总了PHP中Network::deny方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::deny方法的具体用法?PHP Network::deny怎么用?PHP Network::deny使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::deny方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if ($_REQUEST['action'] == 'deny') {
Network::deny(PA::$network_info->network_id, $_REQUEST['uid']);
$message = 7023;
}
if ($_REQUEST['action'] == 'multiple_approve') {
if (is_array($_REQUEST['uid'])) {
foreach ($_REQUEST['uid'] as $uid) {
Network::approve(PA::$network_info->network_id, $uid);
}
$message = 7022;
}
}
if ($_REQUEST['action'] == 'multiple_deny') {
if (is_array($_REQUEST['uid'])) {
foreach ($_REQUEST['uid'] as $uid) {
Network::deny(PA::$network_info->network_id, $uid);
}
$message = 7023;
}
}
}
function setup_module($column, $module, $obj)
{
global $paging, $super_user_and_mothership;
switch ($module) {
case 'NetworkModerateUserModule':
if (@$_GET['sort_by'] == 'alphabetic') {
$obj->sort_by = 'U.login_name';
$obj->direction = 'ASC';
} else {
$obj->sort_by = 'U.created';
示例2: testNetworkCreation
function testNetworkCreation()
{
// check that we can create networks
$can = Network::can_network_be_created();
$this->assertFalse($can['error'], $can['error_msg']);
// get network owner user and figure out name etc
$user = Test::get_test_user();
$name = "testnet" . rand(10000, 99999);
$network_basic_controls = array();
// with crossed fingers, we hope that it will succeed without any of the detail here!
// make a new network
$net = new Network();
$net->set_params(array('user_id' => $user->user_id, 'name' => "auto-test network ({$name})", 'address' => $name, 'tagline' => "not much of a tagline", 'category_id' => 8, 'type' => 0, 'description' => "This network has been created automatically by a PHPUnit test. If the test succeeds, it will be deleted, too!", 'extra' => serialize($network_basic_controls), 'created' => time(), 'changed' => time()));
$net->save();
//default_page_setting($net->address);
// read it in again and see if it still works
$net_read = Network::get_network_by_address($net->address);
$this->assertEquals($net_read->network_id, $net->network_id);
$this->assertEquals($net_read->type, 0);
$this->assertEquals($net_read->member_count, 1);
$this->assertEquals($net_read->owner_id, $user->user_id);
// a user joins
$user2 = Test::get_test_user(2);
Network::join($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 2);
// a user leaves
Network::leave($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 1);
// make it into a moderated network
$net->type = 2;
$net->save();
// check that it really is moderated
$net_read = Network::get_network_by_address($net->address);
$this->assertEquals($net_read->network_id, $net->network_id);
$this->assertEquals($net_read->type, 2);
// a user requests
Network::join($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 1);
// request approved
Network::approve($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 2);
// user leaves
Network::leave($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 1);
// user requests
Network::join($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 1);
// all requests accepted (of course, there will only be the one)
Network::approve_all($net->network_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 2);
// user leaves
Network::leave($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 1);
// user requests
Network::join($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 1);
// request denied
Network::deny($net->network_id, $user2->user_id);
$this->assertEquals(Network::get_network_by_address($net->address)->member_count, 1);
// delete network
Network::delete($net->network_id);
}
示例3: foreach
if ($_REQUEST['action'] == 'deny') {
Network::deny($network_info->network_id, $_REQUEST['uid']);
$message = 7023;
}
if ($_REQUEST['action'] == 'multiple_approve') {
if (is_array($_REQUEST['uid'])) {
foreach ($_REQUEST['uid'] as $uid) {
Network::approve($network_info->network_id, $uid);
}
$message = 7022;
}
}
if ($_REQUEST['action'] == 'multiple_deny') {
if (is_array($_REQUEST['uid'])) {
foreach ($_REQUEST['uid'] as $uid) {
Network::deny($network_info->network_id, $uid);
}
$message = 7023;
}
}
}
function setup_module($column, $module, $obj)
{
global $paging, $configure_permission, $super_user_and_mothership;
//if(!$configure_permission) return 'skip';
switch ($module) {
case 'NetworkModerateUserModule':
if (!$configure_permission) {
return 'skip';
}
if ($_GET['sort_by'] == 'alphabetic') {