Skip to content

Instantly share code, notes, and snippets.

View dmeroff's full-sized avatar

Dmitry Erofeev dmeroff

  • Tbilisi, Georgia
View GitHub Profile

At the moment there are some troubles when adding new fields to registration form. The registration process will be improved in the version 0.9.5, but at the moment you can do following:

    1. add new fields to the user table
    1. override User model
    1. add those fields to the User model's register scenario and to the validation rules (don't forget to merge parent scenarios and rules)
    1. override Registration form
    1. add new fields to the Registration form by defining new properties
    1. add those fields to the Registration form's validation rules (don't forget to merge parent rules)
    1. override view file and add new fields there
<?php
use yii\authclient\OAuth2;
class Odnoklassniki extends OAuth2
{
/** @inheritdoc */
public $authUrl = 'http://www.odnoklassniki.ru/oauth/authorize';
/** @inheritdoc */
@dmeroff
dmeroff / bcrypt.php
Last active October 12, 2015 10:08
Bcrypt
$salt = '$2a$10$13super.Secret.Salt42/';
$hash = crypt('gfhjkm', $salt);
$container = new Pimple();
git reset --hard HEAD^
git reset --soft HEAD^
git commit -a --amend
<?php
echo 'test';