本文整理汇总了PHP中access_control函数的典型用法代码示例。如果您正苦于以下问题:PHP access_control函数的具体用法?PHP access_control怎么用?PHP access_control使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了access_control函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Contracts
function Contracts()
{
parent::__construct();
$this->load->model('users_m', 'user1');
$this->load->model('currency_m');
access_control($this);
}
示例2: index
function index()
{
$data['active'] = $this->pde_m->fetch_pdes('in');
$data['archived'] = $this->pde_m->fetch_pdes('out');
$this->load->view('pde/manage_pda_v', $data);
access_control($this);
}
示例3: Receipts
function Receipts()
{
//********** Back button will not work, after logout **********//
header("cache-Control: no-store, no-cache, must-revalidate");
header("cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
//********** Back button will not work, after logout **********//
parent::__construct();
$this->load->library('form_validation');
$this->load->model('users_m', 'user1');
$this->load->model('sys_email', 'sysemail');
$this->session->set_userdata('page_title', 'Login');
#MOVER LOADED MODELS
$this->load->model('Receipts_m');
$this->load->model('Proc_m');
$this->load->model('Evaluation_methods_m');
$this->load->model('Remoteapi_m');
##END
date_default_timezone_set(SYS_TIMEZONE);
$data = array();
access_control($this);
}
示例4: User
function User()
{
parent::__construct();
$this->load->library('form_validation');
$this->load->model('users_m', 'user1');
$this->load->model('sys_email', 'sysemail');
$this->load->model('file_upload', 'libfileobj');
$this->load->model('sys_file', 'sysfile');
date_default_timezone_set(SYS_TIMEZONE);
access_control($this);
}
示例5: __construct
public function __construct()
{
parent::__construct();
$this->load->model('procurement_plan_m');
$this->load->model('procurement_plan_entry_m');
$this->load->model('notification_m');
$this->load->model('procurement_plan_status_m');
$this->load->model('notification_m');
$this->load->model('sys_file', 'sysfile');
access_control($this);
}
示例6: update_school_info
function update_school_info()
{
access_control($this);
# 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);
$data = restore_bad_chars($data);
if ($data['save']) {
$data['schooldetails'] = $data;
$required_fields = array('schoolname', 'emailaddress', 'telephone');
$_POST = clean_form_data($data);
$validation_results = validate_form('', $_POST, $required_fields);
$classname_error = '';
$rank_error = '';
#set status as editing on destination if updating
if ($this->input->post('editid')) {
$data['editid'] = $_POST['editid'];
}
#Only proceed if the validation for required fields passes
if ($validation_results['bool'] && !(empty($data['editid']) && !empty($user_details))) {
#Update school info
$result = $this->db->query($this->Query_reader->get_query_by_code('user_update_school_data', array_merge($_POST, array('editid' => $this->myschool['id']))));
$data['schooldetails'] = $this->Query_reader->get_row_as_array('search_schools_list', array('limittext' => '', 'searchstring' => ' AND id = ' . $this->myschool['id']));
#Format and send the errors
if (!empty($result) && $result) {
$data['msg'] = "The school data has been successfully saved.";
#Copy school badge to designated folder
if (!empty($_POST['photo'])) {
$copy_image_result = copy(UPLOAD_DIRECTORY . "temp/" . $_POST['photo'], UPLOAD_DIRECTORY . "schools/" . $_POST['photo']);
#copy the thumb_nail as well
$thumb_nail_ext = end(explode('.', $_POST['photo']));
$copy_image_thumb_result = copy(UPLOAD_DIRECTORY . "temp/" . str_replace('.' . $thumb_nail_ext, '_thumb.' . $thumb_nail_ext, $_POST['photo']), UPLOAD_DIRECTORY . "schools/" . str_replace('.' . $thumb_nail_ext, '_thumb.' . $thumb_nail_ext, $_POST['photo']));
if (!$copy_image_result && !$copy_image_thumb_result) {
$data['msg'] = 'WARNING: ' & $data['msg'] . '<br />' . 'An error occured while saving the school badge';
} else {
@unlink(UPLOAD_DIRECTORY . "temp/" . $_POST['photo']);
@unlink(UPLOAD_DIRECTORY . "temp/" . str_replace('.' . $thumb_nail_ext, '_thumb.' . $thumb_nail_ext, $_POST['photo']));
}
}
} else {
if (empty($data['msg'])) {
$data['msg'] = "ERROR: The school data could not be saved or was not saved correctly." . $classname_error . $rank_error;
}
}
}
if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) {
$data['msg'] = "WARNING: The highlighted fields are required.";
}
$data['requiredfields'] = $validation_results['requiredfields'];
}
$this->load->view('schoolinfo/school_info_view', $data);
}
示例7: manage_settings
function manage_settings()
{
access_control($this);
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));
# Pick all assigned data
$data = assign_to_data($urldata);
$data = add_msg_if_any($this, $data);
#default to curriculum settings
$data = paginate_list($this, $data, 'search_subjects', array('isactive' => 'Y', 'searchstring' => ' AND school = ' . $this->myschool['id']));
$this->load->view('settings/manage_settings_view', $data);
}
示例8: Bids
function Bids()
{
parent::__construct();
$this->load->model('users_m', 'users');
$this->load->model('sys_email', 'sysemail');
#date_default_timezone_set(SYS_TIMEZONE);
#MOVER LOADED MODELS
$this->load->model('Receipts_m');
$this->load->model('Proc_m');
$this->load->model('Evaluation_methods_m');
$this->load->model('sys_file', 'sysfile');
$this->load->model('Disposal_m', 'disposal');
access_control($this);
}
示例9: Notifications
function Notifications()
{
parent::__construct();
$this->load->library('form_validation');
$this->load->model('users_m', 'user1');
$this->load->model('Notification_m', 'notification');
$this->session->set_userdata('page_title', 'Login');
#MOVER LOADED MODELS
$this->load->model('Receipts_m');
$this->load->model('Proc_m');
$this->load->model('Evaluation_methods_m');
access_control($this);
##END
date_default_timezone_set(SYS_TIMEZONE);
$data = array();
}
示例10: Reports
function Reports()
{
parent::__construct();
$this->load->model('users_m', 'users');
$this->load->model('sys_email', 'sysemail');
#date_default_timezone_set(SYS_TIMEZONE);
$this->load->model('contracts_m');
$this->load->model('bid_invitation_m');
$this->load->model('receipts_m');
$this->load->model('disposal_m');
$this->load->model('disposal_record_m');
$this->load->model('remoteapi_m');
$this->load->model('procurement_plan_m');
$this->load->model('contracts_m');
$this->load->model('contract_price_m');
access_control($this);
}
示例11: Providers
function Providers()
{
parent::__construct();
$this->load->library('form_validation');
$this->load->model('users_m', 'user1');
$this->load->model('sys_email', 'sysemail');
$this->session->set_userdata('page_title', 'Login');
#MOVER LOADED MODELS
# $this->load->model('Currencies_m');
$this->load->model('Proc_m');
$this->load->model('Evaluation_methods_m');
$this->load->model('Remoteapi_m');
#MOVER LOADED MODELS
$this->load->model('Currency_m', 'currency');
$this->load->model('Disposal_m', 'disposal');
##END
date_default_timezone_set(SYS_TIMEZONE);
$data = array();
access_control($this);
}
示例12: delete_sponsor
function delete_sponsor()
{
access_control($this);
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('m', 'i', 't'));
# Pick all assigned data
$data = assign_to_data($urldata);
if (!empty($data['i'])) {
$result = deactivate_row($this, 'exams', decryptValue($data['i']));
}
if (!empty($result) && $result) {
$this->session->set_userdata('dexam', "The exam data has been successfully deleted.");
} else {
if (empty($data['msg'])) {
$this->session->set_userdata('dexam', "ERROR: The exam could not be deleted or was not deleted correctly.");
}
}
if (!empty($data['t']) && $data['t'] == 'super') {
$tstr = "/t/super";
} else {
$tstr = "";
}
redirect("sponsors/manage_exams/m/dexam" . $tstr);
}
示例13: load_pdetype_form
function load_pdetype_form()
{
access_control($this, array('admin'));
# 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);
#Get access groups
$accessGroupsResult = $this->db->query($this->Query_reader->get_query_by_code('get_user_group_list', array()));
// $data['pdetypes'] = $this-> Pdetypes_m -> fetchpdetypes($status='Y');
$data['usergroups'] = $this->Usergroups_m->fetchusergroups();
$data['users'] = $this->users_m->fetchusers();
// users_m
#form type
$data['formtype'] = 'insert';
$data['page_title'] = 'New PDE ';
$data['current_menu'] = 'add_pdetype';
$data['view_data']['form_title'] = $data['page_title'];
$data['view_to_load'] = 'pde/pdetype_form_v';
$this->load->view('dashboard_v', $data);
}
示例14: save_stream
function save_stream()
{
access_control($this);
}
示例15: settings
function settings()
{
access_control($this);
# Get the passed details into the url data array if any
$urldata = $this->uri->uri_to_assoc(3, array('i'));
# Pick all assigned data
$data = assign_to_data($urldata);
#Get user settings
$editid = $this->session->userdata('userid');
if ($this->session->userdata('usertype') == 'SCHOOL') {
$data['formdata'] = $this->Query_reader->get_row_as_array('get_school_user_by_id', array('id' => $editid));
} elseif ($this->session->userdata('usertype') == 'MSR') {
$data['formdata'] = $this->Query_reader->get_row_as_array('get_user_by_id', array('id' => $editid));
}
$data['isview'] = !empty($data['a']) && decryptValue($data['a']) == 'view' ? "Y" : "";
if ($this->input->post('savesettings')) {
$required_fields = array('firstname', 'lastname', 'address', 'emailaddress*EMAILFORMAT', 'telephone');
$_POST = clean_form_data($_POST);
$validation_results = validate_form('', $_POST, $required_fields);
$update_string = '';
#Only proceed if the validation for required fields passes
if ($validation_results['bool']) {
#Check if the password has been changed, is strong enough and the repeated value is the same
if (!empty($_POST['password']) || !empty($_POST['repeatpassword'])) {
$passwordmsg = $this->user1->check_password_strength($_POST['password']);
if (!$passwordmsg['bool']) {
$data['msg'] = "WARNING: " . $passwordmsg['msg'];
} elseif ($_POST['password'] == $_POST['repeatpassword']) {
$update_string = ", password = '" . sha1($_POST['password']) . "'";
} else {
$data['msg'] = "WARNING: The passwords provided do not match.";
}
}
#Check if a new photo has been uploaded
if (!empty($_FILES['imageurl']['tmp_name'])) {
$new_file_url = 'ac_' . strtotime('now') . generate_random_letter() . "." . end(explode('.', $_FILES['imageurl']['name']));
if (copy($_FILES['imageurl']['tmp_name'], UPLOAD_DIRECTORY . "users/" . $new_file_url)) {
#Create a thumb nail as well
$config['image_library'] = 'gd2';
$config['source_image'] = UPLOAD_DIRECTORY . "users/" . $new_file_url;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 100;
$config['height'] = 80;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
#Delete the previous image from the server if it exists
if (!empty($data['formdata']['photo'])) {
@unlink(UPLOAD_DIRECTORY . "users/" . $data['formdata']['photo']);
}
$update_string .= ',photo ="' . $new_file_url . '"';
}
}
#Update or Save the new form data
if (empty($data['msg'])) {
if ($this->session->userdata('usertype') == 'SCHOOL') {
$save_result = $this->db->query($this->Query_reader->get_query_by_code('update_school_user_data', array_merge(array('editid' => $editid, 'usertype' => $this->session->userdata('usertype'), 'usergroup' => $this->session->userdata('usergroup'), 'isschooladmin' => $this->session->userdata('isschooladmin'), 'updatecond' => $update_string), $_POST)));
} elseif ($this->session->userdata('usertype') == 'MSR') {
$save_result = $this->db->query($this->Query_reader->get_query_by_code('update_user_data', array('editid' => $editid, 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'middlename' => $_POST['middlename'], 'addressline1' => $_POST['addressline1'], 'emailaddress' => $_POST['emailaddress'], 'telephone' => $_POST['telephone'], 'usertype' => $this->session->userdata('usertype'), 'isadmin' => $_POST['isadmin'], 'updatecond' => $update_string)));
}
$msg = !empty($save_result) && $save_result ? "Your settings have been saved." : "ERROR: Your settings were not saved.";
$this->session->set_userdata('sres', $msg);
redirect($this->user1->get_dashboard() . "/m/sres");
}
}
#VALIDATION end
if ((empty($validation_results['bool']) || !empty($validation_results['bool']) && !$validation_results['bool']) && empty($data['msg'])) {
$data['msg'] = "WARNING: The highlighted fields are required.";
}
$data['requiredfields'] = $validation_results['requiredfields'];
$data['formdata'] = $_POST;
}
if (empty($data['formdata'])) {
$this->session->set_userdata('suser', "ERROR: Your settings could not be resolved.");
redirect($this->user1->get_dashboard() . "/m/suser");
}
$data = add_msg_if_any($this, $data);
$this->load->view('admin/settings_view', $data);
}