Пример #1
0
 function editAlamat($id = NULL)
 {
     if ($id == NULL) {
         redirect("404");
     }
     $id_decode = base64_decode_fix($id);
     $id_akun = $this->session->userdata("id_akun_user");
     $data['tampilprov'] = $this->alamatmodel->tampilData("mp_provinsi", NULL);
     $data['tampil'] = $this->alamatmodel->tampilData("mp_alamat", "*", array("ID_ALAMAT" => $id_akun));
     $data['page'] = "alamat-edit";
     $this->load->view($this->template, $data);
 }
Пример #2
0
 function status($id = NULL)
 {
     if ($id == NULL) {
         redirect("404");
     }
     $id = base64_decode_fix($id);
     $data = array('STATUS' => 0);
     $this->adminrajaongkir->editData($data, 'mp_setting');
     $where_auth2 = array('ID_SETTING' => $id);
     $data2 = array('STATUS' => 1);
     $this->adminrajaongkir->editData($data2, 'mp_setting', $where_auth2);
     redirect('admin_api');
 }
Пример #3
0
 function resetPassword($email, $sesi_random)
 {
     $email = base64_decode_fix($email);
     $sesi_random = base64_decode_fix($sesi_random);
     if ($this->session->userdata('sesi_random') == $sesi_random) {
         $cek_email = $this->db->query("SELECT * FROM mp_akun WHERE EMAIL='{$email}'")->row();
         $id_auth = $this->db->query("SELECT * FROM mp_user WHERE ID_AUTH='{$cek_email->ID_AKUN}' AND ID_LEVEL='3'")->row();
         $this->session->set_userdata(array('id_pass_ses' => $id_auth->ID_USER, 'id_email_ses' => $email));
         $data['page'] = 'reset-password';
         $this->load->view($this->template, $data);
     } else {
         redirect('login');
     }
 }
