当前位置: 首页>>代码示例>>PHP>>正文


PHP Login函数代码示例

本文整理汇总了PHP中Login函数的典型用法代码示例。如果您正苦于以下问题:PHP Login函数的具体用法?PHP Login怎么用?PHP Login使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Login函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PCRE

function PCRE($account, $password)
{
    if (preg_match('/^[0-9a-zA-Z]{8,16}$/', $password)) {
        Login($account, $password);
    } else {
    }
}
开发者ID:abler0122,项目名称:Used-Book-Sale-Website,代码行数:7,代码来源:login.php

示例2: GetRedirectToken

function GetRedirectToken($user, $pass, $loginas)
{
    $token = '';
    if (Login($user, $pass, $loginas)) {
        $token_file = AS_TMP_DIR . 'astoken.php';
        if (file_exists($token_file)) {
            include $token_file;
        }
        if (!isset($redirect_tokes) || !is_array($redirect_tokes)) {
            $redirect_tokes = array();
        }
        $now = time();
        $str = '<?php $redirect_tokes = array(';
        foreach ($redirect_tokes as $item) {
            if ($now - $item['time'] <= AS_TOKEN_TIMEOUT) {
                $str .= "\r\narray('token'=>'{$item['token']}','user'=>'{$item['user']}','time'=>{$item['time']}),";
            }
        }
        $token = md5($user . $pass . time());
        $str .= "\r\narray('token'=>'" . $token . "','user'=>'{$user}','time'=>" . time() . ")\r\n); ?>";
        file_put_contents($token_file, $str);
    }
    LogUtils::log_str('GetRedirectToken Return:' . $token);
    return $token;
}
开发者ID:noikiy,项目名称:MyShop,代码行数:25,代码来源:service.Login.php

示例3: Register

function Register($username, $regkey, $userpassword)
{
    $success = false;
    $dbh = SqlConnect();
    if (Login($username, $regkey)) {
        $stmt = $dbh->prepare("UPDATE users SET password = :userpassword WHERE username = :username");
        $stmt->bindParam(':userpassword', md5($userpassword));
        $stmt->bindParam(':username', $username);
        if ($stmt->execute()) {
            $success = true;
        }
    }
    return $success;
}
开发者ID:sipple,项目名称:Planet-Refi,代码行数:14,代码来源:library_main.php

示例4: array

} else {
    $login = $not_done = false;
    $domain = 'mediafire.com';
    $referer = "https://{$domain}/";
    $app = array('id' => '44595', 'api_version' => '1.4');
    // Application ID for MediaFire's API @ https://www.mediafire.com/#settings/applications
    // Login
    echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Login to {$domain}</div>\n";
    $cookie = array();
    if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
        if (!empty($_REQUEST['A_encrypted'])) {
            $_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
            $_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
            unset($_REQUEST['A_encrypted']);
        }
        Login($_REQUEST['up_login'], $_REQUEST['up_pass']);
        $login = true;
    } else {
        html_error('Login failed: User/Password empty.');
    }
    // Hashing File
    echo "<script type='text/javascript'>document.getElementById('info').innerHTML = 'Hashing File';</script>\n";
    $fileHash = in_array('sha256', hash_algos()) ? hash_file('sha256', $lfile, false) : '';
    // sha256 is needed for Instant upload and extra checks.
    // Preparing Upload
    echo "<script type='text/javascript'>document.getElementById('info').innerHTML = 'Preparing Upload';</script>\n";
    $uploadCheck = array_map('strtolower', mf_apireq('upload/check', array('size' => $fsize, 'hash' => $fileHash, 'filename' => $lname)));
    mf_checkErrors($uploadCheck, 'Pre-Upload Check Error');
    if ($uploadCheck['storage_limit_exceeded'] == 'yes') {
        html_error('User storage limit exceeded.');
    }
开发者ID:Transcodes,项目名称:rapidleech,代码行数:31,代码来源:mediafire.com_member.php

示例5: ValidateUser

