Cara Menghilangkan Captcha di Aplikasi PPDB 5 Pro

Captcha yang tidak tampil pada aplikasi ppdb 5 pro disebabkan oleh konfigurasi server yang tidak sesuai atau masalah dengan library yang digunakan. Anda mungkin perlu memeriksa konfigurasi server Anda dan pastikan bahwa semua library yang dibutuhkan tersedia dan diinstal dengan benar.  Jika konfigurasi di server/aplikasi server Anda tidak berhasil karena satu dan lain hal, maka mungkin Anda perlu mencoba Alternatif lain yaitu dengan menghapus image captchanya saja. Berikut ini adalah langkah - langkahnya : 

1. Cari dan Buka file Mainindex.php/Resgister.php yang terdapat pada folder load 
2. Didalam file tersebut cari fungsi/baris dengan nama public function register($file) 
3. Kalau sudah ditemukan, scrool kebawah, cari baris berikut:

 $userCaptcha = filter_var($_POST["captcha_code"], FILTER_SANITIZE_STRING);

                    if($this->captcha->validateCaptcha($userCaptcha))
                    {
                   
                       $Ok='ok';
                    
                    }
                    else
                    {
                        array_push($err,"Kode captcha tidak valid");
                    }

4. Hapus baris diatas 
5. Kemudian scrool lagi, cari dan hapus baris berikut :

 <img src="<?=$file ?>">
      <div class="form-group">
              <label class="control-label mb-10">Security Code</label>
                       <div class="input-group">
              <input type="text" name="captcha_code" class="form-control" required="">
                          <div class="input-group-addon"><i class=" icon-key"></i></div>
                                      </div>

                      <div class="help-block with-errors"></div>
                      </div>

6. Selesai, sekarang image captcha pada aplikasi ppdb 5 pro sudah hilang

PPD 5 Pro memiliki setidaknya 3 jenis template, cara diatas merupakan cara yang diterapkan untuk template default. Sedangkan untuk dua jenis template lain seperti Bootraplander dan Arsha, caranya berbeda

Bootstraplander

menghilangkan cpatcha ppdb 5 pro bootstraplander

