Example #1
0
function check_power()
{
    global $global;
    $flag = 0;
    if ($global['admin_id']) {
        $obj = new admin();
        $obj->set_where('adm_id = ' . $global['admin_id']);
        $one = $obj->get_one();
        if ($one['adm_power'] == 'all') {
            $flag = 1;
        } elseif ($one['adm_power'] != '') {
            $val = $global['channel'] . '/mod-' . $global['mod'];
            $urls = explode('|', $one['adm_power']);
            for ($i = 0; $i < count($urls); $i++) {
                if ($urls[$i] == '/' . $val . '/') {
                    $flag = 1;
                    break;
                }
            }
            if ($flag == 0) {
                $obj = new menu();
                $obj->set_where('');
                $obj->set_where("men_url like '%" . $val . "%'");
                if ($obj->get_count() == 0) {
                    $flag = 1;
                }
            }
        }
    }
    return $flag;
}
Example #2
0
function module_admin_power()
{
    global $global, $smarty;
    $obj = new admin();
    $obj->set_where('adm_id = ' . $global['id']);
    $one = $obj->get_one();
    $power = get_power_arr();
    if ($one['adm_power'] == 'all') {
        for ($i = 0; $i < count($power); $i++) {
            $power[$i]['set'] = 1;
        }
    } elseif ($one['adm_power'] != '') {
        $urls = explode('|', $one['adm_power']);
    } else {
        $urls = array();
    }
    if ($one['adm_power'] != 'all') {
        for ($i = 0; $i < count($power); $i++) {
            for ($j = 0; $j < count($urls); $j++) {
                if ($power[$i]['url'] == $urls[$j]) {
                    $power[$i]['set'] = 1;
                    break;
                } else {
                    $power[$i]['set'] = 0;
                }
            }
        }
    }
    $smarty->assign('admin', $one);
    $smarty->assign('power', $power);
}
Example #3
0
function module_admin_edit()
{
    global $global, $smarty;
    $obj = new admin();
    $obj->set_where('adm_id = ' . $global['id']);
    $smarty->assign('admin', $obj->get_one());
}
Example #4
0
function module_admin_list()
{
    global $global, $smarty;
    $obj = new admin();
    $list = $obj->get_list();
    $smarty->assign('admin', $list);
    $obj->set_where('adm_id = ' . $global['admin_id']);
    $one = $obj->get_one();
    $smarty->assign('me', $one);
}
Example #5
0
/**
* controller
*
* @author     Dac Chartrand <*****@*****.**>
* @license    http://www.fsf.org/licensing/licenses/gpl-3.0.html
*/
function sux($action, $params = null)
{
    switch ($action) {
        case 'access':
            // --------------------------------------------------------------------
            // Access
            // --------------------------------------------------------------------
            if (empty($params[0])) {
                suxFunct::redirect(suxFunct::makeUrl('/admin'));
            }
            $edit = new adminAccess($params[0]);
            if ($edit->formValidate($_POST)) {
                $edit->formProcess($_POST);
                $edit->formSuccess();
            } else {
                $edit->formBuild($_POST);
            }
            break;
        case 'log':
            // --------------------------------------------------------------------
            // Log
            // --------------------------------------------------------------------
            $nickname = null;
            if (!empty($params[0])) {
                $nickname = $params[0];
            }
            $admin = new adminLog($nickname);
            $admin->display();
            break;
        case 'purge':
            // --------------------------------------------------------------------
            // Purge logs
            // --------------------------------------------------------------------
            $edit = new adminPurge();
            if ($edit->formValidate($_POST)) {
                $edit->formProcess($_POST);
                $edit->formSuccess();
            } else {
                $edit->formBuild($_POST);
            }
            break;
        default:
            // --------------------------------------------------------------------
            // Default
            // --------------------------------------------------------------------
            $admin = new admin();
            if ($admin->formValidate($_POST)) {
                $admin->formProcess($_POST);
                $admin->formSuccess();
            } else {
                $admin->formBuild($_POST);
            }
            break;
    }
}
 function selectAdmin(admin $ad)
 {
     try {
         $conexao = parent::getConexao();
         $login = $ad->getLogin();
         $senha = $ad->getSenha();
         $comando = $conexao->prepare("select id,nome,email,login,senha from admin where login=? and senha=?");
         $comando->bindParam(1, $login);
         $comando->bindParam(2, $senha);
         $comando->execute();
         return $comando->fetchall(PDO::FETCH_ASSOC);
     } catch (Exception $ex) {
         parent::setErros($ex->getCode() . $ex->getMessage());
     }
 }
Example #7
0
 function edit()
 {
     events::observe('save', 'templates', 'apps', '_save');
     events::observer();
     $tmpl_file = events::get('tmpl_file');
     $app = events::get('app');
     if (events::detect('restore')) {
         self::restoreVersion($app, $tmpl_file, events::get('restore'));
     }
     admin::components('tabs', 'validator');
     f::set('app', $app);
     f::set('tmpl_file', $tmpl_file);
     s::set('app', $app);
     s::set('tmpl_file', $tmpl_file);
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file;
     $code = files::get($file);
     f::set('tmpl_code', $code);
     self::getApps();
     /*
     	Load versions
     */
     db::table('templates_versions');
     db::where('app', $app);
     db::where('tmpl_file', $tmpl_file);
     db::order('version_date', 'DESC');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row['version_date'] = dt::date2print('%H:%i %d.%m.%Y', $row['version_date']);
         $row['version_code'] = '{non}' . htmlspecialchars($row['version_code']) . '{/non}';
         s::roll('versions', $row);
     }
 }
Example #8
0
 function __construct()
 {
     parent::__construct();
     $this->M = new_html_special_chars(getcache('link', 'commons'));
     $this->db = pc_base::load_model('link_model');
     $this->db2 = pc_base::load_model('type_model');
 }
Example #9
0
 function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('workflow_model');
     $this->admin_db = pc_base::load_model('admin_model');
     $this->siteid = $this->get_siteid();
 }
Example #10
0
 function Main()
 {
     if (isset($_GET['action']) && $_GET['action'] == 'step2') {
         $this->checkUser();
         //验证身份,这一步很重要。
         $this->step2();
     } else {
         if (isset($_GET['action']) && $_GET['action'] == 'step3') {
             $this->checkUser();
             //验证身份,这一步很重要。
             $this->step3();
         } else {
             if (isset($_GET['action']) && $_GET['action'] == 'step2_1') {
                 $this->checkUser();
                 //验证身份,这一步很重要。
                 $this->step2_1();
             } else {
                 if (isset($_GET['action']) && $_GET['action'] == 'step2_2') {
                     $this->checkUser();
                     //验证身份,这一步很重要。
                     $this->step2_2();
                 } else {
                     if (isset($_GET['action']) && $_GET['action'] == 'step4') {
                         $this->checkUser();
                         //验证身份,这一步很重要。
                         $this->step4();
                     } else {
                         parent::Main();
                     }
                 }
             }
         }
     }
 }
Example #11
0
 function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('collection_node_model');
     $this->siteid = get_siteid();
     $this->url_list_type = array('1' => L('sequence'), '2' => L('multiple_pages'), '3' => L('single_page'), '4' => 'RSS');
 }
Example #12
0
 function __construct()
 {
     parent::__construct();
     $setting = new_html_special_chars(getcache('poster', 'commons'));
     $this->M = $setting[$this->get_siteid()];
     $this->db = pc_base::load_model('poster_space_model');
 }
Example #13
0
 function __construct()
 {
     parent::__construct();
     $this->load->model('users_model');
     $this->load->model('site/stripe_model');
     $this->load->model('plans_model');
 }
Example #14
0
 function cache()
 {
     admin::components('shiftable');
     db::table('pages');
     db::where('site_id', ADMIN_SITE_ID);
     db::where('page_pub', '2', '!=');
     db::order('page_map');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         if ($row['page_cache'] == '1') {
             $row['page_cache'] = ' checked="checked"';
         } else {
             $row['page_cache'] = '';
         }
         if ($row['page_folder'] == '/') {
             $page_path = 'http://' . ADMIN_SITE;
         } else {
             $page_path = 'http://' . ADMIN_SITE . '' . $row['page_folder'];
         }
         $row['page_line'] = $row['page_title'];
         if ($row['page_dynamic'] == '0') {
             $row['page_line'] = $row['page_line'] . '&nbsp;<a href="' . $page_path . '" style="top: 0;" class="ico ico16 ico_goto" title="Посмотреть на сайте">&nbsp;</a>';
         }
         $page_tree[$row['page_parent']][$row['page_id']] = $row;
     }
     s::tree('page_tree', $page_tree);
 }
