Пример #1
0
 public function checkemail()
 {
     $email = $this->request->query['email'];
     $uuid = new Uuid();
     $emails = Documents::find('first', array('conditions' => array('email' => $email)));
     if (count($emails) === 0) {
         $kyc_id = $uuid->v4v();
         $data = array('kyc_id' => $kyc_id, 'email' => $email, 'hash' => md5($email), 'IP' => $_SERVER['REMOTE_ADDR']);
         $Documents = Documents::create($data);
         $saved = $Documents->save();
     }
     $emails = Documents::find('first', array('conditions' => array('email' => $email)));
     /////////////////////////////////Email//////////////////////////////////////////////////
     $emaildata = array('kyc_id' => $kyc_id, 'email' => $email);
     $function = new Functions();
     $compact = array('data' => $emaildata);
     $from = array(NOREPLY => "noreply@" . COMPANY_URL);
     $email = $email;
     $function->sendEmailTo($email, $compact, 'process', 'sendKYC', "XGCWallet - Your KYC ID", $from, '', '', '', null);
     /////////////////////////////////Email//////////////////////////////////////////////////
     return $this->render(array('json' => array('success' => 1)));
 }
Пример #2
0
 public function checkCompanyemail()
 {
     $email = strtolower($this->request->query['email']);
     $uuid = new Uuid();
     $emails = Documents::find('first', array('conditions' => array('email' => $email)));
     if (count($emails) === 0) {
         $kyc_id = $uuid->v4v();
         $email_code = substr($kyc_id, 0, 4);
         $data = array('kyc_id' => $kyc_id, 'email_code' => $email_code, 'email' => $email, 'hash' => md5($email), 'IP' => $_SERVER['REMOTE_ADDR']);
         $Companies = Companies::create($data);
         $saved = $Companies->save();
     } else {
         $emails = Companies::find('first', array('conditions' => array('email' => $email)));
         $kyc_id = $emails['kyc_id'];
         if ($emails['Verify']['Score'] >= 80) {
             return $this->render(array('json' => array('success' => 0, 'reason' => 'Aleredy KYC complete')));
         }
     }
     /////////////////////////////////Email//////////////////////////////////////////////////
     $emaildata = array('kyc_id' => $kyc_id, 'email' => $email);
     $function = new Functions();
     $compact = array('data' => $emaildata);
     $from = array(NOREPLY => "noreply@" . COMPANY_URL);
     $email = $email;
     $function->sendEmailTo($email, $compact, 'process', 'sendKYCCompany', "KYCGlobal - Email Code", $from, '', '', '', null);
     /////////////////////////////////Email//////////////////////////////////////////////////
     return $this->render(array('json' => array('success' => 1)));
 }