0

ログインページにリダイレクトするビジネスコントローラーにアクセスしようとするたびに、codeigniterでアプリケーションを開発しています。これは URL http://www.atms.com.au/index.php/businessです。ログインのためにセッション変数のチェックが行われる場所が見つかりません これはコントローラーです

<?php
class Business extends Controller
{
    function Business()
    {
        parent::Controller();
        $this->load->model('members_model');
    }

    function index()
    {
        $this->session->set_userdata( $this->session_name, true) ;
        $this->session->set_userdata( "atms_member_login_id", $this->login_id);
        if($this->input->post('submit_business_info'))
        {           
            $business_name = $data['business_name'] = $this->input->post('business_name');
            $data['business_description'] = $this->input->post('description');
            $data['status'] = '1';

            if($_FILES['business_logo']['name'])
            {
                $prev_image = $this->input->post('prev_image');
                $logo = upload_image('business_logo', $this->config->item('business_logo_root'), array('dest' => $this->config->item('business_logo_root'), 'size' => array('w' => 127, 'h' => 127), 'ratio' => false), $prev_image);

                if($logo)
                    $data['business_logo'] = $logo;
                else
                    $data['business_logo'] = $prev_image;
            }

            $this->general_db_model->update('atms_members_info_tmp', $data, 'member_id = '.member_id());

            $member_detail = $this->general_db_model->getMemberDetail('atms_members_info', member_id());
        //debug_array($member_detail);
            $clinics = $this->input->post('clinic');

            if(!empty($clinics))
            {

                foreach($clinics as $key=>$clinic)
                {

                    if(array_values_exist($clinic))
                    {       

                        if($clinic_id = $clinic['clinic_id'])
                        {

                            unset($clinic['clinic_id']);
                            $this->general_db_model->update('atms_members_clinic_info_tmp', $clinic, 'clinic_id = '.$clinic_id);

                            $data['provider_no'] = 'updated';
                            $this->general_db_model->update('atms_members_info_tmp', $data, 'member_id = '.member_id());

                                        }
                                    else
                                {
                                $clinic['member_id'] = member_id();
                            $this->general_db_model->insert('atms_members_clinic_info_tmp', $clinic);
                            $data['provider_no'] = 'updated';
                            $this->general_db_model->update('atms_members_info_tmp', $data, 'member_id = '.member_id());

                        }
                    }
                }

                    $link = site_url()."/admin/members/update_details/".$member_detail->id;
                    $message = '';
                    $message.= 'Dear '.$business_name.',<br/><br/>';
                    $message.= $business_name.' had update business listing. So please approve it.<br/>';   
                    $message.= " Link: <a href='".$link."' > Update Link</a><br/>";             
                    $message.= 'Thank You.<br/>';                               
                    $subject = "Approve Update business listing.";

                    //$to = $this->settings->item('admin_email');
                    $to = $this->settings->item('admin_email');
                    $from =$member_detail->email;
                    //die($message);
                    $header = config_item('project_title');     

                    $this->my_library->send_email($to , $subject, $message, $header, $from);

            }

            $this->session->set_flashdata('success_message', 'Your business details successfully updated. Note: your updates must be approved by the administrator before displaying on the site.');
            redirect(current_url());
            die();
        }


        $data['info'] = $this->members_model->get_member_details(member_id());
        $data['clinics'] = $this->members_model->get_member_clinics(member_id());       
        $this->load->view('site/member/business_v', $data);
    }
}
?>