Example #15
0
 function defaultAction()
 {
     global $HTTP_SERVER_VARS;
     include "./lib/config.inc.php";
     $db = new sql();
     $db->connect();
     $result = $db->query('SELECT VERSION() AS version');
     if ($result != FALSE && $db->num_rows($result) > 0) {
         $row = $db->fetch_array($result);
         $match = $row['version'];
     } else {
         $result = $db->query('SHOW VARIABLES LIKE \'version\'');
         if ($result != FALSE && $db->num_rows($result) > 0) {
             $row = $db->fetch_array($result);
             $match = $row[1];
         }
     }
     $this->MYSQL_VER = $match;
     $this->PHP_OS = PHP_OS;
     $this->PHP_VERSION = PHP_VERSION;
     $this->CMS = $admin_config["name"] . " " . $admin_config["version"];
     $this->AUTHOR = $admin_config["author"];
     $this->HOME_PAGE = $admin_config["home_page"];
     $content = admin::template("info", $this);
     $this->elements["content"] = $content;
 }
Example #16
0
 function __construct()
 {
     $this->comment_data_db = pc_base::load_model('comment_data_model');
     $this->comment_check_db = pc_base::load_model('comment_check_model');
     parent::__construct();
     $this->comment = pc_base::load_app_class('comment');
 }
Example #17
0
 public function __construct()
 {
     parent::__construct();
     System::load_app_fun('global', G_ADMIN_DIR);
     $this->db = $this->DB('category_model', ROUTE_M);
     $this->ment = array(array("lists", "栏目管理", ROUTE_M . '/' . ROUTE_C . "/lists"), array("addcate", "添加栏目", ROUTE_M . '/' . ROUTE_C . "/addcate/def"), array("addcate", "添加单网页", ROUTE_M . '/' . ROUTE_C . "/addcate/danweb"), array("addcate", "添加外部链接", ROUTE_M . '/' . ROUTE_C . "/addcate/link"));
 }
Example #18
0
 function __construct()
 {
     $this->db = pc_base::load_model('copyfrom_model');
     pc_base::load_sys_class('form', '', 0);
     parent::__construct();
     $this->siteid = $this->get_siteid();
 }
Example #19
0
 public function insert()
 {
     $msg = array();
     $path = isset($_POST['path']) ? _encrypt($_POST['path'], 'DECODE') : '';
     $size = isset($_POST['size']) ? _encrypt($_POST['size'], 'DECODE') : 0;
     $type = isset($_POST['type']) ? _encrypt($_POST['type'], 'DECODE') : 'image';
     $type = explode(',', $this->getUPtype($type, true));
     $watermark = $_POST['iswatermark'] == "true" ? "yes" : "no";
     if (!is_dir(G_UPLOAD . $path)) {
         $msg['ok'] = 'no';
         $msg['text'] = $path . "文件夹不存在";
         echo json_encode($msg);
         exit;
     }
     System::load_app_class("admin", G_ADMIN_DIR, "no");
     $admincheck = admin::StaticCheckAdminInfo() ? 1 : 0;
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config($type, $size, $path);
         upload::go_upload($_FILES['Filedata'], $watermark);
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = $path . '/' . upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
Example #20
0
 function __construct()
 {
     parent::__construct();
     $this->sites = pc_base::load_app_class('sites', 'admin');
     $this->db = pc_base::load_model('wap_model');
     $this->type_db = pc_base::load_model('wap_type_model');
 }
Example #21
0
	function __construct() {
		parent::__construct();
		$this->siteid = $this->get_siteid();
		$this->db = pc_base::load_model('search_model');
		$this->module_db = pc_base::load_model('module_model');
		$this->type_db = pc_base::load_model('type_model');
	}
Example #22
0
 function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('admin_model');
     $this->role_db = pc_base::load_model('admin_role_model');
     $this->op = pc_base::load_app_class('admin_op');
 }
Example #23
0
 public function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('special_content_model');
     $this->data_db = pc_base::load_model('special_c_data_model');
     $this->type_db = pc_base::load_model('type_model');
 }
Example #24
0
 function defaultAction()
 {
     $db = new sql();
     $db->connect();
     $chid = $this->chid;
     include "lib/pagination.class.php";
     include "lib/orderby.class.php";
     $adminConfig = admin::adminConfig();
     for ($i = 1; $i < 4; $i++) {
         $voteTR = "";
         $orderBy = new orderBy("?chid=" . $this->chid . "&", array("id" => "№", "time" => "Дата", "name" => "Заголовок", "company" => "Компания", "gsum" => "Средний бал", "gcount" => "Проголосовало"), array("gsum" => "desc"), $this->field[$i], $this->order[$i], array("field[{$i}]", "order[{$i}]"));
         $pagination = new pagination($orderBy->urlForPage(), $this->page, $adminConfig["recPerPage"], '', "projects", "id");
         $res = $db->query("select projects.id, name, company, category_name, date, sum(IF(grade is null,0, grade))/count(IF(grade is null,0, grade)) as gsum, count(grade) as gcount FROM (projects LEFT JOIN categories ON projects.category = categories.category_id) left join votes on projects.id=votes.id where category={$i} group by projects.id, name, company, category_name, date " . $orderBy->orderByQuery() . " " . $pagination->limit());
         $page = $this->page ? "&page=" . $this->page : "";
         while ($data = $db->fetch_array($res)) {
             $data["date"] = date("d.m.Y", $data["date"]);
             eval('$voteTR.="' . admin::template("voteTR") . '";');
         }
         $pageBar = $pagination->bar();
         $th = $orderBy->bar();
         eval('$content.="' . admin::template("voteMain") . '";');
         $content .= "<br>";
     }
     $this->elements["content"] = $content;
 }
