当前位置: 首页>>代码示例>>PHP>>正文


PHP MY_Controller::mask_characters方法代码示例

本文整理汇总了PHP中MY_Controller::mask_characters方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Controller::mask_characters方法的具体用法?PHP MY_Controller::mask_characters怎么用?PHP MY_Controller::mask_characters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MY_Controller的用法示例。


在下文中一共展示了MY_Controller::mask_characters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit

 function edit($user_id = 0)
 {
     if ($user_id !== 0) {
         $data = array();
         $this->load->helper('form');
         if ($this->input->post()) {
             $this->load->library('form_validation');
             $this->form_validation->set_rules('groups_id', 'User Group', 'trim|required');
             $this->form_validation->set_rules('user_login', 'Username', 'trim|required|min_length[5]|max_length[20]|edit_unique[users.user_login.user_id.' . $user_id . ']');
             $this->form_validation->set_rules('user_email', 'Email', 'trim|required|valid_email|edit_unique[users.user_email.user_id.' . $user_id . ']');
             $this->form_validation->set_rules('user_first_name', 'First Name', 'trim|required');
             $this->form_validation->set_rules('user_last_name', 'Last Name', 'trim');
             $this->form_validation->set_rules('user_status', 'User Status', 'trim|required');
             $this->form_validation->set_rules('notify_user', 'Email Notification', 'trim');
             $this->form_validation->set_rules('captcha_image', 'Image Text', 'trim|required|callback_validate_captcha');
             $this->form_validation->set_error_delimiters('<span class="help-block">', '</span>');
             if ($this->form_validation->run()) {
                 $time_now = date('Y-m-d H:i:s');
                 $user_details_array = array('groups_id' => $this->input->post('groups_id'), 'user_first_name' => $this->input->post('user_first_name'), 'user_last_name' => $this->input->post('user_last_name'), 'user_email' => $this->input->post('user_email'), 'user_login' => $this->input->post('user_login'), 'user_security_hash' => md5($time_now . $this->input->post('user_login')), 'user_status' => $this->input->post('user_status'), 'user_modified' => $time_now);
                 if ($this->User_model->edit($user_id, $user_details_array)) {
                     if ($this->input->post('notify_user') && $this->input->post('notify_user') === '1') {
                         $this->load->helper('string');
                         $email_hash = random_string('unique');
                         $email_body = parent::add_email_tracking($email_hash, $this->render_view(array('email_hash' => $email_hash, 'user_first_name' => $this->input->post('user_first_name'), 'user_last_name' => $this->input->post('user_last_name'), 'user_login' => $this->input->post('user_login'), 'user_email' => $this->input->post('user_email'), 'login_link' => base_url() . 'auth/login'), 'emails', 'emails/users_edit', TRUE));
                         if (parent::send_email($email_hash, 'Account Details Modified', $this->config->item('email_from'), $user_details_array['user_email'], $email_body)) {
                             $data['success'] = 'We have sent account detailed instructions on ' . parent::mask_characters($user_details_array['user_email']);
                         } else {
                             $data['error'] = 'Error Sending Email !!!';
                         }
                     } else {
                         $data['success'] = 'Account Edited Successfully !!!';
                     }
                 } else {
                     $data['error'] = 'Error Editing User Account !!!';
                 }
             } else {
                 $data['error'] = 'Error Editing User Account !!!';
             }
         }
         $this->load->model('Group_model');
         $data['groups_array'] = $this->generate_dropdown_array($this->Group_model->get_all_active_groups(), 'group_id', 'group_name', 'Select User Group');
         $data['user_array'] = $this->User_model->get_user_by_id($user_id);
         $data['captcha_image'] = parent::create_captcha();
         $this->render_view($data);
     } else {
         redirect('users');
     }
 }
开发者ID:Erginus,项目名称:demo,代码行数:48,代码来源:users.php

示例2: array

 function forgot_password()
 {
     $data = array();
     $this->load->helper('form');
     if ($this->input->post()) {
         $this->load->library('form_validation');
         $this->form_validation->set_rules('user_detail', 'Username OR Email Address', 'trim|required|min_length[5]');
         $this->form_validation->set_rules('captcha_image', 'Image Text', 'trim|required|callback_validate_captcha');
         $this->form_validation->set_error_delimiters('<span class="help-block">', '</span>');
         if ($this->form_validation->run()) {
             $this->load->model('Auth_model');
             $user_details_array = $this->Auth_model->get_user_by_username_or_email($this->input->post('user_detail'));
             if (count($user_details_array) > 0) {
                 if ($user_details_array['user_status'] !== '-1') {
                     $this->load->helper('string');
                     $email_hash = random_string('unique');
                     $email_body = parent::add_email_tracking($email_hash, $this->render_view(array('email_hash' => $email_hash, 'user_first_name' => $user_details_array['user_first_name'], 'user_last_name' => $user_details_array['user_last_name'], 'password_reset_link' => base_url() . 'auth/reset-password/' . $user_details_array['user_security_hash']), 'emails', 'emails/forgot_password', TRUE));
                     if (parent::send_email($email_hash, 'Forgot Password Notification', $this->config->item('email_from'), $user_details_array['user_email'], $email_body)) {
                         $data['success'] = 'We have sent password reset instructions on ' . parent::mask_characters($user_details_array['user_email']);
                     } else {
                         $data['error'] = 'Error Sending Email !!!';
                     }
                 } else {
                     $data['error'] = 'Account Suspended !!!';
                 }
             } else {
                 $data['error'] = 'Invalid User Details !!!';
             }
         } else {
             $data['error'] = 'Error Sending Email !!!';
         }
     }
     $data['captcha_image'] = parent::create_captcha();
     $this->render_view($data, 'auth');
 }
开发者ID:Erginus,项目名称:demo,代码行数:35,代码来源:auth.php


注:本文中的MY_Controller::mask_characters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。