Example #1
0
 public function init()
 {
     if (!loginstatus()) {
         $this->redirect(BASE_URL);
     }
     $this->linkmodel = new LinkModel();
 }
Example #2
0
 public function init()
 {
     if (!loginstatus()) {
         $this->redirect(BASE_URL);
     }
     $this->blogmodel = new BlogModel();
     $this->tagmodel = new TagModel();
 }
Example #3
0
 public function init()
 {
     $actionname = $this->getRequest()->getActionName();
     if (!loginstatus() && !in_array($actionname, $this->nologin())) {
         $this->redirect(BASE_URL);
     }
     $this->blogmodel = new BlogModel();
     $this->commentmodel = new CommentModel();
 }
Example #4
0
 public function init()
 {
     $this->catmodel = new CatModel();
     $this->session = Yaf_Session::getInstance();
     $actionname = $this->getRequest()->getActionName();
     if (!loginstatus() && !in_array($actionname, $this->nologin())) {
         $this->redirect(BASE_URL);
     }
 }
Example #5
0
 public function init()
 {
     if (!loginstatus()) {
         $this->redirect(BASE_URL);
     }
     $this->blogmodel = new BlogModel();
     $this->saymodel = new SayModel();
     $this->tagmodel = new TagModel();
     $this->linkmodel = new LinkModel();
     $this->blogtypemodel = new BlogtypeModel();
 }
Example #6
0
 public function init()
 {
     if (!loginstatus()) {
         $this->redirect(BASE_URL);
     }
     $this->blogmodel = new BlogModel();
     $this->tagmodel = new TagModel();
     $this->commentmodel = new CommentModel();
     $this->blogtypemodel = new BlogtypeModel();
     $this->linkmodel = new LinkModel();
     $this->catmodel = new CatModel();
 }
function getDataJSON($user = null)
{
    global $username, $conn, $ustabl;
    if ($user == null) {
        $user = $username;
    }
    $login = loginstatus();
    if ($login['username'] != $user && $login['isAdmin'] != "true") {
        stop('E0.0.1', "You're not logged in like that!");
    }
    $sql = "SELECT data FROM {$ustabl} WHERE username='******'";
    $result = $conn->query($sql);
    if ($result->num_rows == 0) {
        stop('E0.1', "Username not known. [{$user}]");
        // E1*
    }
    if ($result->num_rows > 1) {
        stop('E0.2', "Internal error!");
        // E2*
    }
    $data = $result->fetch_assoc()['data'];
    // We're sure to get 1 line
    return $data;
}
<?php

/* ==========================================
样本文件:登陆程序
文本版本:1, 0, 0, 1
字符编码:Unicode UTF-8
程序语言:PHP
调用方式:include '本文件';[仅同目录生效]
编写人员:dfc643(北极光.Norckon)
                         http://www.fcsys.us
=========================================== */
//SESSION 设置区
error_reporting(0);
session_start();
if ($_SESSION['FC_GOODJOU'] != "jou") {
    loginstatus();
}
function loginstatus()
{
    $filename = substr($_SERVER['PHP_SELF'], strrpos($_SERVER['PHP_SELF'], '/') + 1);
    include '../comm.fc/sys-config.php';
    //全局设置
    if (!isset($_POST['FC_USER'])) {
        if ($filename != "syslogin.php") {
            echo '<SCRIPT>window.location.href="syslogin.php"</SCRIPT>';
        }
        loginfo(1);
        return 1;
        exit;
    } else {
        if ($_POST['FC_USER'] != $loginuser || $_POST['FC_PW'] != $loginpasswd) {
Example #9
0
 /**
  * 右侧公共三栏输出
  */
 private function rightpublic()
 {
     $types = $this->blogtypemodel->alltypes();
     $tags = $this->tagmodel->hottags(10);
     $links = $this->linkmodel->linklist();
     if (loginstatus()) {
         $this->getView()->assign("admin", true);
     }
     $this->getView()->assign("links", $links);
     $this->getView()->assign("tags", $tags);
     $this->getView()->assign("types", $types);
     //加载seo信息,凡事需要调右侧栏的,都是给用户看的页面,都是可以被搜索引擎抓取的,都需要seo
     $this->seopublic();
 }
Example #10
0
<?php

$html = true;
require '../framework.php';
echo preMain();
?>

<?php 
require '../userdata.php';
$asAdmin = getIfSet($_POST, 'admin', "false") == "true";
$temp_user = $username;
if ($asAdmin) {
    // If coming from admin panel
    // Check if really admin
    $login = loginstatus();
    if ($login['isAdmin'] == "true") {
        $temp_user = getIfSet($_POST, 'username', $username);
        // Add fake username to title
        ?>
        <script type="text/javascript">
          var title=document.getElementsByTagName("title")[0];
          title.innerHTML+=" as '<?php 
        echo htmlspecialchars($temp_user);
        ?>
'";
          </script>
      <?php 
    }
}
$json = json_decode(getDataJSON($temp_user), true);
if (getIfSet($_POST, 'doAdd', "false") == "true") {