Pertama buka file Bootstraplander.php lalu ganti fungsi public function bootstraplander_form_register() dan public function bootstraplander_registerproses() menggunakan script berikut

 public function bootstraplander_form_register()
    {
    	?>
    		<form action="<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>" method="post" role="form" class="php-email-form2">
			           
			                
			    <div class="form-group">
			           
			        <input type="text" class="form-control" name="name"  maxlength="10" minlength="10"  pattern="[0-9]*$" placeholder="NISN 10 digit" data-error="Min/Max 10 karakter format angka" required>
			          
			    </div>
			    <div class="form-group mt-3">
			           
			        <input type="email" class="form-control" name="email" placeholder="yourmail@gmail.com" data-error="Masukan email dengan benar" required>
			          
			    </div>
			    <div class="form-group mt-3">
			            
			        <input type="password" class="form-control" name="password" required="" placeholder="Enter pwd">
			    </div>
			    <div class="form-group mt-3">			            
			        <input type="password" class="form-control" name="confirm_pass" required="" placeholder="Konfirmasi password">
			    </div>
			           
			          
			    <div class="my-3">
			         
			     	<span class="inline-block pr-5">Sudah punya akun?</span>
                     <a class="inline-block txt-danger" href="?page=login">Login</a>			         
			        <p><?=$this->log?></p>
                    <p>
                        <?php  
                            if(count($this->err)>0)
                            {
                                echo $this->app->alert2('alert-danger',$this->app->getError($this->err));
                            } 
                        ?>
                    </p>
			          
			    </div>
			    <button type="submit" class="btn btn-success btn-lg">Daftar</button>
			       
			</form>

    	<?php 
    }



 public function bootstraplander_registerproses()
    {

        $this->log = "";
        $this->err = array();
        if($_SERVER['REQUEST_METHOD']=='POST')
        {
            if(empty($this->app->post('name')))
            {
                array_push($this->err,"Harap masukan sebuah username");
            }
            elseif(strlen($this->app->post('name'))!=10)
            {
                array_push($this->err, "NISN tidak boleh lebih atau kurang dari 10 karakter");
            }
            
            else
            {
                        
                if($this->obj->cekData('name','users',$this->app->post('name'))):
                    array_push($this->err, "Maaf NISN tersebut sudah digunakan");
                else:
                    $name = $this->app->post('name');
                endif;      
            }

            if(empty($this->app->post('email')))
            {
                array_push($this->err, "Masukan alamat email Anda");
            }
            elseif($this->app->vldEmail($this->app->post('email')))
            {
                array_push($this->err, "Format alamat email yang Anda gunakan salah");
            }
            else
            {
                if($this->obj->cekData('mail','users',$this->app->post('email'))):
                    array_push($this->err, "Maaf alamat email tersebut sudah digunakan");
                else:
                    $email= $this->app->post('email');
                endif;      
            }              
            if(empty($_POST['password']))
            {
                array_push($this->err, "Password tidak boleh dikosongkan");
               
            }
            elseif(strlen($_POST['password'])<6)
            {
                array_push($this->err, "Password tidak boleh kurang dari 6 karakter");
                       
            }
            else
            {
                $pass = trim($_POST['password']);
            }
            if(empty($_POST['confirm_pass']))
            {
                array_push($this->err, "Konfirmasi password tidak boleh kosong");
            }
            else
            {
                $confirm_pass = trim($_POST['confirm_pass']);
                if(empty($pass_err)&&($pass !=$confirm_pass)):
                    array_push($this->err, "Konfirmasi password tidak cocok");
                endif;
            }
            

            $hash = md5(rand(0,1000));

            if(count($this->err)==0)
            {

                if($this->row2['smtp_status']==1)  
                {  
                            
                                     
                    $tanggal = $this->app->tampilTanggal();   
                    $mailer = new MailSender($this->row2['smtp_host'], $this->row2['smtp_username'], $this->row2['smtp_pass'], $this->row2['smtp_port']);
                    $mailer->setTemplateURL('themes/email/email_template.html');

                    $mailer->compose(array
                    (
                        'name' => $name,
                        'pass' => $pass,
                        'link'=>'http://'.$_SERVER['SERVER_NAME'].'/?page=verify&mail='.$email.'&hash='.$hash.'',
                        'title'=>$this->row['title'],
                        'tanggal'=>$tanggal,
                        'logo'=>'http://'.$_SERVER['SERVER_NAME'].'/content/public/img/'.$this->row['logo'].'',
                    ));

                    // Send email with from, to and Subject.
                    $sended = $mailer->send
                    (
                        array($this->row2['smtp_email'], 'From name'),$email,
                        'Konfirmasi Pendaftaran PPDB '.$this->row['title'].''
                    );

                    if($sended)
                    {
                                        
                        if($this->obj->insertTable('users','name, pass, mail, role,created',':name, :pass, :mail, :role, :created',array(":name"=>$name,":pass"=>password_hash($pass.$this->salt, PASSWORD_DEFAULT),":mail"=>$email,":role"=>'siswa',":created"=>time()))):                                        
                            $last = $this->obj->insertmyId();                         
                            $this->obj->insertTable('users_pending','uid,mail,hash',':uid, :mail, :hash', array(":uid"=>$last,":mail"=>$email,":hash"=>$hash));
                            
                             $this->log = $this->app->alert2('alert-success','Akun anda berhasil dibuat. Link aktifasi  akun akan dikirim ke email');

                        else:

                            $this->log= $this->app->alert2('alert-danger','Terjadi kesalahan, akun gagal dibuat');
                            $this->app->noresubmit();

                        endif;
                    }
                    else
                    {
                        $this->log = $this->app->alert2('alert-success','Gagal mengirim email');    
                        $this->app->noresubmit();   
                    }
                                                 
                }
                else
                {
                    if($this->obj->insertTable('users','name, pass, mail, role,created, status',':name, :pass, :mail, :role, :created, :status',array(":name"=>$name,":pass"=>password_hash($pass.$this->salt, PASSWORD_DEFAULT),":mail"=>$email,":role"=>'siswa',":created"=>time(), ":status"=>1))):

                                        
                            $this->log = $this->app->alert2('alert-success','Akun anda berhasil dibuat');                           
                            $this->app->reload(7,'?page=login');
                                        
                    else:
                            $this->log= $this->app->alert2('alert-danger','Terjadi kesalahan, akun gagal dibuat');
                            $this->app->noresubmit();
                    endif;
                }
                 
            }
        } 
    }


