function backupdb() { $this->m_security->filterPost('nama', 'required'); $this->m_security->filterPost('tipe', 'required'); if ($this->m_security->startPost() == TRUE) { $nama = $this->input->post('nama', TRUE) . '-' . stringRandom(3, TRUE); $tipe = $this->input->post('tipe', TRUE); $addinsert = $this->input->post('addinsert', TRUE); $adddrop = $this->input->post('adddrop', TRUE); $refinsert = FALSE; $refdrop = FALSE; if ($addinsert == "on") { $refinsert = TRUE; } else { $refinsert = FALSE; } if ($adddrop == "on") { $refdrop = TRUE; } else { $refdrop = FALSE; } $prefs = array('format' => $tipe, 'filename' => $nama . '.sql', 'add_drop' => $refdrop, 'add_insert' => $refinsert, 'newline' => "\n"); $backup = $this->dbutil->backup($prefs); $this->load->helper('download'); force_download($nama . '.' . $tipe, $backup); } else { redirect(base_url(roleUser() . 'config/dbtools'), 'refresh'); } }
function __construct() { parent::__construct(); if (roleUser() != 'mimin') { exit(langGet('global', 'noaccess')); } }
function addPost($title, $date, $content, $status = 'publish', $category = '', $tags = '', $keywordAdd = '', $komentar = '', $tampilan = '', $feature = '') { $xStatus = ""; if (roleUser() == "op") { $xStatus = "draft"; } else { $xStatus = $status; } $d = array('post_title' => $title, 'post_date' => $date, 'post_type' => 'post', 'post_content' => $content, 'post_user' => userInfo('user_id'), 'post_slug' => stringCreateSlug($title), 'post_status' => $xStatus); $output = array(); if ($this->m_database->addRow('posts', $d) == TRUE) { $postid = $this->m_database->lastInsertID(); $this->insertCategoryPost($postid, $category); $this->insertTagPost($postid, $tags); $this->insertTaxonomyPost($postid, "keyword_custom", $keywordAdd); $this->insertTaxonomyPost($postid, "comment_system", $komentar); $this->insertTaxonomyPost($postid, "view_style", $tampilan); $this->insertTaxonomyPost($postid, "feature_image", $feature); $output['status'] = true; $output['lastid'] = $postid; } else { $output['status'] = false; $output['lastid'] = ""; } return $output; }
function savecaptcha() { $jdata = $_POST['json']; $json = ''; foreach ($jdata as $key => $val) { $json .= '"' . $key . '":"' . $val . '",'; } $hjson = substr($json, 0, -1); $datajson = "{" . $hjson . "}"; $service = $this->input->post('service'); $tipe = $this->input->post('tipe'); $savepath = $this->input->post('savepath'); $optService = ''; if ($service == "on") { $optService = "1"; } else { $optService = "0"; } optionSet('captcha_enable', $optService); if ($optService == "1") { optionSet('captcha_savepath', $savepath); optionSet('captcha_type', $tipe); optionSet('captcha_data', $datajson); } else { optionSet('captcha_savepath', ""); optionSet('captcha_type', ""); optionSet('captcha_data', ""); } redirect(base_url(roleUser() . '/captcha'), 'refresh'); }
function __construct() { parent::__construct(); if (roleUser() != 'mimin') { exit(langGet('global', 'noaccess')); } $this->load->helper('posts_helper'); }
function __construct() { parent::__construct(); if (roleUser() != 'mimin') { exit(langGet('global', 'noaccess')); } $this->load->library(array('m_security', 'm_auth')); }
function __construct() { parent::__construct(); if (roleUser() != 'mimin') { exit(langGet('global', 'noaccess')); } $this->load->library('m_file'); $this->folderTemp = "temp"; $path = locationUpload('path') . $this->folderTemp . '/'; $this->m_file->makeDir($path); }
function viewdata() { $rolename = roleURIUser(); $role = ""; $userid = userInfo('user_id'); $arr = array(); $prefix = $this->db->dbprefix; $status = $this->input->get('post_status'); $this->load->library('Datatables'); if (roleUser() == "op") { $arr = array($prefix . 'posts.post_status' => $status, $prefix . 'posts.post_type' => 'post', $prefix . 'posts.post_user' => $userid); } else { $arr = array($prefix . 'posts.post_status' => $status, $prefix . 'posts.post_type' => 'post'); } $this->datatables->select($prefix . 'posts.post_id as ii, ' . $prefix . 'posts.post_title as judul,' . $prefix . 'posts.post_date as tanggal')->unset_column('post_id')->add_column('aksi', $this->buttonAksi('$1', $rolename), "ii")->edit_column('penulis', '$1', 'postAuthor(ii)')->edit_column('kategori', '$1', 'postCategory(ii)')->edit_column('tags', '$1', 'postTags(ii)')->from($prefix . 'posts')->where($arr); echo $this->datatables->generate(); }
function role() { $meta['judul'] = 'Access Management'; $this->load->view('header', $meta); $d['data'] = $this->m_database->fetchData('userrole'); $this->load->view(roleUser() . '/user/roleview', $d); $this->load->view('footer'); }
echo userInfo('nama'); ?> </span> </a> <ul class="dropdown-menu"> <li class="user-header"> <img src="<?php echo userAvatar('64'); ?> " class="img-circle" alt="User Image" /> <p> <?php echo userInfo('nama'); ?> - <?php echo strtoupper(roleUser()); ?> </p> </li> <li class="user-footer"> <div class="pull-left"> <a href="<?php echo base_url(roleURIUser() . 'profil'); ?> " class="btn btn-default btn-flat"><?php echo langGet("menu", "menu_profile"); ?> </a> </div> <div class="pull-right"> <a href="<?php
?> "><i class="fa fa-circle-o"></i> <?php echo langGet("menu", "menu_news_add"); ?> </a></li> <li><a href="<?php echo base_url(roleURIUser() . 'content/category'); ?> "><i class="fa fa-circle-o"></i> <?php echo langGet("menu", "menu_news_category"); ?> </a></li> <li><a href="<?php echo base_url(roleURIUser() . 'content/tags'); ?> "><i class="fa fa-circle-o"></i> <?php echo langGet("menu", "menu_news_tags"); ?> </a></li> </ul> </li> <?php if (roleUser() == "mimin") { include dirname(__FILE__) . '/' . 'navadmin.php'; } elseif (roleUser() == "editor") { include dirname(__FILE__) . '/' . 'naveditor.php'; } elseif (roleUser() == "op") { include dirname(__FILE__) . '/' . 'navop.php'; }
function checkAccess() { $CI =& get_instance(); $CI->load->helper(array('db_helper', 'url')); $ses = roleUser(); if (empty($ses)) { redirect(base_url(routeGet('logout')), 'refresh'); } }