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

	$andItemid = getCBprofileItemid();

	// 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) {
			$connectionTypes	=	cbGetParam( $_POST, $cid.'connectiontype', array() );
			$cbCon->saveConnection( $cid, stripslashes( cbGetParam( $_POST, $cid . 'description', '' ) ), implode( '|*|', $connectionTypes ) );
		}
	}
	cbRedirect( cbSef( 'index.php?option=com_comprofiler&task=manageConnections&tab=1' . $andItemid, false ),
							(is_array($connectionids)) ? _UE_CONNECTIONSUPDATEDSUCCESSFULL : null);

}
Пример #2
0
function saveConnections($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('onBeforeSaveConnectionsRequest', 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) {
            $connectionTypes = cbGetParam($_POST, $cid . 'connectiontype', array());
            $cbCon->saveConnection($cid, stripslashes(cbGetParam($_POST, $cid . 'description', '')), implode('|*|', $connectionTypes));
        }
    }
    cbRedirectToProfile(null, is_array($connectionids) ? CBTxt::T('UE_CONNECTIONSUPDATEDSUCCESSFULL', 'Your connections are successfully updated!') : null, 'manageconnections', '1');
}