Пример #1
0
function processConnectionActions($connectionids) {
	global $_CB_framework, $ueConfig, $_POST;

	// simple spoof check security
	cbSpoofCheck( 'manageConnections' );

	if(!$ueConfig['allowConnections']) {
		echo _UE_FUNCTIONALITY_DISABLED;
		return;
	}
	if ( ! ( $_CB_framework->myId() > 0 ) ) {
		cbNotAuth();
		return;
	}
	$cbCon	=	new cbConnection( $_CB_framework->myId() );

	if (is_array($connectionids)) {
		foreach($connectionids AS $cid) {
			$action		=	cbGetParam( $_POST, $cid . 'action' );
			if ( $action== 'd' ) {
				$cbCon->denyConnection( $_CB_framework->myId(), $cid );
			} elseif ( $action == 'a' ) {
				$cbCon->acceptConnection( $_CB_framework->myId(), $cid );
			}
		}
	}
	$error				=	$cbCon->getErrorMSG();
	if ( $error ) {
		cbRedirect( cbSef( 'index.php?option=com_comprofiler&task=manageConnections' . getCBprofileItemid(), false ), $error, 'error' );
	} else {
		cbRedirect( cbSef( 'index.php?option=com_comprofiler&task=manageConnections' . getCBprofileItemid(), false ),
							( is_array($connectionids) ) ? _UE_CONNECTIONACTIONSSUCCESSFULL : null );
	}
	return;
}
Пример #2
0
function processConnectionActions($connectionids)
{
    global $_CB_framework, $ueConfig, $_PLUGINS;
    // simple spoof check security
    cbSpoofCheck('manageconnections');
    if (!$ueConfig['allowConnections']) {
        $msg = CBTxt::Th('UE_FUNCTIONALITY_DISABLED', 'This functionality is currently disabled.');
    } elseif (!($_CB_framework->myId() > 0)) {
        $msg = CBTxt::Th('UE_NOT_AUTHORIZED', 'You are not authorized to view this page!');
    } else {
        $msg = null;
    }
    $_PLUGINS->loadPluginGroup('user');
    $_PLUGINS->trigger('onBeforeProcessConnectionsRequest', array($connectionids, &$msg));
    if ($msg) {
        $_CB_framework->enqueueMessage($msg, 'error');
        return;
    }
    $cbCon = new cbConnection($_CB_framework->myId());
    if (is_array($connectionids)) {
        foreach ($connectionids as $cid) {
            $action = cbGetParam($_POST, $cid . 'action');
            if ($action == 'd') {
                $cbCon->denyConnection($_CB_framework->myId(), $cid);
            } elseif ($action == 'a') {
                $cbCon->acceptConnection($_CB_framework->myId(), $cid);
            }
        }
    }
    $error = $cbCon->getErrorMSG();
    if ($error) {
        cbRedirect($_CB_framework->viewUrl('manageconnections', false), $error, 'error');
    } else {
        cbRedirect($_CB_framework->viewUrl('manageconnections', false), is_array($connectionids) ? CBTxt::Th('UE_CONNECTIONACTIONSSUCCESSFULL', 'Connection actions successful!') : null);
    }
}