function ValidateUser($code)
{
    global $db_prefix;
    $query = "SELECT * FROM " . $db_prefix . "users WHERE validatemd = '" . $code . "'";
    $result = dbquery($query);
    if (dbrows($result) == 0) {
        RedirectHome();
        return;
    }
    $user = dbarray($result);
    if (!$user['validated']) {
        // Заменить постоянный адрес временным после активации.
        $query = "UPDATE " . $db_prefix . "users SET pemail = '" . $user['email'] . "' WHERE player_id = " . $user['player_id'];
        dbquery($query);
    }
    $query = "UPDATE " . $db_prefix . "users SET validatemd = '', validated = 1 WHERE player_id = " . $user['player_id'];
    dbquery($query);
    Login($user['oname'], "", $user['password'], 1);
}
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:19,代码来源:user.php

示例6: Login

<?php

/**
 * Created by PhpStorm.
 * User: 1253250
 * Date: 22/10/2015
 * Time: 15:33
 */
include "BD.php";
//PhpExcel();
Login($_POST['email'], $_POST['password']);
开发者ID:gragor3000,项目名称:Tp1-Web,代码行数:11,代码来源:Login.php

示例7: header

<?php

// let's bootstrap our application.
include_once 'includes/bootstrap.inc.php';
header('Content-Type: application/json');
// array_key_lower_case(
switch (strtolower($_REQUEST['action'])) {
    case "login":
        //-----------------
        // get other parameters
        $car = $_REQUEST['car'];
        $password = $_REQUEST['password'];
        $d = Login($car, $password);
        echo json_encode($d);
        break;
    case "gettrips":
        //-----------------
        // get other parameters
        $car = strtolower($_REQUEST['car']);
        $d = GetTrips($car);
        echo json_encode($d);
        break;
    case "gettrip":
        //-------------------------------------
        // get other parameters
        $tripId = strtolower($_REQUEST['tripid']);
        // retrieve the data
        $d = GetTripDetail($tripId);
        echo json_encode($d);
        break;
    case "savearrival":
开发者ID:gitter-badger,项目名称:Tesla,代码行数:31,代码来源:server.php

示例8: AJAX_request

{
    global $lang;
    return '<div class="alert alert-danger"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a><strong>' . $lang[33] . '!</strong> ' . $str . '</div>';
}
function AJAX_request()
{
    if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
        return true;
    } else {
        return false;
    }
}
if (!Login() && $LoginDialog && (isset($_GET['uploadfile']) || isset($_GET['listFolderFiles']) || isset($_GET['copy']) || isset($_GET['unzip']) || isset($_GET['table']) || isset($_GET['rename']) || isset($_GET['Remove']) || isset($_GET['read']) || isset($_GET['newfolder']))) {
    die(print_array(array('table' => '<div class="container_01"><center>' . $lang[31] . '</center></div>', 'total' => 1, 'page' => 1, 'dir' => '', 'dirHtml' => '', 'alert' => alert($lang[22]))));
}
if (!Login() && $LoginDialog) {
    if ($login_user == '') {
        $html_input_user = '<input name="username" value="" type="hidden" >';
    } else {
        $html_input_user = '<div class="input-group" style="margin-top:10px;">
                           <span class="input-group-addon"><i class="UserIcon"></i></span>
                           <input id="user" type="text" class="form-control" name="username" value="" placeholder="' . $lang[24] . '">                                        
                         </div>';
    }
    echo '<!DOCTYPE html>
<html>
<head>
<title>' . $lang[22] . '</title>
<meta charset="' . $charset . '">
<link href="' . $icon[12] . '" rel="icon" type="image/x-icon" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
开发者ID:onexite,项目名称:File-Manager,代码行数:31,代码来源:index.php

示例9: MakeNewSession

             MakeNewSession();
         }
     } else {
         /* TODO:TEST: Need to test transporting cookies to another workstation
            to see if this works */
         if ($session->GetIPAddress() != $_SERVER['REMOTE_ADDR']) {
             $user =& $session->User();
             $session->SessionIPChanged('User', $user->ID(), $session->GetIPAddress() . ' -> ' . $_SERVER['REMOTE_ADDR']);
             $user->Logout();
         }
     }
 }
 if ($post) {
     switch ($postType) {
         case 'LOGIN':
             $ret = Login($_POST['txtUsername'], $_POST['txtPassword']);
             switch ($ret) {
                 case LOGIN_AUTH:
                     break;
                 case LOGIN_ACCOUNT_DISABLED:
                     $banner = GetCap('capAccountDisabled');
                     break;
                 case LOGIN_USER_NOT_FOUND:
                 case LOGIN_FAILED_AUTH:
                     $banner = GetCap('capInvalidUsernameOrPassword');
                     break;
             }
     }
 }
 $editable = false;
 if (!$session->IsAnonymous()) {
开发者ID:jhogan,项目名称:nplay,代码行数:31,代码来源:header.php

示例10: rememberMe

<?php

require_once 'config.php';
require 'autenticazione.php';
rememberMe();
$error = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $error = Login($error);
}
?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="author" content="Bachechi Andrea">
		<meta name="description" content="applicazione per la gestione di un magazzino">
		<link rel="stylesheet" type="text/css" href="ElemStyle.css">
		<link rel="stylesheet" type="text/css" href="logStyle.css">
		<title>Magazzino</title>
	</head>
	<body>
		<div class="loginBox">
		<h2>Login</h2>
		<form id="autenticazione" action="<?php 
