public function test()
 {
     $test = recaptcha::test();
     if (!$test) {
         $this->err = 'recaptcha';
     }
     return $test;
 }
Example #2
0
 /**
  * Singleton Pattern
  * @return class object
  */
 public static function instance($publickey, $privatekey)
 {
     if (!is_object(self::$instance)) {
         //$class = __CLASS__;
         self::$instance = new recaptcha($publickey, $privatekey);
     }
     return self::$instance;
 }
 static function install()
 {
     $version = module::get_version("recaptcha");
     if ($version == 0) {
         module::set_version("recaptcha", 1);
     }
     recaptcha::check_config();
 }
Example #4
0
 /**
  * Validate this input based on the set rules.
  *
  * @return  bool
  */
 public function validate()
 {
     $input = Input::instance();
     $challenge = $input->post("recaptcha_challenge_field", "", true);
     $response = $input->post("recaptcha_response_field", "", true);
     if (!empty($challenge)) {
         $this->_error = recaptcha::is_recaptcha_valid($challenge, $response, module::get_var("recaptcha", "private_key"));
         if (!empty($this->_error)) {
             $this->add_error($this->_error, 1);
         }
     }
     $this->is_valid = empty($this->_error);
     return empty($this->_error);
 }
Example #5
0
 public function index()
 {
     $form = recaptcha::get_configure_form();
     if (request::method() == "post") {
         // @todo move the "save" part of this into a separate controller function
         access::verify_csrf();
         $old_public_key = module::get_var("recaptcha", "public_key");
         $old_private_key = module::get_var("recaptcha", "private_key");
         if ($form->validate()) {
             $public_key = $form->configure_recaptcha->public_key->value;
             $private_key = $form->configure_recaptcha->private_key->value;
             if ($public_key && $private_key) {
                 module::set_var("recaptcha", "public_key", $public_key);
                 module::set_var("recaptcha", "private_key", $private_key);
                 message::success(t("reCAPTCHA configured!"));
                 log::success("recaptcha", t("reCAPTCHA public and private keys set"));
                 url::redirect("admin/recaptcha");
             } else {
                 if ($public_key && !$private_key) {
                     $form->configure_recaptcha->private_key->add_error("invalid");
                 } else {
                     if ($private_key && !$public_key) {
                         $form->configure_recaptcha->public_key->add_error("invalid");
                     } else {
                         module::set_var("recaptcha", "public_key", "");
                         module::set_var("recaptcha", "private_key", "");
                         message::success(t("No keys provided.  reCAPTCHA is disabled!"));
                         log::success("recaptcha", t("reCAPTCHA public and private keys cleared"));
                         url::redirect("admin/recaptcha");
                     }
                 }
             }
         }
     }
     recaptcha::check_config();
     $view = new Admin_View("admin.html");
     $view->page_title = t("reCAPTCHA");
     $view->content = new View("admin_recaptcha.html");
     $view->content->public_key = module::get_var("recaptcha", "public_key");
     $view->content->private_key = module::get_var("recaptcha", "private_key");
     $view->content->form = $form;
     print $view;
 }
Example #6
0
 public function index()
 {
     $form = recaptcha::get_configure_form();
     if (request::method() == "post") {
         $old_public_key = module::get_var("recaptcha", "public_key");
         $old_private_key = module::get_var("recaptcha", "private_key");
         if ($form->validate()) {
             $public_key = $form->configure_recaptcha->public_key->value;
             $private_key = $form->configure_recaptcha->private_key->value;
             if ($public_key && $private_key) {
                 module::set_var("recaptcha", "public_key", $public_key);
                 module::set_var("recaptcha", "private_key", $private_key);
                 message::success(t("Recaptcha configured!"));
                 log::success("recaptcha", t("Recaptcha public and private keys set"));
                 url::redirect("admin/recaptcha");
             } else {
                 if ($public_key && !$private_key) {
                     $form->configure_recaptcha->private_key->add_error("invalid");
                 } else {
                     if ($private_key && !$public_key) {
                         $form->configure_recaptcha->public_key->add_error("invalid");
                     } else {
                         module::set_var("recaptcha", "public_key", "");
                         module::set_var("recaptcha", "private_key", "");
                         message::success(t("Recaptcha disabled!"));
                         log::success("recaptcha", t("Recaptcha public and private keys cleared"));
                         url::redirect("admin/recaptcha");
                     }
                 }
             }
         }
     }
     recaptcha::check_config();
     $view = new Admin_View("admin.html");
     $view->content = new View("admin_recaptcha.html");
     $view->content->public_key = module::get_var("recaptcha", "public_key");
     $view->content->private_key = module::get_var("recaptcha", "private_key");
     $view->content->form = $form;
     print $view;
 }