Пример #4
0
 function updateUkm($id)
 {
     $id = base64_decode_fix($id);
     $nm_toko = $this->input->post('nm_toko');
     $email = $this->input->post('email');
     $id_penanggung_jwb = $this->input->post('id_penanggung_jwb');
     $des_toko = $this->input->post('des_toko');
     $key_meta = $this->input->post('key_meta');
     $des_meta = $this->input->post('des_meta');
     $jne = $this->input->post('jne');
     $tiki = $this->input->post('tiki');
     $pos = $this->input->post('pos');
     $id_provinsi = $this->input->post('id_provinsi');
     $id_kota = $this->input->post('id_kota');
     $kecamatan = $this->input->post('kecamatan');
     $kelurahan = $this->input->post('kelurahan');
     $alamat = $this->input->post('alamat');
     $no_hp = $this->input->post('no_hp');
     $no_telp = $this->input->post('no_telp');
     $s_bbm = $this->input->post('s_bbm');
     $s_whatsapp = $this->input->post('s_whatsapp');
     $where_auth = array('ID_TOKO' => $id);
     $ter = $this->adminukm->tampilData('mp_toko', '*', $where_auth, TRUE);
     $profil = $ter->ID_TOKO . ".jpg";
     $sampul = $ter->ID_TOKO . ".jpg";
     if ($_FILES['userImage']['name']) {
         if ($_FILES['profil']['name']) {
             $fnamePRO = $_FILES['profil']['name'];
             $sourcePathPRO = $_FILES['profil']['tmp_name'];
             $targetPathPRO = "./upload/profil/" . $profil;
             if (move_uploaded_file($sourcePathPRO, $targetPathPRO)) {
                 $resizePRO = './upload/profil/';
                 $namePRO = $profil;
                 $imgPRO = imagecreatefromjpeg($targetPathPRO);
                 $widthPRO = imagesx($imgPRO);
                 $heightPRO = imagesy($imgPRO);
                 $new_widthPRO = 100;
                 $new_heightPRO = 300;
                 $tmp_imgPRO = imagecreatetruecolor($new_widthPRO, $new_heightPRO);
                 imagecopyresized($tmp_imgPRO, $imgPRO, 0, 0, 0, 0, $new_widthPRO, $new_heightPRO, $widthPRO, $heightPRO);
                 imagejpeg($tmp_imgPRO, "{$resize}{$name}");
                 $fname = $_FILES['userImage']['name'];
                 $sourcePath = $_FILES['userImage']['tmp_name'];
                 $targetPath = "./upload/sampul/" . $sampul;
                 if (move_uploaded_file($sourcePath, $targetPath)) {
                     $resize = './upload/sampul/';
                     $name = $sampul;
                     $img = imagecreatefromjpeg($targetPath);
                     $width = imagesx($img);
                     $height = imagesy($img);
                     $new_width = 500;
                     $new_height = 300;
                     $tmp_img = imagecreatetruecolor($new_width, $new_height);
                     imagecopyresized($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                     imagejpeg($tmp_img, "{$resize}{$name}");
                     $data = array('NM_TOKO' => $nm_toko, 'ID_PENANGGUNG_JWB' => $id_penanggung_jwb, 'DES_TOKO' => $des_toko, 'KEY_META' => $key_meta, 'DES_META' => $des_meta, 'ID_PROVINSI' => $id_provinsi, 'ID_KOTA' => $id_kota, 'KECAMATAN' => $kecamatan, 'KELURAHAN' => $kelurahan, 'ALAMAT' => $alamat, 'NO_HP' => $no_hp, 'NO_TELP' => $no_telp, 'S_BBM' => $s_bbm, 'S_WHATSAPP' => $s_whatsapp, 'EMAIL' => $email, 'FT_PROFIL' => $profil, 'FT_SAMPUL' => $sampul);
                 }
             }
         } else {
             $fname = $_FILES['userImage']['name'];
             $sourcePath = $_FILES['userImage']['tmp_name'];
             $targetPath = "./upload/sampul/" . $sampul;
             if (move_uploaded_file($sourcePath, $targetPath)) {
                 $resize = './upload/sampul/';
                 $name = $sampul;
                 $img = imagecreatefromjpeg($targetPath);
                 $width = imagesx($img);
                 $height = imagesy($img);
                 $new_width = 500;
                 $new_height = 300;
                 $tmp_img = imagecreatetruecolor($new_width, $new_height);
                 imagecopyresized($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                 imagejpeg($tmp_img, "{$resize}{$name}");
                 $data = array('NM_TOKO' => $nm_toko, 'ID_PENANGGUNG_JWB' => $id_penanggung_jwb, 'DES_TOKO' => $des_toko, 'KEY_META' => $key_meta, 'DES_META' => $des_meta, 'ID_PROVINSI' => $id_provinsi, 'ID_KOTA' => $id_kota, 'KECAMATAN' => $kecamatan, 'KELURAHAN' => $kelurahan, 'ALAMAT' => $alamat, 'NO_HP' => $no_hp, 'NO_TELP' => $no_telp, 'S_BBM' => $s_bbm, 'S_WHATSAPP' => $s_whatsapp, 'EMAIL' => $email, 'FT_SAMPUL' => $sampul);
             }
         }
     } elseif ($_FILES['profil']['name']) {
         $fname = $_FILES['profil']['name'];
         $sourcePath = $_FILES['profil']['tmp_name'];
         $targetPath = "./upload/profil/" . $profil;
         if (move_uploaded_file($sourcePath, $targetPath)) {
             $resize = './upload/profil/';
             $name = $profil;
             $img = imagecreatefromjpeg($targetPath);
             $width = imagesx($img);
             $height = imagesy($img);
             $new_width = 500;
             $new_height = 300;
             $tmp_img = imagecreatetruecolor($new_width, $new_height);
             imagecopyresized($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
             imagejpeg($tmp_img, "{$resize}{$name}");
             $data = array('NM_TOKO' => $nm_toko, 'ID_PENANGGUNG_JWB' => $id_penanggung_jwb, 'DES_TOKO' => $des_toko, 'KEY_META' => $key_meta, 'DES_META' => $des_meta, 'ID_PROVINSI' => $id_provinsi, 'ID_KOTA' => $id_kota, 'KECAMATAN' => $kecamatan, 'KELURAHAN' => $kelurahan, 'ALAMAT' => $alamat, 'NO_HP' => $no_hp, 'NO_TELP' => $no_telp, 'S_BBM' => $s_bbm, 'S_WHATSAPP' => $s_whatsapp, 'EMAIL' => $email, 'FT_PROFIL' => $profil);
         }
     } else {
         $data = array('NM_TOKO' => $nm_toko, 'ID_PENANGGUNG_JWB' => $id_penanggung_jwb, 'DES_TOKO' => $des_toko, 'KEY_META' => $key_meta, 'DES_META' => $des_meta, 'ID_PROVINSI' => $id_provinsi, 'ID_KOTA' => $id_kota, 'KECAMATAN' => $kecamatan, 'KELURAHAN' => $kelurahan, 'ALAMAT' => $alamat, 'NO_HP' => $no_hp, 'NO_TELP' => $no_telp, 'S_BBM' => $s_bbm, 'S_WHATSAPP' => $s_whatsapp, 'EMAIL' => $email);
     }
     $this->adminukm->editData('mp_toko', $data, $where_auth);
     if ($this->input->post('jne')) {
         $jne = 1;
     } else {
         $jne = 0;
     }
     if ($this->input->post('tiki')) {
         $tiki = 1;
     } else {
         $tiki = 0;
     }
     if ($this->input->post('pos')) {
         $pos = 1;
     } else {
         $pos = 0;
     }
     $where_auth2 = array('ID_TOKO' => $id);
     $data2 = array('JNE' => $jne, 'POS' => $pos, 'TIKI' => $tiki);
     $this->adminukm->editData('mp_kurir', $data2, $where_auth2);
     $this->session->set_flashdata('notif', 'Perbaharui informasi berhasil');
     $this->session->set_flashdata('clr', 'success');
     redirect('admin_ukm/editUkm/' . base64_encode_fix($id));
 }
Пример #5
0
 * @package 
 * 
 * @copyright Copyright © 2009, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
if (!isset($_POST['group_id']) || !$_POST['group_id']) {
    throw new InvalidArgumentException("No group_id passed");
}
$groupId = base64_decode_fix($_POST['group_id'], true);
if (!$groupId) {
    throw new InvalidArgumentException("Invalid group_id passed");
}
if (!isset($_POST['user_id']) || !$_POST['user_id']) {
    throw new InvalidArgumentException("No user_id passed");
}
$userId = base64_decode_fix($_POST['user_id'], true);
if (!$userId) {
    throw new InvalidArgumentException("Invalid user_id passed");
}
// Verify that the current user really can manage the group.
$groups = $ldap->read('(objectclass=group)', $groupId, array('managedby', 'member'));
if (count($groups) != 1) {
    throw new Exception("Could not find the group specified");
}
$group = $groups[0];
if ($group['managedby'][0] != $_SESSION['user_dn']) {
    throw new PermissionDeniedException("You are not authorized to manage this group.");
}
// Verify that the user is not already in the group
if (!in_array($userId, $group['member'])) {
    throw new Exception("The user is not a member of this group.");
Пример #6
0
<ul id='group_tree'>

<?php 
if (isset($_GET['current']) && $_GET['current']) {
    $current = base64_decode_fix($_GET['current'], true);
}
if (!isset($current) || !$current) {
    $current = $ldapConfig['BaseDN'];
}
$levels = ldap_explode_dn($current, 0);
unset($levels['count']);
$open = array();
while (count($levels) > 1) {
    $open[] = implode(',', $levels);
    array_shift($levels);
}
printHierarchy($ldap, $ldapConfig['BaseDN'], $open);
?>

</ul>
Пример #7
0
 function ft_bukti($id = NULL)
 {
     if ($id == NULL) {
         redirect("404");
     }
     $id = base64_decode_fix($id);
     $ss = $this->db->query("SELECT * FROM mp_bukti WHERE NO_TRANS='{$id}'")->row();
     echo "<img src='" . site_url('assets/images/bukti/' . $ss->FT_BUKTI) . "' ></img>";
 }
Пример #8
0
<?php

/**
 * Add a new user to a group.
 *
 * @since 8/28/09
 * @package
 *
 * @copyright Copyright &copy; 2009, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
if (!isset($_POST['group_id']) || !$_POST['group_id']) {
    throw new InvalidArgumentException("No group_id passed");
}
$groupId = base64_decode_fix($_POST['group_id'], true);
if (!$groupId) {
    throw new InvalidArgumentException("Invalid group_id passed");
}
// Verify that the current user really can manage the group.
$groups = $ldap->read('(objectclass=group)', $groupId, array('managedby', 'member'));
if (count($groups) != 1) {
    throw new Exception("Could not find the group specified");
}
$group = $groups[0];
if ($group['managedby'][0] != $_SESSION['user_dn']) {
    throw new PermissionDeniedException("You are not authorized to manage this group.");
}
// Delete the group
$ldap->delete($groupId);
while (ob_get_level()) {
    ob_end_clean();
Пример #9
0
 * Change the manager of a group.
 *
 * @since 8/28/09
 * @package
 *
 * @copyright Copyright &copy; 2009, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
if (!isset($_POST['group_id']) || !$_POST['group_id']) {
    throw new InvalidArgumentException("No group_id passed");
}
$groupId = base64_decode_fix($_POST['group_id'], true);
if (!$groupId) {
    throw new InvalidArgumentException("Invalid group_id passed");
}
$userId = base64_decode_fix($_POST['new_manager'], true);
if (!$userId) {
    throw new InvalidArgumentException("Invalid user_id passed");
}
// Verify that the current user really can manage the group.
$groups = $ldap->read('(objectclass=group)', $groupId, array('managedby', 'member'));
if (count($groups) != 1) {
    throw new Exception("Could not find the group specified");
}
$group = $groups[0];
if ($group['managedby'][0] != $_SESSION['user_dn']) {
    throw new PermissionDeniedException("You are not authorized to manage this group.");
}
// Delete the group
$ldap->delAttribute($groupId, 'managedby', $_SESSION['user_dn']);
$ldap->addAttribute($groupId, 'managedby', $userId);
Пример #10
0
<?php

/**
 * Create a new group.
 *
 * @since 8/28/09
 * @package
 *
 * @copyright Copyright &copy; 2009, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
if (!isset($_POST['container_dn']) || !$_POST['container_dn']) {
    throw new InvalidArgumentException("No container_dn passed");
}
$containerDn = base64_decode_fix($_POST['container_dn'], true);
if (!$containerDn) {
    throw new InvalidArgumentException("Invalid container_dn passed");
}
if (!isset($_POST['new_group_name']) || !$_POST['new_group_name']) {
    throw new InvalidArgumentException("No new_group_name passed");
}
$newGroupName = $_POST['new_group_name'];
if (!preg_match('/^[a-z0-9][a-z0-9\\s.,_\'&-]+$/i', $newGroupName)) {
    throw new InvalidArgumentException("Invalid new_group_name passed");
}
$groupId = "CN=" . $ldap->escapeDnValue($newGroupName) . "," . $containerDn;
// Verify that the current user really can manage the group.
try {
    $groups = $ldap->read('(objectclass=group)', $groupId, array('managedby', 'member'));
    if (count($groups)) {
        throw new Exception("A group with the name {$newGroupName} already exists.");