Ejemplo n.º 1
0
 public function init(array $argv = array(), $verbosity = 0)
 {
     $this->_verbosity = $verbosity;
     /* First element is the php script name. Store it for debugging. */
     $this->_php_exec = array_shift($argv);
     /* Second element is just the executable we called to run ZF commands. Store it for printing errors/usage. */
     $this->_native_exec = array_shift($argv);
     $opts = $this->getOptions()->addArguments($argv);
     $opts->parse();
     // Shortcut to verbosity option so that we can display more earlier
     if (isset($opts->verbosity)) {
         $this->_verbosity = $opts->verbosity;
     }
     // Shortcut to help option so that no arguments have to be specified
     if (isset($opts->help)) {
         $this->printHelp();
         return null;
     }
     try {
         $actionName = array_shift($argv);
         $context = Zend_Build_Manifest::getInstance()->getContext(self::MF_ACTION_TYPE, $actionName);
         $config = $this->_parseParams($context, $argv);
         $action = new $context->class();
         $action . setConfig($config);
         $action . configure();
     } catch (Zend_Console_Exception $e) {
         throw $e->prependUsage($this->getUsage());
     }
     return $this;
 }
Ejemplo n.º 2
0
 public function __call($func, $argv)
 {
     if (substr($func, 0, 3) == 'get') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         if (isset($argv[0])) {
             $environment = $argv[0];
         } else {
             $environment = APPLICATION_ENV;
         }
         return getConfig($key, $environment);
     } elseif (substr($func, 0, 3) == 'set') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         $value = Arrays::first($argv);
         if (isset($argv[1])) {
             $environment = $argv[1];
         } else {
             $environment = 'all';
         }
         setConfig($key, $value, $environment);
         return $this;
     } elseif (substr($func, 0, 3) == 'has') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         if (isset($argv[0])) {
             $environment = $argv[0];
         } else {
             $environment = APPLICATION_ENV;
         }
         return null !== getConfig($key, $environment);
     }
 }
Ejemplo n.º 3
0
 function updatesyncredit($syncredit)
 {
     require_once R_P . 'admin/cache.php';
     setConfig('uc_syncredit', $syncredit);
     updatecache_c();
     return new ApiResponse(1);
 }
Ejemplo n.º 4
0
function goAction($act, $category_id, $course_id, $courses, $exercises)
{
    if (!$act || $act == null) {
        $act = "default";
    }
    switch ($act) {
        case 'default':
            showPage();
            break;
        case 'getCategory':
            showCategories();
            break;
        case 'getCategoryJson':
            showCategoryTree();
            break;
        case 'getCourses':
            showCourses($category_id);
            break;
        case 'getTracks':
            showTracks($category_id, $course_id);
            break;
        case 'getScores':
            showScores($category_id, $course_id);
            break;
        case 'getSummary':
            showSummary($category_id, $courses, $exercises);
            break;
        case 'getExcel':
            showExcel($category_id, $courses, $exercises);
            break;
        case 'getCfgs':
            showConfig($category_id, $course_id);
            break;
        case 'saveCfgs':
            $count = $_GET['count'];
            $configs = $_GET['config'];
            setConfig($category_id, $course_id, $count, $configs);
            break;
        case 'createCfgs':
            $quiz_count = @$_GET['count'];
            if (!isset($quiz_count) || $quiz_count == null || $quiz_count <= 0) {
                drawConfigPanel($category_id, $course_id);
            } else {
                drawConfigPanel($category_id, $course_id, $quiz_count);
            }
            break;
        case 'removeCfgs':
            removeConfig($category_id, $course_id);
            break;
        case 'getStudents':
            showStudentConfigs();
            break;
        case 'saveStudents':
            $students = $_GET['s'];
            saveStudentConfigs($students);
            break;
    }
}
Ejemplo n.º 5
0
 function setConfig($key, $value)
 {
     if (!$key) {
         return true;
     }
     require_once R_P . 'admin/cache.php';
     setConfig('db_' . $key, $value);
     updatecache_c();
 }
Ejemplo n.º 6
0
 /**
  * 插入站长中心id
  * @param int $siteId 站长中心id
  * @return bool
  */
 function insertWebmasterKey($siteId)
 {
     if ($siteId <= 0) {
         return new ApiResponse(false);
     }
     require_once R_P . 'admin/cache.php';
     setConfig('db_siteappkey', $siteId);
     updatecache_c();
     return new ApiResponse(true);
 }
Ejemplo n.º 7
0
 public function test_matchPWD()
 {
     setConfig("PWD_HASH_TYPE", "logiks");
     $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');
     $algo_actual = getPWDHash('test', $salt);
     $first = matchPWD($algo_actual, 'test', $salt);
     $this->assertEquals(true, $first);
     $first = matchPWD($algo_actual, 'testing', $salt);
     $this->assertEquals(false, $first);
 }
Ejemplo n.º 8
0
 function appsUpdateCache($apps)
 {
     if ($apps && is_array($apps)) {
         require_once R_P . 'admin/cache.php';
         setConfig('db_apps_list', $apps);
         updatecache_c();
         return new ApiResponse(true);
     } else {
         return new ApiResponse(false);
     }
 }
Ejemplo n.º 9
0
function create_dbconfig_table()
{
    $dir = dirname(dirname(__FILE__));
    require_once $dir . '/config.php';
    $table = 'config';
    $params = array(array('id', 'int(11)', 'NOT NULL', 'AUTO_INCREMENT'), array('name', 'varchar(255)', 'DEFAULT NULL'), array('value', 'varchar(255)', 'DEFAULT NULL'), array('PRIMARY KEY (id)'), array('UNIQUE KEY name (name)'));
    $newTable = $DB->createTable($table, $params);
    if ($newTable) {
        setConfig('toto', 'titi');
        return true;
    }
}
 function _saveBindInfo($options)
 {
     require_once R_P . 'admin/cache.php';
     global ${$this->_config_key};
     $bindInfo = ${$this->_config_key} ? ${$this->_config_key} : array();
     foreach ($options as $key => $value) {
         $bindInfo[$key] = $value;
     }
     ${$this->_config_key} = $bindInfo;
     setConfig($this->_config_key, $bindInfo);
     updatecache_c();
     return true;
 }
Ejemplo n.º 11
0
 function matchPWD($pwdHash, $pwd, $salt = null)
 {
     if (strlen(getConfig("PWD_HASH_TYPE")) <= 0 || !getConfig("PWD_HASH_TYPE")) {
         setConfig("PWD_HASH_TYPE", "logiks");
     }
     $newHash = getPWDHash($pwd, $salt);
     // 		printArray([$newHash,$pwd,$salt,$pwdHash]);
     if (is_array($newHash)) {
         $newHash = $newHash['hash'];
     }
     //println($pwdHash);println(getPWDHash($pwd, $salt));exit($pwd);
     // 		println(($pwdHash===$newHash));exit("XXX $pwdHash $newHash ".getConfig("PWD_HASH_TYPE"));
     return $pwdHash === $newHash;
 }
Ejemplo n.º 12
0
function checkBan()
{
    // We need the database and the current time.
    global $DB;
    global $TIMEMARK;
    // Get the ban time, the maximum attempts etc..
    $maxAllowedPerIP = getConfig("banAttempts");
    $banTime = getConfig("banTime") * 60;
    $timeFrame = 1800;
    $targetTimeStamp = $TIMEMARK - $timeFrame;
    // Enforce minimal settings.
    if ($maxAllowedPerIP < 5) {
        setConfig("banAttempts", "5");
        $maxAllowedPerIP = 5;
    }
    if ($banTime < 60) {
        setConfig("banTime", "1");
        $banTime = 60;
    }
    // Wash the username and IP.
    $username = strtolower(sanitize($_POST[username]));
    $ip = $_SERVER[REMOTE_ADDR];
    // Load counts from database.
    $attemptsIP = $DB->getCol("SELECT COUNT(incident) FROM failed_logins WHERE ip='" . $ip . "' AND failed_logins.time > " . $targetTimeStamp);
    $attemptsUsername = $DB->getCol("SELECT COUNT(incident) FROM failed_logins WHERE username='******' AND failed_logins.time > " . $targetTimeStamp);
    // Deny access if limits reached.
    if ($attemptsIP[0] > $maxAllowedPerIP || $attemptsUsername[0] > $maxAllowedPerIP) {
        // Get the time of the latest attempt.
        $latestAttempt = $DB->getCol("SELECT time FROM failed_logins WHERE ip='" . $ip . "' OR username='******' ORDER BY time DESC LIMIT 1");
        // Lets check if that is still in the baaaaad area.
        if ($latestAttempt[0] + $banTime > $TIMEMARK) {
            // Still banned.
            $remain = numberToString($latestAttempt[0] + $banTime - $TIMEMARK);
            makeNotice("You have reached the maximum number of login attempts. You are temporarily banned for " . number_format($banTime / 60, 0) . " minutes. Time left on ban: " . $remain, "error", "Banned");
        }
    }
    // If we get here, all is good.
}
Ejemplo n.º 13
0
 function alertMusic($state)
 {
     //虾米音乐网编辑器开启/关闭
     require_once R_P . 'admin/cache.php';
     setConfig('db_xiami_music_open', $state);
     updatecache_c();
     return new ApiResponse(true);
 }
