예제 #1
0
 public static function step2()
 {
     $oSession = new Session();
     if (!$oSession->exists('mail_step1')) {
         Framework\Url\Header::redirect(Uri::get('user', 'signup', 'step1'));
     } elseif ($oSession->exists('mail_step2')) {
         Header::redirect(Uri::get('user', 'signup', 'step3'));
     }
     unset($oSession);
     if (isset($_POST['submit_join_user2'])) {
         if (\PFBC\Form::isValid($_POST['submit_join_user2'])) {
             (new JoinFormProcess())->step2();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_join_user2');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_join_user2', 'form_join_user2'));
     $oForm->addElement(new \PFBC\Element\Token('join2'));
     $oForm->addElement(new \PFBC\Element\Radio(t('Gender:'), 'sex', array('female' => t('Female') . ' ♀', 'male' => t('Male') . ' ♂', 'couple' => t('Couple')), array('value' => 'female', 'title' => t('Please specify your gender.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Checkbox(t('Interested in:'), 'match_sex', array('male' => t('Male') . ' ♂', 'female' => t('Female') . ' ♀', 'couple' => t('Couple')), array('value' => 'male', 'title' => t('Please specify whom you are looking for'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Date(t('Your Date of birth:'), 'birth_date', array('placeholder' => t('Month/Day/Year'), 'id' => 'birth_date', 'title' => t('Please specify your birth date using the calendar or with this format: Month/Day/Year.'), 'onblur' => 'CValid(this.value, this.id)', 'validation' => new \PFBC\Validation\BirthDate(), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error birth_date"></span>'));
     $oForm->addElement(new \PFBC\Element\Country(t('Your Country:'), 'country', array('id' => 'str_country', 'value' => Geo::getCountryCode(), 'title' => t('Select the country where you live.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your City:'), 'city', array('id' => 'str_city', 'value' => Geo::getCity(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify the city where you live.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_city"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your State or Province:'), 'state', array('id' => 'str_state', 'value' => Geo::getState(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify your state.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_state"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your ZIP/Postal Code:'), 'zip_code', array('id' => 'str_zip_code', 'value' => Geo::getZipCode(), 'onblur' => 'CValid(this.value,this.id,2,15)', 'title' => t('Enter your post code (Zip).'), 'validation' => new \PFBC\Validation\Str(2, 15), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_zip_code"></span>'));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script><script src="' . PH7_URL_STATIC . PH7_JS . 'geo/autocompleteCity.js"></script>'));
     $oForm->render();
 }
예제 #2
0
 /**
  * @param array $aProfile
  * @param object \PH7\UserCoreModel $oUserModel
  * @return void
  */
 public function add(array $aProfile, UserCoreModel $oUserModel)
 {
     $sBirthDate = !empty($aProfile['birthday']) ? $aProfile['birthday'] : date('m/d/Y', strtotime('-30 year'));
     $sSex = $aProfile['gender'] != 'male' && $aProfile['gender'] != 'female' && $aProfile['gender'] != 'couple' ? 'female' : $aProfile['gender'];
     // Default 'female'
     $sMatchSex = $sSex == 'male' ? 'female' : ($sSex == 'female' ? 'male' : 'couple');
     $this->_sUsername = (new UserCore())->findUsername($aProfile['given_name'], $aProfile['name'], $aProfile['family_name']);
     $this->_aUserInfo = ['email' => $aProfile['email'], 'username' => $this->_sUsername, 'password' => Various::genRndWord(8, 30), 'first_name' => !empty($aProfile['given_name']) ? $aProfile['given_name'] : '', 'last_name' => !empty($aProfile['family_name']) ? $aProfile['family_name'] : '', 'sex' => $sSex, 'match_sex' => array($sMatchSex), 'birth_date' => (new CDateTime())->get($sBirthDate)->date('Y-m-d'), 'country' => Geo::getCountryCode(), 'city' => Geo::getCity(), 'state' => Geo::getState(), 'zip_code' => Geo::getZipCode(), 'description' => !empty($aProfile['bio']) ? $aProfile['bio'] : '', 'website' => '', 'social_network_site' => $aProfile['link'], 'ip' => Ip::get(), 'prefix_salt' => Various::genRnd(), 'suffix_salt' => Various::genRnd(), 'hash_validation' => Various::genRnd(), 'is_active' => DbConfig::getSetting('userActivationType')];
     $this->_iProfileId = $oUserModel->add($this->_aUserInfo);
 }
예제 #3
0
 /**
  * @param object $oProfile
  * @param object \PH7\UserCoreModel $oUserModel
  * @return void
  */
 public function add($oProfile, UserCoreModel $oUserModel)
 {
     $sBirthDate = isset($oProfile->birth_month, $oProfile->birth_day, $oProfile->birth_year) ? $oProfile->birth_month . '/' . $oProfile->birth_day . '/' . $oProfile->birth_year : date('m/d/Y', strtotime('-30 year'));
     $sSex = $oProfile->gender != 'male' && $oProfile->gender != 'female' && $oProfile->gender != 'couple' ? 'female' : $oProfile->gender;
     // Default 'female'
     $sMatchSex = $sSex == 'male' ? 'female' : ($sSex == 'female' ? 'male' : 'couple');
     $this->_sUsername = (new UserCore())->findUsername($oProfile->name, $oProfile->first_name, $oProfile->last_name);
     $this->_aUserInfo = ['email' => $oProfile->emails->account, 'username' => $this->_sUsername, 'password' => Various::genRndWord(8, 30), 'first_name' => !empty($oProfile->first_name) ? $oProfile->first_name : '', 'last_name' => !empty($oProfile->last_name) ? $oProfile->last_name : '', 'sex' => $sSex, 'match_sex' => array($sMatchSex), 'birth_date' => (new CDateTime())->get($sBirthDate)->date('Y-m-d'), 'country' => Geo::getCountryCode(), 'city' => Geo::getCity(), 'state' => Geo::getState(), 'zip_code' => Geo::getZipCode(), 'description' => '', 'website' => '', 'social_network_site' => '', 'ip' => Ip::get(), 'prefix_salt' => Various::genRnd(), 'suffix_salt' => Various::genRnd(), 'hash_validation' => Various::genRnd(), 'is_active' => DbConfig::getSetting('userActivationType')];
     $this->_iProfileId = $oUserModel->add($this->_aUserInfo);
 }
예제 #4
0
 /**
  * @param array $aProfile
  * @param object \PH7\UserCoreModel $oUserModel
  * @return void
  */
 public function add(array $aProfile, UserCoreModel $oUserModel)
 {
     $oUser = new UserCore();
     $sBirthDate = !empty($aProfile['birthday']) ? $aProfile['birthday'] : date('m/d/Y', strtotime('-30 year'));
     $sLocation = !empty($aProfile['location']['name']) ? $aProfile['location']['name'] : (!empty($aProfile['hometown']['name']) ? $aProfile['hometown']['name'] : '');
     $aLocation = @explode(',', $sLocation);
     $sSex = $aProfile['gender'] != 'male' && $aProfile['gender'] != 'female' && $aProfile['gender'] != 'couple' ? 'female' : $aProfile['gender'];
     // Default 'female'
     $sMatchSex = $oUser->getMatchSex($sSex);
     $this->_sUsername = $oUser->findUsername($aProfile['username'], $aProfile['first_name'], $aProfile['last_name']);
     $sSite = !empty($aProfile['link']) ? explode(' ', $aProfile['link'])[0] : '';
     $sSocialNetworkSite = !empty($aProfile['username']) ? 'http://facebook.com/' . $aProfile['username'] : '';
     unset($oUser);
     $this->_aUserInfo = ['email' => $aProfile['email'], 'username' => $this->_sUsername, 'password' => Various::genRndWord(8, 30), 'first_name' => !empty($aProfile['first_name']) ? $aProfile['first_name'] : '', 'last_name' => !empty($aProfile['last_name']) ? $aProfile['last_name'] : '', 'middle_name' => !empty($aProfile['middle_name']) ? $aProfile['middle_name'] : '', 'sex' => $sSex, 'match_sex' => array($sMatchSex), 'birth_date' => (new CDateTime())->get($sBirthDate)->date('Y-m-d'), 'country' => !empty($aLocation[1]) ? trim($aLocation[1]) : Geo::getCountryCode(), 'city' => !empty($aLocation[0]) ? trim($aLocation[0]) : Geo::getCity(), 'state' => !empty($aProfile['locale']) ? $aProfile['locale'] : Geo::getState(), 'zip_code' => !empty($aProfile['hometown_location']['zip']) ? $aProfile['hometown_location']['zip'] : Geo::getZipCode(), 'description' => !empty($aProfile['bio']) ? $aProfile['bio'] : '', 'website' => $sSite, 'social_network_site' => $sSocialNetworkSite, 'ip' => Ip::get(), 'prefix_salt' => Various::genRnd(), 'suffix_salt' => Various::genRnd(), 'hash_validation' => Various::genRnd(), 'is_active' => DbConfig::getSetting('userActivationType')];
     $this->_iProfileId = $oUserModel->add($this->_aUserInfo);
 }
예제 #5
0
 public static function step1()
 {
     if (isset($_POST['submit_join_aff'])) {
         if (\PFBC\Form::isValid($_POST['submit_join_aff'])) {
             (new JoinFormProcess())->step1();
         }
         Header::redirect();
     }
     $oForm = new \PFBC\Form('form_join_aff', 400);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_join_aff', 'form_join_aff'));
     $oForm->addElement(new \PFBC\Element\Token('join'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your First Name:'), 'first_name', array('id' => 'str_first_name', 'onblur' => 'CValid(this.value,this.id,2,20)', 'title' => t('Enter your first name.'), 'required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_first_name"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your Last Name:'), 'last_name', array('id' => 'str_last_name', 'onblur' => 'CValid(this.value, this.id,2,20)', 'title' => t('Enter your last name.'), 'required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_last_name"></span>'));
     $oForm->addElement(new \PFBC\Element\Username(t('Username:'******'username', array('id' => 'username', 'onkeyup' => 'CValid(this.value, this.id,\'Affiliates\')', 'title' => t('Your username will be your unique ID reference for advertisements.'), 'required' => 1, 'validation' => new \PFBC\Validation\Username('Affiliates'))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error username"></span>'));
     $oForm->addElement(new \PFBC\Element\Email(t('Your Email:'), 'mail', array('id' => 'email', 'onblur' => 'CValid(this.value, this.id,\'guest\',\'Affiliates\')', 'title' => t('Enter your valid email address.'), 'required' => 1, 'validation' => new \PFBC\Validation\CEmail('guest', 'Affiliates'))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error email"></span>'));
     $oForm->addElement(new \PFBC\Element\Password(t('Your Password:'******'password', array('id' => 'password', 'onkeyup' => 'checkPassword(this.value)', 'onblur' => 'CValid(this.value, this.id)', 'title' => t('Your password. It will be used for logging in to the site. This storage is secure, because we are using an encrypted format.'), 'required' => 1, 'validation' => new \PFBC\Validation\Password())));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error password"></span>'));
     $oForm->addElement(new \PFBC\Element\Radio(t('Your Sex:'), 'sex', array('male' => t('Male'), 'female' => t('Female')), array('value' => 'male', 'title' => t('Please specify your gender.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Date(t('Your Date of birth:'), 'birth_date', array('placeholder' => t('Month/Day/Year'), 'id' => 'birth_date', 'title' => t('Please specify your birth date using the calendar or with this format: Month/Day/Year.'), 'onblur' => 'CValid(this.value, this.id)', 'required' => 1, 'validation' => new \PFBC\Validation\BirthDate())));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error birth_date"></span>'));
     $oForm->addElement(new \PFBC\Element\Country(t('Your Country:'), 'country', array('id' => 'str_country', 'value' => Geo::getCountryCode(), 'title' => t('Select the country where you live.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your City:'), 'city', array('id' => 'str_city', 'value' => Geo::getCity(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify the city where you live.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_city"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your State:'), 'state', array('id' => 'str_state', 'value' => Geo::getState(), 'onblur' => 'CValid(this.value,this.id,2,150)', 'title' => t('Specify your state.'), 'validation' => new \PFBC\Validation\Str(2, 150), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_state"></span>'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your ZIP/Postal Code:'), 'zip_code', array('id' => 'str_zip_code', 'value' => Geo::getZipCode(), 'onblur' => 'CValid(this.value,this.id,2,15)', 'title' => t('Enter your post code (Zip).'), 'validation' => new \PFBC\Validation\Str(2, 15), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_zip_code"></span>'));
     if (DbConfig::getSetting('isCaptchaAffiliateSignup')) {
         $oForm->addElement(new \PFBC\Element\CCaptcha(t('Captcha:'), 'captcha', array('id' => 'ccaptcha', 'onkeyup' => 'CValid(this.value, this.id)', 'description' => t('Enter the code above:'))));
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error ccaptcha"></span>'));
     }
     $oForm->addElement(new \PFBC\Element\Checkbox(t('Terms of Service'), 'terms', array(1 => '<em>' . t('I have read and agree to the %0%.', '<a href="' . Uri::get('page', 'main', 'affiliateterms') . '" rel="nofollow" target="_blank">' . t('Terms of Service') . '</a>') . '</em>'), array('id' => 'terms', 'onblur' => 'CValid(this.checked, this.id)', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error terms-0"></span>'));
     $oForm->addElement(new \PFBC\Element\Button(t('Become an Affiliate!'), 'submit', array('icon' => 'cart')));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script><script src="' . PH7_URL_STATIC . PH7_JS . 'geo/autocompleteCity.js"></script>'));
     $oForm->render();
 }