Example #1
0
loadcache('adminmenu');
if (is_array($_G['cache']['adminmenu'])) {
    foreach ($_G['cache']['adminmenu'] as $row) {
        $menu['plugin'][] = array($row['name'], $row['action']);
    }
}
if (!$menu['plugin']) {
    unset($topmenu['plugin']);
}
$menu['tools'] = array(array('menu_tools_updatecaches', 'tools_updatecache'), array('menu_tools_updatecounters', 'counter'), array('menu_logs', 'logs'), array('menu_misc_cron', 'misc_cron'), $isfounder ? array('menu_tools_fileperms', 'tools_fileperms') : null, $isfounder ? array('menu_tools_filecheck', 'checktools_filecheck') : null, $isfounder ? array('menu_tools_hookcheck', 'checktools_hookcheck') : null);
if ($isfounder) {
    $topmenu['founder'] = '';
    $menu['founder'] = array(array('menu_founder_perm', 'founder_perm'), array('menu_setting_mail', 'setting_mail'), array('menu_patch', 'patch'), array('menu_setting_uc', 'setting_uc'), array('menu_db', 'db_export'), array('menu_membersplit', 'membersplit_check'), array('menu_postsplit', 'postsplit_manage'), array('menu_threadsplit', 'threadsplit_manage'), array('menu_upgrade', 'upgrade'), array('menu_optimizer', 'optimizer'));
    $menu['uc'] = array();
}
if (!isfounder() && !isset($GLOBALS['admincp']->perms['all'])) {
    $menunew = $menu;
    foreach ($menu as $topkey => $datas) {
        if ($topkey == 'index') {
            continue;
        }
        $itemexists = 0;
        foreach ($datas as $key => $data) {
            if (array_key_exists($data[1], $GLOBALS['admincp']->perms)) {
                $itemexists = 1;
            } else {
                unset($menunew[$topkey][$key]);
            }
        }
        if (!$itemexists) {
            unset($topmenu[$topkey]);
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: admincp_templates.php 6757 2010-03-25 09:01:29Z cnteacher $
 */
if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
cpheader();
if (!isfounder()) {
    cpmsg('noaccess_isfounder', '', 'error');
}
$operation = empty($operation) ? 'admin' : $operation;
if ($operation == 'admin') {
    if (!submitcheck('tplsubmit')) {
        $templates = '';
        $query = DB::query("SELECT * FROM " . DB::table('common_template') . "");
        while ($tpl = DB::fetch($query)) {
            $templates .= showtablerow('', array('class="td25"', '', 'class="td29"'), array("<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" " . ($tpl['templateid'] == 1 ? 'disabled ' : '') . "value=\"{$tpl['templateid']}\">", "<input type=\"text\" class=\"txt\" size=\"8\" name=\"namenew[{$tpl['templateid']}]\" value=\"{$tpl['name']}\">", "<input type=\"text\" class=\"txt\" size=\"20\" name=\"directorynew[{$tpl['templateid']}]\" value=\"{$tpl['directory']}\">", !empty($tpl['copyright']) ? $tpl['copyright'] : "<input type=\"text\" class=\"txt\" size=\"8\" name=\"copyrightnew[{$tpl['templateid']}]\" value=>"), TRUE);
        }
        shownav('style', 'templates_admin');
        showsubmenu('templates_admin');
        showformheader('templates');
        showtableheader();
        showsubtitle(array('', 'templates_admin_name', 'dir', 'copyright', ''));
        echo $templates;
        echo '<tr><td>' . $lang['add_new'] . '</td><td><input type="text" class="txt" size="8" name="newname"></td><td class="td29"><input type="text" class="txt" size="20" name="newdirectory"></td><td><input type="text" class="txt" size="25" name="newcopyright"></td><td>&nbsp;</td></tr>';
        showsubmit('tplsubmit', 'submit', 'del');
     showtablerow('', 'colspan="2"', cplang('members_group_extended_comment'));
     showtablefooter();
     showtableheader('members_edit_reason', 'notop');
     showsetting('members_group_ban_reason', 'reason', '', 'textarea');
     showsubmit('editsubmit');
     showtablefooter();
     showformfooter();
 } else {
     $group = C::t('common_usergroup')->fetch($_GET['groupidnew']);
     if (!$group) {
         cpmsg('undefined_action', '', 'error');
     }
     if (strlen(is_array($_GET['extgroupidsnew']) ? implode("\t", $_GET['extgroupidsnew']) : '') > 30) {
         cpmsg('members_edit_groups_toomany', '', 'error');
     }
     if ($member['groupid'] != $_GET['groupidnew'] && isfounder($member)) {
         cpmsg('members_edit_groups_isfounder', '', 'error');
     }
     $_GET['adminidnew'] = $_GET['adminidnew'][$_GET['groupidnew']];
     switch ($group['type']) {
         case 'member':
             $_GET['groupidnew'] = in_array($_GET['adminidnew'], array(1, 2, 3)) ? $_GET['adminidnew'] : $_GET['groupidnew'];
             break;
         case 'special':
             if ($group['radminid']) {
                 $_GET['adminidnew'] = $group['radminid'];
             } elseif (!in_array($_GET['adminidnew'], array(1, 2, 3))) {
                 $_GET['adminidnew'] = -1;
             }
             break;
         case 'system':
Example #4
0
 *
 *      $Id: admincp_index.php 23425 2011-07-14 06:38:11Z liulanbo $
 *		English by Valery Votintsev at sources.ru
 */
if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
if (@file_exists(DISCUZ_ROOT . './install/index.php') && !DISCUZ_DEBUG) {
    @unlink(DISCUZ_ROOT . './install/index.php');
    if (@file_exists(DISCUZ_ROOT . './install/index.php')) {
        dexit('Please delete install/index.php via FTP!');
    }
}
@(include_once DISCUZ_ROOT . './source/discuz_version.php');
require_once libfile('function/attachment');
$isfounder = isfounder();
$siteuniqueid = DB::result_first("SELECT svalue FROM " . DB::table('common_setting') . " WHERE skey='siteuniqueid'");
if (empty($siteuniqueid) || strlen($siteuniqueid) < 16) {
    $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
    $siteuniqueid = 'DX' . $chars[date('y') % 60] . $chars[date('n')] . $chars[date('j')] . $chars[date('G')] . $chars[date('i')] . $chars[date('s')] . substr(md5($_G['clientip'] . $_G['username'] . TIMESTAMP), 0, 4) . random(4);
    $temp = array('skey' => 'siteuniqueid', 'svalue' => $siteuniqueid);
    DB::insert('common_setting', $temp, false, true);
}
if (submitcheck('notesubmit', 1)) {
    if (!empty($_G['gp_noteid']) && is_numeric($_G['gp_noteid'])) {
        DB::query("DELETE FROM " . DB::table('common_adminnote') . " WHERE id='{$_G['gp_noteid']}'" . ($isfounder ? '' : " AND admin='{$_G['username']}'"));
    }
    if (!empty($_G['gp_newmessage'])) {
        $newaccess = 0;
        $_G['gp_newexpiration'] = TIMESTAMP + (intval($_G['gp_newexpiration']) > 0 ? intval($_G['gp_newexpiration']) : 30) * 86400;
        $_G['gp_newmessage'] = nl2br(dhtmlspecialchars($_G['gp_newmessage']));
Example #5
0
    ajaxshowfooter();
} else {
    $appService = Cloud::loadClass('Service_App');
    $doctorService = Cloud::loadClass('Service_Doctor');
    require_once DISCUZ_ROOT . './source/discuz_version.php';
    shownav('navcloud', 'menu_cloud_doctor');
    showsubmenu('menu_cloud_doctor');
    showtips('cloud_doctor_tips');
    echo '<script type="text/javascript">var disallowfloat = "";</script>';
    showtableheader();
    showtagheader('tbody', '', true);
    showtitle('cloud_doctor_title_status');
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_url') . '</strong>', $_G['siteurl']));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_id') . '</strong>', $_G['setting']['my_siteid']));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_key') . '</strong>', preg_replace('/(\\w{2})\\w*(\\w{2})/', '\\1****\\2', $_G['setting']['my_sitekey']) . ' ' . $lang['cloud_site_key_safetips']));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_status') . '</strong>', isfounder() ? $doctorService->showCloudStatus($_G['setting']['cloud_status']) . ' <a href="javascript:;" onClick="showWindow(\'cloudApiIpWin\', \'' . ADMINSCRIPT . '?action=cloud&operation=doctor&op=setidkey\'); return false;">' . $lang['cloud_doctor_modify_siteidkey'] . '</a>' : $doctorService->showCloudStatus($_G['setting']['cloud_status'])));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('setting_basic_bbclosed') . '</strong>', $_G['setting']['bbclosed'] ? $lang['cloud_doctor_close_yes'] : $lang['no']));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_version') . '</strong>', DISCUZ_VERSION . ' ' . DISCUZ_RELEASE));
    showtagfooter('tbody');
    showtagheader('tbody', '', true);
    showtitle('cloud_doctor_title_result');
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_timecheck') . '</strong>', '<span id="cloud_time_check">' . cplang('cloud_doctor_time_check', array('imgdir' => $_G['style']['imgdir'])) . '</span>'));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_doctor_gethostbyname_function') . '</strong>', function_exists('gethostbyname') ? $lang['cloud_doctor_result_success'] . ' ' . $lang['available'] : $lang['cloud_doctor_result_failure'] . $lang['cloud_doctor_function_disable']));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_doctor_dns_api') . '</strong>', $doctorService->checkDNSResult(1, $_G['setting'])));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_doctor_dns_api_test') . '</strong>', $doctorService->showTestJS(1)));
    showtagfooter('tbody');
    showtagheader('tbody', 'cloud_tbody_api_test', false);
    showtagfooter('tbody');
    showtagheader('tbody', '', true);
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_doctor_dns_manyou') . '</strong>', $doctorService->checkDNSResult(2, $_G['setting'])));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_doctor_dns_manyou_test') . '</strong>', $doctorService->showTestJS(2)));
Example #6
0
 */

