Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vaibhav_User_IndexController extends Mage_Core_Controller_Front_Action
- {
- public function loginAction()
- {
- $data = $this->getRequest()->getParams();
- $model = Mage::getModel('user/user')->load($data['login']['username'],'email');
- if($model->getPassword() == $data['login']['password'])
- {
- if($model->getUserType() == 2)
- {
- Mage::getSingleton('core/session')->setLogiusername($model->getUserId());
- $this->_redirect('user/vendor/index');
- return ;
- }
- }
- else{
- Mage::getSingleton('core/session')->addError('Invalid Email Id or Password.');
- $this->_redirect('*/*/');
- return;
- }
- }
- }
- class Vaibhav_User_VendorController extends Mage_Core_Controller_Front_Action
- {
- public function preDispatch()
- {
- }
- public function indexAction()
- {
- echo Mage::getSingleton('core/session')->getLogiusername();
- exit;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement