本文整理汇总了PHP中check_perm函数的典型用法代码示例。如果您正苦于以下问题:PHP check_perm函数的具体用法?PHP check_perm怎么用?PHP check_perm使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_perm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function get($genid = '')
{
$id = id_from_genid($genid);
//Kullanıcı izni var mı?
check_perm($id);
$person = $this->db->select('id,name,first_name,last_name,gender,locale')->from('liste')->where('id', $id)->limit('1')->get()->row();
if (!isset($person->id) || $person->id < 1) {
show_error("Information Removed or Not Exists", "410", "Sorry for inconvenience");
}
$person->picture = site_url('picture/large/' . genid_from_id($person->id));
//$person->picture = "http://graph.facebook.com/".$person->id."/picture?type=large";
$data['person'] = $person;
$data['same_last'] = $this->db->select('id,name')->from('liste')->where('last_name', $person->last_name)->where('id !=', $person->id)->limit('28')->get()->result();
$data['same_first'] = $this->db->select('id,name')->from('liste')->where('first_name', $person->first_name)->where('id !=', $person->id)->limit('28')->get()->result();
$data['same_wiki'] = $this->db->select('id,name,short_desc')->from('wiki')->or_where_in('last_name', array($person->first_name, $person->last_name))->limit('28')->get()->result();
//Stats Ekle -> Viewed
stats_add($person->id, "viewed");
//$this->template->set_master_template('template_get');
$this->template->write('title', convert_accented_characters($person->name));
$this->template->write('description', 'about ' . convert_accented_characters($person->name));
$this->template->write('name', convert_accented_characters($person->name));
$this->template->write('image', site_url('picture/square/' . genid_from_id($person->id)));
$this->template->write('picture', $person->picture);
$this->template->write_view('page', 'face/get', $data);
$this->template->render();
}
示例2: make_footer
function make_footer($has_page = True)
{
global $prefs;
$new_page = "?new";
$latest_pages = "?";
$edit_page = "?edit." . $has_page;
$revert_page = "?revert." . $has_page;
$delete_page = "?delete." . $has_page;
$footer = "<h4>Wiki</h4>\n\t<ul>\n\t\t<li><a href='" . $latest_pages . "'>" . LAN_W_3 . "</a></li>\n\t\t<li><a href='" . e_HTTP . "search.php?&t=wiki&adv=0'>" . LAN_W_9 . "</a></li>\n\t\t\n\t\t";
if (check_perm()) {
$footer .= "<li><a href='" . $new_page . "'>" . LAN_W_6 . "</a></li>";
if ($has_page) {
$footer .= "<li><a href='" . $edit_page . "'>" . LAN_W_5 . "</a></li>";
if (ADMIN) {
$footer .= "<li><a href='" . $revert_page . "'>" . LAN_W_7 . "</a></li>";
$footer .= "<li><a href='" . $delete_page . "'>" . LAN_W_10 . "</a></li>";
}
}
}
$footer .= "\n\t</ul>";
return $footer;
}
示例3: intval
//rendezes vege
//megnezzuk, hogy az azonosito alapjan milyen csoportot akar lekerdezni
$admin_group = 0;
if (isset($_REQUEST['gid']) && is_numeric($_REQUEST['gid'])) {
$gid = intval($_REQUEST['gid']);
$query = "\n\t\tSELECT * \n\t\tFROM iShark_Groups \n\t\tWHERE group_id = {$gid}\n\t";
$result =& $mdb2->query($query);
if ($result->numRows() > 0) {
$row = $result->fetchRow();
if ($row['group_id'] == $_SESSION['site_sys_prefgroup']) {
$admin_group = 1;
}
}
}
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, 'groups') || $admin_group == 1 && $is_admin == 0) {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('error_no_permission'));
return;
}
$groupnums = 0;
//lekerdezzuk, hogy mennyi nem torolt csoport van jelenleg
$query = "\n\tSELECT * \n\tFROM iShark_Groups \n\tWHERE is_deleted = 0\n";
$result = $mdb2->query($query);
$groupnums = $result->numRows();
if ($act == "add" || $act == "mod") {
//js beszurasa
$javascripts[] = "javascripts";
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
require_once $include_dir . '/function.check.php';
示例4: array
$module_name = "settings";
//nyelvi file betoltese
$locale->useArea("admin_" . $module_name);
// Cím beállítása
$title_module = array('title' => $locale->get('title'));
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('lst');
//breadcrumb
$breadcrumb->add($title_module['title'], 'admin.php?p=settings');
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
$act = $_REQUEST['act'];
} else {
$act = "lst";
}
if (!check_perm($act, '', 1, 'settings')) {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('error_permission_denied'));
return;
}
$tpl->assign('self', $module_name);
$tpl->assign('title_module', $title_module);
if (isset($_GET['file'])) {
include_once 'admin/settings/' . $_GET['file'];
} else {
if ($act == "lst") {
//lekerdezzuk es kiirjuk a rendszerben talalhato fooldali modulokat
$query = "\n\t\t\tSELECT DISTINCT m.module_id AS mid, m.module_name AS mname, m.file_name AS mfname, m.file_ext AS mfext, \n\t\t\t\tm.description AS mdesc, m.is_active AS mactive, m.type AS mtypem \n\t\t\tFROM iShark_Modules AS m \n\t\t\tWHERE m.is_active = 1 \n\t\t\tGROUP BY m.file_name \n\t\t\tORDER BY m.module_name\n\t\t";
$result = $mdb2->query($query);
//ha ures a lista, akkor uzenet
if ($result->numRows() != 0) {
示例5: array
// fulek definialasa
$tabs = array('flats' => $locale->get('tabs_title'));
$acts = array('flats' => array('lst', 'mod'));
//aktualis ful beallitasa
$page = 'flats';
if (isset($_REQUEST['act']) && array_key_exists($_REQUEST['act'], $tabs)) {
$page = $_REQUEST['act'];
}
$sub_act = 'lst';
if (isset($_REQUEST['sub_act']) && in_array($_REQUEST['sub_act'], $acts[$page])) {
$sub_act = $_REQUEST['sub_act'];
}
//breadcrumb
$breadcrumb->add($title_module['title'], 'admin.php?p=' . $module_name);
//jogosultsag ellenorzes
if (!check_perm($page, 0, 0, $module_name) || $sub_act != 'lst' && !check_perm($page . '_' . $sub_act, 0, 1, $module_name)) {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('error_no_permission'));
return;
}
$tpl->assign('self', $module_name);
$tpl->assign('title_module', $title_module);
$tpl->assign('this_page', $page);
$tpl->assign('dynamic_tabs', $tabs);
/**
* a hozzadas vagy modositas reszhez tartozo quickform kozos beallitasa
*/
if ($sub_act == "mod") {
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
$titles = array('add' => $locale->get('main_title_add'), 'mod' => $locale->get('main_title_mod'));
示例6: array
//nyelvi file betoltese
$locale->useArea($module_name);
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('ins', 'unins', 'mod');
$menu_id = 0;
//menu azonosito vizsgalata
if (isset($_GET['mid'])) {
$menu_id = intval($_GET['mid']);
}
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
$act = $_REQUEST['act'];
} else {
$act = "lst";
}
if (!check_perm($act, $menu_id, 1, 'settings')) {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('error_no_permission'));
return;
}
/**
*ha modositjuk a beallitasokat
*/
if ($act == "mod") {
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
$form =& new HTML_QuickForm('frm_polls', 'post', 'admin.php?p=settings&file=' . $_GET['file']);
$form->removeAttribute('name');
$form->setRequiredNote($locale->get('form_required_note'));
$form->addElement('header', $locale->get('form_header'));
$form->addElement('hidden', 'act', $act);
示例7: intval
$fieldorder = "ORDER BY fb.form_title";
$order = "ASC";
}
if (isset($_GET['pageID']) && is_numeric($_GET['pageID'])) {
$page_id = intval($_GET['pageID']);
} else {
$page_id = 1;
}
$tpl->assign('fieldselect1', $fieldselect1);
$tpl->assign('fieldselect2', $fieldselect2);
$tpl->assign('ordselect1', $ordselect1);
$tpl->assign('ordselect2', $ordselect2);
$tpl->assign('page_id', $page_id);
//rendezes vege
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, 'form_builder')) {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('error_no_permission'));
return;
}
if ($act == "add" || $act == "mod") {
//js beszurasa
$javascripts[] = "javascripts";
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
require_once $include_dir . '/function.check.php';
$titles = array('add' => $locale->get('title_add'), 'mod' => $locale->get('title_mod'));
$form =& new HTML_QuickForm('frm_forms', 'post', 'admin.php?p=' . $module_name);
$form->setRequiredNote($locale->get('form_required_note'));
$form->addElement('header', $locale->get('form_header'));
$form->addElement('hidden', 'field', $field);
示例8: create_user
function create_user()
{
if ($_POST) {
$this->load->model('dx_auth/users', 'user2');
$val = $this->form_validation;
$val->set_rules('username', lang('Login', 'user_manager'), 'trim|required|xss_clean');
$val->set_rules('password', lang('Password', 'user_manager'), 'trim|min_length[' . $this->config->item('DX_login_min_length') . ']|max_length[' . $this->config->item('DX_login_max_length') . ']|required|xss_clean');
$val->set_rules('password_conf', lang('Confirm the password', 'user_manager'), 'matches[password]|required');
$val->set_rules('email', lang('E-Mail', 'user_manager'), 'trim|required|xss_clean|valid_email');
$val->set_rules('phone', lang('Phone', 'user_manager'), 'trim');
($hook = get_hook('users_create_set_val_rules')) ? eval($hook) : NULL;
$user = $this->input->post('username');
$email = $this->input->post('email');
$role = $this->input->post('role');
// check user mail
if ($this->user2->check_email($email)->num_rows() > 0) {
showMessage(lang('User with the same e-mail has been registered', 'user_manager'), '', 'r');
exit;
}
if (!check_perm('user_create') and !check_perm('user_create_all_roles')) {
//cp_check_perm('user_create');
}
// if (!check_perm('user_create_all_roles')) {
// $role = $this->dx_auth->get_role_id();
// }
$this->load->helper('string');
if ($val->run() and $user_info = $this->dx_auth->register($val->set_value('username'), $val->set_value('password'), $val->set_value('email'), '', random_string('alnum', 5), $this->input->post('phone'), false)) {
//set user role
$user_info = $this->user2->get_user_by_email($user_info['email'])->row_array();
$this->user2->set_role($user_info['id'], $role);
$this->lib_admin->log(lang('Create a user or the username has been created', 'user_manager') . ' <a href="' . site_url('/admin/components/cp/user_manager/edit_user/' . $user_info['id']) . '">' . $val->set_value('username') . '</a>');
showMessage(lang('Username has been created or user has been created', 'user_manager'));
$action = $_POST['action'];
if ($action == 'close') {
pjax('/admin/components/cp/user_manager/edit_user/' . $user_info['id']);
} else {
pjax('/admin/components/init_window/user_manager');
}
} else {
$fields = array('username', 'password', 'password_conf', 'email', 'phone');
$script = "<script type=\"text/javascript\">";
foreach ($fields as $field) {
$error = $val->error($field);
if (!empty($error)) {
$script .= "showError('{$field}','{$error}'); ";
}
}
$script .= "</script>";
echo $script;
}
}
$this->set_tpl_roles();
if (!$this->ajaxRequest) {
$this->template->registerJsFile('templates/administrator/js/jquery.maskedinput-1.3.min.js', 'after');
$this->template->registerJsFile('application/modules/user_manager/templates/js/create.js', 'after');
$this->display_tpl('create_user');
}
}
示例9: intval
}
if (isset($_GET['pageID']) && is_numeric($_GET['pageID'])) {
$page_id = intval($_GET['pageID']);
} else {
$page_id = 1;
}
$tpl->assign('fieldselect1', $fieldselect1);
$tpl->assign('fieldselect2', $fieldselect2);
$tpl->assign('fieldselect3', $fieldselect3);
$tpl->assign('fieldselect4', $fieldselect4);
$tpl->assign('ordselect1', $ordselect1);
$tpl->assign('ordselect2', $ordselect2);
$tpl->assign('page_id', $page_id);
//rendezes vege
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, 'modules')) {
$acttpl = 'error';
$tpl->assign('errormsg', $strErrorPermission);
return;
}
/**
* ha aktivaljuk valamelyik modult
*/
if ($act == "act") {
include_once $include_dir . '/function.check.php';
$mid = intval($_GET['m_id']);
check_active('iShark_Modules', 'module_id', $mid);
//loggolas
logger($act, NULL, '');
header('Location: admin.php?p=modules&field=' . $field . '&ord=' . $ord);
exit;
示例10: Pager_Wrapper_MDB2
$tpl->assign('act_dir', $gallery['name']);
$tpl->assign('dirlist', $dirlist);
$tpl->assign('lang_title', $locale->get('title_ftp_upload'));
$tpl->assign('back_arrow', 'admin.php?p=' . $module_name . '&act=' . $page . '&sub_act=plst&gid=' . $gid);
$acttpl = 'gallery_ftp';
}
/**
* képek listázása
*/
if ($sub_act == 'plst') {
// Galériához tartozó képek lekérdezése
$query = "\n\t\tSELECT P.*, GP.orders\n\t\tFROM iShark_Galleries_Pictures GP\n\t\tLEFT JOIN iShark_Pictures P ON GP.picture_id = P.picture_id\n\t\tWHERE GP.gallery_id = {$gid}\n\t\tORDER BY GP.orders\n\t";
include_once 'Pager/Pager.php';
$paged_data = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
$paged_data2 = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
if ($_SESSION['site_gallery_is_ftpdir'] == '1' && check_perm($page . '_' . $sub_act, NULL, 1, $module_name)) {
$tpl->assign('is_ftp', TRUE);
}
$add_new = array(array('link' => 'admin.php?p=' . $module_name . '&act=' . $page . '&sub_act=upl&gid=' . $gid, 'title' => $locale->get('title_upload'), 'pic' => 'add.jpg'));
if (!empty($_SESSION['site_gallery_is_ftpdir'])) {
$add_new[] = array('link' => 'admin.php?p=' . $module_name . '&act=' . $page . '&sub_act=ftp&gid=' . $gid, 'title' => $locale->get('title_ftp_upload'), 'pic' => 'ftpgallery.jpg');
}
//breadcrumb
$breadcrumb->add($locale->get('tabs_title_piclist'), '#');
$tpl->assign('add_new', $add_new);
$tpl->assign('lang_title', $locale->get('tabs_title_piclist') . ' (' . $gallery['name'] . ')');
$tpl->assign('page_data', $paged_data['data']);
$tpl->assign('page_list', $paged_data['links']);
$acttpl = 'gallery_pics';
}
// Galéria törlése
示例11: Header
if ($elements[0] == "delete" && ADMIN) {
$sql->db_Delete("wiki", "page_title='" . $row['page_title'] . "' ");
Header("Location: ./");
}
}
} elseif (!isset($_GET['page'])) {
// list of last 10 pages added or modified
$title = LAN_W_3;
$sql->db_Select("wiki", "*", "page_active = 1 ORDER BY page_datestamp DESC LIMIT 0,10", true);
$content = make_links($sql->db_getList());
} else {
$page = mysql_real_escape_string($_GET['page']);
$count = $sql->db_Select("wiki", "*", "page_title = '" . $page . "' and page_active=1", true);
if ($count > 0) {
// Page does exists
$row = $sql->db_Fetch();
$title = $row['page_title'];
$content = make_content($row);
$has_page = $row['page_id'];
} elseif (check_perm()) {
$title = "New Page";
$content = "" . page_form(array());
} else {
// Page not found
$title = LAN_W_1;
$content = LAN_W_2;
}
}
require_once HEADERF;
$ns->tablerender($title, $content . make_footer($has_page));
require_once FOOTERF;
示例12: array
";
$mdb2->exec($query);
//loggolas
logger('unins', $menu_id);
header('Location: admin.php?mid='.$menu_id);
exit;
}
*/
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
$act = $_REQUEST['act'];
} else {
$act = "lst";
}
if (!check_perm($act, $menu_id, 1)) {
$acttpl = 'error';
$tpl->assign('errormsg', $strErrorPermission);
return;
}
/**
* ha modositjuk
*/
if ($act == "mod") {
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
$form =& new HTML_QuickForm('frm_guestbook', 'post', 'admin.php?mid=' . $menu_id . '&file=' . $_GET['file']);
$form->setRequiredNote($strAdminForumRequired);
$form->addElement('header', $strAdminForumHeader);
$form->addElement('hidden', 'act', 'mod');
$radio1 = array();
示例13: recursiveDirList
function recursiveDirList($dir, $prefix = '')
{
$dir = rtrim($dir, '/');
$result = array();
foreach (glob("{$dir}/*", GLOB_MARK) as $f) {
#print "\nDEBUG: $f\n";
check_perm($f);
if (substr($f, -1) === '/') {
$result = array_merge($result, recursiveDirList($f, $prefix . basename($f) . '/'));
} else {
$patterns = array("php\$", "js\$");
$regex = '/(' . implode('|', $patterns) . ')/i';
if (preg_match($regex, $f)) {
if (substr(decoct(fileperms($f)), -3) !== '000') {
$result[] = $prefix . basename($f);
#print ".";
}
}
}
}
return $result;
}
示例14: intval
$tpl->assign('page_id', $page_id);
$tpl->assign('self', $module_name);
$tpl->assign('title_module', $title_module);
//rendezes vege
//megnezzuk, hogy az azonosito alapjan milyen felhasznalot akar lekerdezni
$admin_user = 0;
if (isset($_REQUEST['uid']) && is_numeric($_REQUEST['uid'])) {
$uid = intval($_REQUEST['uid']);
$query = "\n\t\tSELECT * \n\t\tFROM iShark_Groups_Users \n\t\tWHERE user_id = {$uid} AND group_id = " . $_SESSION['site_sys_prefgroup'] . "\n\t";
$result =& $mdb2->query($query);
if ($result->numRows() > 0) {
$admin_user = 1;
}
}
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, $module_name) || $admin_user == 1 && $is_admin == 0) {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('error_no_permission'));
return;
}
$group_get = "";
/**
* a hozzadas vagy modositas reszhez tartozo quickform kozos beallitasa
*/
if ($act == "add" || $act == "mod") {
//szukseges fuggvenykonyvtarak betoltese
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
require_once $include_dir . '/function.check.php';
$titles = array('add' => $locale->get('title_add'), 'mod' => $locale->get('title_mod'));
//elinditjuk a form-ot
示例15: die
die("Közvetlenül nem lehet az állományhoz hozzáférni...");
}
//modul neve
$module_name = "system";
$locale->useArea("admin_" . $module_name);
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('mod');
//ezek az elfogadhato almuveleti hivasok ($_REQUEST['type'])
$is_type = array('sys', 'cont', 'mce', 'dwn', 'gal', 'ban', 'sho', 'partners', 'builder', 'stat', 'class');
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
$act = $_REQUEST['act'];
} else {
$act = "lst";
}
if (!check_perm($act, NULL, 1, 'system')) {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('error_no_permission'));
return;
}
if (isset($_REQUEST['type']) && in_array($_REQUEST['type'], $is_type)) {
require_once 'HTML/QuickForm.php';
require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
$form =& new HTML_QuickForm('frm_system', 'post', 'admin.php?p=system');
$form->setRequiredNote($locale->get('form_required_note'));
$form->addElement('header', 'system', $locale->get('form_header'));
$form->addElement('hidden', 'act', 'mod');
$form->addElement('hidden', 'type', $_REQUEST['type']);
/**
* a rendszer alapbeallitasai
*/