Exemple #1
0
function before()
{
    layout('layouts/default.html.php');
    /*set('header', '
          <a href="'.url_for().'">Home</a>
          <a href="'.url_for('people').'">Personen</a>
          <a href="'.url_for('roles').'">Rollen</a>
          <a href="'.url_for('access').'">Zugriff</a>
          <a href="'.url_for('servers').'">Server</a>
          <a href="'.url_for('daemons').'">Daemons</a>
      ');*/
    set('header', '
        <img id="header_img" src="img/aclmodel.png" width="850" height="83" usemap="#head_nav" alt="header_navigation">
        <map name="head_nav">
            <area id="daemons_nav" shape="rect" href="' . url_for('daemons') . '" coords="682,7,781,28" alt="daemons">
            <area id="servers_nav" shape="rect" href="' . url_for('servers') . '" coords="516,7,635,28" alt="servers">
            <area id="access_nav" shape="rect" href="' . url_for('access') . '" coords="391,7,478,28" alt="access">
            <area id="roles_nav" shape="rect" href="' . url_for('roles') . '" coords="239,7,340,28" alt="roles">
            <area id="people_nav" shape="rect" href="' . url_for('people') . '" coords="74,7,193,28" alt="people">
            <area id="clients_nav" shape="rect" href="' . url_for('clients') . '" coords="2,55,98,76" alt="clients">
            <area id="people_roles_nav" shape="rect" href="' . url_for('people_roles') . '" coords="176,54,267,75" alt="people_roles">
            <area id="ports_nav" shape="rect" href="' . url_for('ports') . '" coords="748,55,849,76" alt="ports">
        </map>
    ');
    set('footer', '&copy; 2011 - Florian Staudacher (Frontend), Alexander Philipp Lintenhofer (Backend)');
}
 public function ueditor()
 {
     $data = new \Org\Util\Ueditor();
     layout(false);
     C('SHOW_PAGE_TRACE', false);
     echo $data->output();
 }
Exemple #3
0
function adminuser($lang, $arglist = false)
{
    if (!user_has_role('administrator')) {
        return run('error/unauthorized', $lang);
    }
    $user_id = false;
    if (is_array($arglist)) {
        if (isset($arglist[0])) {
            $user_id = $arglist[0];
        }
    }
    if (!$user_id) {
        return run('error/notfound', $lang);
    }
    $user_id = user_id($user_id);
    if (!$user_id) {
        return run('error/notfound', $lang);
    }
    $useredit = build('useredit', $lang, $user_id);
    if ($useredit === false) {
        return redirect('admin', $lang);
    }
    head('title', translate('admin:title', $lang));
    head('description', false);
    head('keywords', false);
    head('robots', 'noindex, nofollow');
    $admin = true;
    $banner = build('banner', $lang, compact('admin'));
    $content = view('adminuser', $lang, compact('useredit'));
    $output = layout('standard', compact('banner', 'content'));
    return $output;
}
Exemple #4
0
function homepage($lang)
{
    global $sitename, $siteshot;
    $page_contents = build('content', $lang, 'homepage');
    $besocial = $sharebar = false;
    $ilike = true;
    $tweetit = true;
    $plusone = true;
    $linkedin = true;
    $pinit = true;
    if ($tweetit or $pinit) {
        $description = translate('description', $lang);
        if ($tweetit) {
            $tweet_text = $description ? $description : $sitename;
            $tweetit = $tweet_text ? compact('tweet_text') : true;
        }
        if ($pinit) {
            $pinit_text = $description ? $description : $sitename;
            $pinit_image = $siteshot;
            $pinit = $pinit_text && $pinit_image ? compact('pinit_text', 'pinit_image') : false;
        }
    }
    list($besocial, $sharebar) = socialize($lang, compact('ilike', 'tweetit', 'plusone', 'linkedin', 'pinit'));
    $content = view('anypage', false, compact('page_contents', 'besocial'));
    head('title', $sitename);
    $languages = 'homepage';
    $contact = true;
    $banner = build('banner', $lang, compact('languages', 'contact'));
    $languages = false;
    $contact = false;
    $footer = build('footer', $lang, compact('languages', 'contact'));
    $output = layout('standard', compact('sharebar', 'banner', 'footer', 'content'));
    return $output;
}
 public function index()
 {
     layout(false);
     dump($ret);
     die;
     $this->display();
 }
function configure()
{
    option('views_dir', '../app/views');
    option('controllers_dir', '../app/controllers');
    option('encoding', 'utf-8');
    layout('layouts/default.html.php');
}
Exemple #7
0
function threadall($lang)
{
    global $system_languages, $with_toolbar;
    if (!user_has_role('writer')) {
        return run('error/unauthorized', $lang);
    }
    $slang = false;
    if (isset($_GET['slang'])) {
        $slang = $_GET['slang'];
    } else {
        $slang = $lang;
    }
    if (!in_array($slang, $system_languages)) {
        return run('error/notfound', $lang);
    }
    $site_title = translate('title', $lang);
    $site_abstract = translate('description', $lang);
    $site_cloud = translate('keywords', $lang);
    head('title', translate('threadall:title', $slang));
    head('description', false);
    head('keywords', false);
    head('robots', 'noindex, nofollow');
    $edit = user_has_role('writer') ? url('threadedit', $_SESSION['user']['locale']) . '?' . 'clang=' . $lang : false;
    $banner = build('banner', $lang, $with_toolbar ? false : compact('edit'));
    $scroll = true;
    $toolbar = $with_toolbar ? build('toolbar', $lang, compact('edit', 'scroll')) : false;
    $threadlist = build('threadlist', $lang, false, false, $slang);
    $content = view('threadall', $slang, compact('site_title', 'site_abstract', 'site_cloud', 'threadlist'));
    $output = layout('viewing', compact('toolbar', 'banner', 'content'));
    return $output;
}
 public function ajax_display($view)
 {
     layout(false);
     $this->html = $this->fetch($view);
     // sleep(5);
     $this->display();
 }
 public function jump()
 {
     layout(false);
     $gid = I('id');
     $from = I('from');
     $model = M('goods');
     $find = $model->field('gurl')->where('gid=' . $gid)->find();
     empty($from) ? $from = 'pc' : ($from = 'app');
     if (empty($find)) {
         $this->redirect('/Index');
     }
     $c_model = M('userclick');
     $c_find = $c_model->field('uid')->where('gid=' . $gid)->find();
     if (empty($c_find)) {
         $data = array('gid' => $gid, 'count' => 1, 'ip' => get_client_ip(), 'from' => $from, 'endtime' => date('Y-m-d H:i:s'));
         $c_model->add($data);
     } else {
         $c_model->where('gid=' . $gid)->setInc('count', 1);
     }
     $pos = strpos($find['gurl'], "=");
     $pos++;
     $pid = substr($find['gurl'], $pos);
     $this->assign('pid', $pid);
     $this->assign('gurl', $find['gurl']);
     $this->display();
 }
 public function index()
 {
     if (site()->users()->count() > 0) {
         go(panel()->urls()->login());
     }
     if ($problems = installation::check()) {
         $content = view('installation/check', array('problems' => $problems));
     } else {
         $form = panel()->form('installation', array('language' => kirby()->option('panel.language', 'en')));
         $form->cancel = false;
         $form->save = l('installation.signup.button');
         $form->centered = true;
         foreach (panel()->languages() as $lang) {
             $form->fields()->get('language')->options[$lang->code()] = $lang->title();
         }
         $form->on('submit', function ($form) {
             try {
                 // fetch all the form data
                 $data = $form->serialize();
                 // make sure that the first user is an admin
                 $data['role'] = 'admin';
                 // try to create the new user
                 $user = panel()->site()->users()->create($data);
                 // store the new username for the login screen
                 s::set('username', $user->username());
                 // redirect to the login
                 go(panel()->urls()->login() . '/welcome');
             } catch (Exception $e) {
                 $form->alert($e->getMessage());
             }
         });
         $content = view('installation/signup', array('form' => $form));
     }
     return layout('installation', array('meta' => new Snippet('meta'), 'content' => $content));
 }
Exemple #11
0
 /**
  * 后台用户登陆
  */
 public function login($username = null, $password = null, $verify = null)
 {
     if (IS_POST) {
         if (!check_verify($verify)) {
             $this->error('3验证码输入错误!');
         }
         $db = M('admin');
         $data['username'] = $username;
         $admin = $db->where($data)->find();
         if (!$admin) {
             $this->error('1帐号不存在或被禁用');
         }
         if ($admin['password'] != md5($password)) {
             $this->error('2密码不正确');
         }
         $data = array('uid' => $admin['uid'], 'login' => array('exp', '`login` + 1'), 'login_time' => date('y-m-d-H-i-s'), 'login_ip' => get_client_ip());
         $db->save($data);
         $auth = array('uid' => $data['uid'], 'login_time' => $data['login_time'], 'role' => $admin['role'], 'email' => $admin['email'], 'username' => $username);
         session('admin', $auth);
         session('_uid', $data['uid']);
         session('username', $username);
         //			echo dump(session('admin'));
         $this->success('登陆成功', U('Index/index', '', ''));
     } else {
         if (a_is_login()) {
             $this->redirect("Index/index");
         } else {
             layout(false);
             $this->display();
         }
     }
 }
 public function index()
 {
     layout(false);
     //登陆页面不需要应用模板
     $this->display('login');
     //        $this->success('新增成功', './Home/Customer/index',5);
 }
Exemple #13
0
function user($lang, $arglist = false)
{
    global $login_verified, $base_url;
    $login = build('login', $lang);
    if ($login === true) {
        $r = !empty($arglist['r']) ? $arglist['r'] : false;
        if ($login_verified and array_intersect($login_verified, user_profile('role'))) {
            $user = $_SESSION['user'];
            unset($_SESSION['user']);
            if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
                return run('error/unauthorized', $lang);
            }
            $_SESSION['unverified_user'] = $user;
            $next_page = url('sslverifyclient');
            if ($r) {
                $next_page .= '?r=' . $r;
            }
        } else {
            $next_page = $r ? $r : url('home', $lang);
        }
        return reload($base_url . $next_page);
    }
    $banner = build('banner', $lang);
    $content = view('user', $lang, compact('login'));
    head('title', translate('user:title', $lang));
    head('description', false);
    head('keywords', false);
    head('robots', 'noindex, nofollow');
    $output = layout('standard', compact('banner', 'content'));
    return $output;
}
 public function r($gid, $qishu, $pageNo = 1)
 {
     $mdb = M('MiaoshaRecord');
     $pageSize = 14;
     $filter = array('r.prize_gid' => $gid, 'r.prize_qishu' => $qishu);
     $list = $mdb->field("r.gid,r.qishu,r.mid,ms.time,ms.count,ms.ms,m.title\n\t\t\t,(HOUR(ms.time)*10000000+MINUTE(ms.time)*100000+SECOND(ms.time)*1000+ms) prizeno\n\t\t\t,INSERT(u.username,ROUND(CHAR_LENGTH(u.username) / 2),ROUND(CHAR_LENGTH(u.username) / 4),'****') username, u.img userimg")->join("r inner join __MEMBER_MIAOSHA__ ms on ms.id = r.mid")->join("inner join __MIAOSHA__ m on ms.gid = m.gid")->join("inner join __MEMBER__ u on u.uid = ms.uid")->where($filter)->order('ms.time desc')->page($pageNo, $pageSize)->select();
     $num = 0;
     $db = M('MiaoshaHistory');
     $data = $db->where(array('gid' => $gid, 'qishu' => $qishu))->field("end_time")->find();
     $this->assign('end_time', $data['end_time']);
     //		echo $mdb->getLastSql();
     $total = 0;
     if ($list) {
         $this->assign('list', $list);
         $num = count($list);
         $total = $mdb->where(array('prize_gid' => $gid, 'prize_qishu' => $qishu))->count();
         $pageCount = ceil($total / $pageSize);
         $this->assign('pageSize', $pageSize);
         $this->assign('pageNo', $pageNo);
         $this->assign('pageCount', $pageCount);
         $this->assign('minPageNo', floor(($pageNo - 1) / 10.0) * 10 + 1);
         $this->assign('maxPageNo', min(ceil($pageNo / 10.0) * 10 + 1, $pageCount));
     }
     $this->assign('gid', $gid);
     $this->assign('qishu', $qishu);
     $this->assign('num', $num);
     $this->assign('total', $total);
     layout(false);
     $this->display('record');
 }
 public function edit($id = 0)
 {
     $Data = M('Data');
     $this->assign('vo', $Data->find($id));
     layout(true);
     $this->display();
 }