Ejemplo n.º 14
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
$basename = "{$admin_file}?adminjob=ipban&job=ipstates";
if ($action != 'submit' && $action != 'ipIndex') {
    ifcheck($db_ipstates, 'ipstates');
    include PrintEot('ipstates');
} elseif ($_POST['action'] == "submit") {
    S::gp(array('ipstates'), 'P');
    setConfig('db_ipstates', $ipstates);
    updatecache_c();
    $navConfigService = L::loadClass('navconfig', 'site');
    $navConfigService->controlShowByKey('sort_ipstate', $ipstates);
    adminmsg('operate_success');
} elseif ($action == "ipIndex") {
    $ipTable = L::loadClass('IPTable', 'utility');
    $ipTable->createIpIndex();
    adminmsg('operate_success');
}
Ejemplo n.º 15
0
            }
        }
        $config['groups'] = is_array($groups) ? ',' . implode(',', $groups) . ',' : '';
        $updatecache = false;
        $config['groups_creditset'] = array();
        if (is_array($creditset) && !empty($creditset)) {
            foreach ($creditset as $key => $value) {
                foreach ($value as $k => $v) {
                    $creditset[$key][$k] = $v === '' ? in_array($key, array('Post', 'Reply', 'Delete', 'Deleterp')) ? '' : 0 : round($v, $k == 'rvrc' ? 1 : 0);
                }
            }
            $config['groups_creditset'] = $creditset;
        }
        $config['groups_creditlog'] = is_array($creditlog) && !empty($creditlog) ? $creditlog : array();
        foreach ($config as $key => $value) {
            setConfig("o_{$key}", $value, null, true);
        }
        updatecache_conf('o', true);
        adminmsg('operate_success', $j_url);
    }
} elseif ($action == 'setting') {
    !is_array($config = $_POST['config']) && ($config = array());
    foreach ($config as $key => $value) {
        if ($value) {
            $isint = false;
            if ($_POST['step'] == 'basic') {
                if ($key == 'name' || $key == 'moneytype') {
                    $config[$key] = S::escapeChar($value);
                } elseif ($key == 'rate') {
                    $config[$key] = (double) $value;
                } else {
Ejemplo n.º 16
0
 function addConfigPower($powerData, $groupData)
 {
     setConfig('db_ratepower', serialize($powerData));
     setConfig('db_rategroup', serialize($groupData));
     updatecache_c();
 }
Ejemplo n.º 17
0
} elseif ($action == 'statistics') {
    $adverClass = L::loadclass('adver', 'advertisement');
    /*statistics*/
    list($status, $types, $benchs) = $adverClass->statistics();
    include_once PrintEot('setadvert');
    exit;
} elseif ($action == 'alter') {
    $adverClass = L::loadclass('adver', 'advertisement');
    /*during*/
    S::gp(array("step"));
    if ($step == 2) {
        S::gp(array('alterstatus', 'alterbefore', 'alterway'));
        $alterstatus = in_array($alterstatus, array(1, 0)) ? $alterstatus : 1;
        /*security*/
        $alterway = in_array($alterway, array(1, 2)) ? $alterway : 1;
        $alterbefore = intval($alterbefore);
        $alters = array('alterstatus' => $alterstatus, 'alterbefore' => $alterbefore, 'alterway' => $alterway);
        setConfig('db_alterads', $alters);
        updatecache_c();
        adminmsg("operate_success", "{$basename}&action={$action}");
    }
    $alters = $db_alterads ? $db_alterads : $adverClass->getDefaultAlter();
    /*alter*/
    $c_alterstatus = $c_alterway = array('', '');
    $alters['alterstatus'] == 1 ? $c_alterstatus[1] = 'checked' : ($c_alterstatus[0] = 'checked');
    $alters['alterway'] == 1 ? $c_alterway[1] = 'checked' : ($c_alterway[0] = 'checked');
    include_once PrintEot('setadvert');
    exit;
} else {
    adminmsg('operate_success');
}
Ejemplo n.º 18
0
function setScanCache()
{
    global $db, $timestamp, $db_plist;
    # 获取回复表
    if ($db_plist && is_array($db_plist)) {
        foreach ($db_plist as $key => $value) {
            if ($key > 0) {
                $postslist[] = 'pw_posts' . (int) $key;
            } else {
                $postslist[] = 'pw_posts';
            }
        }
    } else {
        $postslist[] = 'pw_posts';
    }
    if (file_exists(D_P . 'data/bbscache/wordsfb_progress.php')) {
        # 读取缓存
        //* require_once pwCache::getPath(D_P.'data/bbscache/wordsfb_progress.php');
        pwCache::getData(D_P . 'data/bbscache/wordsfb_progress.php');
        $temp_threaddb = unserialize($threaddb);
    } else {
        $temp_threaddb = array();
    }
    $forum = $catedb = $forumdb = $subdb1 = $subdb2 = $threaddb = array();
    # 获取版块列表
    $query = $db->query("SELECT fid,name,fup,type FROM pw_forums WHERE cms!='1' ORDER BY vieworder");
    while ($forums = $db->fetch_array($query)) {
        $forums['name'] = Quot_cv(strip_tags($forums['name']));
        if ($forums['type'] == 'category') {
            $catedb[] = $forums;
        } elseif ($forums['type'] == 'forum') {
            $forumdb[] = $forums;
        } elseif ($forums['type'] == 'sub') {
            $subdb1[] = $forums;
        } else {
            $subdb2[] = $forums;
        }
    }
    foreach ($catedb as $cate) {
        $threaddb[$cate['fid']] = array();
        foreach ($forumdb as $key2 => $forumss) {
            if ($forumss['fup'] == $cate['fid']) {
                if (!array_key_exists($forumss['fid'], $temp_threaddb[$cate['fid']])) {
                    # 读取版块帖子总数和表进度
                    $forumss['count'] = 0;
                    $forumss['progress'] = 0;
                    $forumss['result'] = 0;
                    $forumss['table_progress']['pw_threads'] = 0;
                    foreach ($postslist as $pw_posts) {
                        $forumss['table_progress'][$pw_posts] = 0;
                    }
                    $threaddb[$cate['fid']][$forumss['fid']] = $forumss;
                } else {
                    $threaddb[$cate['fid']][$forumss['fid']] = $temp_threaddb[$cate['fid']][$forumss['fid']];
                    unset($threaddb[$cate['fid']][$forumss['fid']]['table_progress']);
                    $threaddb[$cate['fid']][$forumss['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$forumss['fid']]['table_progress']['pw_threads'];
                    foreach ($postslist as $pw_posts) {
                        $threaddb[$cate['fid']][$forumss['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$forumss['fid']]['table_progress'][$pw_posts];
                    }
                }
                unset($forumdb[$key2]);
                foreach ($subdb1 as $key3 => $sub1) {
                    if ($sub1['fup'] == $forumss['fid']) {
                        if (!array_key_exists($sub1['fid'], $temp_threaddb[$cate['fid']])) {
                            # 读取版块帖子总数和表进度
                            $sub1['count'] = 0;
                            $sub1['progress'] = 0;
                            $sub1['result'] = 0;
                            $sub1['table_progress']['pw_threads'] = 0;
                            foreach ($postslist as $pw_posts) {
                                $sub1['table_progress'][$pw_posts] = 0;
                            }
                            $threaddb[$cate['fid']][$sub1['fid']] = $sub1;
                        } else {
                            $threaddb[$cate['fid']][$sub1['fid']] = $temp_threaddb[$cate['fid']][$sub1['fid']];
                            unset($threaddb[$cate['fid']][$sub1['fid']]['table_progress']);
                            $threaddb[$cate['fid']][$sub1['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$sub1['fid']]['table_progress']['pw_threads'];
                            foreach ($postslist as $pw_posts) {
                                $threaddb[$cate['fid']][$sub1['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$sub1['fid']]['table_progress'][$pw_posts];
                            }
                        }
                        unset($subdb1[$key3]);
                        foreach ($subdb2 as $key4 => $sub2) {
                            if ($sub2['fup'] == $sub1['fid']) {
                                if (!array_key_exists($sub2['fid'], $temp_threaddb[$cate['fid']])) {
                                    # 读取版块帖子总数和表进度
                                    $sub2['count'] = 0;
                                    $sub2['progress'] = 0;
                                    $sub2['result'] = 0;
                                    $sub2['table_progress']['pw_threads'] = 0;
                                    foreach ($postslist as $pw_posts) {
                                        $sub2['table_progress'][$pw_posts] = 0;
                                    }
                                    $threaddb[$cate['fid']][$sub2['fid']] = $sub2;
                                } else {
                                    $threaddb[$cate['fid']][$sub2['fid']] = $temp_threaddb[$cate['fid']][$sub2['fid']];
                                    unset($threaddb[$cate['fid']][$sub2['fid']]['table_progress']);
                                    $threaddb[$cate['fid']][$sub2['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$sub2['fid']]['table_progress']['pw_threads'];
                                    foreach ($postslist as $pw_posts) {
                                        $threaddb[$cate['fid']][$sub2['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$sub2['fid']]['table_progress'][$pw_posts];
                                    }
                                }
                                unset($subdb2[$key4]);
                            }
                        }
                    }
                }
            }
        }
    }
    $catedb = serialize($catedb);
    $threaddb = serialize($threaddb);
    # 写入文件
    $filecontent = "<?php\r\n";
    $filecontent .= "\$catedb=" . pw_var_export($catedb) . ";\r\n";
    $filecontent .= "\$threaddb=" . pw_var_export($threaddb) . ";\r\n";
    $filecontent .= "?>";
    $cahce_file = D_P . 'data/bbscache/wordsfb_progress.php';
    pwCache::setData($cahce_file, $filecontent);
    setConfig('db_wordsfb_cachetime', $timestamp);
    updatecache_c();
    return array('catedb' => $catedb, 'threaddb' => $threaddb);
}
Ejemplo n.º 19
0
<?php

!function_exists('readover') && exit('Forbidden');
global $db_picpath, $db_attachname;
$imgdt = $timestamp + $db_hour;
$attachdt = $imgdt + $db_hour * 100;
if (@rename($db_picpath, $imgdt) && @rename($db_attachname, $attachdt)) {
    require_once R_P . 'admin/cache.php';
    setConfig('db_picpath', $imgdt);
    setConfig('db_attachname', $attachdt);
    updatecache_c();
}
pwCache::setData(D_P . "data/bbscache/set_cache.php", "<?php die;?>|{$timestamp}");
Ejemplo n.º 20
0
         $ifpwcache_64 = $db_ifpwcache & 64 ? 'checked' : '';
         $ifpwcache_128 = $db_ifpwcache & 128 ? 'checked' : '';
         $ifpwcache_256 = $db_ifpwcache & 256 ? 'checked' : '';
         $ifpwcache_512 = $db_ifpwcache & 512 ? 'checked' : '';
         $ifpwcache_1024 = $db_ifpwcache & 1024 ? 'checked' : '';
         !$db_cachenum && ($db_cachenum = 20);
         include PrintEot('pwcache');
         exit;
     }
 } elseif ($action == 'blacklist') {
     if ($_POST['step']) {
         InitGP(array('tidblacklist', 'uidblacklist'), 'P');
         $tidblacklist = checkNumStrList($tidblacklist);
         $uidblacklist = checkNumStrList($uidblacklist);
         setConfig('db_tidblacklist', $tidblacklist);
         setConfig('db_uidblacklist', $uidblacklist);
         if ($tidblacklist) {
             $db->update("DELETE FROM pw_elements WHERE type IN('hitsort','hitsortday','hitsortweek','replysort','replysortday','replysortweek', 'newsubject','newreply') AND id IN(" . S::sqlImplode(explode(',', $tidblacklist)) . ')');
         }
         if ($uidblacklist) {
             $db->update("DELETE FROM pw_elements WHERE type='usersort' AND id IN(" . S::sqlImplode(explode(',', $uidblacklist)) . ')');
         }
         updatecache_c();
         adminmsg('operate_success', $basename . '&action=blacklist');
     } else {
         include PrintEot('pwcache');
         exit;
     }
 } elseif ($action == 'update') {
     $type = S::getGP('type', 'G');
     if (!$type) {
Ejemplo n.º 21
0
<?php

require_once R_P . 'lib/cloudwind/cloudwind.class.php';
$_service = CloudWind::getPlatformCheckServerService();
if ($_service->checkCloudWind() < 9) {
    ObHeader($admin_file . '?adminjob=yunbasic');
}
CLOUDWIND_SECURITY_SERVICE::gp(array('action'));
if (empty($action)) {
    if ($_POST['step'] == 2) {
        CLOUDWIND_SECURITY_SERVICE::gp(array('db_yundefend_shield', 'db_yundefend_shieldpost', 'db_yundefend_shielduser'), 'P', 2);
        setConfig('db_yundefend_shield', $db_yundefend_shield);
        setConfig('db_yundefend_shieldpost', $db_yundefend_shieldpost);
        setConfig('db_yundefend_shielduser', $db_yundefend_shielduser);
        updatecache_c();
        Showmsg('云盾设置成功 ');
    }
    ifcheck($db_yundefend_shield, 'yundefend_shield');
    ifcheck($db_yundefend_shieldpost, 'yundefend_shieldpost');
    ${'yundefend_shielduser_' . intval($db_yundefend_shielduser)} = 'checked="checked"';
    $dundescribe = $_service->getDunDescribe();
    $current['config'] = 'current';
} elseif ($action == 'verify') {
    CLOUDWIND_SECURITY_SERVICE::gp(array('page'));
    $page = $page > 1 ? intval($page) : 1;
    $postVerifyService = CloudWind::getDefendPostVerifyService();
    if ($_POST['step'] == 2) {
        CLOUDWIND_SECURITY_SERVICE::gp(array('ids'));
        foreach ($ids as $key => $operate) {
            list($tid, $pid) = explode("_", $key);
            $postVerifyService->verify($operate, $tid, $pid);
Ejemplo n.º 22
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
$basename = "{$admin_file}?adminjob=setads";
if ($action != 'submit') {
    ${'ads_' . $db_ads} = 'checked';
    include PrintEot('setads');
} elseif ($_POST['action'] == "submit") {
    S::gp(array('ads'), 'P');
    setConfig('db_ads', $ads);
    updatecache_c();
    adminmsg('operate_success');
}
Ejemplo n.º 23
0
 function _updateChannelDomain()
 {
     include_once R_P . 'admin/cache.php';
     $channelDAO = $this->_getChannelDAO();
     $channelDomain = $channelDAO->getSecendDomains();
     setConfig('db_channeldomain', $channelDomain);
     updatecache_c();
 }
Ejemplo n.º 24
0
function setConfigSearchTypeExpand($searchAllowExpandType)
{
    global $db_dopen, $db_groups_open;
    //搜索下拉框顺序
    $searchTypeOrder = array('thread' => '帖子', 'cms' => '文章', 'diary' => '日志', 'user' => '用户', 'forum' => '版块', 'group' => '群组');
    $searchAllowDefaultType = array(0 => 'thread', 1 => 'user', 2 => 'forum');
    $searchAllowType = array_merge($searchAllowDefaultType, (array) $searchAllowExpandType);
    $result = array();
    foreach ($searchTypeOrder as $key => $val) {
        if (!in_array($key, $searchAllowType)) {
            continue;
        }
        $result[$key] = $val;
    }
    setConfig('db_search_type', $result);
}
Ejemplo n.º 25
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
require_once R_P . 'require/credit.php';
if (empty($job)) {
    $basename = "{$admin_file}?adminjob=hack&hackset=toolcenter";
    if (!$_POST['step']) {
        ifcheck($db_toolifopen, 'toolifopen');
        ifcheck($db_allowtrade, 'allowtrade');
        include PrintHack('admin');
        exit;
    } else {
        InitGP(array('toolifopen', 'allowtrade'), 'P');
        setConfig('db_toolifopen', $toolifopen);
        setConfig('db_allowtrade', $allowtrade);
        updatecache_c();
        adminmsg('operate_success');
    }
} elseif ($job == 'toolinfo') {
    $basename = "{$admin_file}?adminjob=hack&hackset=toolcenter&job=toolinfo";
    if (!$action) {
        $query = $db->query("SELECT * FROM pw_tools");
        while ($rt = $db->fetch_array($query)) {
            !$rt['creditype'] && ($rt['creditype'] = 'currency');
            $tooldb[] = $rt;
        }
        include PrintHack('admin');
        exit;
    } elseif ($action == 'submit') {
        InitGP(array('tools'), 'P');
        $toolids = array(0);
Ejemplo n.º 26
0
    unset($db_hackdb[$id]);
    $sqlarray = file_exists(R_P . "hack/{$id}/sql.txt") ? FileArray($id) : array();
    !empty($sqlarray) && SQLDrop($sqlarray);
    setConfig('db_hackdb', $db_hackdb);
    $navMenu = L::loadClass('navmenu');
    $navMenu->settype('bbs_navinfo');
    $navMenu->del('hack_' . $id);
    $navMenu->cache();
    adminmsg('operate_success');
} elseif ($action == 'add') {
    InitGP(array('hackdir', 'hackname', 'hackopen'), 'G');
    !empty($db_hackdb[$hackdir]) && adminmsg('hackcenter_sign_exists');
    $sqlarray = file_exists(R_P . "hack/{$hackdir}/sql.txt") ? FileArray($hackdir) : array();
    !empty($sqlarray) && SQLCreate($sqlarray);
    $db_hackdb[$hackdir] = array($hackname, $hackdir, $hackopen);
    setConfig('db_hackdb', $db_hackdb);
    $navMenu = L::loadClass('navmenu');
    $navMenu->settype('bbs_navinfo');
    $navMenu->update('hack_' . $hackdir, array('title' => strip_tags($hackname), 'link' => 'hack.php?H_name=' . $hackdir));
    if ($hackopen == 0) {
        $navMenu->setshow('hack_' . $hackdir, 0);
        $navMenu->setupnav('hack_' . $hackdir, 'hack');
    } elseif ($hackopen == 1) {
        $navMenu->setshow('hack_' . $hackdir, 1);
        $navMenu->setupnav('hack_' . $hackdir, 'hack');
    } elseif ($hackopen == 2) {
        $navMenu->setshow('hack_' . $hackdir, 1);
        $navMenu->setupnav('hack_' . $hackdir);
    }
    $navMenu->cache();
    adminmsg('operate_success');
 /**
  * 
  * @param PW_WeiboSiteBindConfig $config
  */
 function _saveBindConfig($bindConfig)
 {
     require_once R_P . 'admin/cache.php';
     setConfig($this->_config_key, $bindConfig->toArray());
     updatecache_c();
 }
Ejemplo n.º 28
0
 function updatePurviewCache()
 {
     $purviews = $this->findAll('', 0, 0);
     $editadmin = array();
     foreach ($purviews as $pruview) {
         foreach ($pruview['columns'] as $column) {
             $editadmin[$column][] = $pruview['username'];
         }
     }
     setConfig('cms_editadmin', $editadmin, null, true);
     updatecache_conf('cms', true);
 }
Ejemplo n.º 29
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
$basename = "{$admin_file}?adminjob=userpay";
if (!$_POST['action']) {
    include_once D_P . 'data/bbscache/ol_config.php';
    !$ol_paypalcode && ($ol_paypalcode = RandString('40'));
    ifcheck($ol_onlinepay, 'onlinepay');
    include PrintEot('userpay');
    exit;
} else {
    InitGP(array('userpay'), 'P');
    !$userpay['ol_paypalcode'] && ($userpay['ol_paypalcode'] = RandString('40'));
    foreach ($userpay as $key => $value) {
        setConfig($key, $value);
    }
    updatecache_ol();
    adminmsg('operate_success');
}
function RandString($len)
{
    $rand = '1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
    mt_srand((double) microtime() * 1000000);
    for ($i = 0; $i < $len; $i++) {
        $code .= $rand[mt_rand(0, strlen($rand))];
    }
    return $code;
}
Ejemplo n.º 30
-1
 function matchPWD($hash, $pwd)
 {
     if (strlen(getConfig("PWD_HASH_TYPE")) <= 0 || !getConfig("PWD_HASH_TYPE")) {
         setConfig("PWD_HASH_TYPE", "pwdhash");
     }
     if (getConfig("PWD_HASH_TYPE") == "md5") {
         return $hash == md5($pwd);
     } elseif (getConfig("PWD_HASH_TYPE") == "sha1") {
         return $hash == sha1($pwd);
     } else {
         return PwdHash::check_password($hash, $pwd);
     }
 }