Esempio n. 1
0
function removeConnection( $userid, $connectionid ) {
	global $_CB_framework, $ueConfig;

	$andItemid	=	getCBprofileItemid(true);

	if ( ! $ueConfig['allowConnections'] ) {
		echo _UE_FUNCTIONALITY_DISABLED;
		return;
	}
	if ( ! ( $_CB_framework->myId() > 0 ) ) {
		cbNotAuth();
		return;
	}
	$cbCon		=	new cbConnection( $userid );
	if ( ! $cbCon->removeConnection( $userid, $connectionid ) ) {
		$msg	=	$cbCon->getErrorMSG();
	} else {
		$msg	=	$cbCon->getUserMSG();
	}

	// $url=cbSef("index.php?option=com_comprofiler&task=manageConnections");
	$url=cbSef( "index.php?option=com_comprofiler&tab=getConnectionTab" . $andItemid );
	echo "<script type=\"text/javascript\"> alert('".addslashes($msg)."'); document.location.href='".cbUnHtmlspecialchars($url)."'; </script>\n";

}
Esempio n. 2
0
function removeConnection($userid, $connectionid, $act = 'connections')
{
    global $_CB_framework, $ueConfig, $_PLUGINS;
    if (!$ueConfig['allowConnections']) {
        $msg = CBTxt::Th('UE_FUNCTIONALITY_DISABLED', 'This functionality is currently disabled.');
    } elseif (!($_CB_framework->myId() > 0)) {
        cbNotAuth(true);
        return;
    } else {
        $msg = null;
    }
    $_PLUGINS->loadPluginGroup('user');
    $_PLUGINS->trigger('onBeforeRemoveConnectionRequest', array($userid, $connectionid, &$msg, $act));
    if ($msg) {
        $_CB_framework->enqueueMessage($msg, 'error');
        return;
    }
    $cbCon = new cbConnection($userid);
    if (!$cbCon->removeConnection($userid, $connectionid)) {
        $msg = $cbCon->getErrorMSG();
    } else {
        $msg = $cbCon->getUserMSG();
    }
    if ($act == 'connections') {
        cbRedirectToProfile($userid, $msg, null, 'getConnectionTab');
    } elseif ($act == 'manage') {
        cbRedirectToProfile($connectionid, $msg, 'manageconnections', 'cbtabconnections');
    } else {
        cbRedirectToProfile($connectionid, $msg);
    }
}