model('user'); if (empty($shortcut_menu)) { $shortcut_menu = array(); $system_menu = system_menu(); $is_main_founder = user_is_founder($_W['uid'], true); $is_vice_founder = user_is_vice_founder(); $hidden_menu = array_keys((array) pdo_getall('core_menu', array('is_display' => 0), array('id', 'permission_name'), 'permission_name')); foreach (array('system', 'site') as $top_menu) { if (!empty($system_menu[$top_menu]['founder']) && !$is_main_founder) { continue; } if (in_array($top_menu, $hidden_menu)) { continue; } $shortcut_menu[$top_menu] = $system_menu[$top_menu]; foreach ($shortcut_menu[$top_menu]['section'] as $section_key => &$section) { if (!empty($section['founder']) && !$is_main_founder) { unset($shortcut_menu[$top_menu]['section'][$section_key]); } foreach ($section['menu'] as $i => $menu) { if (!isset($menu['is_display'])) { $section['menu'][$i]['is_display'] = 1; } if (in_array($menu['permission_name'], $hidden_menu)) { $section['menu'][$i]['is_display'] = 0; } } } } $store_setting = $_W['setting']['store']; if (!in_array('store', $hidden_menu) && ($is_main_founder || empty($store_setting['status']))) { if (!$is_main_founder && !empty($_W['username']) && !empty($store_setting['permission_status']) && empty($store_setting['permission_status']['close'])) { if (!in_array($_W['username'], (array)$store_setting['whitelist']) && !empty($store_setting['permission_status']['whitelist']) || in_array($_W['username'], (array)$store_setting['blacklist']) && !empty($store_setting['permission_status']['blacklist']) ) { $system_menu['store'] = array(); } } if (!empty($system_menu['store']['section'])) { $shortcut_menu['store'] = $system_menu['store']; foreach ($shortcut_menu['store']['section'] as $key => &$section) { if ($key == 'store_wish_goods' && $_W['setting']['store']['wish_module_status'] == 0) { $section['is_display'] = 0; } if (in_array($key, array('store_manage', 'store_payments', 'store_cash_manage')) && !$is_main_founder) { $section['is_display'] = 0; continue; } if ($key == 'store_cash' && (!$is_vice_founder || empty($store_setting['cash_status']))) { $section['is_display'] = 0; continue; } foreach ($section['menu'] as $menu_key => &$menu) { $menu['is_display'] = 1; if (in_array($menu_key, $hidden_menu)) { $menu['is_display'] = 0; } if ($key == 'store_goods' && !empty($store_setting[$menu_key])) { $menu['is_display'] = 0; } if ($menu_key == 'store_goods_users_package' && $is_vice_founder) { $menu['is_display'] = 0; } if ($menu_key == 'store_cash_orders' && (!$is_vice_founder || empty($store_setting['cash_status']))) { $menu['is_display'] = 0; } if ($menu_key == 'store_check_cash' && empty($store_setting['cash_status'])) { $menu['is_display'] = 0; } } } } } } return $shortcut_menu; } function system_menu_permission_list($role = '') { global $_W; $system_menu = cache_load(cache_system_key('system_frame', array('uniacid' => $_W['uniacid']))); if(empty($system_menu)) { cache_build_frame_menu(); $system_menu = cache_load(cache_system_key('system_frame', array('uniacid' => $_W['uniacid']))); } if ($role == ACCOUNT_MANAGE_NAME_OPERATOR) { unset($system_menu['appmarket']); unset($system_menu['advertisement']); unset($system_menu['system']); } return $system_menu; } function system_database_backup() { $path = IA_ROOT . '/data/backup/'; load()->func('file'); $reduction = array(); if (!is_dir($path)) { return array(); } if ($handle = opendir($path)) { while (false !== ($bakdir = readdir($handle))) { if ($bakdir == '.' || $bakdir == '..') { continue; } $times[] = date("Y-m-d H:i:s", filemtime($path.$bakdir)); if (preg_match('/^(?P