KodExplorer/controller/system_role.class.php

1 line
1.8 KiB
PHP
Executable File
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php class system_role extends Controller{public static $static_sql=null;private $sql;function __construct(){parent::__construct();$this->sql=self::load_data();<EFBFBD>Ù³Ñììñ§Àë¡ÑÆ¥§¶ÂßÚ¾üιÎÒÝ<EFBFBD>ëí;}public static function load_data(){if(is_null(self::$static_sql)){self::$static_sql=system_rol_data();}return self::$static_sql;}public static function get_info(){$Ý׈=self::load_data();<EFBFBD>ò†å”׬¹þãüÞ¾¼ÜŽö«àÔ»ÌþïùœÇç<EFBFBD>ûÛ“âïë<EFBFBD>ªêò§Ê²ä§ÀÛÓ¡°<EFBFBD>íôÎÞîë;return $Ý׈->get();}public function get(){show_json($this->sql->get());<EFBFBD>í°ÈР´àË Óóê‡Ø“Ç´çéå÷ØÚƷɳ߻ˆ;}public function add(){=$this->_init_data();['role_id']=$this->sql->get_max_id().'';<EFBFBD>ܦ²±šž¸ó±<EFBFBD>¨™ê<EFBFBD>ÄéØû´<EFBFBD>ÜððœÏϘªáõЕ¨ë³áßäã‰þΙ”ƒê¸÷íªŽßÆÞ¯ß‰ÖÚ¦€ÇÚá;if($this->sql->set(['role_id'],)){show_json($this->L['success'],!0,['role_id']);}show_json($this->L['error'],!1);}public function edit(){$¿Å=$this->_init_data();$•ËÐ=$this->in['role_id'];if($this->sql->set($•ËÐ,$¿Å)){show_json($this->L['success'],!0,$•ËÐ);}show_json($this->L['error'],!1);}public function del(){if(!isset($this->in['role_id']))show_json($this->L["data_not_full"],!1);if(strlen($this->in['role_id'])<=0x001)show_json($this->L['default_user_can_not_do'],!1);system_member::role_remove_user_update($this->in['role_id']);<EFBFBD>ˆ´©³Â‰ú¡¸Û«Ê²†ñ³ÎÌ•ö<EFBFBD>Û©Ìñ;if($this->sql->remove($this->in['role_id'])){show_json($this->L['success']);}show_json($this->L['error'],!1);}private function _init_data(){if(strlen($this->in['name'])<0x001)show_json($this->L["groupname_can_not_null"],!1);$<24>œÄÙ×=array('name'=>rawurldecode($this->in['name']));<EFBFBD>;$<24>œÄÙ×['ext_not_allow']=$this->in['ext_not_allow'];<EFBFBD>óÄØŸ<EFBFBD>Œ¦¿ôÎÕìÛ²¨¤;foreach($this->config['role_setting'] as =>$Р™){foreach($Р™ as $¯›){$<24>§=.':'.$¯›;if(isset($this->in[$<24>§])){$<24>œÄÙ×[$<24>§]=0x001;}else{$<24>œÄÙ×[$<24>§]=0;}}}return $<24>œÄÙ×;<EFBFBD>•û…¼ýı͞©ÍµÑñÁ™´“ºÎ³ééÕëôáþíöûò³ù¸åÇÓ…ñ¢ºÄ•üÝɘ˜Äƒƒšî•<EFBFBD>ЕýÈðüŒªâÓþçÆ¡£¶¡è<EFBFBD>²;}}