Esempio n. 1
0
    } else {
        $c_user = "";
        $c_text = "";
        $c_smileys = "1";
    }
    if (iMEMBER) {
        $name_line = "";
    } else {
        $name_line = $locale['PDP002'] . ": <input type='text' size='32' maxlength='50'" . " class='textbox' name='comment_name'" . " value='" . $c_user . "' /><br />\n";
    }
    opentable($locale['PDP211']);
    if (isset($_GET['wrong_captcha'])) {
        show_info($locale['pdp_wrong_captcha']);
    }
    echo "\n<a name='new_comment'></a>\n<p></p>\n<form action='include/do_did.php?did=" . $download->id . "' method='post'\n\tname='inputform'>\n<div align='center'>\n{$name_line}\n\n<textarea cols='60' rows='5' class='textbox' name='comm_text'>" . $c_text . "</textarea><br />" . pdp_get_bb_smileys("comm_text", $c_smileys, true) . '
<hr />';
    if (!iMEMBER) {
        echo '
	<p></p>
	<label>' . $locale['pdp_captcha'] . ':</label><br />
	' . make_captcha() . '
	<input type="text" class="textbox" name="user_code" size="5" />';
    }
    echo '
<p></p>
<input type="submit" value="' . $locale['PDP211'] . '" class="button"
	name="add_comment" />
