本文整理汇总了PHP中check_user_access函数的典型用法代码示例。如果您正苦于以下问题:PHP check_user_access函数的具体用法?PHP check_user_access怎么用?PHP check_user_access使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_user_access函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_menu
function display_menu($current_menu = '')
{
$nav_menu_str = '';
$menu_array = $this->menu_engie->menu_bucket();
if (check_user_access($this, 'manage_reports')) {
}
if (!empty($menu_array)) {
echo '<div class="span3"> <ul>';
foreach ($menu_array as $text => $link) {
$parent_links_html = '<li class="' . (!empty($link['child']) ? ' has-sub' : '') . ($text == $current_menu || $text == $this->find_my_parent($current_menu) ? ' active open' : '') . '">' . '<a href="' . $link['attr']['url'] . '" id="' . $link['attr']['id'] . '" class="sed">' . '<span class="icon-box"><i class="' . $link['attr']['classes'] . '"></i></span>' . $link['attr']['text'] . (!empty($link['child']) ? '<span class="arrow"></span>' : '') . '</a>';
$child_links_html = '';
if (!empty($link['child'])) {
foreach ($link['child'] as $child_text => $child_link) {
if (check_user_access($this, $child_text) || in_array($child_text, array('my_profile', 'log_out', 'home'))) {
$child_links_html .= '<li class="' . ($child_text == $current_menu ? 'active' : '') . '">' . '<a href="' . $child_link['url'] . '" class="">' . $child_link['text'] . '</a>' . '</li>';
}
}
}
if (!empty($child_links_html)) {
print $parent_links_html . '<ul id="' . $link['attr']['id'] . '-child" class="sub">' . $child_links_html . '</ul></li>';
}
}
echo "</ul> </div>";
}
}
示例2: array
$menu_array['users']['section'] = array('title' => 'Users', 'url' => base_url() . 'admin/manage_users');
$menu_array['users']['Add a New User'] = base_url() . 'admin/load_user_form';
$menu_array['users']['Manage Users'] = base_url() . 'admin/manage_users';
} else {
$menu_array['news']['section'] = array('title' => 'News', 'url' => base_url() . 'news/user_news_list');
if (check_user_access($this, 'view_news_feed')) {
$menu_array['news']['News Feed'] = base_url() . 'news/user_news_list';
}
if (check_user_access($this, 'view_news_archive')) {
$menu_array['news']['News Archive'] = base_url() . 'news/user_news_list/t/' . encryptValue('archive');
}
$menu_array['invitations']['section'] = array('title' => 'Invitations', 'url' => 'javascript:void(0)');
if (check_user_access($this, 'view_invitations')) {
$menu_array['invitations']['Your Invitations'] = base_url() . 'deal/user_invitations_list';
}
if (check_user_access($this, 'view_invitation_archive')) {
$menu_array['invitations']['Invitations Archive'] = base_url() . 'deal/user_invitations_list/t/' . encryptValue('archive');
}
}
if (!empty($section) && $subsection != 'settings') {
$section_array = $menu_array[$section];
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
#Include only if there are other pages
if (!empty($section_array) && !empty($subsection) || !empty($subsection) && $subsection == 'settings') {
if (!empty($section_array)) {
示例3: foreach
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div id="searchresults">
<?php
#Show search results
if (!empty($page_list)) {
echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n \t<tr>\r\r\n\t\t\t<td class='listheader'> </td>\r\r\n\t\t\t<td class='listheader'>Help Topic</td>\r\r\n \t<td class='listheader' nowrap>Last Updated</td>\r\r\n\t\t\t</tr>";
$counter = 0;
foreach ($page_list as $row) {
#Show one row at a time
echo "<tr style='" . get_row_color($counter, 2) . "'>\r\r\n\t\t\t\t<td width='1%'>";
if (check_user_access($this, 'update_help_topic')) {
echo "<a href='" . base_url() . "help/add_help_topic/i/" . encryptValue($row['topiccode']) . "' title=\"Click to edit this help topic.\"><img src='" . base_url() . "images/edit.png' border='0'/></a>";
}
echo "</td>\r\r\n\t\t\t\t\r\r\n\t\t\t\t<td width='1%' valign='top' nowrap><a href='" . base_url() . "help/view_help_topic/i/" . encryptValue($row['topiccode']) . "' class='fancybox fancybox.ajax bluelink'>" . $row['helptopic'] . "</a></td>\r\r\n\t\t\t\t\r\r\n <td width='98%'>" . date('m/d/Y h:iA', strtotime($row['lastupdateddate'])) . "</td>\r\r\n\t\t\t</tr>";
$counter++;
}
echo "<tr>\r\r\n\t<td colspan='3' align='center' class='layer_table_pagination' nowrap>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "help/manage_help/p/%d") . "</td>\r\r\n\t</tr>\r\r\n\t</table>";
} else {
echo format_notice("There is no help at the moment.");
}
?>
</div>
</td>
</tr>
</table></td>
示例4: foreach
foreach ($page_list as $row) {
#Show one row at a time
if ($row['type'] == 'DEBIT') {
$debit = $row['amount'];
$credit = 0;
$balance -= $debit;
$total_debit += $debit;
} else {
$debit = 0;
$credit = $row['amount'];
$balance += $credit;
$total_credit += $credit;
}
$fee = get_fee_lines($this, $row['fee']);
echo "<tr class='listrow' style='" . get_row_color($counter, 2, 'row_borders') . "'>\r\r\n\t\t<td valign='top' nowrap>";
if (check_user_access($this, 'delete_deal')) {
echo "<a href='javascript:void(0)' onclick=\"confirmDeleteEntity('" . base_url() . "finances/delete_fee/i/" . encryptValue($row['id']) . "', 'Are you sure you want to remove this fee? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.');\" title=\"Click to remove this fee.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>";
}
#if(check_user_access($this,'update_deals')){
echo " <a href='#' title=\"Click to print this transaction details.\"><img src='" . base_url() . "images/small_pdf.png' border='0'/></a>";
#}
echo "</td>\r\r\n\t\t \t\t<td valign='top'>" . date("j M, Y", GetTimeStamp($row['dateadded'])) . "</td>\r\r\n\t\t\t\t<td valign='top'>" . $fee['fee'] . "</td>\r\r\n\t\t\t\t<td valign='top' nowrap align='right'>" . number_format($debit, 0, '.', ',') . "</td>\r\r\n\t\t\t\t<td valign='top' nowrap align='right'>" . number_format($credit, 0, '.', ',') . "</td>\r\r\n\t\t\t\t<td valign='top' nowrap align='right'>" . number_format($balance, 0, '.', ',') . "</td>\r\r\n\t\t\t</tr>";
$counter++;
}
echo "<tr>\r\r\n\t\t <td colspan='3'></td>\r\r\n\t\t <td><div class='sum'>" . number_format($total_debit, 0, '.', ',') . "</div></td>\r\r\n\t\t <td><div class='sum'>" . number_format($total_credit, 0, '.', ',') . "</div></td>\r\r\n\t\t <td style='padding-right:0'><div class='sum'>" . number_format(-($total_debit - $total_credit), 0, '.', ',') . "</div></td>\r\r\n\t\t </tr>";
echo "<tr>\r\r\n\t<td colspan='6' align='right' class='layer_table_pagination'>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "classes/manage_classes/p/%d") . "</td>\r\r\n\t</tr>\r\r\n\t</table>";
} else {
echo "<div>No transactions have been added.</div";
}
?>
示例5: base_url
if (check_user_access($this, 'update_access_group')) {
?>
<a href="<?php
echo base_url();
?>
admin/access_group_form/i/<?php
echo encryptValue($row['groupid']);
?>
" title="Click to update this access group."><img src="<?php
echo base_url();
?>
images/edit.png" border="0"/></a>
<?php
}
if (check_user_access($this, 'manage_access_permissions')) {
?>
<a href="<?php
echo base_url();
?>
admin/update_permissions/i/<?php
echo encryptValue($row['groupid']);
?>
" title="Click to update this access group's permissions"><img src="<?php
echo base_url();
?>
images/patient_history.png" border="0" height="18"/></a>
<?php
}
?>
示例6: array
<tr>
<td valign="top">
<?php
#$page_list = array();
if (!empty($page_list)) {
echo "<table width='100%' border='0' cellspacing='0' cellpadding='5'>\r\r\n \t<tr>\r\r\n\t\t\t<td class='listheader'> </td>\r\r\n \t<td class='listheader' nowrap>User</td>\r\r\n\t\t\t<td class='listheader' nowrap>Username</td>\r\r\n \t<td class='listheader' nowrap>Phone</td>\r\r\n\t\t\t<td class='listheader' nowrap>Email</td>\r\r\n\t\t\t<td class='listheader' nowrap>Date Added</td>\r\r\n\t\t\t</tr>";
$counter = 0;
foreach ($page_list as $row) {
#Show one row at a time
echo "<tr style='" . get_row_color($counter, 2) . "'>\r\r\n\t\t<td valign='top' nowrap>";
if (check_user_access($this, 'delete_deal')) {
echo "<a href='javascript:void(0)' onclick=\"confirmDeleteEntity('" . base_url() . "admin/delete_user/i/" . encryptValue($row['id']) . "', 'Are you sure you want to remove this user? \\nThis operation can not be undone. \\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.');\" title=\"Click to remove this user.\"><img src='" . base_url() . "images/delete.png' border='0'/></a>";
}
if (check_user_access($this, 'update_deals')) {
echo " <a href='" . base_url() . "admin/load_user_form/i/" . encryptValue($row['id']) . "' title=\"Click to edit this user details.\"><img src='" . base_url() . "images/edit.png' border='0'/></a>";
}
echo "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['firstname'] . " " . $row['lastname'] . "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['username'] . "</td>\r\r\n\t\t\t\t\r\r\n\t\t<td valign='top' nowrap>" . $row['telephone'] . "</td>\r\r\n\t\t\r\r\n\t\t<td valign='top'>" . $row['emailaddress'] . "</td>\r\r\n\t\t<td valign='top'>" . date("j M, Y", GetTimeStamp($row['dateadded'])) . "</td>\t\t\r\r\n\t\t</tr>";
$counter++;
}
echo "<tr>\r\r\n\t<td colspan='5' align='right' class='layer_table_pagination'>" . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "deal/manage_deals/p/%d") . "</td>\r\r\n\t</tr>\r\r\n\t</table>";
} else {
echo "<div>No schools have been registered.</div";
}
?>
</td>
</tr>
示例7: custom_date_format
<li class="divider"></li>
<li>' . $completion_str . '</li>
</ul>
</div>';
print '<tr>' . '<td>' . $delete_str . ' ' . $edit_str . ' ' . $more_actions . '</td>' . '<td>' . custom_date_format('d M, Y', $row['date_signed']) . '</td>' . '<td>' . format_to_length($row['procurement_ref_no'], 30) . '</td>' . '<td>' . format_to_length($row['subject_of_procurement'], 30) . '</td>' . '<td>' . $status_str . '</td>' . '<td style="text-align:right; font-family:Georgia; font-size:14px">' . addCommas($row['total_price'], 0) . '</td>' . '<td>' . custom_date_format('d M, Y', $row['dateadded']) . ' by ' . format_to_length($row['authorname'], 10) . '</td>' . '</tr>';
}
print '</tbody></table>';
} else {
print format_notice('WARNING: Your search criteria does not match any contracts');
}
} else {
if (!empty($area) && $area == 'procurement_entries') {
if (!empty($page_list)) {
print '<table class="table table-striped table-hover">' . '<thead>' . '<tr>' . '<th width="5%"></th>' . '<th>Procurement Ref. No</th>' . '<th class="hidden-480">Subject of procurement</th>' . '<th class="hidden-480">Source of funding</th>' . '<th class="hidden-480">Estimated amount</th>' . '<th>Author</th>' . '<th>Date Added</th>' . '</tr>' . '</thead>' . '</tbody>';
$delete_rights = check_user_access($this, 'delete_procurement_entry');
$edit_rights = check_user_access($this, 'edit_procurement_entry');
$delete_str = '';
$edit_str = '';
foreach ($page_list as $row) {
if ($delete_rights) {
$delete_str = '<a title="Delete entry" href="javascript:void(0);" onclick="confirmDeleteEntity(\'' . base_url() . 'procurement/delete_entry/i/' . encryptValue($row['entryid']) . '\', \'Are you sure you want to delete this entry?\\nClick OK to confirm, \\nCancel to cancel this operation and stay on this page.\')"><i class="icon-trash"></i></a>';
}
if ($edit_rights) {
$edit_str = '<a title="Edit entry details" href="' . base_url() . 'procurement/load_procurement_entry_form/i/' . encryptValue($row['entryid']) . '"><i class="icon-edit"></i></a>';
}
print '<tr>' . '<td>' . $delete_str . ' ' . $edit_str . '</td>' . '<td>' . $row['procurement_ref_no'] . '</td>' . '<td>' . format_to_length($row['subject_of_procurement'], 50) . '</td>' . '<td>' . $row['funding_source'] . '</td>' . '<td>' . (is_numeric($row['estimated_amount']) ? number_format($row['estimated_amount'], 0, '.', ',') . ' ' . $row['currency_abbr'] : $row['estimated_amount']) . '</td>' . '<td>' . (empty($row['authorname']) ? 'N/A' : $row['authorname']) . '</td>' . '<td>' . custom_date_format('d M, Y', $row['dateadded']) . '</td>' . '</tr>';
}
print '</tbody></table>';
print '<div class="pagination pagination-mini pagination-centered">' . pagination($this->session->userdata('search_total_results'), $rows_per_page, $current_list_page, base_url() . "bids/manage_bid_invitations/p/%d") . '</div>';
} else {
print format_notice('ERROR: Your search criteria does not match any records');
示例8: save_user
function save_user()
{
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 'a', 't'));
# Pick all assigned data
$data = assign_to_data($urldata);
#check user access
if (!empty($data['i'])) {
check_user_access($this, 'edit_user_details', 'redirect');
} else {
check_user_access($this, 'add_users', 'redirect');
}
if ($this->input->post('cancel')) {
redirect("admin/manage_users");
} else {
if ($this->input->post('save')) {
$data['userdetails'] = $_POST;
$required_fields = array('firstname', 'lastname', 'gender', 'emailaddress*EMAILFORMAT', 'telephone', 'username');
$_POST = clean_form_data($_POST);
$validation_results = validate_form('', $_POST, $required_fields);
#Only proceed if the validation for required fields passes
if ($validation_results['bool']) {
#User's added by non admins have PDE of author
if ($this->session->userdata('isadmin') == 'N') {
#should also NEVER try adding system admins, under any circumstances!
if (!empty($_POST['roles']) && $_POST['roles'] == 14) {
$this->session->set_userdata('usave', "ERROR: Invalid action");
redirect("user/dashboard/m/usave");
}
$userdata = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
$_POST['pde'] = $userdata[0]['pde'];
}
if (!empty($data['i'])) {
$userid = decryptValue($data['i']);
$data['msg'] = '';
#test if email is unique to user being edited
$user_details = $this->Query_reader->get_row_as_array('search_user_list', array('searchstring' => 'emailaddress="' . $_POST['emailaddress'] . '" AND userid != "' . $userid . '"', 'limittext' => ''));
if (!empty($user_details)) {
$data['msg'] = "ERROR: A user with the specified email address already exists. <br />";
}
if (!empty($_POST['password']) || !empty($_POST['repeatpassword'])) {
$passwordmsg = $this->user1->check_password_strength($_POST['password']);
if (!$passwordmsg['bool']) {
$data['msg'] .= "ERROR: " . $passwordmsg['msg'];
} elseif ($_POST['password'] == $_POST['repeatpassword']) {
$update_string = ", password = '" . sha1($_POST['password']) . "'";
} else {
$data['msg'] .= "ERROR: The passwords provided do not match.";
}
} else {
$update_string = "";
}
if (empty($data['msg'])) {
$result = $this->db->query($this->Query_reader->get_query_by_code('update_user_data', array_merge($_POST, array('updatecond' => $update_string, 'editid' => $userid))));
#update the user's roles
if (empty($_POST['roles'])) {
$this->db->update('roles', array('isactive' => 'N'), array('userid' => $userid, 'isactive' => 'Y'));
} else {
#get the user's current roles
$current_user_roles = $this->db->get_where('roles', array('userid' => $userid, 'isactive' => 'Y'))->result_array();
foreach ($current_user_roles as $current_user_role) {
if (in_array($current_user_role['groupid'], $_POST['roles'])) {
foreach ($_POST['roles'] as $role_key => $role_value) {
if ($role_value == $current_user_role['groupid']) {
unset($_POST['roles'][$role_key]);
break;
}
}
} else {
$this->db->update('roles', array('isactive' => 'N'), array('id' => $current_user_role['id']));
}
}
if (!empty($_POST['roles'])) {
$this->db->insert('roles', array('userid' => $userid, 'groupid' => $_POST['roles'], 'author' => $this->session->userdata('userid')));
}
}
#echo $this->Query_reader->get_query_by_code('update_user_data', array_merge($_POST, array('updatecond'=>$update_string, 'editid'=>decryptValue($data['i']))));
#exit();
}
} else {
#check if a similar username already exists
$username_error = "";
$usernames = $this->db->query($this->Query_reader->get_query_by_code('get_existing_usernames', array('searchstring' => ' username = "' . $_POST['username'] . '"')));
#Check if adding a new user and the email added has already been used
if (!empty($data['userdetails']['emailaddress']) && empty($data['i'])) {
$user_details = $this->Query_reader->get_row_as_array('get_any_user_by_email', array('emailaddress' => $data['userdetails']['emailaddress']));
}
#determine password strength
$passwordmsg = $this->user1->check_password_strength($_POST['password']);
if (strlen($_POST['username']) < 5) {
$data['msg'] = "ERROR: The username must be at least 5 characters long";
$data['errormsgs']['username'] = "The username must be at least 5 characters long";
$data['requiredfields'] = array('username');
} elseif (count($usernames->result_array())) {
$data['msg'] = "ERROR: The username is already being used by another user.";
$data['errormsgs']['username'] = "The username is already being used by another user";
$data['requiredfields'] = array('username');
} elseif (!$passwordmsg['bool']) {
$data['msg'] = "ERROR: " . $passwordmsg['msg'];
$data['errormsgs']['password'] = $passwordmsg['msg'];
//.........这里部分代码省略.........
示例9: suspended_providers
function suspended_providers()
{
check_user_access($this, 'suspended_provider_reports', 'redirect');
$data['pdes'] = $this->db->get_where('pdes', array('isactive' => 'Y', 'status' => 'in'))->result_array();
$data['pdes'] = array_merge(array(array('pdeid' => 'ALL', 'pdename' => 'View All')), $data['pdes']);
$data['financial_years'] = $this->financial_years;
$data['page_title'] = 'Best Evaluated Bids awarded to suspended providers ' . date('Y') . '-' . (date('Y') + 1);
$data['current_menu'] = 'suspended_provider_reports';
$data['view_to_load'] = 'reports/suspended_providers/suspended_provider_reports_v';
$data['view_data']['form_title'] = $data['page_title'];
$data['search_url'] = '';
$data['rop_suspended_providers'] = $this->remoteapi_m->providers_suspended();
$data['report_form'] = 'reports/suspended_providers/forms/suspended_providers_f';
$data['report_view'] = 'reports/suspended_providers/suspended_providers_home';
if ($this->input->post('generate_ppms')) {
//print_array($_POST);
$data['page_title'] = 'Best Evaluated Bids awarded to suspended providers ' . $this->input->post('financial_year');
$start_year = substr($this->input->post('financial_year'), 0, 4);
$end_year = substr($this->input->post('financial_year'), 5, 4);
$where = array('isactive' => 'Y', 'datereceived >=' => date('Y-m-d', strtotime($start_year . '-01-01')), 'datereceived <=' => date('Y-m-d', strtotime($end_year . '-01-01')), 'beb' => 'Y');
$data['month'] = $this->input->post('month');
//if there are where variables
if (isset($where)) {
$data['results'] = $this->receipts_m->get_where($where);
}
//print_array($this->db->last_query());
} else {
$data['month'] = custom_date_format('M', mysqldate());
$where = array('isactive' => 'Y', 'datereceived >=' => date('Y-m-d', strtotime(date('Y') . '-01-01')), 'datereceived <=' => date('Y-m-d', strtotime(date('Y') + 1 . '-01-01')), 'beb' => 'Y');
}
$data['results'] = $this->receipts_m->get_where($where);
$this->load->view('dashboard_v', $data);
}
示例10: load_approve_bid_invitation_form
function load_approve_bid_invitation_form()
{
#check user access
check_user_access($this, 'approve_invitation_for_bids', 'redirect');
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('m'));
# Pick all assigned data
$data = assign_to_data($urldata);
$app_select_str = ' procurement_plan_entries.isactive="Y" ';
if ($this->session->userdata('isadmin') == 'N') {
$userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
$app_select_str .= ' AND procurement_plans.pde_id ="' . $userdetails[0]['pde'] . '"';
}
$data['procurement_plan_entries'] = $this->db->query($this->Query_reader->get_query_by_code('procurement_plan_details', array('searchstring' => $app_select_str, 'limittext' => '', 'orderby' => ' procurement_plan_entries.dateadded ')))->result_array();
#exit($this->db->last_query());
if (!empty($data['i'])) {
$app_select_str = ' procurement_plan_entries.isactive="Y" ';
if ($this->session->userdata('isadmin') == 'N') {
$userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
$app_select_str .= ' AND procurement_plans.pde_id ="' . $userdetails[0]['pde'] . '"';
}
$bid_id = decryptValue($data['i']);
$data['formdata'] = $this->Query_reader->get_row_as_array('search_table', array('table' => 'bidinvitations', 'limittext' => '', 'orderby' => 'id', 'searchstring' => ' id="' . $bid_id . '" AND isactive="Y"'));
#get procurement plan details
if (!empty($data['formdata']['procurement_ref_no'])) {
$data['formdata']['procurement_details'] = $this->Query_reader->get_row_as_array('procurement_plan_details', array('searchstring' => $app_select_str . ' AND procurement_plan_entries.procurement_ref_no="' . $data['formdata']['procurement_ref_no'] . '"', 'limittext' => '', 'orderby' => ' procurement_plan_entries.dateadded '));
}
}
if (!empty($data['formdata']['approval_comments'])) {
$data['formdata']['approval_comments'] = $_POST['approval_comments'];
}
$data['page_title'] = 'Approve bid invitation';
$data['current_menu'] = 'manage_bid_invitations';
$data['view_to_load'] = 'bids/approve_bid_invitation_form';
$data['view_data']['form_title'] = $data['page_title'];
$this->load->view('dashboard_v', $data);
}
示例11: delete_contract
function delete_contract()
{
#check user access
check_user_access($this, 'delete_contract', 'redirect');
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('m', 's', 'i', 'b'));
# Pick all assigned data
$data = assign_to_data($urldata);
if (!empty($data['i'])) {
$result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_item', array('item' => 'contracts', 'id' => decryptValue($data['i']))));
}
if (!empty($result) && $result) {
#deactivate the contract prices as well
$this->db->update('contract_prices', array('isactive' => 'Y'), array('contract_id' => decryptValue($data['i'])));
$this->session->set_userdata('dbid', "The contract details have been successfully deleted.");
} else {
if (empty($data['msg'])) {
$this->session->set_userdata('dbid', "ERROR: The contract details could not be deleted or were not deleted correctly.");
}
}
redirect(base_url() . "contracts/manage_contracts/m/dbid/");
}
示例12: base_url
if (check_user_access($this, 'update_report')) {
?>
<a href="<?php
echo base_url();
?>
reports/add_report/i/<?php
echo encryptValue($row['id']);
?>
" title="Click to update this report"><img src="<?php
echo base_url();
?>
images/edit.png" border="0"/></a>
<?php
}
if (check_user_access($this, 'update_report_access')) {
?>
<a href="<?php
echo base_url();
?>
reports/report_access_control/i/<?php
echo encryptValue($row['id']);
?>
" title="Click to update this report's access permissions"><img src="<?php
echo base_url();
?>
images/patient_history.png" border="0"/></a>
<?php
}
示例13: delete_entry
function delete_entry()
{
#check user access
check_user_access($this, 'delete_procurement_entry', 'redirect');
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('m', 's', 'i'));
# Pick all assigned data
$data = assign_to_data($urldata);
$redirect_url = '';
if (!empty($data['i'])) {
$search_str = '';
if ($this->session->userdata('isadmin') == 'N') {
$userdetails = $this->db->get_where('users', array('userid' => $this->session->userdata('userid')))->result_array();
$search_str .= ' AND PP.pde_id ="' . $userdetails[0]['pde'] . '"';
}
$entry_details = $this->Query_reader->get_row_as_array('procurement_entries', array('table' => 'procurement_plan_entries', 'searchstring' => ' AND PPE.id = "' . decryptValue($data['i']) . '" AND PPE.isactive="Y" ' . $search_str, 'orderby' => 'PPE.id', 'limittext' => ''));
if (!empty($entry_details)) {
$result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_item', array('item' => 'procurement_plan_entries', 'id' => $entry_details['entryid'])));
$redirect_url = "procurement/procurement_plan_entries/v/" . encryptValue($entry_details['procurement_plan_id']) . "/m/dbid";
} else {
$msg = "ERROR: Invalid function access";
$this->session->set_userdata('dbid', $msg);
$redirect_url = "user/dashboard/m/dbid";
exit('hmm');
}
}
if (!empty($result) && $result) {
$this->session->set_userdata('dbid', "The procurement entry has been successfully deleted.");
} else {
if (empty($msg)) {
$this->session->set_userdata('dbid', "ERROR: The procurement entry could not be deleted or were not deleted correctly.");
}
}
redirect(base_url() . $redirect_url);
}
示例14: auth_user
function auth_user($loc = null)
{
if (!is_user_logged_in()) {
if (is_null($loc)) {
auth_redirect();
} else {
wp_redirect(site_url($loc));
exit;
}
}
if (!check_user_access(get_current_user_id(), get_the_ID())) {
wp_redirect(site_url('/members-only'));
exit;
}
}
示例15: load_user_form
function load_user_form()
{
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 'a'));
# Pick all assigned data
$data = assign_to_data($urldata);
#check user access
if (!empty($data['i'])) {
check_user_access($this, 'edit_user_details', 'redirect');
} else {
check_user_access($this, 'add_users', 'redirect');
}
#Get access groups
$data['usergroups'] = $this->db->query($this->Query_reader->get_query_by_code('get_user_group_list', array('searchstring' => 'UG.isactive="Y" ' . ($this->session->userdata('isadmin') == 'N' ? ' AND UG.id != 14 AND UG.groupname not like "%PPDA Administrator%"' : ''), 'orderby' => 'ORDER BY UG.groupname', 'limittext' => '')))->result_array();
#Get pdes
$this->db->order_by("pdename", "asc");
$data['pdes'] = $this->db->get_where('pdes', array('isactive' => 'Y', 'status' => 'in'))->result_array();
#user is editing
if (!empty($data['i'])) {
$userid = decryptValue($data['i']);
$data['formdata'] = $this->Query_reader->get_row_as_array('get_user_by_id', array('id' => $userid));
#get the user's roles
$user_roles = $this->db->query($this->Query_reader->get_query_by_code('get_roles_by_user', array('userid' => $userid)))->result_array();
#format role IDs into simple array
$data['formdata']['roles'] = array();
foreach ($user_roles as $user_role) {
array_push($data['formdata']['roles'], $user_role['groupid']);
}
#If the user is to be reactivated
if (!empty($data['a']) && decryptValue($data['a']) == 'reactivate' && $this->session->userdata('isadmin') == 'Y') {
$result = $this->db->query($this->Query_reader->get_query_by_code('reactivate_user', array('id' => $userid)));
if ($result) {
$send_result = $this->sysemail->email_form_data(array('fromemail' => NOREPLY_EMAIL), get_confirmation_messages($this, $data['userdetails'], 'account_reactivated_notice'));
} else {
$data['msg'] = "ERROR: There was an error activating the user.";
}
}
#Check if the user is simply viewing
if (!empty($data['a']) && decryptValue($data['a']) == 'view') {
$data['isview'] = "Y";
#get the access group name
$data['access_group_info'] = $this->Query_reader->get_row_as_array('get_group_by_id', array('groupid' => $data['userdetails']['accessgroup']));
}
}
$data['page_title'] = !empty($data['i']) ? 'Edit user details' : 'Add user';
$data['current_menu'] = 'add_users';
$data['view_to_load'] = 'users/user_form_v';
$data['view_data']['form_title'] = $data['page_title'];
$this->load->view('dashboard_v', $data);
}