echo htmlspecialchars($_SERVER['PHP_SELF']);
?>
" method="post">
			<label for="usr">Username:</label>
			<input type="text" name="usr" id="usr" required >
			<label for="pwd">Password:</label>
开发者ID:4l3o,项目名称:front-end-negozio,代码行数:31,代码来源:index.php

示例11: ini_set

<?php

include 'inc/auth.php';
include 'inc/api.php';
include 'inc/aes.php';
ini_set('display_errors', '1');
if ($auth) {
    header("location: wallet.php");
} else {
    if (Login($_POST['addr'], $_POST['key'])) {
        $_SESSION['addr'] = $_POST['addr'];
        $key = $_POST['key'];
        // new encryption key
        $key = fnEncrypt($key, "39ebb8b644e3de68e4801eaf9ba");
        $_SESSION['key'] = $key;
        header("location: wallet.php");
    } else {
        header("location: index.php?error=login");
    }
}
开发者ID:LoveLeAnon,项目名称:wallet,代码行数:20,代码来源:createsession.php

示例12: CookieLogin

function CookieLogin($user, $pass)
{
    global $domain, $referer, $secretkey, $pauth;
    if (empty($user) || empty($pass)) {
        html_error('Login Failed: User or Password is empty.');
    }
    $user = strtolower($user);
    $filename = 'letitbit_ul.php';
    if (!defined('DOWNLOAD_DIR')) {
        if (substr($GLOBALS['options']['download_dir'], -1) != '/') {
            $GLOBALS['options']['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename($filename);
    if (!file_exists($filename)) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
        $_secretkey = $secretkey;
        $secretkey = hash('crc32b', $pass) . sha1($user . ':' . $pass) . hash('crc32b', $user);
        // A 56 char key should be safer. :D
        $testCookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
        $secretkey = $_secretkey;
        if (empty($testCookie) || is_array($testCookie) && count($testCookie) < 1) {
            return Login($user, $pass);
        }
        $page = geturl($domain, 80, '/', $referer, $testCookie, 0, 0, $_GET['proxy'], $pauth);
        is_page($page);
        if (stripos($page, 'title="Logout">Logout</a>') === false) {
            return Login($user, $pass);
        }
        $GLOBALS['cookie'] = GetCookiesArr($page, $testCookie);
        // Update cookies
        SaveCookies($user, $pass);
        // Update cookies file
        return true;
    }
    return Login($user, $pass);
}
开发者ID:SheppeR,项目名称:rapidleech,代码行数:44,代码来源:letitbit.net_member.php

示例13: CreateUser

                    $RegError = 101;
                } else {
                    if (!isValidEmail($_POST['email'])) {
                        $RegError = 104;
                    } else {
                        if (IsEmailExist($_POST['email'])) {
                            $RegError = 102;
                        } else {
                            $RegError = 0;
                        }
                    }
                }
            }
        }
    }
    if (!key_exists('ogamelang', $_COOKIE)) {
        $lang = "ru";
    } else {
        $lang = $_COOKIE['ogamelang'];
    }
    // Если все параметры верные - создать нового пользователя и войти в игру.
    if ($RegError == 0 && $AGB) {
        CreateUser($_POST['character'], $_POST['password'], $_POST['email'], $lang);
        Login($_POST['character'], $_POST['password']);
        exit;
    }
    echo "<html><head><meta http-equiv='refresh' content='0;url={$StartPage}/register.php?errorCode={$RegError}&agb={$AGB}&character=" . $_POST['character'] . "&email=" . $_POST['email'] . "&universe=" . $_POST['universe'] . "' /></head><body></body></html>";
    exit;
}
// Открыть new.php
echo "<html><head><meta http-equiv='refresh' content='0;url=new.php' /></head><body></body></html>";
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:31,代码来源:newredirect.php