そしてこれがビューです

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php $this->load->view('site/inc/head');?>
</head>
<body>
<div id="wrapper">
  <div id="headerWrapper">
    <div id="header">
      <div class="top">
        <?php $this->load->view('site/inc/header');?>
      </div>
      <div id="menu">
        <?php $this->load->view('site/inc/menu');?>
      </div>
      <div id="bannerIn" class="">
        <h1>Update My Details</h1>
      </div>
    </div>
  </div>
  <!-- end #header -->
  <div id="pageWrapper">
    <div id="page" class="clf">
      <div id="content">
        <div class="wideForm">
        <?php 
            global_message();
        ?>
        <form method="post" enctype="multipart/form-data" id="businessForm" name="businessForm">
        <ul class="clf">
            <li>
              <label>Business Name</label>
              <div class="inpWrapwide">
                <input type="text" class="text" name="business_name" id="business_name" value="<?php echo $info->business_name;?>" />
              </div>
            </li>
            <li>
              <label>Add Logo</label>

                <div class="inpWrap file">
                    <input type="file" name="business_logo" id="addlogo" value="<?php echo $info->business_logo;?>" />
                    <input type="hidden" name="prev_image" value="<?php echo $info->business_logo;?>" />

                </div>
                <div style="padding:5px;"><em><?php echo $info->business_logo;?></em></div>
            </li>
            <li>
              <label>Description</label>
              <div class="txtWrap">
                <textarea name="description" rows="4" cols="60"><?php echo $info->business_description;?></textarea>
              </div>
            </li>
            <?php 
            $count = 1;
            if(count($clinics) > 0) : 
                    foreach($clinics as $key=>$clinic):
            ?>
            <div id="clinic_<?php echo $count;?>">
                <li>
                    <h3 style="float:left;">Clinic <?php echo $key+1;?></h3>
                    <input type="hidden" name="clinic[<?php echo $count;?>][clinic_id]" value="<?php echo $clinic->clinic_id;?>" />
                    <span style="padding-left:10px;"><a href="javascript:;" onclick="removeClinic(<?php echo $count;?>, <?php echo $clinic->clinic_id;?>);" class="remove_clinic"><img src="<?php echo config_item('site_images');?>close.gif" /></a></span>
                </li>
                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>Address 1</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_address_1]" value="<?php echo $clinic->clinic_address_1;?>" />                
                    </div>
                </dd>
                <dd class="lastItem">

                    <label>Address 2</label>
                   <div class="inpWrap">
            <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_address_2]" value="<?php echo $clinic->clinic_address_2;?>" />                                        
                   </div>
                </dd></dl>
                </li>
                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>Suburb</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_suburb]" value="<?php echo $clinic->clinic_suburb;?>" />                
                    </div>
                </dd>
                <dd class="lastItem">
                    <label>State</label>

                     <?php echo select_states('clinic['.$count.'][clinic_state_id]', $clinic->clinic_state_id);?>                                       

                </dd></dl>
                </li>

                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>Postcode</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_postcode]" value="<?php echo $clinic->clinic_postcode;?>" />                
                    </div>
                </dd>
                <dd class="lastItem">
                    <label>Phone</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_telephone]" value="<?php echo $clinic->clinic_telephone;?>" />                
                    </div>
                </dd></dl>
                </li>
                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>Mobile</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_mobile]" value="<?php echo $clinic->clinic_mobile;?>" />                
                    </div>
                </dd>
                <dd class="lastItem">
                    <label>Email</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_email]" value="<?php echo $clinic->clinic_email;?>" />                
                    </div>
                </dd></dl>
                <dl class="clf">            
                <dd>
                    <label>Website</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_website]" value="<?php echo $clinic->clinic_website;?>" />                
                    </div>
                </dd>
                </dl>
                </li>
            </div>
            <?php $count++; endforeach; ?>    
            <?php else: 
            ?>
            <div>
                <li>
                    <h3>Clinic 1</h3>
                </li>
                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>City</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_address_1]" value="" />                
                    </div>
                </dd>
                <dd class="lastItem">
                    <label>State</label>
                    <div class="inpWrap">
                        <?php echo select_states('clinic['.$count.'][clinic_state_id]');?>

                    </div>
                </dd></dl>
                </li>
                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>Postcode</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_postcode]" value="" />                
                    </div>
                </dd>
                <dd class="lastItem">
                    <label>Phone</label>
                    <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_telephone]" value="" /> 
                </dd></dl>
                </li>
                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>Mobile</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_mobile]" value="" />                
                    </div>
                </dd>
                <dd class="lastItem">
                    <label>Email</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_email]" value="" />                
                    </div>
                </dd></dl>
                </li>
                <li class="split">
                <dl class="clf">            
                <dd>
                    <label>Website</label>
                    <div class="inpWrap">
                        <input type="text" class="text" name="clinic[<?php echo $count;?>][clinic_website]" value="" />                
                    </div>
                </dd>
                </dl>
                </li>
            </div>  
            <?php $count++;?>  
            <?php endif; ?>

            <div id="new_clinics">
                <!--appends new clinics here-->
            </div>
          </ul>

           <input type="button" class="add_clinic" value="Add more clinic" name="add_clinic" />
           <div class="buttons clf">
                <input type="button" class="cancel" value="cancel" onclick="window.location = '<?php echo current_url();?>';" />
                <input type="submit" class="update" value="update" name="submit_business_info" />
           </div>
        </form>
      </div>
      </div>
      <!-- end #content -->
      <div id="sidebar">
        <?php $this->load->view('site/inc/login_sidebar');?>
      </div>
      <!-- end #sidebar --> 

    </div>
  </div>
  <!-- end #page --> 
