本文整理汇总了PHP中check_access函数的典型用法代码示例。如果您正苦于以下问题:PHP check_access函数的具体用法?PHP check_access怎么用?PHP check_access使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_access函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settings
public function settings()
{
if (!$this->authedUser) {
redirect(base_url('app/novp/'));
} else {
if (!check_access($this->authedUser, 'use_novp_api')) {
redirect(base_url('app/novp/start/'));
}
}
// Get token
$r_token = $this->db->get_where('novp_tokens', array('user_id' => $this->authedUser->getId()));
if ($r_token->num_rows() == 1) {
$token = $r_token->result()[0]->token;
} else {
$token = "Click Refresh icon to get token";
}
$this->data['user'] = $this->authedUser;
$this->data['token'] = $token;
$this->data['user_details'] = $this->authedUser->toArray()['details'][0];
$this->data['page_title'] = 'Settings | NOVP - Power your video with NOVP';
$this->data['menu_active'] = "settings";
$this->load->view('novp/views/header', $this->data);
$this->load->view('novp/views/nav');
$this->load->view('novp/views/settings');
$this->load->view('novp/views/footer');
}
示例2: call_move_text
function call_move_text()
{
global $local_stats,$id,$confirm,$target,$tool;
include_once('inc/functions/resort_tools.php');
check_access($tool);
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">" .
"Input user id: <input name=id size=5><br>" .
"Move to alliance: <input name=target size=5><br>" .
'<label>Check if touring:</label>' .
'<input type="checkbox" name="tourer">' .
"<input type=submit value=Move name=confirm>" .
"</form>" .
"<br><br>";
if ($confirm && $id && $target)
{
//if ($target == 1 && $local_stats[LEVEL] < 5)
// $target = 2;
echo "User $id has been move to alliance $target";
$orkTime = date(TIMESTAMP_FORMAT);
$search = mysql_query("SELECT * FROM stats WHERE id = $id");
$search = mysql_fetch_array($search);
//mysql_query("UPDATE stats SET kingdom = $target, type ='player', invested = 0 where id = $id");
//mysql_query("UPDATE rankings_personal SET alli_id = $target where id = $id");
//mysql_query("UPDATE stats SET vote = 0, invested = 0 WHERE vote = $id");
//mysql_query("UPDATE goods SET credits = 0, market_money = 0, market_food = 0, market_soldiers = 0, market_wood = 0 WHERE id = $id");
move_tribe($id, $target);
mysql_query("INSERT INTO news (id, time, ip, type, duser, ouser, result, text, kingdom_text, kingdoma, kingdomb) VALUES ('', '$orkTime', '---', 'Mod Move', '0', '0', '1', '', '<font class=\"indicator\">$search[tribe] was moved from #$search[kingdom] to #$target!</font>', '$search[kingdom]', '$target')");
}
}
示例3: index
function index()
{
$this->load->dbutil();
$this->load->helper('download');
/* Check access */
if (!check_access('backup account')) {
$this->messages->add('Permission denied.', 'error');
redirect('setting');
return;
}
$backup_filename = "backup" . date("dmYHis") . ".gz";
/* Backup your entire database and assign it to a variable */
$backup_data =& $this->dbutil->backup();
/* Write the backup file to server */
if (!write_file($this->config->item('backup_path') . $backup_filename, $backup_data)) {
$this->messages->add('Error saving backup file to server.' . ' Check if "' . $this->config->item('backup_path') . '" folder is writable.', 'error');
redirect('setting');
return;
}
/* Send the file to your desktop */
force_download($backup_filename, $backup_data);
$this->logger->write_message("success", "Downloaded account backup");
redirect('setting');
return;
}
示例4: register
public function register()
{
check_access(TRUE, TRUE);
$data = array('title' => 'Register', 'button' => 'Register', 'fields' => array('id' => array('label' => 'Registration ID', 'type' => 'text', 'attr' => array('required' => '', 'autofocus' => '')), 'email' => array('label' => 'Email', 'type' => 'email', 'attr' => array('required' => '')), 'password' => array('label' => 'Password', 'type' => 'password'), 'title' => array('label' => 'Title', 'type' => 'select', 'values' => array('Mr' => 'Mr', 'Ms' => 'Ms', 'Mrs' => 'Mrs', 'Dr' => 'Dr', 'Prof' => 'Prof')), 'first_name' => array('label' => 'First Name', 'type' => 'text'), 'last_name' => array('label' => 'Last Name', 'type' => 'text'), 'address' => array('label' => 'Address', 'type' => 'textarea'), 'city' => array('label' => 'City', 'type' => 'text'), 'country' => array('label' => 'Country', 'type' => 'text'), 'attendee_type' => array('label' => 'Attendee Type', 'type' => 'select', 'values' => array('student' => 'Student', 'participant' => 'Participant', 'sponsor' => 'Sponsor', 'vip' => 'VIP', 'speaker' => 'Speaker')), 'department' => array('label' => 'Department', 'type' => 'text'), 'company' => array('label' => 'Company', 'type' => 'text'), 'phone_number' => array('label' => 'Phone Number', 'type' => 'tel'), 'fax_number' => array('label' => 'Fax Number', 'type' => 'tel'), 'payment_status' => array('label' => 'Payment Status', 'type' => 'select', 'values' => array('unpaid' => 'Unpaid', 'cash' => 'Paid by Cash', 'credit' => 'Paid by Credit Card', 'epa' => 'Paid by EPS', 'cheque' => 'Paid by Cheque')), 'remarks' => array('label' => 'Remarks', 'type' => 'textarea'), 'is_admin' => array('label' => 'Is administrator?', 'type' => 'checkbox')));
if ($this->input->method() == 'post') {
$this->load->database();
$fields = $this->input->post();
foreach ($fields as &$v) {
if ($v == "") {
$v = NULL;
}
}
$fields['is_admin'] = empty($fields['is_admin']);
if ($this->db->set('registration_date', 'now()', FALSE)->insert('member', $fields) === FALSE) {
$e = $this->db->error();
$e = json_encode($e['message']);
$this->output->append_output("<script>\n alert('Database Error:\\n' + {$e});\n </script>");
} else {
$x = json_encode(site_url());
$this->output->append_output("<script>\n if(confirm('Register Success!\\nClick OK to enter a new record or cancel to go back to Home . '))\n window.parent.location.reload();\n else\n window.parent.location = {$x};\n </script>");
}
return;
}
$data['menu'] = $this->load->view('menu', NULL, TRUE);
$this->load->view('simple_form', $data);
}
示例5: adminSideBar
public function adminSideBar($param)
{
if (check_access("Weixin/Index/index")) {
echo '<li><a href="' . U('Weixin/Index/index') . '">
<i class="fa fa-angle-double-right"></i>微信模块</a></li>';
} else {
}
}
示例6: index
public function index()
{
check_access(TRUE);
$data = array('title' => $this->title, 'menu' => $this->load->view('menu', NULL, TRUE), 'detail_url' => site_url(uri_string() . '/detail/{id}'), 'create_url' => site_url(uri_string() . '/create'), 'edit_url' => site_url(uri_string() . '/edit/{id}'), 'delete_url' => site_url(uri_string() . '/delete/{id}'), 'fields' => $this->fields);
$r = $this->db->where('receiver_id', $this->auth->user()->id)->get($this->table);
$data['data'] = $r->result_array();
$this->load->view($this->view[__FUNCTION__], $data);
}
示例7: Status
function Status()
{
parent::Controller();
/* Check access */
if (!check_access('administer')) {
$this->messages->add('Permission denied.', 'error');
redirect('');
return;
}
return;
}
示例8: index
public function index()
{
check_access(TRUE, TRUE);
$data = array('title' => $this->title, 'menu' => $this->load->view('menu', NULL, TRUE), 'create_url' => site_url('/auth/register'), 'edit_url' => !isset($this->view['edit']) || $this->view['edit'] !== FALSE ? site_url(uri_string() . '/edit/{id}') : NULL, 'delete_url' => !isset($this->view['delete']) || $this->view['delete'] !== FALSE ? site_url(uri_string() . '/delete/{id}') : NULL, 'fields' => $this->processDynamicSource($this->fields, array(__FUNCTION__)));
$r = $this->db->get($this->table);
$data['data'] = $r->result_array();
foreach ($data['data'] as &$v) {
$v = $this->processItemSource($v, __FUNCTION__);
}
$this->load->view($this->view[__FUNCTION__], $data);
}
示例9: Welcome
function Welcome()
{
parent::Controller();
/* Check access */
if (!check_access('change account settings')) {
$this->messages->add('Permission denied.', 'error');
redirect('');
return;
}
return;
}
示例10: Printer
function Printer()
{
parent::Controller();
$this->load->model('Setting_model');
/* Check access */
if (!check_access('change account settings')) {
$this->messages->add('Permission denied.', 'error');
redirect('');
return;
}
return;
}
示例11: Report
function Report()
{
parent::Controller();
$this->load->model('Ledger_model');
/* Check access */
if (!check_access('view reports')) {
$this->messages->add('Permission denied.', 'error');
redirect('');
return;
}
return;
}
示例12: call_tour_move_text
function call_tour_move_text()
{
global $local_stats, $id, $confirm, $target, $tool;
include_once 'inc/functions/resort_tools.php';
check_access($tool);
$alli_id = '';
if (isset($_POST['alli_id'])) {
$alli_id = intval($_POST['alli_id']);
}
echo '<h2>ORKFiA Tour!</h2>';
$strForm = "<form method=\"post\" action=\"" . $_SERVER['REQUEST_URI'] . "\">" . '<label>Where is our touring tribe? Alliance #</label> ' . '<input name="alli_id" size="3" value="' . $alli_id . '"/><br /><br />';
if (isset($_POST['alli_id']) && !empty($_POST['alli_id'])) {
$iAlliance = intval($_POST['alli_id']);
include 'inc/functions/vote.php';
// select everyone in this alliance
$strSQL = "SELECT * " . " FROM stats " . " WHERE kingdom = " . $iAlliance . " ORDER BY tribe ASC";
$result = mysql_query($strSQL) or die("Elder Defect:" . mysql_error());
$strForm .= "<label>Select the lucky tribe</label>: " . '<select name="id" size="1">' . render_option_list($result, TRIBE, ID, 0) . '</select><br /><br />' . '<label>Where will they apparate to? Alliance #</label>: ' . '<input name="target" size="5" /><br /><br />' . '<input type="submit" value="Move Tourer" name="confirm">';
} else {
$strForm .= '<input type="submit" value="Choose Alliance" name="confirm">';
}
$strForm .= "</form>";
echo $strForm;
if (isset($_POST['confirm']) && isset($_POST['id']) && !empty($_POST['id']) && isset($_POST['target']) && !empty($_POST['target'])) {
$id = intval($_POST['id']);
$target = intval($_POST['target']);
$trgTmpUser = new clsUser($id);
$strTribeName = ucwords(stripslashes($trgTmpUser->get_stat(TRIBE)));
if ($trgTmpUser->get_build(LAND) != 1) {
echo '<p>"W-T-F mate?" That was not a tourer tribe.</p></div>';
include_game_down();
exit;
} elseif ($target < 11) {
echo '<p>"W-T-F mate?" No apparating into staff alliances.</p></div>';
include_game_down();
exit;
}
echo "<p>Leader! The tribe of " . $strTribeName . " has now apparated to alliance #<strong>{$target}</strong>. Let us hope that neither of their citizens got splinched.</p>";
$orkTime = date(TIMESTAMP_FORMAT);
$search = mysql_query("SELECT * FROM stats WHERE id = {$id}");
$search = mysql_fetch_array($search);
//mysql_query("UPDATE stats SET kingdom = $target, type ='player', invested = 0 where id = $id");
//mysql_query("UPDATE rankings_personal SET alli_id = $target where id = $id");
//mysql_query("UPDATE stats SET vote = 0, invested = 0 WHERE vote = $id");
//mysql_query("UPDATE goods SET credits = 0, market_money = 0, market_food = 0, market_soldiers = 0, market_wood = 0 WHERE id = $id");
include_once 'inc/staff/move.inc.php';
move_tribe($id, $target);
mysql_query("INSERT INTO news (id, time, ip, type, duser, ouser, result, text, kingdom_text, kingdoma, kingdomb) VALUES ('', '{$orkTime}', '---', 'Tour Move', '0', '0', '1', '', '<span class=\"indicator\">{$search['tribe']} has joined our alliance. Long live Orkfia! Long live the tour!</span>', '', '{$target}')");
}
}
示例13: create_post
public function create_post($survey_id = 0)
{
check_access(TRUE);
$set = array('survey_id' => $survey_id, 'writer_id' => $this->auth->user()->id, 'response_json' => json_encode($_POST));
if ($this->db->insert($this->table, $set) !== FALSE) {
$list = json_encode(site_url(dirname(uri_string())));
$this->output->append_output("<script>\n alert('Thank you for your participation!');\n window.parent.location = {$list};\n </script>");
} else {
$e = $this->db->error();
if ($e['code'] == 1062) {
$this->output->append_output("<script>alert('You have done this survey already!');</script>");
} else {
$this->dbError();
}
}
}
示例14: call_update_text
function call_update_text()
{
$tool = $_GET['tool'];
include_once 'inc/functions/resort_tools.php';
check_access($tool);
echo "'Updating' a tribe means updating the rankings and alliscreen, " . "not giving an actual update.<br /><br />" . "<form method='post' action='{$_SERVER['REQUEST_URI']}'>" . "User id to update: <input name='id' size='5' /><br /><br />" . "<input type='submit' value='Update' name='op' />" . "</form>";
if (isset($_POST['op']) && !empty($_POST['id'])) {
$id = $_POST['id'];
$op = $_POST['op'];
include_once 'inc/functions/update.php';
include_once 'inc/functions/update_ranking.php';
$objTrgUser = new clsUser($id);
doUpdateRankings($objTrgUser, 'yes');
check_to_update($objTrgUser->get_userid());
echo "<br /><br />User " . $objTrgUser->get_userid() . " updated =)";
}
}
示例15: call_unsuspend_text
function call_unsuspend_text()
{
$tool = $_GET['tool'];
include_once 'inc/functions/resort_tools.php';
check_access($tool);
echo "<form method='post' action='{$_SERVER['REQUEST_URI']}'>" . "User id to unsuspend: <input name='id' size='5' /><br /><br />" . "<input type='submit' value='Unsuspend' name='op' />" . "</form>";
if (isset($_POST['op']) && !empty($_POST['id'])) {
$id = $_POST['id'];
$objTrgUser = new clsUser($id);
$arrTrgUser = array(PAUSE_ACCOUNT => 0);
$objTrgUser->set_user_infos($arrTrgUser);
// Forced Ranking Update
include_once 'inc/functions/update_ranking.php';
doUpdateRankings($objTrgUser, 'yes');
echo "<br /><br />User " . $objTrgUser->get_userid() . " unsuspended =)";
}
}