我正在研究由codeigniter 2.1.4开发的现有项目。当我向控制器添加一个新方法并将其运行到浏览器时,它什么也没显示。如果将新方法添加到该控制器,即使该控制器下的其他方法也不会运行。这些控制器扩展了以下控制器:
<?php
class MY_Controller extends CI_Controller {
public $data = array();
public $allowedUrl = array(
"super admin" => array("case_controllerler/deleteSingleCase","case_controller/quickPendingCaseSearch","case_controller/checkUniqueCaseNumber","case_controller/kharijCase","admin/index","case_controller/viewSatalementKhatianCopyApplication", "admin/saveAdmin","admin/addUser", "admin/allAdmin", "admin/suspendUser", "admin/activeUser", "admin/CustomSearchGL","admin/showMethod","admin/CustomSearchAction","admin/deleteUser","admin/showAllComplain","admin/singleAdminInfo","admin/updateAdminInfo","admin/successfullyUpdated","case_controller/downloadPendingCase",
"case_controller/addCase", "case_controller/store_data", "case_controller/caseSuccessfullyAdded", "case_controller/createCalender",
"case_controller/workingDaysCalender", "case_controller/editPendingCase","case_controller/saveEditedPendingCase","case_controller/EditmissCase","case_controller/UpdateMisccase",
"case_controller/pending", "case_controller/allCase", "case_controller/searchCase", "case_controller/singleCase","case_controller/testAjax","case_controller/DeleteLandData","case_controller/SaveNEwLandInfo","case_controller/DeleteApplicantinfo",
"case_controller/nextDateFromGivenDate","case_controller/downloadArchiveCase","case_controller/sendSms","case_controller/secondSms","case_controller/thirdSms","case_controller/fourthSms","case_controller/fiveSms","case_controller/CustomSms","case_controller/monthAllreadyExit",
"register_control/AddTohsil","register_control/TohsilEntry","register_control/EditTohsil","register_control/updatetohsil",
"register_control/AddMouja","register_control/MoujaEntry","register_control/EditMouja","register_control/updateMouja",
"register_control/AddMutationAsistant","register_control/MutationAsistantEntry","register_control/EditMutationAsistant","register_control/updateMutationAsistant",
"register_control/AddKhotiyan","register_control/moujaquery","register_control/saveKhotiyan","register_control/saveKhotiyanFile",
"register_control/FindKhotiyan","register_control/SearchKhotiyan","register_control/DeleteKhotiyan","register_control/Editkhotiyan",
"register_control/AddNewKhotiyanUnderKhotiyanId","register_control/saveNewKhotiyan","register_control/UpdateKhotiyan","register_control/Getjolmohol",
"register_control/Tamil","register_control/EntryTamilFormat","register_control/createcellfortamil","register_control/editTamil","register_control/UpdateTamil","register_control/DeleteTamil","register_control/Imgdownload",
"dashboard/DashboardHome","dashboard/viewFullreport","dashboard/tohsilviewlist","dashboard/tohsilviewlistoverdate","dashboard/namjariviewlist","dashboard/namjariviewlistoverdate","dashboard/kanongopendingviewlist","dashboard/kanongooverdateviewlist","dashboard/aclandPendingeviewlist","dashboard/aclandoverdateviewlist","dashboard/waitingpendingviewlist","dashboard/waitingooverdateviewlist",
"admin/DeleteComplains","admin/fullviewcomplains", "register_nine/Newentry","register_nine/SaveData","register_nine/Search","register_nine/viewapplication",
"register_nine/editapplication","register_nine/Deleteapplication","register_nine/Preview","register_nine/UpdateApplication",
"register_nine/SearchForPreview","register_nine/paginationData","admin/GovLandEntry","admin/savegovtLandInfo","admin/GovLandQuery","admin/govtLandInfoQuery","admin/EditGovtLand",
"admin/UpdategovtLandInfo","admin/DeleteGovtLandInfo","admin/govtLandInfoQueryByType",
"case_controller/AddmissCase","case_controller/SaveMissCase","case_controller/MIssCassUpdate","case_controller/UpdateInfoMissCase","case_controller/MiscSmsToplaintiff",
"case_controller/EditMIssCaseUpdate","case_controller/UpdateStatus","case_controller/DeletemissCasestatus","case_controller/CheckGovtLand",
"case_controller/FinishMisscase","case_controller/DeletemissCase","case_controller/ArchivemissCase","case_controller/ViewMIssCassUpdate","case_controller/SearchActionByNameOrNId","case_controller/SearchActionBydag",
"case_controller/SearchmissCase","case_controller/SearchMisscaseAction","case_controller/viewPorcaApplication","case_controller/DeletePorcaapplication","case_controller/ArchivePorcaApplication","case_controller/approvalsms",
"case_controller/ApprovePoRcaApliCation","case_controller/fullviewPrcaApplication","register_control/RemoveKhotiyanFile","case_controller/SaveMissCaseAttchment",
"register_control/DeleteKHotiyanFile","register_control/ViewTamil","register_control/NewAddKhotiyanFile","register_control/TamilDownload","register_control/RegisterONe","register_control/FileInventory"
,"other_registers/EntryDailyIncome","other_registers/SaveDailyINcome","other_registers/inqueryAndSubmit","other_registers/SearchActionOfInquery","other_registers/DeliveryToBank","other_registers/deliverySuccess",
"other_registers/searchCashRegister","other_registers/SearchActionregisterthree","other_registers/SearchActionregisterthreebyStauts","other_registers/registerseventeenOfTohsil","other_registers/DemandRegister","other_registers/miscellenousPaymentRegister",
"other_registers/registerseventeenOfAcland","admin/showAllOpinion","admin/Deleteopinion","admin/fullviewopinion","mutation_controller/DownloadMutationApplication","mutation_controller/AllMutationApplications","mutation_controller/DetailsMutationAppliCation",
"mutation_controller/accecptApplicationSms","mutation_controller/DeleteMutationApplication","dashboard/TohsilPieChart","other_registers/SavedemandRegisterSix","other_registers/SearchAndDelivaryRegisterSix"
,"other_registers/SearchActionOfInqueryRegisterSix","other_registers/RegisterSixDelivery","other_registers/registerSixdeliverySuccess","other_registers/SavePaymentRegisterSeven",
"other_registers/SearchAndDelivaryRegisterSeven","other_registers/SearchActionOfInqueryRegisterSeven","other_registers/RegisterSevenDelivery","other_registers/registerSevendeliverySuccess","case_controller/ChangeMutationAsistant",
"case_controller/ActionChangeMutationAsistant","case_controller/FeedbackMiscCaseUpdate","case_controller/FeedbackUpdateInfoMissCase","admin/EditUser","admin/updateAdminInfobySuperAdmin", "case_controller/EditMIssCaseUpdateFeedback",
"case_controller/UpdateStatusFeedback","case_controller/PrintMIsscassInformation","case_controller/viewArchiveCase","case_controller/deleteArchiveSingleCase","case_controller/RuningMiscCase","dashboard/CaseCounter",
"other_registers/deleteDailyEntryRegisterThree","other_registers/deleteDailyEntryRegistersix","other_registers/deleteDailyEntryRegisterseven","case_controller/fullviewArchivePrcaApplication","case_controller/OrderSheet","case_controller/SaveOrderInfo","case_controller/PrintOrderSheet",
"case_controller/ViewLedger","case_controller/ProposalView","case_controller/SaveProposalInfo","case_controller/PrintProposalView","case_controller/CaseNotice","case_controller/PrintNoticeView","case_controller/SecondPagePrintProposalView",
"case_controller/UpdateCaseLandInfo","case_controller/SaveScratchMap","case_controller/UpdateCaseApplicantInfo","case_controller/TohsilWisePendingCaselist"),
"admin" => array("case_controller/addCase","case_controller/organizeDateFormat","case_controller/createCalender","case_controller/EditmissCase","case_controller/UpdateMisccase","case_controller/DeleteLandData","case_controller/SaveNEwLandInfo","case_controller/DeleteApplicantinfo",
"case_controller/assendingCalender","case_controller/monthAllreadyExit","case_controller/changeDateFromat","case_controller/testAjax","case_controller/nextDateFromGivenDate",
"case_controller/store_data","case_controller/caseSuccessfullyAdded","case_controller/allCase","case_controller/searchCase","case_controller/singleCase",
"case_controller/pending","case_controller/quickPendingCaseSearch","case_controller/kharijCase","case_controller/editPendingCase","case_controller/saveEditedPendingCase",
"case_controller/downloadArchiveCase","case_controller/downloadPendingCase","case_controller/sendSms","case_controller/secondSms","case_controller/thirdSms",
"case_controller/fourthSms","case_controller/fiveSms","case_controller/CustomSms","case_controller/checkUniqueCaseNumber","case_controller/AddmissCase","case_controller/MiscSmsToplaintiff","case_controller/ViewLedger","case_controller/CaseNotice",
"case_controller/SaveMissCase","case_controller/MIssCassUpdate","case_controller/UpdateInfoMissCase","case_controller/EditMIssCaseUpdate","case_controller/UpdateStatus",
"case_controller/FinishMisscase","case_controller/ArchivemissCase","case_controller/ViewMIssCassUpdate","case_controller/RuningMiscCase","case_controller/SaveMissCaseAttchment",
"case_controller/SearchmissCase","case_controller/SearchMisscaseAction","case_controller/viewPorcaApplication","case_controller/ArchivePorcaApplication",
"case_controller/ApprovePoRcaApliCation","case_controller/fullviewPrcaApplication","case_controller/SearchActionByNameOrNId","case_controller/SearchActionBydag",
"case_controller/approvalsms","case_controller/ChangeMutationAsistant","case_controller/ActionChangeMutationAsistant","case_controller/FeedbackMiscCaseUpdate",
"case_controller/FeedbackUpdateInfoMissCase","case_controller/EditMIssCaseUpdateFeedback","case_controller/UpdateStatusFeedback","case_controller/PrintMIsscassInformation",
"case_controller/viewArchiveCase","case_controller/RuningMiscCase","case_controller/viewSatalementKhatianCopyApplication","case_controller/fullviewArchivePrcaApplication",
"dashboard/DashboardHome","dashboard/viewFullreport","dashboard/tohsilviewlist","dashboard/tohsilviewlistoverdate","dashboard/namjariviewlist",
"dashboard/namjariviewlistoverdate","dashboard/kanongopendingviewlist","dashboard/kanongooverdateviewlist","dashboard/aclandPendingeviewlist",
"dashboard/aclandoverdateviewlist","dashboard/waitingpendingviewlist","dashboard/waitingooverdateviewlist","dashboard/TohsilPieChart","dashboard/CaseCounter",
"mutation_controller/AllMutationApplications","mutation_controller/DetailsMutationAppliCation","mutation_controller/DownloadMutationApplication",
"mutation_controller/accecptApplicationSms","mutation_controller/DeleteMutationApplication","mutation_controller/MutationForm",
"other_registers/EntryDailyIncome","other_registers/SaveDailyINcome","other_registers/inqueryAndSubmit","other_registers/SearchActionOfInquery",
"other_registers/searchCashRegister","other_registers/SearchActionregisterthree","other_registers/SearchActionregisterthree","other_registers/SearchActionregisterthreebyStauts",
"other_registers/registerseventeenOfTohsil","other_registers/DemandRegister","other_registers/miscellenousPaymentRegister","other_registers/registerseventeenOfAcland",
"other_registers/SavedemandRegisterSix","other_registers/SearchAndDelivaryRegisterSix","other_registers/SearchActionOfInqueryRegisterSix","other_registers/RegisterSixDelivery",
"other_registers/registerSixdeliverySuccess","other_registers/SavePaymentRegisterSeven","other_registers/SearchAndDelivaryRegisterSeven",
"other_registers/SearchActionOfInqueryRegisterSeven","other_registers/RegisterSevenDelivery","other_registers/registerSevendeliverySuccess",
"register_control/moujaquery","register_control/getmoujaAndMObile","register_control/AddKhotiyan","register_control/saveKhotiyan","register_control/saveKhotiyanFile",
"register_control/NewAddKhotiyanFile","register_control/FindKhotiyan","register_control/SearchKhotiyan","register_control/Editkhotiyan","register_control/UpdateKhotiyan",
"register_control/Tamil","register_control/createcellfortamil","register_control/EntryTamilFormat","register_control/editTamil","register_control/UpdateTamil",
"register_control/ViewTamil","register_control/Imgdownload","register_control/TamilDownload","register_control/RegisterONe","register_control/Getjolmohol",
"admin/index","admin/singleAdminInfo","admin/updateAdminInfo","admin/successfullyUpdated","admin/GovLandEntry","admin/savegovtLandInfo","admin/GovLandQuery","admin/govtLandInfoQuery",
"admin/EditGovtLand","admin/UpdategovtLandInfo","admin/govtLandInfoQueryByType","admin/allAdmin","admin/CustomSearchGL","admin/showMethod","admin/CustomSearchAction",
"register_nine/Newentry","register_nine/Search","register_nine/viewapplication","register_nine/editapplication","register_nine/UpdateApplication",
"register_nine/Preview","register_nine/SearchForPreview","register_nine/paginationData","case_controller/UpdateCaseLandInfo","case_controller/SaveScratchMap","case_controller/UpdateCaseApplicantInfo"),
"general user" => array("case_controller/quickPendingCaseSearch","case_controller/kharijCase","case_controller/pending", "case_controller/allCase", "case_controller/searchCase", "case_controller/singleCase", "admin/index","case_controller/downloadPendingCase","admin/singleAdminInfo","admin/updateAdminInfo","admin/successfullyUpdated",)
);
public function __construct() {
parent::__construct();
$this->isLoggedIn();
$this->isPermitedToAccess();
}
public function isLoggedIn() {
if ($this->session->userdata('logged_in') === FALSE) {
redirect('login/index');
}
}
//end of the is logged in
public function isPermitedToAccess() {
$userType = $this->session->userdata("type");
$currentUrl = $this->uri->segment(1) . "/" . $this->uri->segment(2);
if (array_search($currentUrl, $this->allowedUrl[$userType]) === FALSE) {
redirect("admin/index");
}
}
}
我尝试将新方法添加到$ allowedUrl变量中。但它没有用。任何人都可以给我任何解决这个问题的想法。我被困在上面了。
答案 0 :(得分:0)
你是否尝试在__construct函数中为$ allowedUrl赋值,我认为它会起作用!