Esempio n. 1
0
        if ($value != $appid) {
            $applist[] = $value;
        }
    }
    C::t('app_user')->delete_by_uid_appid($_G['uid'], $appid);
    if (C::t('user_field')->update($_G['uid'], array('applist' => implode(',', $applist)))) {
        echo json_encode($return);
        exit;
    } else {
        echo json_encode(array('error' => '删除失败'));
        exit;
    }
} elseif ($do == 'rename') {
    $path = dzzdecode($_GET['path']);
    $text = io_dzz::name_filter(diconv(str_replace('...', '', getstr($_POST['text'], 80)), 'UTF-8'));
    $ret = IO::rename($path, $text);
    exit(json_encode($ret));
} elseif ($do == 'NewIco') {
    //error_reporting(E_ALL);
    $type = trim($_GET['type']);
    $path = trim($_GET['path']);
    $filename = '';
    $bz = getBzByPath($path);
    switch ($type) {
        case 'NewTxt':
            $filename = '新建文本文档.txt';
            if (!perm_check::checkperm_Container($path, 'newtype', $bz)) {
                exit(json_encode(array('error' => '没有权限')));
            }
            break;
        case 'NewDzzDoc':
Esempio n. 2
0
 if (submitcheck('propertysubmit')) {
     $return = array();
     if (!$icoarr['bz']) {
         $name = io_dzz::name_filter(trim($_GET['name']));
         if ($icoarr['name'] != $name || $icoarr['type'] == 'folder' && $icoarr['gid'] > 0) {
             C::t('icos')->update_by_name($icoid, $name);
             if ($icoarr['type'] == 'folder' && $icoarr['gid'] > 0 && (C::t('organization_admin')->ismoderator_by_uid_orgid($icoarr['gid'], $_G['uid']) || $_G['adminid'] == 1)) {
                 C::t('folder')->update($icoarr['fid'], array('perm' => intval($_GET['perm'])));
             }
             $return = C::t('icos')->fetch_by_icoid($icoid);
             $return['msg'] = 'success';
         }
     } else {
         $name = io_dzz::name_filter(trim($_GET['name']));
         if ($icoarr['name'] != $name) {
             $return = IO::rename($icoid, $name);
             if (empty($return['error'])) {
                 if ($return['type'] == 'folder') {
                     $return['folderdata'] = IO::getFolderByIcosdata($return);
                 }
                 $return['msg'] = 'success';
                 $return['oicoid'] = $icoarr['icoid'];
             }
         }
     }
     showmessage('do_success', $refer . '', $return, array());
 } else {
     $info = array();
     $info['icon'] = $icoarr['img'] ? $icoarr['img'] : geticonfromext($icoarr['ext'], $icoarr['type']);
     $info['name'] = getstr($icoarr['name'], 30);
     $info['ftype'] = $icoarr['ftype'];