Exemple #1
0
        $acc->acc_company = $company;
        $acc->save();
        if ($post['account_type'] == 'db' && $post['account_pwd'] != '') {
            $auth = new AUTH($post['account_id']);
            $auth->setpwd($post['account_pwd']);
        }
        $msg = array('class' => 'success', 'msg' => '帳號修改完成');
    }
    $app->render('_notice.html', $msg);
});
/*
 * 刪除
 */
$app->get('/user_delete/:id', function ($id) use($app) {
    $app->applyHook('account.check_sysadmin');
    $type_words = AUTH::get_support_auth_type();
    $tpl = array('breadcrumb_title' => '刪除帳號', 'type_words' => $type_words);
    $user = ORM::for_table('account')->where('acc_name', $id)->find_one();
    $tpl['acc_name'] = $user->acc_name;
    $tpl['acc_auth_type'] = $user->acc_auth_type;
    $info = unserialize($user->acc_company);
    if (is_array($info)) {
        while ($k = key($info)) {
            $tpl['info_' . $k] = $info[$k];
            next($info);
        }
    }
    $app->render('user_mgr_delete.html', $tpl);
});
$app->post('/ajax_user_delete', function () use($app) {
    $app->applyHook('account.check_sysadmin');