if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
	exit('Access Denied');
}

lang('admincp_menu');

$extra = cpurl('url');
$extra = $extra && getgpc('action') ? $extra : 'action=index';
$charset = CHARSET;
$title = cplang('admincp_title');
$header_welcome = cplang('header_welcome');
$header_logout = cplang('header_logout');
$header_bbs = cplang('header_bbs');
if(isfounder()) {
	cplang('founder_admin');
} else {
	if($GLOBALS['admincp']->adminsession['cpgroupid']) {
		$cpgroup = C::t('common_admincp_group')->fetch($GLOBALS['admincp']->adminsession['cpgroupid']);
		$cpadmingroup = $cpgroup['cpgroupname'];
	} else {
		cplang('founder_master');
	}
}
require './source/admincp/admincp_menu.php';
$basescript = ADMINSCRIPT;

//vot Multi-Lingual
$change_language = cplang('change_language');
$lang_list='';
Example #7
0
	$topmenu['founder'] = '';

	$menu['founder'] = array(
		array('menu_founder_perm', 'founder_perm'),
		array('menu_setting_mail', 'setting_mail'),
		array('menu_setting_uc', 'setting_uc'),
		array('menu_setting_manyou', 'setting_manyou'),
		array('menu_db', 'db_export'),
		array('menu_postsplit', 'postsplit_manage'),
		array('menu_threadsplit', 'threadsplit_manage'),
	);

	$menu['uc'] = array();
}
*/
if (!isfounder() && !isset($_SGLOBAL['adminsession']['perms']['all'])) {
    $menunew = $menu;
    foreach ($menu as $topkey => $datas) {
        /*
        if($topkey == 'index') {
        	continue;
        }
        */
        $itemexists = 0;
        foreach ($datas as $key => $data) {
            if ($data[1] == 'index') {
                $itemexists = 1;
                continue;
            }
            if (array_key_exists($data[1], $_SGLOBAL['adminsession']['perms'])) {
                $itemexists = 1;
Example #8
0
/*
	[Discuz!] (C)2001-2007 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$Id: database.inc.php 11168 2007-11-08 05:23:57Z tiger $
*/

if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
        exit('Access Denied');
}

$tabletype = $db->version() > '4.1' ? 'Engine' : 'Type';;

require_once DISCUZ_ROOT.'./include/attachment.func.php';
cpheader();
if(!isfounder()) cpmsg('noaccess_isfounder');


$excepttables = array_merge(array($tablepre.'adminsessions', $tablepre.'failedlogins', $tablepre.'pmsearchindex', $tablepre.'relatedthreads', $tablepre.'rsscaches', $tablepre.'searchindex', $tablepre.'spacecaches', $tablepre.'sessions'),
	($supe['status'] ? array($supe['tablepre'].'cache', $supe['tablepre'].'corpus', $supe['tablepre'].'rss', $supe['tablepre'].'spacecache', $supe['tablepre'].'tagcache') : array()));

if(!$backupdir = $db->result($db->query("SELECT value FROM {$tablepre}settings WHERE variable='backupdir'"), 0)) {
	$backupdir = random(6);
	@mkdir('./forumdata/backup_'.$backupdir, 0777);
	$db->query("REPLACE INTO {$tablepre}settings (variable, value) values ('backupdir', '$backupdir')");
}
$backupdir = 'backup_'.$backupdir;
if(!is_dir('./forumdata/'.$backupdir)) {
	mkdir('./forumdata/'.$backupdir, 0777);
}
Example #9
0
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: admincp_main.php 10337 2010-05-10 10:21:20Z monkey $
 */
if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
lang('admincp_menu');
$extra = cpurl('url');
$extra = $extra && getgpc('action') ? $extra : 'action=index';
$charset = CHARSET;
$title = cplang('admincp_title');
$header_welcome = cplang('header_welcome');
$header_logout = cplang('header_logout');
$header_bbs = cplang('header_bbs');
$cpadmingroup = isfounder() ? cplang('founder_admin') : ($GLOBALS['admincp']->adminsession['cpgroupid'] ? DB::result_first("SELECT cpgroupname FROM " . DB::table('common_admincp_group') . " WHERE cpgroupid='" . $GLOBALS['admincp']->adminsession['cpgroupid'] . "'") : cplang('founder_master'));
require './source/admincp/admincp_menu.php';
$basescript = ADMINSCRIPT;
echo <<<EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>{$title}</title>
<meta http-equiv="Content-Type" content="text/html; charset={$charset}">
<meta content="Comsenz Inc." name="Copyright" />
<link rel="stylesheet" href="static/image/admincp/admincp.css" type="text/css" media="all" />
<script src="static/js/common.js" type="text/javascript"></script>
</head>
<body style="margin: 0px" scroll="no">
<div id="append_parent"></div>
<table id="frametable" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
Example #10
0
    exit;
}
$isfounder = isfounder();
if ($action == 'menu') {
    require_once DISCUZ_ROOT . './admin/menu.inc.php';
} elseif ($action == 'header') {
    require_once DISCUZ_ROOT . './admin/header.inc.php';
} elseif ($action == 'logout') {
    $db->query("DELETE FROM {$tablepre}adminsessions WHERE uid='{$discuz_uid}'");
    loginmsg('logout_succeed', 'index.php');
} else {
    $cpscript = '';
    if ($adminid == 1) {
        if ($action == 'home') {
            $cpscript = 'home';
        } elseif ($action == 'runwizard' && isfounder()) {
            $cpscript = 'runwizard';
        } elseif ($action == 'settings') {
            $cpscript = 'settings';
        } elseif ($action == 'xspace') {
            $cpscript = 'supesite';
        } elseif ($action == 'passport' || $action == 'shopex') {
            $cpscript = 'passport';
        } elseif ($action == 'google_config') {
            $cpscript = 'google';
        } elseif ($action == 'qihoo_config' || $action == 'qihoo_relatedthreads' || $action == 'qihoo_topics') {
            $cpscript = 'qihoo';
        } elseif ($action == 'forumadd' || $action == 'forumsedit' || $action == 'forumsmerge' || $action == 'forumdetail' || $action == 'forumdelete' || $action == 'moderators' || $action == 'forumcopy' || $action == 'forumrecommend') {
            $cpscript = 'forums';
        } elseif ($action == 'editmember' || $action == 'memberadd' || $action == 'members' || $action == 'membersmerge' || $action == 'editgroups' || $action == 'access' || $action == 'editcredits' || $action == 'editmedals' || $action == 'memberprofile' || $action == 'profilefields' || $action == 'ipban' || $action == 'banmember') {
            $cpscript = 'members';
    ajaxshowfooter();
    exit;
} elseif ($operation == 'edit') {
    $return = isset($return) && $return ? 'admin' : '';
    if (empty($id)) {
        $grouplist = "<select name=\"id\" style=\"width: 150px\">\n";
        $conditions = !empty($anchor) && $anchor == 'system' ? "WHERE type='special'" : '';
        $query = $db->query("SELECT groupid, grouptitle FROM {$tablepre}usergroups {$conditions}");
        while ($group = $db->fetch_array($query)) {
            $grouplist .= "<option value=\"{$group['groupid']}\">{$group['grouptitle']}</option>\n";
        }
        $grouplist .= '</select>';
        cpmsg('usergroups_edit_nonexistence', $BASESCRIPT . '?action=usergroups&operation=edit' . (!empty($highlight) ? "&highlight={$highlight}" : '') . (!empty($highlight) ? "&anchor={$anchor}" : ''), 'form', $grouplist);
    }
    $group = $db->fetch_first("SELECT * FROM {$tablepre}usergroups WHERE groupid='{$id}'");
    if ($group['radminid'] > 0 && !isfounder()) {
        if (!checkacpaction('admingroups', '', false)) {
            cpmsg('usergroups_edit_fail', '', 'error');
        }
    }
    if (!submitcheck('detailsubmit') && !submitcheck('saveconfigsubmit')) {
        $projectselect = "<select name=\"projectid\" onchange=\"window.location='{$BASESCRIPT}?action=usergroups&operation=edit&id={$id}&projectid='+this.options[this.options.selectedIndex].value\"><option value=\"0\" selected=\"selected\">" . $lang['none'] . "</option>";
        $query = $db->query("SELECT id, name FROM {$tablepre}projects WHERE type='group'");
        while ($project = $db->fetch_array($query)) {
            $projectselect .= "<option value=\"{$project['id']}\" " . ($project['id'] == $projectid ? 'selected="selected"' : NULL) . ">{$project['name']}</option>";
        }
        $projectselect .= '</select>';
        if (!empty($projectid)) {
            $group = @array_merge($group, unserialize($db->result_first("SELECT value FROM {$tablepre}projects WHERE id='{$projectid}'")));
        }
        $group['exempt'] = strrev(sprintf('%0' . strlen($group['exempt']) . 'b', $group['exempt']));
Example #12
0
    showformheader('cloud');
    showhiddenfields(array('operation' => $operation));
    if ($_GET['callback']) {
        showhiddenfields(array('callback' => $_GET['callback']));
    }
    showtableheader();
    showsetting('cloud_api_ip', 'cloud_api_ip', $_G['setting']['cloud_api_ip'], 'text');
    showsetting('cloud_manyou_ip', 'my_ip', $_G['setting']['my_ip'], 'text');
    showsetting('cloud_connect_api_ip', 'connect_api_ip', $_G['setting']['connect_api_ip'], 'text');
    showsubmit('ipsubmit');
    showtablefooter();
    showformfooter();
    echo '</div>';
    ajaxshowfooter();
} else {
    shownav('navcloud', 'menu_cloud_siteinfo');
    showsubmenu('menu_cloud_siteinfo');
    showtips('cloud_siteinfo_tips');
    echo '<script type="text/javascript">var disallowfloat = "";</script>';
    showformheader('cloud');
    showhiddenfields(array('operation' => $operation));
    showtableheader();
    showtitle('menu_cloud_siteinfo');
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_name') . '</strong>', $_G['setting']['bbname']));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_url') . '</strong>', $_G['siteurl']));
    showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_id') . '</strong>', $_G['setting']['my_siteid']));
    $resetSubmitButton = isfounder() ? '<input type="submit" class="btn" id="submit_resetsubmit" name="resetsubmit" value="' . $lang['cloud_resetkey'] . '" />&nbsp; ' : '';
    showsubmit('syncsubmit', 'cloud_sync', '', $resetSubmitButton . '<input type="button" class="btn" onClick="showWindow(\'cloudApiIpWin\', \'' . ADMINSCRIPT . '?action=cloud&operation=siteinfo&anchor=cloud_ip\'); return false;" value="' . $lang['cloud_api_ip_btn'] . '" />');
    showtablefooter();
    showformfooter();
}
Example #13
0
     switch ($cpaccess) {
         case 1:
             $extralog = 'AUTHENTIFICATION(ERROR #' . intval($adminsession['errorcount']) . ')';
             break;
         case 3:
             $extralog = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('formhash', 'submit', 'addsubmit', 'admin_password', 'sid', 'action'));
             break;
         default:
             $extralog = '';
     }
     $extralog = trim(str_replace(array('GET={};', 'POST={};'), '', $extralog));
     $extralog = $action == 'home' && isset($securyservice) || $action == 'insenz' && in_array($operation, array('register', 'binding')) ? '' : $extralog;
     writelog('cplog', implode("\t", clearlogstring(array($timestamp, $discuz_userss, $adminid, $onlineip, $action, $extralog))));
     unset($extralog);
 }
 $isfounder = $adminsession->isfounder = isfounder();
 if (empty($action) || isset($frames)) {
     $extra = cpurl('url');
     $extra = $extra && $action ? $extra : (!empty($runwizard) ? 'action=runwizard' : 'action=home');
     require_once DISCUZ_ROOT . './admin/main.inc.php';
 } elseif ($action == 'logout') {
     $adminsession->destroy();
     dheader("Location: {$indexname}");
 } else {
     checkacpaction($action, $operation);
     if (in_array($action, array('home', 'settings', 'members', 'profilefields', 'admingroups', 'usergroups', 'ranks', 'forums', 'threadtypes', 'threads', 'moderate', 'attach', 'smilies', 'recyclebin', 'prune', 'styles', 'plugins', 'tasks', 'magics', 'medals', 'google', 'qihoo', 'video', 'announce', 'faq', 'ec', 'tradelog', 'creditwizard', 'jswizard', 'project', 'counter', 'misc', 'adv', 'insenz', 'logs', 'tools', 'checktools', 'search', 'upgrade')) || $isfounder && in_array($action, array('runwizard', 'templates', 'db'))) {
         require_once DISCUZ_ROOT . './admin/' . $action . '.inc.php';
         $title = 'cplog_' . $action . ($operation ? '_' . $operation : '');
         if (!in_array($action, array('home', 'custommenu')) && lang($title, false)) {
             strtolower($_SERVER['REQUEST_METHOD']) == 'get' && admincustom($title, cpurl('url'));
         }
Example #14
0
 */

if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
	exit('Access Denied');
}

$db = & DB::object();

$tabletype = $db->version() > '4.1' ? 'Engine' : 'Type';
$tablepre = $_G['config']['db'][1]['tablepre'];
$dbcharset = $_G['config']['db'][1]['dbcharset'];

require_once libfile('function/attachment');
cpheader();

if(!isfounder()) cpmsg('noaccess_isfounder', '', 'error');


$excepttables = array($tablepre.'common_admincp_session', $tablepre.'common_syscache', $tablepre.'common_failedlogin', $tablepre.'forum_rsscache', $tablepre.'common_searchindex', $tablepre.'forum_spacecache', $tablepre.'common_session');

$backupdir = C::t('common_setting')->fetch('backupdir');

if(!$backupdir) {
	$backupdir = random(6);
	@mkdir('./data/backup_'.$backupdir, 0777);
	C::t('common_setting')->update('backupdir',$backupdir);
}
$backupdir = 'backup_'.$backupdir;
if(!is_dir('./data/'.$backupdir)) {
	mkdir('./data/'.$backupdir, 0777);
}
Example #15
0
if ($operation == 'list') {
    if (!submitcheck('membersubmit')) {
        shownav('global', 'nav_member');
        showsubmenu('nav_member', array(array('member_list', 'member&operation=list', 1), array('member_add', 'member&operation=add', 0)));
        showformheader('member');
        showtableheader('member_list', 'fixpadding');
        showsubtitle(array('', 'username', 'usergroup', 'email', 'regdate', ''));
        $where = !empty($where) ? $where : 1;
        $num = DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_member') . " WHERE {$where}");
        $perpage = max(5, empty($_G['gp_perpage']) ? 50 : intval($_G['gp_perpage']));
        $start_limit = ($page - 1) * $perpage;
        $mpurl = ADMINSCRIPT . "?action=member&operation=list";
        $multipage = multi($num, $perpage, $page, $mpurl);
        $query = DB::query("SELECT * FROM " . DB::table('common_member') . " WHERE {$where} ORDER BY uid LIMIT {$start_limit}, {$perpage}");
        while ($member = DB::fetch($query)) {
            $disable = isfounder($member) ? 'disabled="true"' : '';
            showtablerow('', array('', '', '', '', '', '', ''), array("<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"{$member['uid']}\" {$disable}>", $member['username'], $usergrouplist[$member['groupid']], $member['email'], dgmdate($member['regdate'], 'Y-n-j H:i'), "<a href=\"" . ADMINSCRIPT . "?action=member&operation=edit&uid={$member['uid']}\" class=\"act\">{$lang['detail']}</a>"));
        }
        showsubmit('membersubmit', 'submit', 'del', $multipage);
        showtablefooter();
        showformfooter();
    } else {
        if (is_array($_G['gp_usergroupidnew'])) {
            foreach ($_G['gp_usergroupidnew'] as $uid => $groupid) {
                $adminid = $groupid == 1 ? 1 : 0;
                DB::query("UPDATE " . DB::table('common_member') . " SET adminid='" . intval($adminid) . "', groupid='" . intval($groupid) . "' WHERE uid='{$uid}'");
            }
        }
        if (is_array($_G['gp_delete'])) {
            $ids = $comma = '';
            foreach ($_G['gp_delete'] as $id) {