Arsha

menghilangkan captcha pada ppdb 5 pro template arsha

Selanjutnya untuk template Arsha, Anda perlu membuka file Arshamain.php, ganti fungsi public function arsha_form_register() dan public function arsha_registerproses() menjadi seperti berikut 


public function arsha_form_register()
    {
    	?>
    		<form action="<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>" method="post" role="form" class="php-email-form2">
			           
			                
			    <div class="form-group">
			           
			        <input type="text" class="form-control" name="name"  maxlength="10" minlength="10"  pattern="[0-9]*$" placeholder="NISN 10 digit" data-error="Min/Max 10 karakter format angka" required>
			          
			    </div>
			    <div class="form-group mt-3">
			           
			        <input type="email" class="form-control" name="email" placeholder="yourmail@gmail.com" data-error="Masukan email dengan benar" required>
			          
			    </div>
			    <div class="form-group mt-3">
			            
			        <input type="password" class="form-control" name="password" required="" placeholder="Enter pwd">
			    </div>
			    <div class="form-group mt-3">			            
			        <input type="password" class="form-control" name="confirm_pass" required="" placeholder="Konfirmasi password">
			    </div>
			          
			          
			    <div class="my-3">
			         
			     	<span class="inline-block pr-5">Sudah punya akun?</span>
                     <a class="inline-block txt-danger" href="?page=login">Login</a>			         
			        <p><?=$this->log?></p>
                    <p>
                        <?php  
                            if(count($this->err)>0)
                            {
                                echo $this->app->alert2('alert-danger',$this->app->getError($this->err));
                            } 
                        ?>
                    </p>
			          
			    </div>
			    <button type="submit" class="btn btn-success btn-lg">Daftar</button>
			       
			</form>

    	<?php 
    }



 public function arsha_registerproses()
    {
        $this->log = "";
        $this->err = array();
        if($_SERVER['REQUEST_METHOD']=='POST')
        {
            if(empty($this->app->post('name')))
            {
                array_push($this->err,"Harap masukan sebuah username");
            }
            elseif(strlen($this->app->post('name'))!=10)
            {
                array_push($this->err, "NISN tidak boleh lebih atau kurang dari 10 karakter");
            }
            
            else
            {
                        
                if($this->obj->cekData('name','users',$this->app->post('name'))):
                    array_push($this->err, "Maaf NISN tersebut sudah digunakan");
                else:
                    $name = $this->app->post('name');
                endif;      
            }

            if(empty($this->app->post('email')))
            {
                array_push($this->err, "Masukan alamat email Anda");
            }
            elseif($this->app->vldEmail($this->app->post('email')))
            {
                array_push($this->err, "Format alamat email yang Anda gunakan salah");
            }
            else
            {
                if($this->obj->cekData('mail','users',$this->app->post('email'))):
                    array_push($this->err, "Maaf alamat email tersebut sudah digunakan");
                else:
                    $email= $this->app->post('email');
                endif;      
            }              
            if(empty($_POST['password']))
            {
                array_push($this->err, "Password tidak boleh dikosongkan");
               
            }
            elseif(strlen($_POST['password'])<6)
            {
                array_push($this->err, "Password tidak boleh kurang dari 6 karakter");
                       
            }
            else
            {
                $pass = trim($_POST['password']);
            }
            if(empty($_POST['confirm_pass']))
            {
                array_push($this->err, "Konfirmasi password tidak boleh kosong");
            }
            else
            {
                $confirm_pass = trim($_POST['confirm_pass']);
                if(empty($pass_err)&&($pass !=$confirm_pass)):
                    array_push($this->err, "Konfirmasi password tidak cocok");
                endif;
            }
            
            

            $hash = md5(rand(0,1000));

            if(count($this->err)==0)
            {

                if($this->row2['smtp_status']==1)  
                {  
                            
                                     
                    $tanggal = $this->app->tampilTanggal();   
                    $mailer = new MailSender($this->row2['smtp_host'], $this->row2['smtp_username'], $this->row2['smtp_pass'], $this->row2['smtp_port']);
                    $mailer->setTemplateURL('themes/email/email_template.html');

                    $mailer->compose(array
                    (
                        'name' => $name,
                        'pass' => $pass,
                        'link'=>'http://'.$_SERVER['SERVER_NAME'].'/?page=verify&mail='.$email.'&hash='.$hash.'',
                        'title'=>$this->row['title'],
                        'tanggal'=>$tanggal,
                        'logo'=>'http://'.$_SERVER['SERVER_NAME'].'/content/public/img/'.$this->row['logo'].'',
                    ));

                    // Send email with from, to and Subject.
                    $sended = $mailer->send
                    (
                        array($this->row2['smtp_email'], 'From name'),$email,
                        'Konfirmasi Pendaftaran PPDB '.$this->row['title'].''
                    );

                    if($sended)
                    {
                                        
                        if($this->obj->insertTable('users','name, pass, mail, role,created',':name, :pass, :mail, :role, :created',array(":name"=>$name,":pass"=>password_hash($pass.$this->salt, PASSWORD_DEFAULT),":mail"=>$email,":role"=>'siswa',":created"=>time()))):                                        
                            $last = $this->obj->insertmyId();                         
                            $this->obj->insertTable('users_pending','uid,mail,hash',':uid, :mail, :hash', array(":uid"=>$last,":mail"=>$email,":hash"=>$hash));
                            
                             $this->log = $this->app->alert2('alert-success','Akun anda berhasil dibuat. Link aktifasi  akun akan dikirim ke email');

                        else:

                            $this->log= $this->app->alert2('alert-danger','Terjadi kesalahan, akun gagal dibuat');
                            $this->app->noresubmit();

                        endif;
                    }
                    else
                    {
                        $this->log = $this->app->alert2('alert-success','Gagal mengirim email');    
                        $this->app->noresubmit();   
                    }
                                                 
                }
                else
                {
                    if($this->obj->insertTable('users','name, pass, mail, role,created, status',':name, :pass, :mail, :role, :created, :status',array(":name"=>$name,":pass"=>password_hash($pass.$this->salt, PASSWORD_DEFAULT),":mail"=>$email,":role"=>'siswa',":created"=>time(), ":status"=>1))):

                                        
                            $this->log = $this->app->alert2('alert-success','Akun anda berhasil dibuat');                           
                            $this->app->reload(7,'?page=login');
                                        
                    else:
                            $this->log= $this->app->alert2('alert-danger','Terjadi kesalahan, akun gagal dibuat');
                            $this->app->noresubmit();
                    endif;
                }
                 
            }
        } 
    }


0 Response to "Cara Menghilangkan Captcha di Aplikasi PPDB 5 Pro"

Post a Comment

Komentar yang Anda kirim akan terlebih dahulu di moderasi oleh Admin