本文整理汇总了PHP中admin类的典型用法代码示例。如果您正苦于以下问题:PHP admin类的具体用法?PHP admin怎么用?PHP admin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了admin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_power
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;
}
示例2: module_admin_power
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);
}
示例3: module_admin_edit
function module_admin_edit()
{
global $global, $smarty;
$obj = new admin();
$obj->set_where('adm_id = ' . $global['id']);
$smarty->assign('admin', $obj->get_one());
}
示例4: module_admin_list
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);
}
示例5: sux
/**
* controller
*
* @author Dac Chartrand <dac.chartrand@gmail.com>
* @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;
}
}
示例6: selectAdmin
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());
}
}
示例7: edit
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);
}
}
示例8: __construct
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();
}
示例9: cache
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'] . ' <a href="' . $page_path . '" style="top: 0;" class="ico ico16 ico_goto" title="Посмотреть на сайте"> </a>';
}
$page_tree[$row['page_parent']][$row['page_id']] = $row;
}
s::tree('page_tree', $page_tree);
}
示例10: defaultAction
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;
}
示例11: insert
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);
}
}
示例12: __construct
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');
}
示例13:
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');
}
示例14: Main
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();
}
}
}
}
}
}
示例15: array
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');
}