Beispiel #1
0
     break;
 case 'delete':
     if ($do->delete_admin($username)) {
         dmsg('撤销成功', $this_forward);
     }
     msg($do->errmsg);
     break;
 case 'right':
     if (!$userid) {
         msg();
     }
     $user = $do->get_one($userid, 0);
     if ($submit) {
         $right[0]['action'] = $right[0]['action'] ? implode('|', $right[0]['action']) : '';
         $right[0]['catid'] = $right[0]['catid'] ? implode('|', $right[0]['catid']) : '';
         if ($do->update($userid, $right, $user['admin'])) {
             dmsg('更新成功', '?file=' . $file . '&action=right&userid=' . $userid);
         }
         msg($do->errmsg);
     } else {
         $username = $user['username'];
         $drights = $do->get_right($userid);
         $dmenus = $do->get_menu($userid);
         include tpl('admin_right');
     }
     break;
 case 'ajax':
     @(include DT_ROOT . '/' . ($mid == 1 ? 'admin' : 'module/' . $MODULE[$mid]['module'] . '/admin') . '/config.inc.php');
     if (isset($fi)) {
         if (isset($RT) && isset($RT['action'][$fi])) {
             $action_select = '<select name="right[0][action][]" size="2" multiple  style="height:200px;width:150px;"><option value="">选择动作[按Ctrl键多选]</option>';
     $admin = new admin();
     $rows = $admin->getAdminInfo($id);
     $currency = $rows[0]['currency'];
     $accesslevel = $rows[0]['accesslevel'];
     $app->view->setData('currencies', $admin->EditAllCurrency($currency));
     $app->view->setData('user_permission', $admin->EditUserPermission($accesslevel));
     $app->view->setData('rows', $rows);
     $app->view->setData('form_action', "dashboard/admin/editconfirm");
     $app->view->setData('page_title', "Edit Admin");
     $app->render(new u('admin.edit'));
 });
 $app->post('/editconfirm/', function () use($app) {
     $POST = $app->request()->post();
     $admin = new admin();
     $admin->form_post_values = $POST;
     $admin->update();
     if ($admin->fails()) {
         $app->view->setData('error', "1");
         $app->view->setData('msg', $admin->getError());
         $app->render(new u('msg'));
     } else {
         $app->view->setData('success', "1");
         $app->view->setData('msg', "Successfully User Updated");
         $app->render(new u('msg'));
     }
 });
 /***********************************SEARCH*************************************************/
 $app->post('/search', function () use($app) {
     $POST = $app->request()->post();
     $SearchDb = new SearchDb('admininfo', 'username', $POST);
     $app->view->setData('rows', $SearchDb->getSearchResult());
Beispiel #3
0
<?php

/*
	[Destoon B2B System] Copyright (c) 2008-2015 www.destoon.com
	This is NOT a freeware, use is subject to license.txt
*/
defined('DT_ADMIN') or exit('Access Denied');
require DT_ROOT . '/admin/admin.class.php';
$do = new admin();
$menus = array(array('我的面板', '?file=' . $file));
if ($submit) {
    if ($do->update($_userid, $right, $_admin)) {
        dmsg('更新成功', '?file=' . $file . '&update=1');
    }
    msg($do->errmsg);
} else {
    $dmenus = $do->get_menu($_userid);
    include tpl('mymenu');
}