sms5에서 인증체크 함수 따로 추가

This commit is contained in:
thisgun
2014-04-16 14:06:58 +09:00
parent 344a61d5a5
commit f5583edec7
5 changed files with 37 additions and 5 deletions

View File

@ -10,7 +10,9 @@ if( !function_exists('json_encode') ) {
}
}
auth_check($auth[$sub_menu], "r");
if( $auth_check = ajax_auth_check($auth[$sub_menu], "r") ){
die("{\"error\":\"$auth_check\"}");
}
$err = '';
$arr_ajax_msg = array();

View File

@ -10,9 +10,11 @@ if( !function_exists('json_encode') ) {
}
}
$page_size = 6;
if( $auth_check = ajax_auth_check($auth[$sub_menu], "r") ){
die("{\"error\":\"$auth_check\"}");
}
auth_check($auth[$sub_menu], "r");
$page_size = 6;
if (!$page) $page = 1;

View File

@ -10,7 +10,9 @@ if( !function_exists('json_encode') ) {
}
}
auth_check($auth[$sub_menu], "r");
if( $auth_check = ajax_auth_check($auth[$sub_menu], "r") ){
die("{\"error\":\"$auth_check\"}");
}
$lev = array();

View File

@ -5,7 +5,9 @@ include_once("./_common.php");
$page_size = 10;
$colspan = 5;
auth_check($auth[$sub_menu], "r");
if( $auth_check = ajax_auth_check($auth[$sub_menu], "r") ){
die("{\"error\":\"$auth_check\"}");
}
$g5['title'] = "휴대폰번호 관리";

View File

@ -60,6 +60,30 @@ function sms5_sub_paging($write_pages, $cur_page, $total_page, $url, $add="", $s
return "";
}
// 권한 검사
function ajax_auth_check($auth, $attr)
{
global $is_admin;
if ($is_admin == 'super') return;
if (!trim($auth))
return '이 메뉴에는 접근 권한이 없습니다.\\n\\n접근 권한은 최고관리자만 부여할 수 있습니다.';
$attr = strtolower($attr);
if (!strstr($auth, $attr)) {
if ($attr == 'r')
return '읽을 권한이 없습니다.';
else if ($attr == 'w')
return '입력, 추가, 생성, 수정 권한이 없습니다.';
else if ($attr == 'd')
return '삭제 권한이 없습니다.';
else
return '속성이 잘못 되었습니다.';
}
}
if ( ! function_exists('array_overlap')) {
function array_overlap($arr, $val) {
for ($i=0, $m=count($arr); $i<$m; $i++) {