1 line
1.8 KiB
PHP
Executable File
1 line
1.8 KiB
PHP
Executable File
<?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>²‚™;}} |