Advertisement
Guest User

Untitled

a guest
Apr 6th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. require('/path/to/framework/YiiBase.php');
  2.  
  3. $config = require('/path/to/protected/config/main.php');
  4. $session = YiiBase::createComponent($config['components']['session']);
  5.  
  6. $session = new CHttpSession();
  7.  
  8. require('/path/to/framework/YiiBase.php');
  9. $config = require('/path/to/configs_directory/main.php');
  10. Yii::createWebApplication($config);
  11.  
  12. $userInfo = User::model()->findByPk(array('id'=>Yii::app()->user->id));
  13. $user = $userInfo->username;
  14. $password = md5($this->userInfo->password);
  15.  
  16. Yii::app()->session['usename'] = $user;
  17. Yii::app()->session['password'] = $password;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement