Esempio n. 1
0
File: user.php Progetto: sembrono/1
/*
 * 用户中心文件
*/
if (!defined('IN_CRONLITE')) {
    exit;
}
$title = "任务管理";
include_once TEMPLATE_ROOT . "head.php";
if ($islogin == 1) {
    $gls = $DB->count("SELECT count(*) from wjob_job WHERE lx='{$gl}'");
    if ($row['num'] == $gls) {
    } else {
        $DB->query("UPDATE wjob_user SET num= '{$gls}' WHERE user = '******'");
    }
    navi();
    if (OPEN_CRON == 0) {
        showmsg('当前站点未开启此功能。', 2);
        exit;
    }
    echo '<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title" align="center">网址监控任务控制面板</h3></div>';
    echo '<div class="panel-body">请从以下' . $conf['sysnum'] . '个系统中选择一个总任务数较少的来添加你的网址监控任务。<br/>本系统有以下功能:自定义运行时间,自定义使用代理,自定义代理ip及端口号,自定义POST模拟,自定义POST数据,自定义COOKIE,自定义来源地址,自定义模拟浏览器。<br/><br/>';
    echo '
<div class="alert alert-info">你总共建立了' . $gls . '条任务 [<a href="index.php?mod=output">导出任务</a>]</div>';
    $show = explode('|', $conf['show']);
    echo '<div class="table-responsive"><table class="table table-hover"><thead><tr>';
    echo '<th>任务系统</th><th>总任务数</th><th>你的任务</th><th>执行频率</th></thead><tbody>';
    for ($i = 1; $i <= $conf['sysnum']; $i++) {
        $addstr = '';
        $all_sys = $DB->count("SELECT count(*) from wjob_job WHERE sysid='{$i}'");
Esempio n. 2
0
function processAdminRequest($url)
{
    global $modulesMgr, $structureMgr, $authenticationMgr, $permissionsMgr, $cacheMgr, $templatesMgr;
    $userID = $authenticationMgr->getUserID();
    $userGroupID = $authenticationMgr->getUserGroup();
    // Если пользователь - гость, то отправить логиниться
    if ($userID == 1 || $userGroupID != 5) {
        header('Status: 302 Moved');
        header('Location: /login');
        exit;
    }
    SetCfg('InAdmin', true);
    //$pageID = isset($_GET['pageID']) ? $_GET['pageID'] : -1;
    if ($url == '/') {
        $pageID = -1;
    } else {
        //direct link is provided to edit some content
        $pageID = $structureMgr->getPageIDByPath($url);
        //$md = $structureMgr->getMetaData($pageID);
        if (!$pageID) {
            trigger_error('Admin 404 will be provided later. But now it is just a fatal error.', PM_FATAL);
        }
        if (!$permissionsMgr->canUpdate($pageID, $userID)) {
            trigger_error('Beautiful 403 will be provided later. But now it is just a fatal error.', PM_FATAL);
        }
    }
    include '_kernel.edit.php';
    $tpl = $templatesMgr->getTemplate(-1, GetCfg('TemplatesPath') . '/admin/page.html');
    $tpl = str_replace('%site_name%', GetCfg('SiteName'), $tpl);
    $res = '';
    $cmd = _var('cmd');
    if ($pageID == -1) {
        $pageID = _var('pageID');
        if (!$pageID) {
            $pageID = $structureMgr->getRootPageID();
        }
        //print 'pageID='.$pageID;
        if ($permissionsMgr->canUpdate($pageID, $userID) == false) {
            trigger_error('Beautiful 403 will be provided later. But now it is just a fatal error.', PM_FATAL);
        }
        if (!$cmd) {
            $res .= navi($pageID, false);
            $res .= structure($pageID);
            // this very evil function. Very slowed.
        } else {
            $res .= processAdminCommand($cmd, $pageID);
        }
    } else {
        if ($permissionsMgr->canUpdate($pageID, $userID) == false) {
            trigger_error('Beautiful 403 will be provided later. But now it is just a fatal error.', PM_FATAL);
        }
        $res .= processAdminCommand('editPage', $pageID);
    }
    $admMenu = admMenu($cmd);
    $tpl = str_replace('%content%', $res, $tpl);
    $tpl = str_replace('%adm_menu%', $admMenu, $tpl);
    print $tpl;
}
Esempio n. 3
0
function uppe()
{
    global $SIDU;
    $url = @array_pop(@explode("/", $_SERVER['SCRIPT_NAME']));
    if ($url == 'db.php') {
        $title = ($SIDU[4] != '' ? "{$SIDU['4']} « " : "") . ($SIDU[2] ? "{$SIDU['2']} « " : "") . $SIDU[1];
        $ico = $SIDU[4] || $SIDU[3] ? "z{$SIDU['3']}" : ($SIDU[2] ? "xsch" : "xdb");
    } elseif ($url == 'tab.php') {
        $title = $SIDU[4] . ($SIDU[2] ? " « {$SIDU['2']}" : "") . " « {$SIDU['1']}";
        $ico = "x{$SIDU['3']}";
    } else {
        $ico = "sidu";
    }
    if (!$title) {
        $title = "SIDU 3 Database Web GUI: MySQL + Postgres + SQLite";
    }
    echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>\n<link rel='shortcut icon' href='img/{$ico}.png'/>\n<title>{$title}</title>\n<link rel='stylesheet' media='all' type='text/css' href='css.css'/>";
    if ($SIDU['page']['xJS']) {
        echo "\n<script language='javascript' type='text/javascript' src='x.js'></script>\n<script language='javascript' type='text/javascript' src='xenabledrag.js'></script>";
    }
    echo "\n<script language='javascript' type='text/javascript' src='css.js'></script>\n</head>\n<body>";
    if ($SIDU['page']['nav']) {
        echo "<div class='nav1'>";
        if ($SIDU['page']['nav'] == 'defa') {
            echo @html_img('img/sidu'), " <b>SIDU 3.2</b> Database Web GUI ", @html_img('img/tool-web'), " <b>sidu.sf.net</b>";
        } else {
            @navi();
        }
        echo "</div><div class='nav2'>&nbsp;</div>";
    }
}
Esempio n. 4
0
function processAdminCommand($cmd, $pageID)
{
    global $modulesMgr, $structureMgr, $authenticationMgr, $permissionsMgr, $cacheMgr, $templatesMgr;
    $res = "";
    switch ($cmd) {
        case "editPage":
            $res .= navi($pageID, false);
            $res .= editPage($pageID);
            break;
        case "editDict":
            $res .= editDict();
            break;
        case "addDictValue":
            $res .= addDictValue();
            break;
        case "updateDictValues":
            $res .= updateDictValues();
            break;
        case "delDictValue":
            $res .= delDictValue();
            break;
        case "updatePage":
            updatePage();
            break;
            //we always exit in prev. function
        case "delPage":
            delPage(_get("pageID"));
            break;
            //we always exit in prev. function
        case "addPage":
            $res .= navi(_get("pageID"), true);
            $res .= editPage(-1);
            break;
        case "updChildren":
            //first we should handle group movements
            $cmds = _postByPattern("/cmd\\d+/");
            $cmdsFound = false;
            if (count($cmds) > 0) {
                foreach ($cmds as $cmdkey => $curcmd) {
                    if ($curcmd) {
                        $cmdsFound = true;
                        switch ($curcmd) {
                            case "movePages":
                                movePages($pageID);
                                break;
                            case "moveToTheTop":
                                moveToTheTop($pageID);
                                break;
                            case "moveToTheBottom":
                                moveToTheBottom($pageID);
                                break;
                            case "delPages":
                                delPages($pageID);
                                break;
                        }
                        break;
                    }
                }
            }
            if (!$cmdsFound) {
                //no cmds found, just update children
                updateChildren();
            }
            break;
        case "modparams":
            global $modulesMgr;
            $ms = $modulesMgr->modules();
            $dicts = array();
            foreach ($ms as $mname => $m) {
                $d = GetCfg($mname . ".dictionaries");
                if ($d) {
                    $dicts[$mname] = $d;
                }
            }
            $res .= "<h4>Справочники</h4>";
            foreach ($dicts as $mname => $dict) {
                $res .= GetCfg($mname . ".ModuleName") . ": ";
                $r1 = "";
                foreach ($dict as $dname => $d) {
                    if ($r1) {
                        $r1 .= ", ";
                    }
                    $r1 .= "<a href=/admin/?cmd=editDict&moduleName={$mname}&dict={$dname}>{$d['0']}</a>";
                }
                $res .= "{$r1}<br>\n";
            }
            break;
        case "cards":
            $act = _get('act');
            $cardAdmin = new CardsAdminHandler();
            if (isset($act) && $act != '') {
                $res .= $cardAdmin->handleRequest($act);
            } else {
                $res .= $cardAdmin->getList();
            }
            break;
        case "users":
            $handler = new UsersAdminHandler();
            $res .= $handler->getContent();
            if ($handler->location != '') {
                header('Location: ' . $handler->location);
            }
            break;
        case "mails":
            $handler = new MailsAdminHandler();
            $act = _get('act');
            if ($act == "send") {
                $handler->sendToMail();
            } else {
                $res .= $handler->getContent();
            }
            break;
        case "banner":
            $handler = new BannerAdminHandler();
            $act = _get('act');
            $banID = _get('banID');
            switch ($act) {
                case "save":
                    $handler->saveBanner();
                    break;
                case "delete":
                    $handler->deleteBanner($banID);
                    break;
                default:
                    $res .= $handler->getContent($banID);
                    break;
            }
            break;
        case "vote":
            $handler = new VoteAdminHandler();
            $act = _get('act');
            $qID = _get('qID');
            switch ($act) {
                case "save":
                    $handler->saveVote();
                    break;
                case "delete":
                    $handler->deleteVote($qID);
                    break;
                default:
                    $res .= $handler->getContent($qID);
                    break;
            }
            break;
        default:
            $res .= navi($pageID, false);
            $res .= "Unknown command: {$cmd}<br><br>\n";
    }
    return $res;
}
Esempio n. 5
0
</a>
               <ul>
                  <li><a href="/admin/users"><span class="icon ion-android-contact"></span><?php 
echo lang('side_all_user');
?>
</a>
                  </li>
                  <li><a href="forms_extras.html"><span class="icon ion-android-contacts"></span><?php 
echo lang('side_groups');
?>
</a>
                  </li>
               </ul>
            </li>
            <li class="<?php 
echo navi("settings");
?>
">
               <a href="javascript:void(0);">
               <img src="/tempe/ganteng/img/icons/packs/fugue/16x16/abacus.png" alt="" height=16 width=16><?php 
echo lang('side_settings');
?>
               </a>
               <ul>
                  <li><a href="<?php 
echo base_url($this->uri->segment(1) . "/admin");
?>
/settings/general"><span class="icon ion-android-options"></span><?php 
echo lang('side_general');
?>
</a>