Coder Social home page Coder Social logo

Comments (6)

artseld avatar artseld commented on September 27, 2024

Hello @lukeman83,
Try to run postinstall.php before using, it is need to initialize OpenInviter library to work.
Maybe, this post can be helpful for you: http://openinviter.com/forum/viewtopic.php?pid=2680#p2680
I guess that you also need to modify config.yml and set correct path to your tmp directory. Please, open the file BUNDLE/Resources/config/config.yml and modify parameter cookie_path.

from artseldopeninviterbundle.

lukeman83 avatar lukeman83 commented on September 27, 2024

Hi Arteld,
when I run postinstall.php it writes

Checking for new versions of OpenInviter...
Warning: fopen(C: mpp mp\oi.1360135958.2481.cookie): failed to open stream: Invalid argument in C:\xampp\htdocs\project\vendor\bundles\Artseld\OpeninviterBundle\Openinviter\plugins_base.php on line261

At the moment my cookie_path is "/tmp". What is the way to decide correct path?

from artseldopeninviterbundle.

artseld avatar artseld commented on September 27, 2024

Hi @lukeman83,
You can extend this bundle and override this configuration file in your own bundle. Or you can add all configuration data to config.yml of your application. See https://github.com/artseld/ArtseldOpeninviterBundle#step-4-minimal-configuration and try to add this data to your PROJECT/app/config.yml.
I guess that default temporary directory for Xampp on Windows should be something like to C:\xampp\tmp (so, change cookie_path from "/tmp" to "C:\xampp\tmp").

from artseldopeninviterbundle.

lukeman83 avatar lukeman83 commented on September 27, 2024

I setted cookie_path "C:\xampp\tmp" but:
{% render 'ArtseldOpeninviterBundle:Default:login' %}
return this error:

Fatal error: Declaration of Artseld\OpeninviterBundle\Form\Type\LoginFormType::buildForm() must be compatible with Symfony\Component\Form\FormTypeInterface::buildForm(Symfony\Component\Form\FormBuilderInterface $builder, array $options) in C:\xampp\htdocs\project\vendor\bundles\Artseld\OpeninviterBundle\Form\Type\LoginFormType.php on line 67

from artseldopeninviterbundle.

artseld avatar artseld commented on September 27, 2024

This bundle was developed for Symfony 2.0 almost 1 year ago. The error appears because you are using 2.1 or 2.2 version. I can apply small hotfix and do it in another branch. Sorry, I haven't a free time at this evening to check it, please contact me in any case - if problem will be solved or not. I will investigate it in details on this weekend.

from artseldopeninviterbundle.

lukeman83 avatar lukeman83 commented on September 27, 2024

Ok!
I found problems.

It's necessary to evveride LoginFormType :

namespace Artseld\OpeninviterBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class LoginFormType extends AbstractType
{
protected $openinviter;

public function __construct($openinviter)
{
    $this->openinviter = $openinviter;
}

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder
        ->add('email', 'text', array(
            'required' => true,
            'label' => 'artseld_openinviter.label.email',
        ))
        ->add('password', 'password', array(
            'required' => true,
            'label' => 'artseld_openinviter.label.password',
        ))
        ->add('provider', 'choice', array(
            'required' => true,
            'label' => 'artseld_openinviter.label.provider',
            'multiple' => false,
            'expanded' => false,
            'choices' => $this->getProviderChoices(),
        ))
    ;
}

public function getName()
{
    return 'artseld_openinviter_login_form';
}

protected function getProviderChoices()
{
    $choices = array();
    foreach ($this->openinviter->getPlugins() as $type => $providers)
    {
        // Email Providers, Social Networks
        $choices['artseld_openinviter.label.type_' . $type] = array();
        foreach ($providers as $provider => $details)
        {
            $choices['artseld_openinviter.label.type_' . $type][$provider] = $details['name'];
        }
    }

    return $choices;
}

}

and InviteFormType:

namespace Artseld\OpeninviterBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class InviteFormType extends AbstractType
{
protected $contacts;

public function __construct($contacts = array())
{
    $this->contacts = $contacts;
}

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder
        ->add('message', 'textarea', array(
            'required' => true,
            'label' => 'artseld_openinviter.label.message',
        ))
        ->add('email', 'choice', array(
            'required' => true,
            'label' => 'artseld_openinviter.label.recipients',
            'multiple' => true,
            'expanded' => true,
            'choices' => $this->getRecipientsChoices(),
        ))
    ;
}

public function getName()
{
    return 'artseld_openinviter_invite_form';
}

/**
 * @return array
 */
protected function getRecipientsChoices()
{
    return array_values($this->contacts);
}

}

from artseldopeninviterbundle.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.