</div>
<div id="footerWrapper">
  <div id="footer">
    <?php $this->load->view('site/inc/footer');?>
  </div>
</div>
<!-- end #footer --> 


<textarea style="display:none;" id="template">
<div class="transform" id="clinic_{0}">
    <li>
        <h3 style="float:left;">Clinic {0}</h3>
        <span style="padding-left:10px;"><a href="javascript:;" onclick="removeClinic({0});" class="remove_clinic"><img src="<?php echo config_item('site_images');?>close.gif" /></a></span>
    </li>
    <li class="split">
    <dl class="clf">            
    <dd>
        <label>City</label>
        <div class="inpWrap">
            <input type="text" class="text" name="clinic[{0}][clinic_address_1]" value="" />                
        </div>
    </dd>
    <dd class="lastItem">
        <label>State</label>
        <div class="inpWrap">
           <?php echo select_states('clinic[{0}][clinic_state_id]');?>               
        </div>
    </dd></dl>
    </li>
    <li class="split">
    <dl class="clf">            
    <dd>
        <label>Postcode</label>
        <div class="inpWrap">
            <input type="text" class="text" name="clinic[{0}][clinic_postcode]" value="" />                
        </div>
    </dd>
    <dd class="lastItem">
        <label>Phone</label>
        <div class="inpWrap">
       <input type="text" class="text" name="clinic[{0}][clinic_telephone]" value="" /> 
       </div>         
    </dd></dl>
    </li>
    <li class="split">
    <dl class="clf">            
    <dd>
        <label>Mobile</label>
        <div class="inpWrap">
            <input type="text" class="text" name="clinic[{0}][clinic_mobile]" value="" />                
        </div>
    </dd>
    <dd class="lastItem">
        <label>Email</label>
        <div class="inpWrap">
            <input type="text" class="text" name="clinic[{0}][clinic_email]" value="" />                
        </div>
    </dd></dl>
    </li>
     <li class="split">
    <dl class="clf">            
    <dd>
        <label>Website</label>
        <div class="inpWrap">
            <input type="text" class="text" name="clinic[{0}][clinic_website]" value="" />                
        </div>
    </dd>
    </dl>
    </li>
</textarea>


<script type="text/javascript">

jQuery(document).ready(function(){
    jQuery('.bannerLinks a').wrapInner('<span></span>');
     $("input[type=file]").filestyle({ 
     image: "<?php echo config_item('site_images');?>browse.gif",
     imageheight : 22,
     imagewidth : 68,
     width : 250
 });
 jQuery('.file div').hover(function(){
     //var _b = jQuery(this).attr("background");
     //jQuery(this).css("background","<?php echo config_item('site_images');?>browse_h.gif");
     }, function(){
         //jQuery(this).css("background","<?php echo config_item('site_images');?>browse.gif");
     });

    $("#businessForm").validate();  

    var template = jQuery.format($("#template").val());
    function addClinic() {
        $(template(i++)).appendTo("div#new_clinics");
        $('div.transform').jqTransform({imgPath:'<?php echo config_item('site_asset');?>jqtransform/img/'});
    }

    var i = <?php echo $count;?>;

    $(".add_clinic").click(addClinic);
});

function removeClinic(index, cid)
{
    if(cid)
    {
        if(confirm('Are You Sure?'))
        {
            $.post('<?php echo admin_url('members/remove_clinic_tmp');?>', {clinic_id : cid}, function(data){});
        }
        else
            return false;
    }

    $('div#clinic_'+index).remove();

}

</script>
</body>
</html>

ログインチェックが行われる場所を見つけるのにイライラします。誰でも私を助けることができますありがとう

4

1 に答える 1

3

私の提案は、アプリケーション/コアのメイン コントローラーを調べてみることです。たぶん、コントローラークラスがすぐに拡張されます。しかも、言われている通り、旧式のコンストラクタをPHP 5+の__construct()にコンバート。アプリケーションにいくつかのブレークポイントを設定して、どこに行き、どこに行かないかを確認してください。コアコントローラーへの拡張に関連するはずだと思います。

于 2012-11-19T22:53:06.763 に答える