Exemple #16
0
 public function index()
 {
     if (app::$site->users()->count() > 0) {
         go('panel/login');
     }
     if ($problems = installation::check()) {
         $content = view('installation/check', array('problems' => $problems));
     } else {
         $form = app::form('installation', array('language' => c::get('panel.language', 'en')));
         $form->cancel = false;
         $form->save = l::get('installation.signup.button');
         $form->centered = true;
         foreach (app::languages() as $lang) {
             $form->fields()->get('language')->options[$lang->code()] = $lang->title();
         }
         $form->on('submit', function ($form) {
             try {
                 app::$site->users()->create($form->serialize());
                 go('panel/login/welcome');
             } catch (Exception $e) {
                 $form->alert($e->getMessage());
             }
         });
         $content = view('installation/signup', array('form' => $form));
     }
     return layout('installation', array('meta' => new Snippet('meta'), 'content' => $content));
 }
 public function OtherCallbackLogin()
 {
     layout(false);
     $ary_get = $this->_get();
     $type = ucwords($ary_get['t']);
     if ($ary_get['state'] == $_SESSION['state']) {
         //获取Access_Token
         $ary_data = array();
         $ary_data['code'] = $ary_get['code'];
         $url = str_replace('__APP__/', '/', 'http://' . $_SERVER['HTTP_HOST'] . U('Home/Oauth/OtherCallbackLogin', array('t' => $ary_get['t'])));
         $ary_data['redirect_uri'] = $url;
         $config = M("Oauth")->where(array('code' => $type, 'status' => '1'))->find();
         $ary_config = json_decode($config['config'], true);
         ${$ary_get}['t'] = new $type($ary_config['app_key'], $ary_config['app_secret']);
         $accessToken = ${$ary_get}['t']->getAccessToken($ary_data);
         if (!empty($accessToken) && is_array($accessToken)) {
             session("userinfo", $accessToken);
             $this->success("登录成功", U('Home/Index/index'), 3);
         } else {
             $this->error("登录失败", U('Home/Index/index'), 3);
         }
     } else {
         $this->error("登录失败", U('Home/Index/index'), 3);
     }
 }
 /**
  * 找回密码页面
  */
 public function findPwd()
 {
     if (IS_POST) {
         $userName = I('post.username', '', 'trim');
         $email = I('post.email', '', 'trim');
         $userModel = D('User');
         $where = array('username' => $userName, 'email' => $email);
         $userInfo = $userModel->where($where)->find();
         if (empty($userInfo)) {
             $this->error('该用户不存在');
         }
         $newPwd = $userModel->createPassword();
         $data = array('password' => md5(md5($userInfo['username']) . $newPwd));
         $result = $userModel->where(array('id' => $userInfo['id']))->save($data);
         if ($result === FALSE) {
             $this->error('密码重置失败:' . $userModel->getError());
         }
         //将新密码发送到邮箱中去
         $mail = new \Lib\Mail();
         $mailResult = $mail->sendMail('重置密码', '您的新密码为:' . $newPwd, $userInfo['email'], $userInfo['cname']);
         if ($mailResult) {
             $this->success('新密码已发送到您的邮箱中,请登陆邮箱查收', U('Backend/Index/index'));
             exit;
         }
         $this->error('密码已重置,邮件发送失败,请联系系统管理员', U('Backend/Index/index'));
     }
     layout(false);
     $this->display();
 }
Exemple #19
0
 public function login($welcome = null)
 {
     if ($user = panel()->site()->user()) {
         go(panel()->urls()->index());
     }
     $message = l('login.error');
     $error = false;
     $form = panel()->form('login');
     $form->cancel = false;
     $form->save = l('login.button');
     $form->centered = true;
     if (r::is('post') and get('_csfr') and csfr(get('_csfr'))) {
         $data = $form->serialize();
         $user = site()->user(str::lower($data['username']));
         if (!$user) {
             $error = true;
         } else {
             if (!$user->hasPanelAccess()) {
                 $error = true;
             } else {
                 if (!$user->login(get('password'))) {
                     $error = true;
                 } else {
                     go(panel()->urls()->index());
                 }
             }
         }
     }
     if ($username = s::get('username')) {
         $form->fields->username->value = html($username, false);
     }
     return layout('login', array('meta' => new Snippet('meta'), 'welcome' => $welcome ? l('login.welcome') : '', 'form' => $form, 'error' => $error ? $message : false));
 }
 /**
  * 后台用户登录
  * @author 麦当苗儿 <*****@*****.**>
  */
 public function login($username = null, $password = null, $type = 1, $verify = null)
 {
     layout(false);
     if (IS_POST) {
         /* 检测验证码 TODO: */
         //             if (APP_DEBUG==false){
         //                 if(!check_verify($verify)){
         //                     $this->error('验证码输入错误!');
         //                 }
         //             }
         /* 调用UC登录接口登录 */
         $User = new UserApi();
         $uid = $User->login($username, $password, $type);
         if (99 < $uid) {
             //UC登录成功
             //TODO:跳转到登录前页面
             $this->success('登录成功!', U('Admin/Index/index'));
         } else {
             //登录失败
             switch ($uid) {
                 case -1:
                     $error = '用户不存在!';
                     break;
                     //系统级别禁用
                 //系统级别禁用
                 case -2:
                     $error = '密码错误!';
                     break;
                 case 0:
                     $error = '用户未激活!';
                     break;
                 case 1:
                     $error = '用户在审核过程中,请耐心等待!';
                     break;
                 case 3:
                     $error = '用户审核未通过!';
                     break;
                 default:
                     $error = '未知错误!';
                     break;
                     // 0-接口参数错误(调试阶段使用)
             }
             $this->error($error);
         }
     } else {
         if (is_login()) {
             $this->redirect('Admin/Index/index');
         } else {
             /* 读取数据库中的配置 */
             $config = S('DB_CONFIG_DATA');
             if (!$config) {
                 $config = D('Config')->lists();
                 S('DB_CONFIG_DATA', $config);
             }
             C($config);
             //添加配置
             $this->display();
         }
     }
 }
 public function index()
 {
     $data['dependencias'] = $this->comunes->get_dependencias();
     $data['sedes'] = $this->comunes->get_sedes_inei();
     $data['planilla'] = array(array('TIPO_PLAN_TPL' => '01', 'TPLANI' => 'NOMBRADOS'), array('TIPO_PLAN_TPL' => '02', 'TPLANI' => 'C.A.S'), array('TIPO_PLAN_TPL' => '03', 'TPLANI' => 'LOC.SERV'));
     layout('registro_visitas/visitas_personal', $data, array('index'));
 }
 public function index()
 {
     $CheckBelonging = M('siteboard_project');
     $condition = array('pid' => $_POST['pid'], 'uid' => session('uid'));
     $result = $CheckBelonging->where($condition)->find();
     if ($result == null) {
         $this->error('Internal Error', U('Home/Index/index'));
     }
     //获得本地文件夹
     session('folder', $result['folder']);
     session('pid', $_POST['pid']);
     layout('common_layout');
     $this->assign('data', $result);
     //SetBranchList in sync
     $condition = array('pid' => session('pid'), 'uid' => session('uid'));
     $branches = $CheckBelonging->where($condition)->getField('folder');
     $str = RunCMD::fetchLocalBranches($branches);
     $output = array();
     for ($i = 0; $i < count($str); $i++) {
         switch (substr($str[$i], 0, 1)) {
             case " ":
                 array_push($output, substr($str[$i], 2));
                 break;
             case "*":
                 array_unshift($output, substr($str[$i], 2));
                 break;
         }
     }
     $this->assign('branches', $output);
     $this->display();
 }
Exemple #23
0
function threadsummary($lang, $thread)
{
    global $system_languages, $with_toolbar;
    if (!user_has_role('writer')) {
        return run('error/unauthorized', $lang);
    }
    $slang = false;
    if (isset($_GET['slang'])) {
        $slang = $_GET['slang'];
    } else {
        $slang = $lang;
    }
    if (!in_array($slang, $system_languages)) {
        return run('error/notfound', $lang);
    }
    $thread_id = thread_id($thread);
    if (!$thread_id) {
        return run('error/notfound', $lang);
    }
    $r = thread_get($lang, $thread_id);
    if (!$r) {
        return run('error/notfound', $lang);
    }
    extract($r);
    /* thread_name thread_title thread_type thread_abstract thread_cloud thread_image thread_visits thread_nosearch thread_nocloud thread_nocomment thread_nomorecomment thread_novote thread_nomorevote thread_created thread_modified */
    $thread_search = !$thread_nosearch;
    $thread_tag = !$thread_nocloud;
    $thread_comment = !$thread_nocomment;
    $thread_morecomment = !$thread_nomorecomment;
    $thread_vote = !$thread_novote;
    $thread_morevote = !$thread_nomorevote;
    $thread_contents = array();
    $r = thread_get_contents($lang, $thread_id, false);
    if ($r) {
        $thread_url = url('thread', $lang) . '/' . $thread_id;
        foreach ($r as $c) {
            extract($c);
            /* node_id node_name node_title node_number node_ignored */
            $node_url = $thread_url . '/' . $node_id . '?' . 'slang=' . $slang;
            $thread_contents[] = compact('node_id', 'node_title', 'node_url', 'node_ignored');
        }
    }
    $headline_text = translate('threadall:title', $slang);
    $headline_url = url('thread', $lang) . '?' . 'slang=' . $slang;
    $headline = compact('headline_text', 'headline_url');
    $title = view('headline', false, $headline);
    $sidebar = view('sidebar', false, compact('title'));
    head('title', $thread_title ? $thread_title : $thread_id);
    head('description', $thread_abstract);
    head('keywords', $thread_cloud);
    head('robots', 'noindex, nofollow');
    $edit = user_has_role('writer') ? url('threadedit', $_SESSION['user']['locale']) . '/' . $thread_id . '?' . 'clang=' . $lang : false;
    $banner = build('banner', $lang, $with_toolbar ? compact('headline') : compact('headline', 'edit'));
    $scroll = true;
    $toolbar = $with_toolbar ? build('toolbar', $lang, compact('edit', 'scroll')) : false;
    $content = view('threadsummary', $slang, compact('thread_id', 'thread_title', 'thread_abstract', 'thread_cloud', 'thread_image', 'thread_visits', 'thread_search', 'thread_tag', 'thread_comment', 'thread_morecomment', 'thread_vote', 'thread_morevote', 'thread_ilike', 'thread_tweet', 'thread_plusone', 'thread_linkedin', 'thread_pinit', 'thread_created', 'thread_modified', 'thread_contents'));
    $output = layout('viewing', compact('toolbar', 'banner', 'content', 'sidebar'));
    return $output;
}
function before()
{
    layout('layouts/default.html.php');
    $lemon_tree = _helye_lemon_tree();
    set('portfolio_lemon', $lemon_tree->find('/portfolio'));
    set('lab_lemon', $lemon_tree->find('/lab'));
    set('site_title', $lemon_tree->title);
}
 /**
  * 邮箱注册:第一步页面
  */
 public function registerEmailStep1()
 {
     // 页面信息
     $pageInfo['title'] = C("MALL_NAME") . '-注册';
     layout("Layout/layout_common");
     $this->assign($pageInfo);
     $this->display('register_email_step1');
 }