Example #7
0
 static function activate()
 {
     recaptcha::check_config();
 }
 public function display_form()
 {
     if ((int) $this->config->get('cmsbridge_active') == 1 && strlen($this->config->get('cmsbridge_reg_url'))) {
         redirect($this->config->get('cmsbridge_reg_url'), false, true);
     }
     //Captcha
     if ($this->config->get('enable_captcha') == 1) {
         require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
         $captcha = new recaptcha();
         $this->tpl->assign_vars(array('CAPTCHA' => $captcha->get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
     }
     $language_array = array();
     if ($dir = @opendir($this->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->root_path . 'language/' . $file) && !is_link($this->root_path . 'language/' . $file) && valid_folder($file)) {
                 $language_array[$file] = ucfirst($file);
             }
         }
     }
     //User Profilefields
     $arrUserProfileFields = $this->pdh->get('user_profilefields', 'registration_fields');
     if (count($arrUserProfileFields)) {
         $form = register('form', array('register'));
         $form->validate = true;
         $form->add_fields($arrUserProfileFields);
         $form->output($this->userProfileData);
     }
     $this->tpl->assign_vars(array('S_CURRENT_PASSWORD' => false, 'S_NEW_PASSWORD' => false, 'S_SETTING_ADMIN' => false, 'S_MU_TABLE' => false, 'S_PROFILEFIELDS' => count($arrUserProfileFields) ? true : false, 'VALID_EMAIL_INFO' => $this->config->get('account_activation') == 1 ? '<br />' . $this->user->lang('valid_email_note') : '', 'AUTH_REGISTER_BUTTON' => ($arrRegisterButtons = $this->user->handle_login_functions('register_button')) ? implode(' ', $arrRegisterButtons) : '', 'REGISTER' => true, 'DD_LANGUAGE' => new hdropdown('user_lang', array('options' => $language_array, 'value' => $this->data['user_lang'])), 'DD_TIMEZONES' => new hdropdown('user_timezone', array('options' => $this->time->timezones, 'value' => $this->data['user_timezone'])), 'HIDDEN_FIELDS' => isset($this->data['auth_account']) ? new hhidden('lmethod', array('value' => $this->in->get('lmethod'))) . new hhidden('auth_account', array('value' => $this->crypt->encrypt($this->data['auth_account']))) : '', 'USERNAME' => $this->data['username'], 'USER_EMAIL' => $this->data['user_email'], 'USER_EMAIL2' => $this->data['user_email2']));
     $this->core->set_vars(array('page_title' => $this->user->lang('register_title'), 'template_file' => 'register.html', 'display' => true));
 }
