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


PHP Network::approve方法代码示例

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


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

示例1: array

 }
 // adding default media as well as album
 User_Registration::add_default_media($newuser->user_id, '', PA::$network_info);
 User_Registration::add_default_media($newuser->user_id, '_audio', PA::$network_info);
 User_Registration::add_default_media($newuser->user_id, '_video', PA::$network_info);
 User_Registration::add_default_blog($newuser->user_id);
 //adding default link categories & links
 User_Registration::add_default_links($newuser->user_id);
 // Making user member of a network if he is registering to PA from a network
 if (!empty(PA::$network_info)) {
     if (!Network::member_exists(PA::$network_info->network_id, $newuser->user_id)) {
         // check is waiting member
         Network::join(PA::$network_info->network_id, $newuser->user_id);
         // no - join to network
     } else {
         Network::approve(PA::$network_info->network_id, $newuser->user_id);
         // yes - approve membership
     }
 }
 // register session
 register_session($newuser->login_name, $newuser->user_id, $newuser->role, $newuser->first_name, $newuser->last_name, $newuser->email, $newuser->picture);
 PA::$login_user = $newuser;
 PA::$login_uid = $newuser->user_id;
 // send welcome message
 PAMail::send("welcome_message", $newuser, PA::$network_info, array());
 if (!empty($_GET['InvID'])) {
     // if network invitation
     $invitation_id = $_GET['InvID'];
     $inv_error = "";
     $error_inv = false;
     try {
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:31,代码来源:mail_action.php

示例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);
 }
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:62,代码来源:NetworkCreationTest.php

示例3: foreach

    $super_user_and_mothership = TRUE;
}
if (!$error && isset($_REQUEST['action'])) {
    //there can be 4 possible actions
    if ($_REQUEST['action'] == 'approve') {
        Network::approve(PA::$network_info->network_id, $_REQUEST['uid']);
        $message = 7022;
    }
    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)
{
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:31,代码来源:moderate_users.php


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