Example #1
0
 public function __construct()
 {
     if (User::isLogin() === false and !empty($_POST["username"]) and !empty($_POST["pass"])) {
         $head['title'] = 'GİRİŞ YAPILIYOR';
         $kontrol = User::login($_POST["username"], $_POST["pass"]);
         if ($kontrol) {
             redirect('home', 1);
             exit;
         } else {
             redirect('home', 0, array('uyari' => '<div class="alert alert-info"><strong>HATA!</strong> Giriş İşleminiz başarısız! Lütfen bilgilerinizi kontrol ediniz.</div>'));
         }
     } elseif (User::isLogin() == false) {
         $head['title'] = 'GİRİŞ YAP';
         $head['meta']['author'] = '';
         $bodyVeri["uyari"] = redirectData('uyari');
         $data['head'] = "";
         $data['footer'] = Import::view('footer', '', true);
         $data['body'] = Import::view('login', $bodyVeri, true);
         Import::masterPage($data, $head);
         exit;
     } else {
         $head['title'] = 'Yönetim Paneli';
         $head['meta']['author'] = '';
     }
 }
Example #2
0
 public static function isAdmin()
 {
     if (User::isLogin()) {
         return $_SESSION['isadmin'] == '1';
     }
     return false;
 }
Example #3
0
 public function render($name)
 {
     include_once 'Controller/User.php';
     $userlog = new User();
     $userlog->isLogin();
     if ($userlog->isLogin() == FALSE) {
         include_once 'views/header/header_loging.php';
         include_once 'Views/pages/user.php';
     } else {
         if ($name != "user") {
             require 'views/header/header.php';
             require 'Views/pages/' . $name . '.php';
         } else {
             require 'views/header/header.php';
             include_once 'Views/pages/home.php';
         }
     }
     require 'views/footer/footer.php';
 }
Example #4
0
		top:1px;
	}
	</style>
</head>
<html>
<body>
<div class="tips">
	<p>望大家的代祷意向符合以下要求:</p>
	<p>&nbsp;&nbsp;1、请不要在意向中使用任何人的姓名;</p>
	<p>&nbsp;&nbsp;2、请不要在意向中诅咒别人</p>
</div>
<?php 
//先从数据库中获取
//	mysql_query("delete from pray where createtime>(utc_timestamp()-3600);");
$result = mysql_query("select id,name,text,createtime from pray order by id desc limit 20;");
if (User::isLogin()) {
    while ($row = mysql_fetch_array($result)) {
        echo '<div class="css_div_class"><span  style="width:100%">[<a href="#" onclick="delPray(' . $row['id'] . ')">删除</a>]昵称:' . $row['name'] . '  时间:' . date('Y-m-d H:i', strtotime($row['createtime']) + 3600 * 8) . '</span><p>' . nl2br($row['text']) . '</p></div>';
    }
} else {
    while ($row = mysql_fetch_array($result)) {
        echo '<div class="css_div_class"><span  style="width:100%">昵称:' . $row['name'] . '  时间:' . date('Y-m-d H:i', strtotime($row['createtime']) + 3600 * 8) . '</span><p>' . nl2br($row['text']) . '</p></div>';
    }
}
?>
<hr/>
<p><strong>提交你的代祷意向:</strong></p>
<form action="update.php" method="post">
	<label for="input_name" style="width:100px;">昵称:</label><input name="name" id="input_name" type="text" value="<?php 