Example #9
0
 public function after_login($arrOptions)
 {
     if ($arrOptions[0] && $arrOptions[0]['user_id'] != ANONYMOUS && !$this->in->exists('lmethod')) {
         //Get Auth Account
         $arrAuthAccounts = $this->pdh->get('user', 'auth_account', array($arrOptions[0]['user_id']));
         if ($arrAuthAccounts['twofactor'] != "") {
             $data = unserialize(register('encrypt')->decrypt($arrAuthAccounts['twofactor']));
             if ($data) {
                 $cookie = $this->in->getEQdkpCookie("twofactor");
                 $cookie_secret = unserialize(register('encrypt')->decrypt($cookie));
                 if ($cookie_secret['secret'] === $data['secret'] && intval($cookie_secret['user_id']) === intval($arrOptions[0]['user_id'])) {
                     return false;
                 }
                 $this->tpl->assign_vars(array('TWOFACTOR_DATA' => register('encrypt')->encrypt(serialize($arrOptions[0]['user_id'])), 'TWOFACTOR_AUTOLOGIN' => $arrOptions[4] ? 'checked' : ''));
                 $blnShowCaptcha = false;
                 if ((int) $this->config->get('failed_logins_inactivity') - 2 > 0) {
                     if ($this->user->data['session_failed_logins'] >= (int) $this->config->get('failed_logins_inactivity') - 2) {
                         $blnShowCaptcha = true;
                     }
                     if (!$blnShowCaptcha) {
                         $objQuery = $this->db->prepare("SELECT SUM(session_failed_logins) as failed_logins FROM __sessions WHERE session_ip =?")->execute($this->env->ip);
                         if ($objQuery) {
                             $arrResult = $objQuery->fetchAssoc();
                             if ((int) $arrResult['failed_logins'] >= (int) $this->config->get('failed_logins_inactivity') - 2) {
                                 $blnShowCaptcha = true;
                             }
                         }
                     }
                 }
                 //Captcha
                 if ($blnShowCaptcha) {
                     require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
                     $captcha = new recaptcha();
                     $this->tpl->assign_vars(array('CAPTCHA' => $captcha->get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
                 }
                 $this->core->set_vars(array('page_title' => $this->user->lang("login_twofactor"), 'template_file' => 'twofactor_login.html', 'display' => true));
             }
         }
     }
     return false;
 }
Example #10
0
 public function display_form()
 {
     if ((int) $this->config->get('cmsbridge_reg_redirect') == 1 && (int) $this->config->get('cmsbridge_active') == 1) {
         if (strlen($this->config->get('cmsbridge_reg_url')) > 1) {
             redirect($this->config->get('cmsbridge_reg_url'), false, true);
         } else {
             redirect('index.php');
         }
     }
     //Captcha
     if ($this->config->get('pk_enable_captcha') == 1) {
         require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
         $captcha = new recaptcha();
         $this->tpl->assign_vars(array('CAPTCHA' => $captcha->recaptcha_get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
     }
     $language_array = array();
     if ($dir = @opendir($this->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->root_path . 'language/' . $file) && !is_link($this->root_path . 'language/' . $file) && valid_folder($file)) {
                 $language_array[$file] = ucfirst($file);
             }
         }
     }
     $this->tpl->assign_vars(array('S_CURRENT_PASSWORD' => false, 'S_NEW_PASSWORD' => false, 'S_SETTING_ADMIN' => false, 'S_MU_TABLE' => false, 'VALID_EMAIL_INFO' => $this->config->get('account_activation') == 1 ? '<br />' . $this->user->lang('valid_email_note') : '', 'AUTH_REGISTER_BUTTON' => ($arrRegisterButtons = $this->user->handle_login_functions('register_button')) ? implode(' ', $arrRegisterButtons) : '', 'REGISTER' => true, 'DD_LANGUAGE' => $this->html->DropDown('user_lang', $language_array, $this->data['user_lang']), 'DD_TIMEZONES' => $this->html->DropDown('user_timezone', $this->time->timezones, $this->data['user_timezone']), 'HIDDEN_FIELDS' => isset($this->data['auth_account']) ? $this->html->TextField('lmethod', '', $this->in->get('lmethod'), 'hidden') . $this->html->TextField('auth_account', '', $this->crypt->encrypt($this->data['auth_account']), 'hidden') : '', 'USERNAME' => $this->data['username'], 'USER_EMAIL' => $this->data['user_email'], 'USER_EMAIL2' => $this->data['user_email2']));
     $this->core->set_vars(array('page_title' => $this->user->lang('register_title'), 'template_file' => 'register.html', 'display' => true));
 }
Example #11
0
 public function display()
 {
     $arrFields = $this->pdh->get('guildrequest_fields', 'id_list', array());
     $intGroup = 0;
     $blnGroupOpen = false;
     $blnPersonalGroup = false;
     $this->tpl->assign_block_vars('tabs', array());
     $this->add_personal_group();
     foreach ($arrFields as $id) {
         $row = $this->pdh->get('guildrequest_fields', 'id', array($id));
         $row['options'] = unserialize($row['options']);
         //Close previous group
         if ($row['type'] == 3) {
             $blnGroupOpen = false;
             $intGroup++;
         }
         //Input
         if ($row['type'] == 0) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $options = array('fieldtype' => 'text', 'name' => 'gr_field_' . $row['id'], 'javascript' => 'style="width:95%"', 'value' => isset($this->data[$row['name']]) ? $this->data[$row['name']]['input'] : '');
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => $this->html->widget($options), 'REQUIRED' => $row['required'], 'HELP' => $row['help']));
         }
         //Textarea
         if ($row['type'] == 1) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $options = array('fieldtype' => 'textarea', 'name' => 'gr_field_' . $row['id'], 'javascript' => 'style="width:95%"', 'rows' => 10, 'value' => isset($this->data[$row['name']]) ? $this->data[$row['name']]['input'] : '');
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => $this->html->widget($options), 'REQUIRED' => $row['required'], 'HELP' => $row['help']));
         }
         //Select
         if ($row['type'] == 2) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $arrOptions = array();
             $arrOptions[''] = $this->user->lang('cl_ms_noneselected');
             foreach ($row['options'] as $val) {
                 $arrOptions[$val] = $val;
             }
             $options = array('fieldtype' => 'dropdown', 'name' => 'gr_field_' . $row['id'], 'options' => $arrOptions, 'no_lang' => true, 'selected' => isset($this->data[$row['name']]) ? $this->data[$row['name']]['input'] : '');
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => $this->html->widget($options), 'REQUIRED' => $row['required'], 'HELP' => $row['help']));
         }
         //Group Label
         if ($row['type'] == 3) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $row['name'], 'ID' => utf8_strtolower(str_replace(' ', '', $row['name']))));
                 $blnGroupOpen = true;
             }
         }
         //Plain text
         if ($row['type'] == 4) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'S_NO_DIVIDER' => true));
         }
         //Checkboxes
         if ($row['type'] == 5) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $field = '';
             $selected = isset($this->data[$row['name']]) ? unserialize($this->data[$row['name']]['input']) : array();
             foreach ($row['options'] as $val) {
                 $options = array('fieldtype' => 'checkbox', 'name' => 'gr_field_' . $row['id'] . '[' . trim($val) . ']', 'options' => trim($val), 'no_lang' => true, 'selected' => isset($selected[trim($val)]) ? $selected[trim($val)] : '', 'text' => trim($val));
                 $field .= $this->html->widget($options) . '&nbsp;&nbsp;&nbsp;';
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => $field, 'REQUIRED' => $row['required'], 'HELP' => $row['help']));
         }
         //Radioboxes
         if ($row['type'] == 6) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $arrOptions = array();
             foreach ($row['options'] as $val) {
                 $arrOptions[trim($val)] = trim($val);
             }
             $options = array('fieldtype' => 'radio', 'name' => 'gr_field_' . $row['id'], 'options' => $arrOptions, 'no_lang' => true, 'selected' => isset($this->data[$row['name']]) ? $this->data[$row['name']]['input'] : '');
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => $this->html->widget($options), 'REQUIRED' => $row['required'], 'HELP' => $row['help']));
         }
     }
     require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
     $captcha = new recaptcha();
     $this->tpl->assign_vars(array('CAPTCHA' => $captcha->recaptcha_get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
     // -- EQDKP ---------------------------------------------------------------
     $this->core->set_vars(array('page_title' => $this->user->lang('gr_add'), 'template_path' => $this->pm->get_data('guildrequest', 'template_path'), 'template_file' => 'addrequest.html', 'display' => true));
 }
Example #12
0
 public function display()
 {
     if ($this->user->is_signedin()) {
         redirect($this->controller_path_plain . 'Settings/' . $this->SID);
     }
     $blnShowCaptcha = false;
     if ((int) $this->config->get('failed_logins_inactivity') - 2 > 0) {
         if ($this->user->data['session_failed_logins'] >= (int) $this->config->get('failed_logins_inactivity') - 2) {
             $blnShowCaptcha = true;
         }
         if (!$blnShowCaptcha) {
             $objQuery = $this->db->prepare("SELECT SUM(session_failed_logins) as failed_logins FROM __sessions WHERE session_ip =?")->execute($this->env->ip);
             if ($objQuery && $objQuery->numRows) {
                 $arrResult = $objQuery->fetchAssoc();
                 if ($arrResult['failed_logins'] >= (int) $this->config->get('failed_logins_inactivity') - 2) {
                     $blnShowCaptcha = true;
                 }
             }
         }
     }
     //Captcha
     if ($blnShowCaptcha && $this->config->get('lib_recaptcha_pkey') && strlen($this->config->get('lib_recaptcha_pkey'))) {
         require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
         $captcha = new recaptcha();
         $this->tpl->assign_vars(array('CAPTCHA' => $captcha->get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
     }
     $arrPWresetLink = $this->core->handle_link($this->config->get('cmsbridge_pwreset_url'), $this->user->lang('lost_password'), $this->config->get('cmsbridge_embedded'), 'pwreset');
     $this->tpl->add_js('$("#username").focus();', 'docready');
     $this->tpl->assign_vars(array('S_USER_ACTIVATION' => $this->config->get('account_activation') == 1 ? true : false, 'REDIRECT' => isset($redirect) ? '<input type="hidden" name="redirect" value="' . base64_decode($redirect) . '" />' : ''));
     $this->core->set_vars(array('page_title' => $this->user->lang('login'), 'template_file' => 'login.html', 'display' => true));
 }
 public function display()
 {
     $arrFields = $this->pdh->get('guildrequest_fields', 'id_list', array());
     $intGroup = 0;
     $blnGroupOpen = true;
     $this->tpl->assign_block_vars('tabs', array());
     $this->add_personal_group();
     foreach ($arrFields as $id) {
         $row = $this->pdh->get('guildrequest_fields', 'id', array($id));
         $row['options'] = unserialize($row['options']);
         //Dependency
         if ($row['dep_field'] && (strlen($row['dep_value']) && in_array($row['dep_field'], $arrFields) || $row['dep_field'] == 999999999)) {
             $this->gen_dependency($row);
         }
         //Close previous group
         if ($row['type'] == 3) {
             $blnGroupOpen = false;
             $intGroup++;
         }
         //Input
         if ($row['type'] == 0) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => new htext('gr_field_' . $row['id'], array('js' => 'style="width:95%"', 'value' => isset($this->data[$row['id']]) ? $this->data[$row['id']]['input'] : '')), 'REQUIRED' => $row['required'], 'HELP' => $row['help'], 'ID' => 'dl_' . $row['id']));
         }
         //Textarea
         if ($row['type'] == 1) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => new htextarea('gr_field_' . $row['id'], array('js' => 'style="width:95%"', 'rows' => 10, 'value' => isset($this->data[$row['id']]) ? $this->data[$row['id']]['input'] : '')), 'REQUIRED' => $row['required'], 'HELP' => $row['help'], 'ID' => 'dl_' . $row['id']));
         }
         //Select
         if ($row['type'] == 2) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $arrOptions = array();
             $arrOptions[''] = $this->user->lang('cl_ms_noneselected');
             foreach ($row['options'] as $val) {
                 $val = trim(str_replace(array("\n", "\r"), "", $val));
                 $arrOptions[$val] = $val;
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => new hdropdown('gr_field_' . $row['id'], array('options' => $arrOptions, 'value' => isset($this->data[$row['id']]) ? $this->data[$row['id']]['input'] : '')), 'REQUIRED' => $row['required'], 'HELP' => $row['help'], 'ID' => 'dl_' . $row['id']));
         }
         //Group Label
         if ($row['type'] == 3) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $row['name'], 'ID' => utf8_strtolower(str_replace(' ', '', $row['name'])), 'FID' => 'dl_' . $row['id']));
                 $blnGroupOpen = true;
             }
         }
         //Plain text
         if ($row['type'] == 4) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'S_NO_DIVIDER' => true, 'ID' => 'dl_' . $row['id']));
         }
         //Checkboxes
         if ($row['type'] == 5) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $field = '';
             $selected = isset($this->data[$row['id']]) ? unserialize($this->data[$row['id']]['input']) : array();
             foreach ($row['options'] as $val) {
                 $field .= new hcheckbox('gr_field_' . $row['id'] . '[' . trim($val) . ']', array('options' => array(1 => trim($val)), 'value' => isset($selected[trim($val)]) ? $selected[trim($val)] : '')) . '&nbsp;&nbsp;&nbsp;';
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => $field, 'REQUIRED' => $row['required'], 'HELP' => $row['help'], 'ID' => 'dl_' . $row['id']));
         }
         //Radioboxes
         if ($row['type'] == 6) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $arrOptions = array();
             foreach ($row['options'] as $val) {
                 $arrOptions[trim($val)] = trim($val);
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => new hradio('gr_field_' . $row['id'], array('value' => isset($this->data[$row['id']]) ? $this->data[$row['id']]['input'] : '', 'options' => $arrOptions)), 'REQUIRED' => $row['required'], 'HELP' => $row['help'], 'ID' => 'dl_' . $row['id']));
         }
         //BBCode Editor
         if ($row['type'] == 7) {
             if (!$blnGroupOpen) {
                 $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('gr_default_grouplabel'), 'ID' => 'information'));
                 $blnGroupOpen = true;
             }
             $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $row['name'], 'FIELD' => new hbbcodeeditor('gr_field_' . $row['id'], array('rows' => 6, 'value' => isset($this->data[$row['id']]) ? $this->data[$row['id']]['input'] : '')), 'REQUIRED' => $row['required'], 'HELP' => $row['help'], 'ID' => 'dl_' . $row['id']));
         }
     }
     if (!$this->user->is_signedin() && $this->config->get('enable_captcha')) {
         require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
         $captcha = new recaptcha();
         $this->tpl->assign_vars(array('CAPTCHA' => $captcha->get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
     }
     $this->tpl->assign_vars(array('S_USERNAME_CHECK' => $this->config->get('create_account', 'guildrequest') && !$this->config->get('cmsbrige_active') ? true : false, 'S_HAS_APPLICATIONS' => $this->user->is_signedin() && count($this->pdh->get('guildrequest_requests', 'id_list', array($this->user->id))) ? true : false));
     // -- EQDKP ---------------------------------------------------------------
     $this->core->set_vars(array('page_title' => $this->user->lang('gr_add'), 'template_path' => $this->pm->get_data('guildrequest', 'template_path'), 'template_file' => 'addrequest.html', 'display' => true));
 }