本文整理汇总了PHP中UserModel::is_authorize方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::is_authorize方法的具体用法?PHP UserModel::is_authorize怎么用?PHP UserModel::is_authorize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel::is_authorize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_EMPLOYEE) && !UserModel::is_authorize(UserModel::$TYPE_COMPANY)) {
redirect(base_url());
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_COMPANY)) {
redirect(base_url());
}
$this->load->model("ApplicationModel", "application_model");
}
示例3: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_EMPLOYEE)) {
redirect(base_url());
}
$this->load->library("form_validation");
}
示例4: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) {
redirect(base_url());
}
$this->load->model("CompanySizeModel", "size_model");
$this->load->library('form_validation');
}
示例5: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_COMPANY)) {
redirect(base_url());
}
$this->load->model("AchievementModel", "achievement_model");
$this->load->library('form_validation');
}
示例6: index
public function index()
{
if (UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) {
redirect("dashboard");
} else {
$data = array();
$data["page"] = "Authentication";
$this->load->view("administrator/pages/login", $data);
}
}
示例7: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_COMPANY)) {
redirect(base_url());
}
$this->load->model("CompanyTaskModel", "task_model");
$this->load->model("UploaderModel", "uploader_model");
$this->load->library('form_validation');
}
示例8: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_COMPANY)) {
redirect(base_url());
}
$this->load->model("PeopleModel", "people_model");
$this->load->model("PeoplePhotoModel", "people_photo_model");
$this->load->model("PeopleSectionModel", "section_model");
$this->load->model("UploaderModel", "uploader_model");
$this->load->library('form_validation');
}
示例9: delete
public function delete($id)
{
if (UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) {
$result = $this->employee_model->delete($id);
if ($result) {
$this->alert->warning_alert("Employee has been deleted successfully");
} else {
$this->alert->danger_alert("Something is getting wrong");
}
redirect("employee");
} else {
redirect("show404");
}
}
示例10: index
public function index()
{
if (UserModel::is_authorize(UserModel::$TYPE_EMPLOYEE)) {
$this->load->model("EmployeeActivityModel", "activity_model");
$this->load->model("ApplicationModel", "application_model");
$this->load->model("BookmarkModel", "bookmark_model");
$this->load->model("FollowerModel", "follower_model");
$employee = $this->session->userdata(UserModel::$SESSION_ID);
$data = array();
$data["page"] = "Employee Dashboard";
$data["menu"] = "dashboard";
$data["content"] = "website/pages/employee/dashboard";
$data["chart"] = $this->application_model->get_statistic_range_applied($employee);
$data["statistic_applied"] = $this->application_model->get_statistic_applied($employee);
$data["statistic_saved"] = $this->bookmark_model->get_statistic_saved($employee);
$data["statistic_following"] = $this->follower_model->get_statistic_following($employee);
$data["activities"] = $this->activity_model->read_by_activity($employee);
$this->load->view("website/template", $data);
} else {
if (UserModel::is_authorize(UserModel::$TYPE_COMPANY)) {
$this->load->model("CompanyActivityModel", "activity_model");
$this->load->model("ApplicationModel", "application_model");
$this->load->model("JobModel", "job_model");
$this->load->model("FollowerModel", "follower_model");
$company = $this->session->userdata(UserModel::$SESSION_ID);
$data = array();
$data["page"] = "Company Dashboard";
$data["menu"] = "dashboard";
$data["content"] = "website/pages/company/dashboard";
$data["chart"] = $this->application_model->get_statistic_range_applicant($company);
$data["statistic_applicant"] = $this->application_model->get_statistic_applicant($company);
$data["statistic_job"] = $this->job_model->get_statistic_list($company);
$data["statistic_follower"] = $this->follower_model->get_statistic_follower($company);
$data["activities"] = $this->activity_model->read_by_activity($company);
$this->load->view("website/template", $data);
} else {
if (UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) {
$this->load->model("VisitorModel", "visitor_model");
$data = array();
$data["page"] = "Dashboard";
$data["menu"] = "dashboard";
$data["content"] = "administrator/pages/dashboard";
$data["visitor"] = $this->visitor_model->read_chart_statistic();
$this->load->view("administrator/template", $data);
} else {
redirect(base_url());
}
}
}
}
示例11: delete
public function delete($id)
{
if (UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) {
$result = $this->comment_model->delete($id);
if ($result) {
$this->alert->success_alert("Comment has been removed successfully");
} else {
$this->alert->danger_aler("Something is getting wrong");
}
redirect("threads/comments");
} else {
redirect("error404");
}
}
示例12: __construct
public function __construct()
{
parent::__construct();
if (!UserModel::is_authorize(UserModel::$TYPE_COMPANY)) {
redirect(base_url());
}
$this->load->model("CompanyModel", "company_model");
$this->load->model("CompanyFieldModel", "company_field_model");
$this->load->model("CompanySizeModel", "company_size_model");
$this->load->model("CountryModel", "country_model");
$this->load->model("StateModel", "state_model");
$this->load->model("CityModel", "city_model");
$this->load->model("UploaderModel", "uploader_model");
$this->load->model("CompanySectionModel", "section_model");
$this->load->model("CompanyTaskModel", "task_model");
$this->load->model("AchievementModel", "achievement_model");
$this->load->library('form_validation');
}
示例13: archive
public function archive($destination, $id)
{
if (UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) {
$state = "IMPORTANT";
if ($destination == "important") {
$state = "GENERAL";
}
$data = array("fdb_type" => $state);
$result = $this->feedback_model->update($data, $id);
if ($result) {
$this->alert->success_alert("Feedback has been moved as important record");
} else {
$this->alert->error_alert("Something is getting wrong");
}
redirect("feedback/{$destination}");
} else {
redirect("error404");
}
}
示例14: delete_all
public function delete_all()
{
if (UserModel::is_authorize(UserModel::$TYPE_ADMINISTRATOR)) {
$collectid = $this->input->post("checkid");
$result = true;
foreach ($collectid as $id) {
$delete = $this->job_model->delete($id);
if (!$delete) {
$result = false;
}
}
if ($result) {
$this->alert->success_alert("Selected Jobs has been removed successfully");
} else {
$this->alert->danger_alert("Something is getting wrong");
}
redirect("jobs");
} else {
redirect("administrator");
}
}
示例15: delete
public function delete()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (UserModel::is_authorize(UserModel::$TYPE_EMPLOYEE)) {
$employee_id = $this->session->userdata(UserModel::$SESSION_ID);
$job_id = $this->input->post("job_id");
$result = $this->bookmark_model->delete($job_id, $employee_id);
if ($result) {
echo "success";
return;
}
echo "failed";
return;
} else {
echo "restrict";
return;
}
} else {
redirect("error404");
}
}