Пример #1
0
 public function login()
 {
     checkLogin();
     echo "<br/>";
     $Wecat = new LibWexinJssdk();
     $share = $Wecat->test();
 }
Пример #2
0
 public function index()
 {
     if (!checkLogin()) {
         //reviso si esta autenticado
         require APP . 'view/_templates/admin/header.php';
         if (isset($_POST["user"]) && isset($_POST["password"])) {
             // recibo parametros para login
             $isUser = $this->system->isUser($_POST["user"], $_POST["password"]);
             if ($isUser) {
                 // es usuario?
                 header('location: ' . $_POST["url"]);
             } else {
                 require APP . 'view/_templates/login.php';
                 // usuario incorrecto
             }
         } else {
             require APP . 'view/_templates/login.php';
             // faltan parametros
         }
         require APP . 'view/_templates/admin/footer.php';
     } else {
         header('location: ' . URL);
         // ingreso a login estando logueado
     }
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct();
     $this->load->library('session');
     $this->load->helper('user');
     //登录验证
     checkLogin();
 }
Пример #4
0
 public function checkAdminLogin()
 {
     if (!checkLogin() || strcmp($_SESSION["usertype"], "admin")) {
         $this->load->view('redirect', array("url" => "/admin/login", "info" => "请先登录管理员账号"));
         return false;
     } else {
         return true;
     }
 }
Пример #5
0
 public function checkMerchantLogin()
 {
     if (!checkLogin() || strcmp($_SESSION["usertype"], "merchant")) {
         $this->load->view('redirect', array("url" => "/cmsmini/index/login", "info" => "请先登录商户账号"));
         return false;
     } else {
         return true;
     }
 }
Пример #6
0
	private function doLogin(){
		$result=checkLogin($this->login,$this->pass);
		if($result){
			//if ok, write in session
			$_SESSION['cid']=$_POST['login'];
			$this->result='logged';
		}

	}
Пример #7
0
 public function linkTo($aim = "index")
 {
     if (checkLogin()) {
         $this->assign('log', true);
         $this->assign('username', session('name'));
     } else {
         $this->assign('log', false);
     }
     $this->display($aim);
 }
Пример #8
0
/**
 * Check one of the values.  We always assume that addrOwner should be able
 * to sign in, addrOther never, and addrSigner sometimes.
 * @param val The value to set the name to for this trial.
 * @param signerOk Whether addrSigner is allowed to sign in.
 */
function checkValue($val, $signerOk)
{
    global $nc, $auth;
    global $name, $addrOwner, $sigOwner, $sigSigner, $sigOther;
    $nc->set($name, $addrOwner, $val);
    checkLogin($sigOwner, TRUE);
    checkLogin($sigSigner, $signerOk);
    checkLogin($sigOther, FALSE);
    checkLogin(base64_encode("invalid sig"), FALSE);
}
Пример #9
0
 public function index()
 {
     require APP . 'view/_templates/admin/header.php';
     if (checkLogin()) {
         require APP . 'view/_templates/admin/nav.php';
         require APP . 'view/_templates/admin/sidebar.php';
         require APP . 'view/dashboard/index.php';
     } else {
         require APP . 'view/_templates/login.php';
     }
     require APP . 'view/_templates/admin/footer.php';
 }
Пример #10
0
 public function principal()
 {
     $data['title'] = 'Admin - Principal';
     //confere se o usuario esta logado
     if (checkLogin('userBolado')) {
         $this->load->view('admin/header', $data);
         $this->load->view('admin/principal');
         $this->load->view('admin/footer');
     } else {
         redirect('/admin/logout', 'refresh');
     }
 }
Пример #11
0
function isLogin()
{
    //获取cookie
    $isLogin = checkLogin();
    if ($isLogin) {
        //cookie有效期为1天
        //        setcookie("isLogin", "yes", time()+3600*24);
    } else {
        header('Content-Type: text/html; charset=utf-8');
        include_once PATH_VIEW . '/' . "login.php";
        exit;
    }
}
Пример #12
0
 public function newMessage()
 {
     $mes = D('Message');
     if (!checkLogin()) {
         echo "未登录";
     } else {
         $result = $mes->addMessage();
         if ($result) {
             $this->success("发表留言成功,即将返回上一页...");
         } else {
             $this->error("发表留言失败,请稍后重试...");
         }
     }
 }
Пример #13
0
function checkSystemAccess($url)
{
    $access = true;
    $checks = $ACCESS[$url];
    foreach ($checks as $c) {
        if ($c == 'logged_in') {
            $access = checkLogin();
        } else {
            if (!in_array($c, $_SESSION['system_permissions'])) {
                $access = false;
            }
        }
    }
    return $access;
}
Пример #14
0
 public function index()
 {
     require APP . 'view/_templates/admin/header.php';
     if (checkLogin()) {
         $cards = $this->model->getAllCards($_COOKIE["user_id"]);
         $amount_of_cards = $this->model->getAmountOfCards();
         require APP . 'view/_templates/admin/nav.php';
         require APP . 'view/_templates/admin/sidebar.php';
         require APP . 'view/cards/index.php';
     } else {
         require APP . 'view/_templates/admin/header.php';
         require APP . 'view/_templates/login.php';
     }
     require APP . 'view/_templates/admin/footer.php';
 }
Пример #15
0
/**
 * Check the input values for a login request
 */
function login_checkInput($input)
{
    $openid_url = false;
    $errors = array();
    if (!isset($input['openid_url'])) {
        $errors[] = 'Enter an OpenID URL to continue';
    }
    if (!isset($input['password'])) {
        $errors[] = 'Enter a password to continue';
    }
    if (count($errors) == 0) {
        $openid_url = $input['openid_url'];
        $openid_url = Auth_OpenID::normalizeUrl($openid_url);
        $password = $input['password'];
        if (!checkLogin($openid_url, $password)) {
            $errors[] = 'The entered password does not match the ' . 'entered identity URL.';
        }
    }
    return array($errors, $openid_url);
}
Пример #16
0
function index($config, $parameters)
{
    if ('POST' == getRequestMethod()) {
        $username = isset($_POST['username']) ? $_POST['username'] : null;
        $password = isset($_POST['password']) ? sha1($_POST['password']) : null;
        loadModel('models/Users');
        $result = checkLogin($config, $username, $password);
        if ($result['status']) {
            if (isset($result['user'])) {
                $_SESSION['uname'] = $result['user']['UserName'];
                $_SESSION['urole'] = $result['user']['UserRole']['ID'];
                header('Location: /');
                exit;
            }
        } else {
            return ['status' => true, 'message' => $result['message'], 'invalid' => true];
        }
    }
    return ['status' => true, 'message' => 'Index action completed for controller Home.', 'data' => []];
}
Пример #17
0
function getParas($username, $password, $delimiter_rn = "51eca_rn", $delimiter_cn = "51eca_cn")
{
    if (!checkLogin($username, $password)) {
        return "-999";
        //login_faild
    }
    $delimiter_rn = base64_decode($delimiter_rn);
    $delimiter_cn = base64_decode($delimiter_cn);
    $params = 'IMAGE_DIR' . $delimiter_cn . IMAGE_DIR;
    $params = $params . $delimiter_rn . 'DATA_DIR' . $delimiter_cn . DATA_DIR;
    $params = $params . $delimiter_rn . 'DBPREFIX' . $delimiter_cn . $GLOBALS['ecs']->prefix;
    $params = $params . $delimiter_rn . 'VERSION' . $delimiter_cn . VERSION;
    $params = $params . $delimiter_rn . 'RELEASE' . $delimiter_cn . RELEASE;
    $params = $params . $delimiter_rn . 'EC_CHARSET' . $delimiter_cn . EC_CHARSET;
    $params = $params . $delimiter_rn . 'ECS_CHARSET' . $delimiter_cn . ECS_CHARSET;
    $params = $params . $delimiter_rn . 'PHP_SELF' . $delimiter_cn . str_replace('/' . ASSISTANT_PATH, '', dirname(PHP_SELF));
    $params = $params . $delimiter_rn . 'ECS_VERSION' . $delimiter_cn . '1.2.6';
    $params = $params . $delimiter_rn . 'ASSISTANT_VERSION' . $delimiter_cn . '1.27';
    $params = $params . $delimiter_rn . 'ADMIN_DIR' . $delimiter_cn . ADMIN_DIR;
    return base64_encode($params);
}
Пример #18
0
function startSession()
{
    session_start();
    $time = time();
    $logged_in = checkLogin();
    if (!$logged_in) {
        $username = $_SESSION['username'] = GUEST_NAME;
        $userlevel = GUEST_LEVEL;
        addActiveGuest($_SERVER['REMOTE_ADDR'], $time);
    } else {
        addActiveUser($username, $time);
    }
    // remove inactive users
    removeInactiveUsers();
    removeInactiveGuests();
    // set referrer page
    if (isset($_SESSION['url'])) {
        $referrer = $_SESSION['url'];
    } else {
        $referrer = "/";
    }
    //set current url
    $url = $_SESSION['url'] = $_SERVER['PHP_SELF'];
}
 *  substitute goods or services; loss of use, data, or profits; or business    *
 *  interruption) however caused and on any theory of liability, whether in     *
 *  contract, strict liability, or tort (including negligence or otherwise)     *
 *  arising in any way out of the use of this software, even if advised of the  *
 *  possibility of such damage.                                                 *
 *                                                                              *
 ********************************************************************************/
include_once "../../config.php";
$me = substr($_SERVER["PHP_SELF"], 1);
// remove initial '/'
if ($HUB_FLM->hasCustomVersion($me)) {
    $path = $HUB_FLM->getCodeDirPath($me);
    include_once $path;
    die;
}
checkLogin();
include_once $HUB_FLM->getCodeDirPath("ui/headerdialog.php");
if ($USER == null || $USER->getIsAdmin() == "N") {
    echo "<div class='errors'>." . $LNG->ADMIN_NOT_ADMINISTRATOR_MESSAGE . "</div>";
    include_once $HUB_FLM->getCodeDirPath("ui/footerdialog.php");
    die;
}
$errors = array();
if (isset($_POST["rejectuser"])) {
    $userid = optional_param("userid", "", PARAM_ALPHANUMEXT);
    if ($userid != "") {
        $user = new User($userid);
        $user = $user->load();
        //$user->updateStatus($CFG->USER_STATUS_SUSPENDED);
        // send email to say request rejected
        $message = vsprintf($LNG->REGSITRATION_ADMIN_EMAIL_REJECT_BODY, array($CFG->SITE_TITLE));
Пример #20
0
<?php

DEFINE('INCLUDE_CHECK', 1);
require_once 'lib/connections/db.php';
include 'lib/functions/functions.php';
checkLogin('2');
// we check if everything is filled in and perform checks
if ($_POST['phone'] && !validateNumeric($_POST['phone'])) {
    die(msg(0, "Phone numbers must be of numeric type only."));
}
if ($_POST['email'] && validateEmail($_POST['email'])) {
    die(msg(0, "Invalid Email!"));
}
if ($_POST['email'] && uniqueEmail($_POST['email'])) {
    die(msg(0, "Email already in database. Please select another email address."));
}
$res = editUser($_SESSION['user_id'], $_POST['email'], $_POST['first_name'], $_POST['last_name'], $_POST['dialing_code'], $_POST['phone'], $_POST['city'], $_POST['country']);
if ($res == 4) {
    die(msg(0, "An internal error has occured. Please contact the site admin!"));
}
if ($res == 99) {
    die(msg(1, "Profile updated successfully!"));
}
function msg($status, $txt)
{
    return '{"status":' . $status . ',"txt":"' . $txt . '"}';
}
Пример #21
0
<?php

require_once 'dbconnect.php';
require_once 'checkUser.php';
$login = $_POST['login'];
$password = md5($_POST['password']);
if (!checkLogin($login, $password)) {
    $hash = md5(rand(0, PHP_INT_MAX));
    setcookie('user', $hash, time() + 3600 * 24 * 365);
    $query = $dbh->query("SELECT user_id FROM users WHERE login = '******' AND password = '******'");
    $result = $query->fetchAll();
    $user_id = array_shift($result);
    $id = array_shift($user_id);
    $dbh->query("INSERT INTO user_token VALUES ('{$id}', '{$hash}')");
    header('Location: http://study/Mysql/addUserMysql/page.php');
} else {
    echo 'Вы не зарегестрированый пользователь';
}
<?php

session_start();
include_once '../configuration/db.php';
include_once '../configuration/ClassUser.php';
include_once '../configuration/ClassAsset.php';
include_once '../configuration/ClassCustomer.php';
include_once '../function/funcs.php';
if (checkLogin()) {
    echo "\n       <html>\n       <head>\n       <title>OpenTroubleTicketing | ";
    if (isset($_GET['choose']) && $_GET['choose'] == 'assignee') {
        echo "Pick Customer </title>";
    }
    if (isset($_GET['choose']) && $_GET['choose'] == 'asset') {
        echo "Pick Asset </title>";
    }
    if (isset($_GET['choose']) && $_GET['choose'] == 'category') {
        echo "Pick Category </title>";
    }
    echo "\n       <meta charset='utf-8'>\n       <meta name='viewport' content='width=device-width, initial-scale=1'>\n       <link rel='icon' href='icon/icon.png'/>\n       <link rel='stylesheet' href='../style/bootstrap.min.css'>\n       <link rel='stylesheet' href='../style/defaultStyle.css'>\n       <link rel='stylesheet' href='pickToken.css'>\n       <script src='../js/jquery.min.js'></script>\n       <script src='../js/bootstrap.min.js'></script>\n       <script src='../js/defaultScript.js'></script>\n       <script src='pickToken.js'></script>";
    echo "\n       </head>\n       <body>\n       <div class='container-fluid'>";
    if (isset($_GET['choose']) && $_GET['choose'] == 'assignee') {
        echo "<label for='assignee'>SEARCH ASSIGNEE</label><br>\n             <input type='text' id='assignee' value='' placeholder='Search by Surname'>";
    }
    if (isset($_GET['choose']) && $_GET['choose'] == 'asset') {
        echo "<label for='asset'>SEARCH ASSET</label><br>\n             <input type='text' id='asset' value='' placeholder='Search by Code'>";
    }
    if (isset($_GET['choose']) && $_GET['choose'] == 'asset') {
    }
    echo "<div class='cointainer' id='hintsGot'></div>";
    echo "</div>\n         </body>\n         </html>";
Пример #23
0
<?php

include "../config.php";
include "../include/common.php";
include "../include/db_connect.php";
include "../include/session.php";
include "../include/chk.php";
if (isset($_SESSION['root'])) {
    if (isset($_REQUEST['wipe']) && isset($_REQUEST['password'])) {
        if (checkLogin($_SESSION['user_id'], $_REQUEST['password'])) {
            databaseWipe();
            $success = "Your database has been completely wiped.";
        } else {
            $error = "Invalid password! You have been logged out for security purposes!";
            session_unset();
        }
    }
    if (isset($success)) {
        get_page_advanced("dbwipe", "root", array('success' => $success));
    } else {
        if (isset($error)) {
            get_page_advanced("dbwipe", "root", array('error' => $error));
        } else {
            if (isset($warning)) {
                get_page_advanced("dbwipe", "root", array('warning' => $warning));
            } else {
                if (isset($info)) {
                    get_page_advanced("dbwipe", "root", array('info' => $info));
                } else {
                    get_page_advanced("dbwipe", "root");
                }
Пример #24
0
<?php

require "../a/include/login-functions.php";
$pwCheck = checkLogin();
if ($pwCheck == false) {
    header("Location: http://roondoo.com/s/login.php");
    die;
}
header("Location: http://roondoo.com/s/set-general.php");
Пример #25
0
<?php

DEFINE('INCLUDE_CHECK', 1);
require_once '../lib/connections/db.php';
include '../lib/functions/functions.php';
checkLogin('1');
if (empty($_POST['oldpassword']) || empty($_POST['newpassword'])) {
    die(msg(0, "Old / New password fields empty!"));
}
if (strlen($_POST['newpassword']) < 5) {
    die(msg(0, "Password must contain more than 5 characters."));
}
$res = updatePass($_SESSION['user_id'], $_POST['oldpassword'], $_POST['newpassword']);
if ($res == 2) {
    die(msg(0, "Incorrect old password!"));
}
if ($res == 3) {
    die(msg(0, "An error occured saving your password. Please contact the site admin."));
}
if ($res == 99) {
    die(msg(1, "Your new password has been saved."));
}
function msg($status, $txt)
{
    return '{"status":' . $status . ',"txt":"' . $txt . '"}';
}
Пример #26
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 */
require_once('includes/common.php');
require_once('includes/SI_PaymentSchedule.php');
require_once('includes/SI_CompanyTransaction.php');
require_once('includes/SI_Project.php');
require_once('includes/SI_Task.php');
require_once('includes/SI_ItemCode.php');

checkLogin('accounting');

$title = '';
$ps = new SI_PaymentSchedule();
$project = new SI_Project();
$task = new SI_Task();
$item_code = new SI_ItemCode();

// Clean up amount
if(!empty($_POST['amount'])){
	$_POST['amount'] = preg_replace('/[^0-9\.]/','', $_POST['amount']);
}

if($_REQUEST['mode'] == 'add'){
	$title = "Add Scheduled Billing";
Пример #27
0
include_once "header.php";
?>

<?php 
include_once "db.php";
include_once "mindoflib.php";
if (stripslashes(!$_POST['checksubmit']) && checkCookie()) {
    showSettingsform();
} else {
    if (checkCookie()) {
        $username = getUserName();
        $site = strip_tags($_POST['site']);
        $url = stripslashes($_POST['url']);
        $numberIndex = stripslashes($_POST['index']);
        $numberRSS = stripslashes($_POST['rss']);
        $user = $username;
        $pass = stripslashes($_POST['pass']);
        $logincheck = checkLogin($user, $pass);
        if ($logincheck == 0) {
            changeSettings($site, $url, $numberIndex, $numberRSS);
        } else {
            echo "the username and/or password you entered was wrong.  please <a href='settings.php'>try again</a>.";
        }
    } else {
        echo "please <a href='login.php'>login</a> in order to change the site settings!";
    }
}
?>
</body>
</html>
Пример #28
0
            <tr>
                <td><a href=/links/inv.php>Vendor Invoices</a></td>
                <td>&nbsp;</td>
                <td>Download copies of vendor invoices</td>
            </tr>
            <tr>
                <td><a href=/wiki/>WFC Wiki</a></td>
                <td>&nbsp;</td>
                <td>Mostly IT info/documentation</td>
            </tr>
            <!--
            <tr>
                <td valign=top><a href="http://192.168.1.10/manual.html">Printer Documentation (PDFs)</a></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            -->
        </table>
    <img src=../images/locked.gif>: indicates password protected areas.<br />
<?php 
require '../auth/login.php';
$user = checkLogin();
if ($user) {
    echo "You are logged in as <b>{$user}</b>. <a href=/auth/ui/loginform.php?logout=yes>Logout</a>";
} else {
    echo "You are not <a href=/auth/ui/loginform.php?redirect=/queries/index.php>logged in</a>.";
}
?>
    </body>
</html>
Пример #29
0
        die("<div class='alert alert-danger'>" . _("Invalid characters in username") . "!</div>");
    }
    // check failed table
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    $cnt = check_blocked_ip($ip);
    # check for failed logins and captcha
    if ($cnt < 5) {
    } elseif (!isset($_POST['captcha'])) {
        updateLogTable("Login IP blocked", "Login from IP address {$ip} was blocked because of 5 minute block after 5 failed attempts", 1);
        die('<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' . _('You have been blocked for 5 minutes due to authentication failures') . '!</div>');
    } else {
        # start session
        if (strlen($phpsessname) > 0) {
            session_name($phpsessname);
        }
        session_start();
        # check captcha
        if ($_POST['captcha'] != $_SESSION['securimage_code_value']) {
            die("<div class='alert alert-danger'>" . _("Invalid security code") . "!</div>");
        }
        session_write_close();
    }
    /* check local login */
    checkLogin($_POST['ipamusername'], md5($_POST['ipampassword']), $_POST['ipampassword']);
} else {
    die('<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' . _('Please enter your username and password') . '!</div>');
}
Пример #30
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php 
require "../dbase/dbFunction.php";
if (isset($_POST['submitLogin'])) {
    $userName = $_POST['UserName'];
    $password = $_POST['Password'];
    if (checkLogin($userName, $password)) {
        session_start();
        $_SESSION['UserName'] = $userName;
        $sql = "SELECT UserID FROM UserInfoTable WHERE UserName='******'";
        $res = exeSQL($sql);
        $row = mysql_fetch_array($res);
        $userID = $row['UserID'];
        $_SESSION['UserID'] = $userID;
        echo "<script type=text/javascript>window.location=\"/index.php\";</script>";
    }
}
?>

<html  xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <link href="Login.css" rel='stylesheet' type='text/css' />
    <title>PicMap</title>
  </head>

  <body>
    
    
    <div class="LoginDiv">