Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1.             $user = ORM::factory('user');
  2.             $user->username = 'yoda';
  3.             $user->email = 'aeon.yoda@gmail.com';
  4.             $user->password = '12345';
  5.             $user->save();
  6.             $user->add('roles', ORM::factory('role', 1));
  7.             $user->save();
  8.            
  9.             $status = Auth::instance()->login('yoda', '12345');
  10.            
  11.             if ($status)
  12.             {
  13.                 echo 'true';
  14.             }
  15.             else
  16.             {
  17.                 echo 'false';
  18.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement