create new user record in other database

Discussion in 'Integration' started by mani_bharath, May 25, 2016.

  1. mani_bharath

    mani_bharath New Member

    Joined:
    May 23, 2016
    Messages:
    3
    if subscription susses then automatically create new user record in other database using amember userid and password. and if amember user un subscribe automatically other database user record will be remove

    what can i do. ?

    give me coding to integrate it
  2. mani_bharath

    mani_bharath New Member

    Joined:
    May 23, 2016
    Messages:
    3
    i use this custom integration plugin code
    but if i enable this plugin amember user end not working

    <?php/**
    * Create Integration Plugin
    * Checklist (mark tested items with x):
    * [x] - template generated
    * [ ] - go to aMember Cp -> Setup -> Plugins and enable this plugin
    * [ ] - test user creation
    * try to create user in aMember and add access manually.
    * Login to Create and check that
    * that corresponding user appeared in users list and all necessary
    * fields transferred
    * [ ] - test password generation: login to create as the new user
    * [ ] - update user record in amember and try to login and view profile in the script
    * [ ] - implement single-login
    *
    **/class Am_Protect_Create extends Am_Protect_Databased{
    const PLUGIN_DATE = '$Date$';
    const PLUGIN_REVISION = '@@VERSION@@';

    protected $guessTablePattern = "users";
    protected $guessFieldsPattern = array('name','email','username','password',
    );
    protected $groupMode = Am_Protect_Databased::GROUP_NONE;

    public function afterAddConfigItems(Am_Form_Setup_ProtectDatabased $form)
    {parent::afterAddConfigItems($form);// additional configuration items for the plugin may be inserted here}

    public function getPasswordFormat()
    {
    return SavedPassTable::pASSWORD_PLAIN;
    }
    public function createTable()
    {$table = new Am_Protect_Table($this, $this->getDb(), '?_users', 'id');$table->setFieldsMapping(array(
    array(Am_Protect_Table::FIELD_NAME_F, 'name'),
    array(Am_Protect_Table::FIELD_EMAIL, 'email'),
    array(Am_Protect_Table::FIELD_NAME, 'username'),
    array(Am_Protect_Table::FIELD_PASS, 'password'),

    ));

    return $table;
    }
    public function createSessionTable()
    {$table = new Am_Protect_SessionTable($this, $this->getDb(),'?_users', 'id');$table->setTableConfig(array(Am_Protect_SessionTable::FIELD_SID => 'id',Am_Protect_SessionTable::FIELD_SID => 'name',Am_Protect_SessionTable::FIELD_SID => 'email',Am_Protect_SessionTable::FIELD_SID => 'username',Am_Protect_SessionTable::FIELD_SID => 'fb_user_id',Am_Protect_SessionTable::FIELD_SID => 'fb_id',Am_Protect_SessionTable::FIELD_SID => 'password',Am_Protect_SessionTable::FIELD_SID => 'gmt',Am_Protect_SessionTable::FIELD_SID => 'gmt_zone',Am_Protect_SessionTable::FIELD_SID => 'access',Am_Protect_SessionTable::FIELD_SID => 'status',Am_Protect_SessionTable::FIELD_SID => 'timestamp_login',Am_Protect_SessionTable::FIELD_SID => 'timestamp',Am_Protect_SessionTable::SESSION_COOKIE => $this->getSessionCookieName(),
    )
    );
    return $table;
    }

    function getSessionCookieName()
    {//return name of cookie that used for sessions}

    function getReadme()
    {
    return <<<CUT create README
    CUT;
    }
    }
  3. mani_bharath

    mani_bharath New Member

    Joined:
    May 23, 2016
    Messages:
    3
    Adding new ameberuser to custom database

Share This Page