Ejemplo n.º 1
0
 public function createleafaccountAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     //$username=$this->getRequest()->getParam('username');
     $password = $this->getRequest()->getParam('password');
     $email = $this->getRequest()->getParam('email');
     $dd = $this->getRequest()->getParam('dd');
     $dm = $this->getRequest()->getParam('dm');
     $dy = $this->getRequest()->getParam('dy');
     $dob = $dy . '-' . $dm . '-' . $dd;
     $create = new Application_Model_Users($this->registry['DB']);
     $finis = $create->CreateUserAccount(null, $password, null, null, $email, null, $dob, 'none');
     echo json_encode($finis);
 }
Ejemplo n.º 2
0
 public function signupAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getParams();
         if ($data['password'] != $data['confirmpassword']) {
             $this->view->errorMessage = "Password and confirm password don't match.";
             return;
         }
         $facebook = new FbPlugin_Facebook(array('appId' => '216305671841281', 'secret' => '041be5ec9d9cb6aea7cd4bb3541e9c8c'));
         $fbuser = $facebook->getUser();
         if ($fbuser) {
             $fbprofile = $facebook->api('/me?fields=id,email');
             if (strcasecmp($fbprofile['email'], $data['email']) === 0) {
                 $fbuserid = $fbprofile['id'];
             }
         }
         $users = new Application_Model_Users($this->registry->DB);
         $createaccresult = $users->CreateUserAccount($data['username'], $data['password'], $data['firstname'], $data['lastname'], $data['email'], $data['gender'], $data['dob'], 'user', $fbuserid);
         if ($createaccresult['status'] == 'true' && $fbuserid) {
             $facebook->api('/me/feed', 'post', array('message' => 'Now Joined in Freniz Network', 'link' => "http://www.freniz.com/" . $data['username'], 'picture' => "http://images.freniz.com/freniz.png", 'name' => $data['firstname'] . ' ' . $data['lastname'], "description" => 'description'));
         }
         echo json_encode($createaccresult);
         // $this->_redirect('auth/login');
     }
 }