</div>
</form>';
    closetable();
}
function pdp_make_captcha()
{
    if (FUSION_VERSION == 7) {
        return "\n<img id='captcha' src='" . INCLUDES . "securimage/securimage_show.php' alt=''/>\n<a href='" . INCLUDES . "securimage/securimage_play.php'><img src='" . INCLUDES . "securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n<a href='#' onclick=\"document.getElementById('captcha').src = '" . INCLUDES . "securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='" . INCLUDES . "securimage/images/refresh.gif' alt='' align='bottom' class='tbl-border' /></a>" . '<br /><input type="text" class="textbox" name="user_code" size="5" />
<br/>';
    } else {
        return make_captcha() . '<input type="text" class="textbox" name="user_code" size="5" />';
    }
}
Esempio n. 3
0
 function register()
 {
     $this->data['cap_img'] = make_captcha();
     $this->data['title'] = "Register User";
     if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin()) {
         //redirect('user/auth', 'refresh');
     }
     if ($this->ion_auth->logged_in()) {
         redirect('user/profile', 'refresh');
     }
     //validate form input
     $this->form_validation->set_rules('username', $this->lang->line('create_user_validation_name_label'), 'required|xss_clean');
     $this->form_validation->set_rules('first_name', "Nama Lengkap", 'required|xss_clean');
     $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');
     $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'required|xss_clean');
     $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');
     $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');
     $this->form_validation->set_rules('tempat_lahir', 'Tempat Lahir', 'required|xss_clean');
     $this->form_validation->set_rules('tanggal_lahir', 'Tanggal Lahir', 'required|xss_clean');
     $this->form_validation->set_rules('tanda_pengenal', 'Tanda pengenal', 'required|xss_clean');
     $this->form_validation->set_rules('pekerjaan_select', 'Pekerjaan Select', 'xss_clean');
     $this->form_validation->set_rules('pekerjaan', 'Pekerjaan', 'xss_clean');
     $this->form_validation->set_rules('kabupaten_kota', $this->lang->line('create_user_validation_lname_label'), 'xss_clean');
     $this->form_validation->set_rules('propinsi', $this->lang->line('create_user_validation_lname_label'), 'xss_clean');
     $this->form_validation->set_rules('kode_pos', $this->lang->line('create_user_validation_lname_label'), 'xss_clean');
     // pre(check_captcha());
     if (check_captcha() && $this->form_validation->run() == true) {
         // echo "in";exit;
         $username = strtolower($this->input->post('username'));
         $email = strtolower($this->input->post('email'));
         $password = $this->input->post('password');
         /*$cfolder = $this->config->item('dir_members');
         		if (!is_dir($cfolder)) mkdir($cfolder);
         		
         		$folder = $this->config->item('dir_members');
         		$data["process"]=true;
         		if ($_POST['image_name']) {
         			$fix_name = $_POST['username'].substr($_POST['image_name'],strrpos($_POST['image_name'],"."));
         			$tmp_name = $this->config->item('dir_tmp_members').$_POST['image_name'];
         			$new_name = $folder.$fix_name;
         			if (file_exists($tmp_name)) {
         				if (copy($tmp_name,$new_name)) {
         					$file_name=$fix_name;
         					unlink($tmp_name);
         				}
         			}
         		}*/
         if ($_POST['image_name']) {
             $file_name = $this->__file_upload($_POST['image_name'], $_POST['username']);
         }
         $additional_data = array('first_name' => $this->input->post('first_name'), 'last_name' => $this->input->post('last_name'), 'company' => $this->input->post('company'), 'phone' => $this->input->post('phone'), 'handphone' => $this->input->post('handphone'), 'nama' => $this->input->post('first_name'), 'pekerjaan' => $this->input->post('pekerjaan'), 'tanda_pengenal' => $this->input->post('tanda_pengenal'), 'nomor_pengenal' => $this->input->post('username'), 'jenis_kelamin' => $this->input->post('jenis_kelamin'), 'tempat_lahir' => $this->input->post('tempat_lahir'), 'tanggal_lahir' => $this->input->post('tanggal_lahir'), 'alamat' => $this->input->post('alamat'), 'kabupaten_kota' => $this->input->post('kabupaten_kota'), 'propinsi' => $this->input->post('propinsi'), 'kode_pos' => $this->input->post('kode_pos'), 'image' => $file_name);
     }
     if (check_captcha() && $this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data)) {
         // echo "inaaa";exit;
         //check to see if we are creating the user
         //redirect them back to the admin page
         $this->session->set_flashdata('message', $this->ion_auth->messages());
         set_message("success", "Proses Pendaftaran Berhasil. Kode Aktifasi telah dikirim ke email anda (" . $email . ")");
         redirect("user/login", 'refresh');
     } else {
         //display the create user form
         //set the flash data error message if there is one
         $this->data['message'] = validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'));
         $this->data['username'] = array('name' => 'username', 'id' => 'username', 'type' => 'text', 'value' => $this->form_validation->set_value('username'));
         $this->data['first_name'] = array('name' => 'first_name', 'id' => 'first_name', 'type' => 'text', 'value' => $this->form_validation->set_value('first_name'));
         $this->data['last_name'] = array('name' => 'last_name', 'id' => 'last_name', 'type' => 'text', 'value' => $this->form_validation->set_value('last_name'));
         $this->data['email'] = array('name' => 'email', 'id' => 'email', 'type' => 'text', 'value' => $this->form_validation->set_value('email'));
         $this->data['company'] = array('name' => 'company', 'id' => 'company', 'type' => 'text', 'value' => $this->form_validation->set_value('company'));
         $this->data['phone'] = array('name' => 'phone', 'id' => 'phone', 'type' => 'text', 'value' => $this->form_validation->set_value('phone'));
         $this->data['handphone'] = array('name' => 'handphone', 'id' => 'handphone', 'type' => 'text', 'value' => $this->form_validation->set_value('handphone'));
         $this->data['password'] = array('name' => 'password', 'id' => 'password', 'type' => 'password', 'value' => '');
         $this->data['password_confirm'] = array('name' => 'password_confirm', 'id' => 'password_confirm', 'type' => 'password', 'value' => '');
         //ADDITIONAL DATA
         $this->data['tanda_pengenal'] = array('name' => 'tanda_pengenal', 'id' => 'tanda_pengenal', 'type' => 'text', 'value' => $this->form_validation->set_value('tanda_pengenal'));
         $this->data['tempat_lahir'] = array('name' => 'tempat_lahir', 'id' => 'tempat_lahir', 'type' => 'text', 'value' => $this->form_validation->set_value('tempat_lahir'));
         $this->data['tanggal_lahir'] = array('name' => 'tanggal_lahir', 'id' => 'tanggal_lahir', 'type' => 'text', 'value' => $this->form_validation->set_value('tanggal_lahir'));
         $this->data['kode_pos'] = array('name' => 'kode_pos', 'id' => 'kode_pos', 'type' => 'text', 'value' => $this->form_validation->set_value('kode_pos'));
         $this->data['kabupaten_kota'] = array('name' => 'kabupaten_kota', 'id' => 'kabupaten_kota', 'type' => 'text', 'value' => $this->form_validation->set_value('kabupaten_kota'));
         $this->data['propinsi'] = array('name' => 'propinsi', 'id' => 'propinsi', 'type' => 'text', 'value' => $this->form_validation->set_value('propinsi'));
         $this->data['pekerjaan_select'] = array('name' => 'pekerjaan_select', 'id' => 'pekerjaan', 'type' => 'text', 'value' => $this->form_validation->set_value('pekerjaan_select'));
         $this->data['pekerjaan'] = array('name' => 'pekerjaan', 'id' => 'pekerjaan_text2', 'type' => 'text', 'value' => $this->form_validation->set_value('pekerjaan'));
         $this->data['m_tanda_pengenal'] = $this->get_lookup_tanda_pengenal();
         $this->data['m_propinsi'] = $this->get_lookup_propinsi();
         $this->data['m_pekerjaan'] = $this->get_lookup_pekerjaan();
         $this->_render_page('user/auth/create_user', $this->data, true);
     }
 }
Esempio n. 4
0
<?php

function make_captcha($id)
{
    require 'kcaptcha/kcaptcha.php';
    $captcha = new KCAPTCHA();
    cache_set('taxi_captcha_' . $id, $captcha->getKeyString());
    die;
}
if ($id = intval($_GET['id']) and preg_match('/\\d{11,12}/', $_GET['id'])) {
    require 'inc/dbcm.php';
    if (cache_isset('taxi_captcha_' . $id)) {
        make_captcha($id);
    } else {
        if (fetch_user_by_id($id)) {
            make_captcha($id);
        } else {
            header('HTTP/1.0 404 Not Found');
        }
    }
} else {
    header('HTTP/1.0 400 Bad Request');
}