Example #25
0
 public function __construct()
 {
     parent::__construct();
     //if (!module_exists(ROUTE_M)) showmessage(L('module_not_exists'));
     $this->username = param::get_cookie('admin_username');
     $this->db = pc_base::load_model('announce_model');
 }
Example #26
0
 function Main()
 {
     if (isset($_GET['action']) && $_GET['action'] == 'print') {
         $this->checkUser();
         //验证身份,这一步很重要。
         $this->print1();
     } else {
         if (isset($_GET['action']) && $_GET['action'] == 'viewbill') {
             $this->checkUser();
             //验证身份,这一步很重要。
             $this->viewbill();
         } else {
             if (isset($_GET['action']) && $_GET['action'] == 'recoil') {
                 $this->checkUser();
                 //验证身份,这一步很重要。
                 $this->recoil();
             } else {
                 if (isset($_GET['action']) && $_GET['action'] == 'audit') {
                     $this->checkUser();
                     //验证身份,这一步很重要。
                     $this->audit();
                 } else {
                     if (isset($_GET['action']) && $_GET['action'] == 'turnback') {
                         $this->checkUser();
                         //验证身份,这一步很重要。
                         $this->turnback();
                     } else {
                         parent::Main();
                     }
                 }
             }
         }
     }
 }
Example #27
0
 public function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('sitemodel_field_model');
     $this->model_db = pc_base::load_model('sitemodel_model');
     $this->siteid = $this->get_siteid();
 }
Example #28
0
 function __construct()
 {
     parent::__construct();
     $this->M = new_html_special_chars(getcache('vote', 'commons'));
     $this->db = pc_base::load_model('vote_subject_model');
     $this->db2 = pc_base::load_model('vote_option_model');
 }
Example #29
0
 function Main()
 {
     if (isset($_GET['action']) && $_GET['action'] == 'viewhistorty') {
         $this->checkUser();
         //验证身份,这一步很重要。
         $this->viewhistorty();
     } else {
         if (isset($_GET['action']) && $_GET['action'] == 'savetohistory') {
             $this->checkUser();
             //验证身份,这一步很重要。
             $this->savetohistory();
         } else {
             if (isset($_GET['action']) && $_GET['action'] == 'audit') {
                 $this->checkUser();
                 //验证身份,这一步很重要。
                 $this->audit();
             } else {
                 if (isset($_GET['action']) && $_GET['action'] == 'exportexcel') {
                     $this->checkUser();
                     //验证身份,这一步很重要。
                     $this->exportexcel();
                 } else {
                     if (isset($_GET['action']) && $_GET['action'] == 'printview') {
                         $this->checkUser();
                         //验证身份,这一步很重要。
                         $this->printview();
                     } else {
                         parent::Main();
                     }
                 }
             }
         }
     }
 }
Example #30
0
 function Main()
 {
     if (isset($_GET['action']) && $_GET['action'] == 'selectwarehouse') {
         $this->checkUser();
         //验证身份,这一步很重要。
         $this->selectwarehouse();
     } else {
         if (isset($_GET['action']) && $_GET['action'] == 'submittoaudit') {
             $this->checkUser();
             //验证身份,这一步很重要。
             $this->submittoaudit();
         } else {
             if (isset($_GET['action']) && $_GET['action'] == 'audit') {
                 $this->checkUser();
                 //验证身份,这一步很重要。
                 $this->audit();
             } else {
                 if (isset($_GET['action']) && $_GET['action'] == 'print') {
                     $this->checkUser();
                     //验证身份,这一步很重要。
                     $this->print1();
                 } else {
                     if (isset($_POST['action']) && $_POST['action'] == 'save1') {
                         $this->checkUser();
                         //验证身份,这一步很重要。
                         $this->save1();
                     } else {
                         parent::Main();
                     }
                 }
             }
         }
     }
 }