예제 #1
0
 /**
  * 后台用户登录
  *
  * @author Rocks
  */
 public function login($email = null, $password = null, $verify = null)
 {
     if (IS_POST) {
         $Admin = D('AdminAdmin');
         $adminid = $Admin->login($email, $password);
         if (0 < $adminid) {
             $this->success('登录成功!', U('Home/Index/index'));
         } else {
             switch ($adminid) {
                 case -1:
                     $error = '用户不存在或被禁用!';
                     break;
                 case -2:
                     $error = '密码错误!';
                     break;
                 default:
                     $error = '未知错误!';
                     break;
             }
             $this->error($error);
         }
     } else {
         if (is_admin_login()) {
             $this->redirect('Home/Index/index');
         } else {
             $config = S('DB_CONFIG_DATA');
             if (!$config) {
                 $config = api('SystemConfig/lists');
                 S('DB_CONFIG_DATA', $config);
             }
             C($config);
             $this->display();
         }
     }
 }
예제 #2
0
파일: board.php 프로젝트: nemoluv/pushwing
 function __construct()
 {
     parent::__construct();
     $this->lang->load('board', 'korean');
     $this->load->helper(array('alert', 'common'));
     $this->load->model('board_m');
     $this->load->library('tank_auth');
     $this->lang->load('tank_auth');
     is_admin_login(3);
     $perm = explode("|", '0|0|3|3');
     $this->list_perm = $perm[0];
     $this->view_perm = $perm[1];
     $this->comment_perm = $perm[2];
     $this->write_perm = $perm[3];
     if ($this->uri->segment(2) == 'notice') {
         $title = '공지사항';
         $num = 2;
     }
     define('MENU_BOARD_NAME', $title);
     define('MENU_ID', $num);
     define('MENU_CATEGORY_WORD', '');
     $this->output->enable_profiler(false);
     $this->seg_exp = segment_explode($this->uri->uri_string());
     //var_dump($this->seg_exp);
     $this->load->helper('ckeditor');
     //Ckeditor's configuration
     $this->data['ckeditor'] = array('id' => 'contents', 'path' => 'include/ckeditor', 'config' => array('toolbar' => "Full", 'width' => "550px", 'height' => '100px'), 'styles' => array('style 1' => array('name' => 'Blue Title', 'element' => 'h2', 'styles' => array('color' => 'Blue', 'font-weight' => 'bold')), 'style 2' => array('name' => 'Red Title', 'element' => 'h2', 'styles' => array('color' => 'Red', 'font-weight' => 'bold', 'text-decoration' => 'underline'))));
 }
예제 #3
0
 public function _initialize()
 {
     parent::_initialize();
     //dump($_SESSION);exit;
     if (!is_admin_login()) {
     }
 }
 /**
  * 检测登录
  *
  * @return bool|\Illuminate\Http\RedirectResponse
  * @author yangyifan <*****@*****.**>
  */
 private function checkIsLogin()
 {
     load_func('common');
     $uid = is_admin_login();
     return $uid <= 0 && header('location:' . action('Admin\\LoginController@getIndex'));
     die;
 }
예제 #5
0
 public function _initialize()
 {
     parent::_initialize();
     if (!is_admin_login()) {
         $this->error('你没有权限登录', C('UC_LOGIN_URL'));
         exit;
     }
 }
 /**
  * 判断是否登录状态
  *
  * @return bool
  * @author yangyifan <*****@*****.**>
  */
 public static function hasLoginStatus()
 {
     //加载函数库
     load_func('common');
     if (is_admin_login() > 0) {
         return true;
     }
     return false;
 }
 /**
  * 登录操作
  *
  * @return Response
  * @author yangyifan <*****@*****.**>
  */
 public function getIndex()
 {
     load_func('common');
     //判断是否已经登录
     if (is_admin_login() > 0) {
         return redirect(url('admin/home'), 302);
     }
     return view('admin.login.login');
 }
예제 #8
0
 protected function _initialize()
 {
     // 获取当前用户ID
     define('UID', is_admin_login());
     if (!UID) {
         // 还没登录 跳转到登录页面
         $this->redirect('/Admin/');
     }
 }
예제 #9
0
 public function logout()
 {
     if (is_admin_login()) {
         D('AdminAdmin')->logout();
         session('[destroy]');
         $this->success('退出成功!', U('login'));
     } else {
         $this->redirect('login');
     }
 }
예제 #10
0
파일: client.php 프로젝트: nemoluv/pushwing
 public function __construct()
 {
     parent::__construct();
     $this->load->model('admin/client_m');
     $this->load->helper('alert');
     $this->load->helper('common');
     $this->seg_exp = segment_explode($this->uri->uri_string());
     $this->output->enable_profiler(false);
     is_admin_login('9', $this->uri->segment(2));
 }
예제 #11
0
 public function _initialize()
 {
     parent::_initialize();
     //echo 'index';exit;
     //dump($_SESSION);exit;
     if (is_admin_login()) {
         redirect('/Home/AdminPage/index?access_token=' . $_GET['access_token']);
     } elseif (is_staff_login()) {
         redirect('/Home/StaffPage/index?access_token=' . $_GET['access_token']);
     }
 }
예제 #12
0
 public function _initialize()
 {
     parent::_initialize();
     if (is_admin_login()) {
         $data['status'] = 0;
         $data['info'] = '管理员暂时不能报修';
         $this->ajaxReturn($data, 'JSON');
         exit;
     } elseif (is_user_login()) {
         $data['status'] = 0;
         $data['info'] = '你没有权限访问';
         $this->ajaxReturn($data, 'JSON');
         exit;
     }
 }
예제 #13
0
 /**
  * 后台控制器初始化
  */
 protected function _initialize()
 {
     // 获取当前用户ID
     define('UID', is_admin_login());
     if (!UID) {
         // 还没登录 跳转到登录页面
         $this->redirect('Member/Login/login');
     }
     /* 读取数据库中的配置 */
     $config = S('DB_CONFIG_DATA');
     if (!$config) {
         $config = api('SystemConfig/lists');
         S('DB_CONFIG_DATA', $config);
     }
     C($config);
     //添加配置
     // 是否是超级管理员
     define('IS_ROOT', is_administrator());
     if (!IS_ROOT && C('ADMIN_ALLOW_IP')) {
         // 检查IP地址访问
         if (!in_array(get_client_ip(), explode(',', C('ADMIN_ALLOW_IP')))) {
             $this->error('403:禁止访问');
         }
     }
     // 		// 检测访问权限
     // 		$access =   $this->accessControl();
     // 		if ( $access === false ) {
     // 			$this->error('403:禁止访问');
     // 		}elseif( $access === null ){
     // 			$dynamic        =   $this->checkDynamic();//检测分类栏目有关的各项动态权限
     // 			if( $dynamic === null ){
     // 				//检测非动态权限
     // 				$rule  = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME);
     // 				if ( !$this->checkRule($rule,array('in','1,2')) ){
     // 					$this->error('未授权访问!');
     // 				}
     // 			}elseif( $dynamic === false ){
     // 				$this->error('未授权访问!');
     // 			}
     // 		}
     $this->assign('__UID__', UID);
 }
예제 #14
0
파일: header.php 프로젝트: umuttepe2/phurl
?>
<html>
<head>
<title>Phurl Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../assets/admin.css" />
<script type="text/javascript" src="../assets/admin.js"></script>
<style type="text/css">
.style2 {
	font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
}
</style>
</head>
<body>
<?php 
if (is_admin_login()) {
    ?>
<img src="http://code.google.com/p/phurl/logo?cct=1278165547" alt="Phurl" height="52" width="116" />

<span class="style2">Administration<hr />
<?php 
    $updateurl = "http://liveupdate.hencogroup.co.uk/os/phurl/latest.txt";
    $fh = fopen($updateurl, 'r');
    $version = fread($fh, 3);
    fclose($fh);
    $current = PHURL_NUMERICVERSION;
    if ($version > $current && $version !== $current) {
        echo "<center><p style=\"color:green;\">A new version of Phurl is available! Download it at <a href=\"http://code.google.com/p/phurl/downloads/list\">http://code.google.com/p/phurl/downloads/list</a></p></center><hr/>";
    } elseif ($version < $current && $version !== $current) {
        echo "<center><p style=\"color:blue;\">It seems you are running a prerelease version of Phurl. Expect Bugs!</p></center><hr/>";
    }
예제 #15
0
파일: index.php 프로젝트: umuttepe2/phurl
<?php

session_start();
require_once "../config.php";
require_once "../functions.php";
if (!is_admin_login()) {
    header("Location: login.php", true, 301);
    exit;
}
require_once "header.php";
db_connect();
$delete_id = (int) @$_GET['delete_id'];
if ($delete_id > 0) {
    mysql_query("DELETE FROM " . DB_PREFIX . "urls WHERE id = '{$delete_id}'") or db_die(__FILE__, __LINE__, mysql_error());
}
$page = (int) @$_GET['page'];
if ($page < 1) {
    $page = 1;
}
$db_query = "1 AND ";
$search_alias = mysql_real_escape_string(@$_GET['search_alias']);
$search_url = mysql_real_escape_string(@$_GET['search_url']);
if (!empty($search_alias)) {
    $db_query .= "(code = '{$search_alias}' OR alias = '{$search_alias}') AND ";
}
if (!empty($search_url)) {
    $db_query .= "url LIKE '%{$search_url}%' AND ";
}
$db_query = substr($db_query, 0, -5);
$db_result = mysql_query("SELECT COUNT(id) FROM " . DB_PREFIX . "urls WHERE {$db_query}") or db_die(__FILE__, __LINE__, mysql_error());
$db_row = mysql_fetch_row($db_result);