yii 2 – creating a new user using migrations

After installing yii framework 2 you will probably face the following problem: “How in the world a default user is created ?” (in order to log in into demo backend).

One way is the following . Seems pretty logical to me too. As you figured out you after you create the database you need to do a migrate in order to have the needed database tables. However this tables are empty.
Let’s fill them with an admin account.

First we need to create a migration:

yii create/migration insert_user

The resulting file is something like this :

This is the placeholder where we can actually add the usefull stuff. So … Without any delays we will add the User model to it and call User::create .
This is how it should look like:

‘admin’,
‘password’ => ‘demodemo’,
’email’ => ‘demo@tfm.ro’
)
);
}

public function down()
{
echo “m140803_224937_insert_user cannot be reverted.\n”;

return true;
}
}

Migrations are a very powerfull tool in yii framework 2. You can alter database with it, you can insert test or live data . And sometime you can revert the modifications.

compiling kde 4.11.1

Preparing the new TFM workstation. So far things look good.
kde-workspace will need some more libraries . First i’ll try without them .

  • Wayland , The Wayland Client and Server libraries , <http://wayland.freedesktop.org>

Required for building KWin with Wayland support

  •   Systemd , Init and service manager for Linux , <http://www.freedesktop.org/wiki/Software/systemd>

Provides automatic multi-seat, session and power management features

  •   Prison , Prison library , <http://projects.kde.org/prison>

Needed to create mobile barcodes from clipboard data

  •   libgps , GPS support for geolocation , <http://gpsd.berlios.de/>
  •   Xmms , X MultiMedia System development libraries , <http://www.xmms.org>

Support for XMMS in the Now Playing data engine

  •   Qalculate , Qalculate Library , <http://qalculate.sourceforge.net>

Needed to enable advanced features of the calculator runner

Screenshots will be added on the first test run .

 

Later update ( here it is ) : kde411

voyo.ro e gata. Let’s voyo.

Voyo logoIn sfirsit voyo.ro e gata. Ii dam drumul la apa luni 1 august. Filme online, seriale online, stirile Protv toate intr-un singur loc via internet streaming. Legal si fara sa trebuiasca sa instalezi pluginuri sau alte softuri pe calculator.

Voyo face parte din proiectul mare CME de a implementa un portal VOD in 6 tari .Voyo Cehia a fost lansat la inceputul anului , Voyo Croatia in iulie si acum Romania.

Eu personal sint foarte curios ce impact va avea in piata. Daca va reusi sa schimbe obieciurile de a downloada torente sau de a vedea pe diverse alte site-uri pirat filmele ramine de vazut. Oricum incepe o lupta mult mai zdravana impotriva pirateriei. Asta e clar.

Puteti sa faceti urmatorul calcul:

  • 8 RON filmul de dragoste neintrerupt de reclame si vazut la ce ora vrei
  • 1 RON punga de popcorn
  • 4 RON o sticla de cola
  • Filmul vazut din pat alaturi de iubita ? priceless

E mai ieftin decit la cinema 🙂

Si asa arata site-ul

 

Configurarea Redmine pentru automatizarea creare / administrare SVN

Atunci cind incepi sa utilizezi redmine in fiecare zi te lovesti integrarea svn – redmine. In mod normal serverul de svn si redmine-ul se pun pe masini separate si fiecare cu sistemul lui de gestionare de proiecte  / useri. Cind ai multi developeri , unii care vin , altii care pleaca , altii uita parole,  problemele de gestionare a sistemului pot deveni serioase. Redmine-ul rezolva aceste probleme prin:

1) Integrarea redmine cu ActiveDirectory ( sau cu un alt server LDAP ). Am spus integrare cu AD pentru ca in majoritatea firmelor medii / mari exista AD.  Asta inseamna ca sarcina crearii de useri / intretinerea de parole / access controlul / password policy se muta catre Active Directory sau LDAP. Ca avantaj major este ca administrarea poate fi centralizata.  Utilizatorul  poate sa isi schimbe singur parola ,  poate fi fortat sa schimbe parola o data la x luni si se poate impune o politica de parole ( n caractere din care m cifre si p semne speciale ). Un foarte bun punct de start se gaseste aici : http://www.redmine.org/projects/redmine/wiki/redmineldap

2) Integrarea si crearea automata a tree-urilor de svn atunci cind un proiect nou se adauga in redmine. Asta inseamna ca administratorul de redmine nu trebuie sa creeze de mina tree-ul de svn , sa adauge useri la svn scutind mult timp. Pentru a realiza acest lucru puteti citi http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_Subversion_integration