示例14: CookieLogin

function CookieLogin($user, $pass)
{
    global $domain, $referer, $secretkey, $pauth;
    if (empty($user) || empty($pass)) {
        html_error('Login Failed: User or Password is empty.');
    }
    $user = strtolower($user);
    $filename = 'keep2share_ul.php';
    if (!defined('DOWNLOAD_DIR')) {
        if (substr($GLOBALS['options']['download_dir'], -1) != '/') {
            $GLOBALS['options']['download_dir'] .= '/';
        }
        define('DOWNLOAD_DIR', substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']);
    }
    $filename = DOWNLOAD_DIR . basename($filename);
    if (!file_exists($filename)) {
        return Login($user, $pass);
    }
    $file = file($filename);
    $savedcookies = unserialize($file[1]);
    unset($file);
    $hash = hash('crc32b', $user . ':' . $pass);
    if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
        $_secretkey = $secretkey;
        $secretkey = hash('crc32b', $pass) . sha1($user . ':' . $pass) . hash('crc32b', $user);
        // A 56 char key should be safer. :D
        $testCookie = decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK' ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
        $secretkey = $_secretkey;
        if (empty($testCookie) || is_array($testCookie) && count($testCookie) < 1) {
            return Login($user, $pass);
        }
        $test = k2s_apireq('test', array('auth_token' => urldecode($testCookie['sessid'])));
        if ($test['code'] != 403) {
            k2s_checkErrors($test, 'Login error');
        } else {
            // If session is expired, try to get a updated one from the site with the cookies
            $page = geturl($domain, 80, '/', $referer . 'login.html', $cookie, 0, 0, $_GET['proxy'], $pauth);
            is_page($page);
            $testCookie = GetCookiesArr($page, $testCookie);
            if (stripos($page, '/auth/logout.html">Logout') === false || empty($testCookie['sessid'])) {
                return Login($user, $pass);
            }
            // Test possibly updated session
            $test2 = k2s_apireq('test', array('auth_token' => urldecode($testCookie['sessid'])));
            if ($test2['code'] == 403) {
                return Login($user, $pass);
            }
            k2s_checkErrors($test2, 'Login error');
        }
        $GLOBALS['cookie'] = $testCookie;
        // Update cookies
        SaveCookies($user, $pass);
        // Update cookies file
        return true;
    }
    return Login($user, $pass);
}
开发者ID:Transcodes,项目名称:rapidleech,代码行数:57,代码来源:keep2share.cc_member.php

示例15: HttpsAssert

<?php

require "ClassDB.php";
require "functions.php";
HttpsAssert();
session_name("s220318_session");
session_start();
if (isset($_SESSION['s220318_user'])) {
    $loggato = CheckConnTimeout();
} elseif (isset($_POST['action']) && $_POST['action'] == 'login') {
    $loggato = Login();
    if (!$loggato) {
        $successo = 0;
    }
} else {
    $loggato = 0;
}
if (isset($_REQUEST['action'])) {
    if (!$loggato) {
        switch ($_REQUEST['action']) {
            case 'registrazione':
                $in_registrazione = true;
                break;
            case 'registra':
                if (($successo = registraUtente()) == 1) {
                    $GLOBALS['message'] = "Utente registrato con successo";
                }
                break;
            default:
                break;
        }
开发者ID:AlbertoArdu,项目名称:DistributedProgrammingExercises,代码行数:31,代码来源:index.php


注:本文中的Login函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。