Exemple #26
0
function before($route)
{
  header("X-LIM-route-function: ".$route['function']);
  header("X-LIM-route-params: ".json_encode($route['params']));
  header("X-LIM-route-options: ".json_encode($route['options']));
  layout('html_my_layout'); # setting default html layout
  //error_layout('html_my_layout');
}
Exemple #27
0
/**
 * your "controller"
 * @author Antoine Chauvin <*****@*****.**>
 */
function main()
{
    $boissons = BoissonMetier::getAll();
    $currentPage = isset($_GET['page']) ? intval($_GET['page'], 10) : 1;
    layout(function () use($boissons, $currentPage) {
        boissons($boissons, $currentPage);
    });
}
function configure()
{
    option('env', ENV_PRODUCTION);
    option('debug', false);
    option('base_uri', '<TPL:NGINX_LOCATION>/');
    layout('layout.html.php');
    define('PUBLIC_DIR', '<TPL:NGINX_LOCATION>/public');
}
Exemple #29
0
function before()
{
    require_once 'Net/UserAgent/Mobile.php';
    require_once 'Text/Pictogram/Mobile.php';
    $picObject = Text_Pictogram_Mobile::factory('docomo', 'utf-8');
    set('emoji', $picObject->getFormattedPictogramsArray());
    layout('layout.default.html.php');
}
 public function homepage()
 {
     if (session('user_type') == 4) {
         layout('./Common/frame');
         $this->display('./Public/html/Content/District/homepage/district_index.html');
     } else {
         $this->redirect('Home/Index/index');
     }
 }