Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function executeLogin(sfWebRequest $request)
- {
- $user = $_GET['username'];
- $passwd = $_GET['password'];
- $hash = $_GET['hash'];
- $xml = '<?xml version="1.0" encoding="UTF-8"?>';
- //$resultArr = Array();
- $comphash = sha1("DFh3X98njaW4tb082ky".$passwd.$user."mNGwn3D8Iodq28ZXAsf35Nb");
- if($comphash == $hash)
- {
- $cuser = Doctrine_Query::create()
- ->from('sfGuardUser p')
- ->where('p.username = ?', $user)
- ->andWhere('p.is_active = ?', 1)
- ->fetchOne();
- if($cuser)
- {
- $passhash = sha1($cuser->getSalt().$passwd);
- $passhash2 = sha1($passwd);
- $cuser = Doctrine_Query::create()
- ->from('sfGuardUser p')
- ->where('p.username = ?', $user)
- ->andWhere('p.password = ?', $passhash)
- ->andWhere('p.is_active = ?', 1)
- ->fetchOne();
- if($cuser)
- {
- $this->getUser()->signIn($cuser);
- $this->redirect('dashboard/init');
- $xml = $xml.'<result>00001</result>';
- }
- else
- $xml = $xml.'<result>01004</result>';
- }
- }
- else
- $xml = $xml.'<result>01006</result>';
- $this->getResponse()->setContentType('application/xml');
- // HAY QUE PONER ESTA LINEA, PORQUE SINO AΓADE UN INTRO AL PRINCIPIO DEL FICHERO.
- ob_end_clean();
- $this->setLayout(false);
- return $this->renderText($xml);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement