Sfoglia il codice sorgente

修改color的权限问题

lvhao 1 mese fa
parent
commit
ae0ac0a7e4
2 ha cambiato i file con 21 aggiunte e 3 eliminazioni
  1. 16 2
      core/CoreApp/controllers/Color.php
  2. 5 1
      template/erp/color_edit.html

+ 16 - 2
core/CoreApp/controllers/Color.php

@@ -189,6 +189,14 @@ class Color extends Start_Controller {
 		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
 		    echo json_encode($rows);exit;
 		}
+
+		if (empty($_SESSION['api'])) {
+			$userid = 0;
+		}else{
+			$user = $this->user->get_api($_SESSION['api']);
+			$userid = $user['id'];
+		}
+		$this->data['userid'] = $userid;
         $this->_Template('color',$this->data);
 	}
 
@@ -225,7 +233,14 @@ class Color extends Start_Controller {
 	
 	public function _edit($arg_array)
 	{
-		$user = $this->user->get_api($_SESSION['api']);
+		if (empty($_SESSION['api'])) {
+			$userid = 0;
+		}else{
+			$user = $this->user->get_api($_SESSION['api']);
+			$userid = $user['id'];
+		}
+		$this->data['user_id'] = $userid;
+		$this->data['userid'] = $user['userid'];
 		$post = $this->input->post(NULL, TRUE);
 		if(isset($post['id']))
 		{
@@ -283,7 +298,6 @@ class Color extends Start_Controller {
 				$img = '';
 			}
 		}
-		$this->data['userid'] = $user['userid'];
 		$color['img'] = $img;
 		$this->data['color'] = $color;
 		$this->_Template('color_edit',$this->data);

+ 5 - 1
template/erp/color_edit.html

@@ -71,7 +71,11 @@
 <div style="clear:both;"></div>
 </ul>
 <input type="hidden" name="id" value="{$color['id']}" />
-<div class="button"><font class="datasave">提 交</font> <font class="fh">关 闭</font></div>
+<div class="button">
+    {if ($user_id == 10)}
+    <font class="datasave">提 交</font> 
+    {/if}
+    <font class="fh">关 闭</font></div>
 </div>
 <div style="display:none;">
 <input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">