if (isset($_SESSION['name'])) {
    echo $_SESSION['name'];
Example #5
0
 public function __construct()
 {
     if (User::isLogin() == false) {
         redirect('home');
     }
 }
Example #6
0
<?php

require_once dirname(__FILE__) . "/../../App.class.php";
App::loadMod("User");
App::loadMod("Tools");
App::loadMod("Setting");
$app = new App();
$user = new User();
$tools = new Tools();
$setting = new Setting();
if (!$user->isLogin()) {
    header("Location: status.php?action=login");
}
if ($user->getPower() != 0 && $setting->get("UploadOpen", "on") != "on") {
    die("<script>alert('服务器禁止上传!');</script>");
}
include "upload.php";
$myclass = new upload_file();
empty($_GET['curl']) ? $myclass->flash_directory = "" : ($myclass->flash_directory = str_replace("..", "", urldecode($_GET['curl'])));
//删除文件
if (isset($_GET["del"])) {
    $myclass->del_files(urldecode($_GET["del"]));
}
//删除文件夹
if (isset($_GET["deldir"])) {
    if ("yes" == $_GET["deldir"]) {
        $myclass->rm_dir();
        $myclass->flash_directory = "";
    }
}
//创建文件夹
Example #7
0
 public function __construct()
 {
     //检查是否已登录
     User::isLogin();
 }
Example #8
0
<?php

require_once "../include/dbconn.php";
require_once "../include/define.php";
require_once "../users/user.class.php";
if (!User::isLogin()) {
    die("非法访问!");
}
if (!isset($_POST['mode'])) {
    die("未找到参数1!");
}
function writeArticle($id, $title, $author, $content, $topic, $src)
{
    $filestr = "./articles/" . $id . ".html";
    $link = ROOT_WEB_URL . 'articles/' . $filestr;
    $topicName = "未知";
    $result = mysql_query('select id,name from article_topic where id=' . $topic . '');
    while ($row = mysql_fetch_array($result)) {
        $topicName = $row['name'];
    }
    $fp = fopen($filestr, "w");
    if (!$fp) {
        return false;
    } else {
        fwrite($fp, '<html><head><title>' . $title . '</title><meta http-equiv=Content-Type content="text/html;charset=utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"><link href="../articles.css" type="text/css" rel="stylesheet"></head><body><div class="topic"><span class="current"><a href="/">首页</a> › <a href="../index.php">小助手推荐</a> › <a href="../index.php?topic=' . $topic . '">' . $topicName . '</a></span><h1 class="topic-title">' . $title . '</h1></div><div class="content">' . $content . '</div>');
        if (!empty($src)) {
            fwrite($fp, '<br/><a class="src" href="' . $src . '">>>>原始文章</a>');
        }
        fwrite($fp, '</body><script type="text/javascript" language="javascript" src="/include/googleanalysis.js"></script><script type="text/javascript" language="javascript" src="http://cathassist.org/include/common.js"></script><script type="text/javascript">document.addEventListener("DOMContentLoaded", function(){SetWechatShare("' . $title . '","' . $link . '","http://cathassist.org/logo.jpg","' . $title . '");})</script></html>');
    }
    fclose($fp);
Example #9
0
 public function dealWithPost()
 {
     /*
      *	1.sign in
      *	2.sign up
      *	3.submit xueshu
      *	4.submit xueshu huida
      */
     $way = $this->way;
     if ($way === 1 or $way === 2) {
         $name = $_POST['name'];
         $pass = $_POST['pass'];
         $verify_code = $_POST['verifycode'];
         $sign_token = $_POST['signToken'];
         $verify_name = $way === 1 ? 'in' : 'up';
         $bool = false;
         if ($sign_token !== $_SESSION['token']['sign']) {
             $arr = array('isok' => '0', 'code' => '2', 'info' => 'sign token wrong');
         } else {
             if (strtolower($verify_code) === strtolower($_SESSION['verify_code'][$verify_name])) {
                 $bool = true;
             } else {
                 $arr = array('isok' => '0', 'code' => '1', 'info' => 'wrong verify_code');
             }
         }
         if ($bool) {
             //OK,执行开始!
             switch ($this->way) {
                 case 1:
                     //sign in
                     $arr = array();
                     $arr['name'] = $name;
                     $arr['pass'] = $pass;
                     $user = new User($this->arr);
                     $arr = $user->signIn($arr);
                     break;
                 case 2:
                     //sign up
                     $arr = array();
                     $arr['name'] = $name;
                     $arr['pass'] = $pass;
                     $user = new User($this->arr);
                     $arr = $user->signUp($arr);
                     break;
             }
         }
         echo json_encode($arr);
     }
     if ($way === 3) {
         $arr = array();
         $arr['kinds'] = C::safe($_POST['kinds'], $this->dbc);
         $arr['title'] = C::safe(urldecode($_POST['title']), $this->dbc);
         $arr['content'] = urldecode($_POST['content']);
         $xueshu = new Xueshu($this->arr);
         $arr = $xueshu->insertXueshu($arr);
         echo json_encode($arr);
     }
     if ($way === 4) {
         $user = new User($this->arr);
         if (!$user->isLogin()) {
             $arr = array("isok" => 0, "code" => 1, "info" => 'Not sign in');
             echo json_encode($arr);
             exit;
         }
         $content = Safe::removeXSS(urldecode($_POST['content']));
         $id = (int) $_POST['id'];
         $arr = array("kinds" => "b1", "title" => "", "content" => $content, "huida_id" => $id);
         $xueshu = new Xueshu($this->arr);
         $arr = $xueshu->insertXueshu($arr);
         echo json_encode($arr);
         exit;
     }
 }
Example #10
0
 public function addtoorder()
 {
     //是否已经登录
     User::isLogin();
     if (!$_POST) {
         $url = url('goods', 'goods::balance');
         header('Location:' . $url);
         throw new Exception('exit');
     }
     $default_address_id = isset($_POST['shipping']) ? htmlspecialchars($_POST['shipping']) : 0;
     $payment = isset($_POST['payment']) ? htmlspecialchars($_POST['payment']) : '';
     $is_mobile = isset($_POST['mobile']) ? htmlspecialchars($_POST['mobile']) : '';
     $uid = LuS::get('uid');
     $username = LuS::get('username');
     $order_id = Cart::addOrder($uid, $username, $payment, $default_address_id);
     //订单详情页
     $order_detail_url = url('usercenter', 'usercenter::detail', $order_id);
     //首页
     $home_url = HOMEURL;
     //订单号
     $order_info = OrderInfo::getUserOrderInfoByOrderId($uid, $order_id);
     //获取支付链接
     $pay = GoodsM::getPayList($order_info['sn']);
     //货到付款
     $hdfkpay_url = $order_detail_url;
     $smarty = get_smarty();
     $smarty->assign('order_detail_url', $order_detail_url);
     $smarty->assign('home_url', $home_url);
     $str = $smarty->fetch('goods/order_success.html');
     //增加一个订单id
     $return_arr = array(true, $str, $pay['alipay'], $pay['wxpay'], $pay['wxsaomapay'], $hdfkpay_url, $order_id);
     echo json_encode($return_arr);
     throw new Exception('exit');
 }
Example #11
0
 * @author: 樊亚磊
 * @mail:fanyalei@aliyun.com
 * @QQ:451802973
 */
$stime = microtime(true);
include_once 'conf/config.php';
$m = isset($_REQUEST['m']) ? ucwords($_REQUEST['m']) : 'Core';
$a = isset($_REQUEST['a']) ? $_REQUEST['a'] : 'index';
if (!file_exists(CONFIG_PATH . 'install.lock')) {
    include VIEW_PATH . 'install.php';
    exit;
}
require_once ACTION_PATH . 'User.class.php';
if (!(strtolower($m) == 'core' && ($a == 'view' || $a == 'down' || $a == 'mdown' || $a == 'own') || strtolower($m) == 'collection' && $a == 'collect' || strtolower($m) == 'share' && $a == 'pwd')) {
    if (!$_SESSION['CLOUD_UID'] && $m != 'User') {
        $islogin = json_decode(User::isLogin(), true);
        if ($islogin['code'] != SUCC) {
            header('Location: index.php?m=user');
            exit;
        }
    }
}
$_REQUEST['uid'] = (int) $_SESSION['CLOUD_UID'];
if ($_REQUEST['uid']) {
    $uidLen = strlen($_REQUEST['uid']);
    for ($i = 0; $i < $uidLen; $i++) {
        if ($i % 2 == 0) {
            $uidDir .= sprintf("%02d", substr($_REQUEST['uid'], $i, 2)) . DS;
        }
    }
    $space = User::getUserSpace();
Example #12
0
require_once '../model/Log.php';
$logClass = new Log();
session_start();
if (isset($_POST['user_mail'])) {
    //			$logClass->setNewLog($_POST['user_mail']." ".$_POST['pwd']." ");
    if ((!isset($_POST['user_mail']) or $_POST['user_mail'] == "") and (!isset($_POST['pwd']) or $_POST['pwd'] == "")) {
        $_SESSION['message'] = " Les deux champs doivent être saisis.";
        $logClass->setNewLog($_SESSION['message']);
        include_once '../vue/connexion.php';
    } else {
        if (strpos($_POST['pwd'], "'") === FALSE and strpos($_POST['user_mail'], "'") === FALSE) {
            $user_mail = $_POST['user_mail'];
            //			$user_mail = str_replace("'","''",$_POST['user_mail']);
            //			$password = str_replace("'","''",$_POST['pwd']);
            $password = $_POST['pwd'];
            $resultIsLogin = $userClass->isLogin($user_mail);
            if ($resultIsLogin != null and $resultIsLogin[0]->result == 1) {
                $resultPwd = $userClass->getPasswordByLogin($user_mail);
                $user_pasw = $resultPwd[0]->user_pasw;
                if (password_verify($password, $user_pasw)) {
                    $_SESSION['last_access'] = time();
                    $_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
                    $_SESSION['user_mail'] = $user_mail;
                    $_SESSION['message'] = htmlentities("Vous êtes bien connecté");
                    $params = $paramClass->getList();
                    for ($i = 0; $i < 9; $i++) {
                        $param_lib = $params[$i]->param_lib;
                        $param_value = $params[$i]->param_value;
                        switch ($param_lib) {
                            case 'prop_arg_rank_default':
                                $_SESSION['prop_arg_rank_default'] = $param_value;
Example #13
0
<?php

/**
 * Created by PhpStorm.
 * User: lc4t
 * Date: 15-11-11
 * Time: 20:06
 */
require_once '../include/session_start.php';
require_once '../include/DB.php';
require_once '../include/Chat.php';
require_once '../include/User.php';
$user = new User();
if ($user->isLogin() !== true) {
    echo $errorResponse = json_encode(array("status" => false, "message" => array("errorCode" => -4, "errorMessage" => "User not login.")));
    exit(0);
}
if (@isset($_GET['action'])) {
    $action = $_GET['action'];
    if ($action === 'send') {
        $chat = new Chat();
        if (@isset($_POST['to']) && isset($_POST['message'])) {
            $to = $_POST['to'];
            $message = $_POST['message'];
            echo json_encode($chat->addMessage($user->getUsername(), $to, $message, date('Y-m-d H:i:s', time())));
            exit(0);
        } else {
            echo $errorResponse = json_encode(array("status" => false, "message" => array("errorCode" => -16, "errorMessage" => "No user for to or no message.")));
        }
    } else {
        if ($action === 'get') {
Example #14
0
<?php

/**
 * Created by PhpStorm.
 * User: lc4t
 * Date: 10/22/15
 * Time: 12:02 AM
 * function login
 */
require_once '../include/session_start.php';
require_once '../include/DB.php';
require_once '../include/User.php';
$user = new User();
if ($user->isLogin()) {
    header("Location: home.php");
    exit(0);
}
if (@isset($_POST['username']) && isset($_POST['password'])) {
    $raw_username = $_POST['username'];
    $raw_password = $_POST['password'];
    $db = new DB();
    $response = $db->loginUser($raw_username, $raw_password, date('Y-m-d H:i:s', time()));
    if ($response['status'] === true) {
        $_SESSION['username'] = $response['message']['username'];
        header('Location: home.php');
    } else {
        echo json_encode($response);
    }
} else {
    die('input error');
}
Example #15
0
require_once 'helper/auto_include.php';
$site = new Site();
if (!$site->isSetSession()) {
    $site->setlanguage("en");
    $site->setSession();
} else {
    $site = $site->getSession();
}
// check language to show
SessionHandlers::checkSession();
$_SESSION["locale"] = $site->getlanguage();
if ($_SESSION["locale"] == "kh") {
    echo "<style> * { font-family: 'Khmer OS System','Khmer OS','Khmer OS Muol','Khmer OS Battambang'; !important }</style>";
}
$user1 = new User();
if ($user1->isLogin()) {
    $log_user = Tool::getLoginUser();
    if (!$site->isExist($log_user)) {
        $site->setrefUser($log_user->getId());
        $site->insertDatabase($log_user);
    } else {
        $site->setrefUser($log_user->getId());
        $site->setSessionByUser();
    }
    // HTML HEAD
    require_once 'public/masterPages/head.php';
    // BODY
    $frame = false;
    $clearMargin = "style='margin: 0px; padding: 0px;'";
    if (!isset($_GET[VIEW]) || $_GET[VIEW] != FRAME) {
        $frame = true;