<?php /* * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ if (!defined('IN_DZZ')) { exit('Access Denied'); } $code = rawurldecode($_GET['code']); $redirecturl = dzzdecode(rawurldecode($_GET['url'])); if (empty($redirecturl)) { $redirecturl = dzzdecode(rawurldecode($_GET['url']), '', 4); } $weObj = new qyWechat(array('token' => getglobal('setting/token_0'), 'appid' => getglobal('setting/CorpID'), 'appsecret' => getglobal('setting/CorpSecret'), 'agentid' => 0, 'encodingaeskey' => getglobal('setting/encodingaeskey_0'), 'debug' => true)); $userid = $weObj->getUserId($code, 0); //生成登录cookie if ($user = C::t('user')->fetch(str_replace('dzz-', '', $userid))) { dsetcookie('auth', authcode("{$user['password']}\t{$user['uid']}", 'ENCODE'), 365 * 24 * 60 * 60, 1, true); } @header("Location: {$redirecturl}"); exit;
if ($username) { $sql .= " and username=%s"; $param[] = $username; } if ($uid) { $sql .= " and uid=%d"; $param[] = $uid; } $list = array(); if ($count = DB::result_first("SELECT COUNT(*) FROM %t WHERE {$sql}", $param)) { foreach (DB::fetch_all("SELECT * FROM %t WHERE {$sql} {$orderby} limit {$start},{$perpage}", $param) as $value) { if ($value['dateline']) { $value['fdateline'] = dgmdate($value['dateline']); } if ($value['password']) { $value['password'] = dzzdecode($value['password']); } if ($value['endtime']) { $value['fendtime'] = dgmdate($value['endtime'], 'Y-m-d'); } $value['fsize'] = formatsize($value['size']); $value['ftype'] = getFileTypeName($value['type'], $value['ext']); if ($value['type'] == 'folder') { $value['img'] = 'dzz/images/extimg/folder.png'; } if ($value['img']) { $value['img'] = str_replace('dzz/images/extimg/', 'dzz/images/extimg_small/', $value['img']); } if ($value['type'] == 'image' && $value['status'] == -3) { $value['img'] = ''; }
<?php /* * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ if (!defined('IN_DZZ')) { exit('Access Denied'); } $icoid = intval(dzzdecode($_GET['icoid'])); if (!($icoarr = C::t('icos')->fetch_by_icoid($icoid))) { showmessage('文件不存在或已删除!'); } $did = $icoarr['did']; $navtitle = $icoarr['name']; $do = trim($_GET['do']); $version = intval($_GET['v']); if ($do == 'deleteVersion') { if ($_G['adminid'] != 1 && $_G['uid'] != $icoarr['uid']) { showmessage('没有权限', dreferer()); } if ($ver = C::t('document_reversion')->delete_by_version($did, $version)) { showmessage('do_success', DZZSCRIPT . "?mod=document&icoid=" . dzzencode($icoid)); } else { showmessage('删除版本失败', dreferer()); } } elseif ($do == 'applyVersion') { if ($ver = C::t('document_reversion')->reversion($did, $version, $_G['uid'], $_G['username'])) {
<?php /* * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ if (!defined('IN_DZZ')) { exit('Access Denied'); } define('NOROBOT', TRUE); $path = empty($_GET['icoid']) ? trim($_GET['path']) : $_GET['icoid']; if ($path = dzzdecode($path)) { IO::download($path, $_GET['filename']); } exit;
} elseif (strpos($icoid, 'preview') !== false) { //此处兼容feed内文本文档的查看 $path = dzzdecode($_GET['path']); $isadmin = 0; //无权限 $str = IO::getFileContent($path); require_once DZZ_ROOT . './dzz/class/class_encode.php'; $p = new Encode_Core(); $code = $p->get_encoding($str); if ($code) { $str = diconv($str, $code, CHARSET); } $str = htmlspecialchars($str); include template('textviewer'); } else { if (!($path = dzzdecode($_GET['path']))) { showmessage('参数错误!'); } $dpath = dzzencode($path); $error = ''; $table = ''; $icoarr = IO::getMeta($path); $maxputsize = 0; //get_config_bytes(ini_get('post_max_size')); if (!$maxputsize) { $maxputsize = 2000000; } if ($icoarr['size'] > $maxputsize) { $url = DZZSCRIPT . '?mod=textviewer&path=' . dzzencode($path); header("Location: {$url}"); exit;
<?php /* * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ if (!defined('IN_DZZ')) { exit('Access Denied'); } $path = dzzdecode($_GET['path']); $str = IO::getFileContent($path); require_once DZZ_ROOT . './dzz/class/class_encode.php'; $p = new Encode_Core(); $code = $p->get_encoding($str); if ($code) { $str = diconv($str, $code, CHARSET); } $str = htmlspecialchars($str); $str = nl2br(str_replace(array("\t", ' ', ' '), array(' ', ' ', ' '), $str)); include template('textviewer');
* @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ @set_time_limit(0); include_once libfile('class/ZipStream'); $patharr = $_GET['paths']; print_r($_GET); exit('dfdsfsf'); $meta = IO::getMeta(dzzdecode($patharr[0])); if ($meta['error']) { exit($meta['error']); } $filename = strtolower(CHARSET) == 'utf-8' && (strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strexists($_SERVER['HTTP_USER_AGENT'], 'rv:11')) ? urlencode($meta['name']) : $meta['name']; $zip = new ZipStream($filename . ".zip"); foreach ($patharr as $dpath) { $path = dzzdecode($dpath); $meta = IO::getMeta($path); switch ($meta['type']) { case 'app': case 'video': case 'dzzdoc': case 'link': continue; break; case 'folder': IO::getFolderInfo($path, $meta['name'], $zip); break; default: $zip->addLargeFile(fopen(IO::getStream($path), 'rb'), $meta['name'], $meta['dateline']); break; }
if ($share['status'] == -4) { showmessage('此分享链接已被管理员屏蔽'); } //判断是否过期 if ($share['endtime'] && $share['endtime'] < TIMESTAMP) { showmessage('此分享链接已经过期'); } if ($share['times'] && $share['times'] < $share['count']) { showmessage('此分享连接已经到达最大使用次数'); } if ($share['status'] == -3) { showmessage('此分享文件已删除'); } if ($share['password'] && dzzdecode($share['password']) != authcode($_G['cookie']['pass_' . $sid])) { if (submitcheck('passwordsubmit')) { if ($_GET['password'] != dzzdecode($share['password'])) { include template('common/share_password'); exit; } dsetcookie('pass_' . $sid, authcode($_GET['password'], 'ENCODE')); } else { include template('common/share_password'); exit; } } $sharestatus = array('-4' => '已屏蔽', '-3' => '文件已删除', '-2' => '次数用尽', '-1' => '已过期', '0' => '正常'); $typearr = array('folder' => '目录', 'image' => '图片', 'app' => '应用', 'link' => '网址', 'video' => '视频', 'attach' => '文件', 'document' => '文档', 'dzzdoc' => 'Dzz文档', 'url' => '其他'); $asc = intval($_GET['asc']); $page = empty($_GET['page']) ? 1 : intval($_GET['page']); $perpage = 20; $start = ($page - 1) * $perpage;
<?php /* //分享地址支持下载(a=down),预览(a=view)和流 * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ define('APPTYPEID', 200); require './core/class/class_core.php'; require './dzz/function/dzz_core.php'; $dzz = C::app(); $dzz->init(); if (!($path = dzzdecode(trim($_GET['s'])))) { exit('Access Denied'); } if ($_GET['a'] == 'down') { IO::download($path); exit; } elseif ($_GET['a'] == 'view') { $icoarr = IO::getMeta($path); if ($icoarr['type'] == 'video') { @header("Location: {$icoarr['url']}"); exit; } $imageexts = array('jpg', 'jpeg', 'png', 'gif'); //图片使用; $filename = $icoarr['name']; //rtrim($_GET['n'],'.dzz'); $ext = $icoarr['ext'];
} elseif ($do == 'share') { $sharestatus = array('-4' => '已屏蔽', '-3' => '分享文件删除', '-2' => '次数用尽', '-1' => '已过期', '0' => '正常'); if (!submitcheck('sharesubmit')) { $path = dzzdecode($_GET['path']); $icoarr = IO::getMeta($path); if ($icoarr['type'] == 'shortcut') { $icoarr['type'] = $icoarr['ttype']; $icoarr['size'] = $icoarr['tdate']['size']; $icoarr['ext'] = $icoarr['tdate']['ext']; } if ($share = C::t('share')->fetch_by_path($path . '&uid=' . $_G['uid'])) { if (is_file($_G['setting']['attachdir'] . './qrcode/' . $share['sid'][0] . '/' . $share['sid'] . '.png')) { $share['qrcode'] = $_G['setting']['attachurl'] . './qrcode/' . $share['sid'][0] . '/' . $share['sid'] . '.png'; } if ($share['password']) { $share['password'] = dzzdecode($share['password'], 'DECODE'); } if ($share['endtime']) { if ($share['endtime'] < TIMESTAMP && $share['status'] > -1) { $share['status'] = -1; } $share['endtime'] = dgmdate($share['endtime'], 'Y-m-d'); } else { $share['endtime'] = ''; } if ($share['times']) { if ($share['times'] >= $share['count'] && $share['status'] > -1) { $share['status'] = -2; } } else { $share['times'] = '';
<?php /* * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ $path = dzzdecode(urldecode($_GET['path'])); $width = intval($_GET['width']); $height = intval($_GET['height']); $original = intval($_GET['original']); IO::getThumb($path, $width, $height, $original);