• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_active函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login

<?php

include 'core/init.php';
$error = null;
// Ako e pristapeno so post metod, proverka na greski za username i password
if (!empty($_POST)) {
    $username = $_POST['user'];
    $password = $_POST['pass'];
    if (empty($username) || empty($password)) {
        $error = 'Потребно е да внесите корисничко име и лозинка';
    } else {
        if (!user_exists($username)) {
            $error = 'Корисничкото име што го внесивте не постои';
        } else {
            if (!user_active($username)) {
                $error = 'Потрено е да ја активирате вашата корисничка сметка';
            } else {
                $login = login($username, $password);
                if (!$login) {
                    $error = 'Корисничкото име или лозинката се погрешни';
                }
            }
        }
    }
}
// Ako error e null togas znaci deka ili korisnikot ne pristapil so post metod i ke bidi vraten na prethodnata strana,
// ili deka korisnikot se logiral uspesno i ke bidi startuvana sesija
if (!is_null($error)) {
    $_SESSION['error'] = $error;
    $_SESSION['user_value'] = $username;
    // Ako ima greska da se zapamti to so go zapisal userot za da ne go pisi pak
开发者ID:AleksandarGjorgievski,项目名称:biblioteka,代码行数:31,代码来源:login-post.php


示例2: array

$config['db'] = array('host' => 'localhost', 'username' => 'root', 'password' => '', 'dbname' => 'medium');
try {
    $db = new PDO('mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], $config['db']['username'], $config['db']['password']);
} catch (PDOException $e) {
    echo $e->getMessage();
}
require 'functions/general.php';
require 'functions/users.php';
require 'functions/posthandler.php';
// echo $current_file = basename(__FILE__);
$current_file = explode('/', $_SERVER['SCRIPT_NAME']);
$current_file = end($current_file);
// print_r($current_file);
if (logged_in() === true) {
    $session_user_id = $_SESSION['user_id'];
    $user_data = user_data($session_user_id, 'user_id', 'username', 'password', 'first_name', 'last_name', 'email', 'password_recover', 'type', 'allow_email', 'profile');
    //   echo $user_data['username'];
    if (user_active($user_data['username']) === false) {
        session_destroy();
        header('Location: index.php');
        exit;
    }
    if ($current_file !== 'changepassword.php' && $user_data['password_recover'] == 1) {
        header('Location: changepassword.php?force');
        exit;
    }
} else {
    $session_user_id = 0;
}
// echo $user_data['type'];
$errors = array();
开发者ID:stevensmetellus,项目名称:medium-clone,代码行数:31,代码来源:init.php


示例3: session_start

<?php

session_start();
//error_reporting(0);
require_once 'config.php';
require_once 'includes/functions/general.php';
if (logged_in() === true) {
    if (user_active($_SESSION['user_username'], $conn) === false) {
        session_destroy();
        header('Location: index.php');
        exit;
    }
}
开发者ID:emilsrits,项目名称:RB,代码行数:13,代码来源:init.php


示例4: array

<?php

include "include/overall/header.php";
include "core/init.php";
if (empty($_POST) === false) {
    $name = $_POST['name'];
    $password = $_POST['password'];
    $errors = array();
    if (empty($name) === true || empty($password) === true) {
        $errors[] = "You need to enter a name and password";
    } else {
        if (user_exists($name) === false) {
            $errors[] = "We can't find that name. Have you registered?";
        } else {
            if (user_active($name) === false) {
                $errors[] = "You haven't activated your account!";
            } else {
                $login = login($name, $password);
                if ($login === false) {
                    $errors[] = "That Name and Password combination is incorrect";
                } else {
                    $_SESSION['ID'] = $login;
                    $_SESSION['name'] = $name;
                    $userNameCookie = "name";
                    $passwordCookie = "password";
                    setcookie($userNameCookie, $name, time() + 604800 * 30);
                    setcookie($passwordCookie, $password, time() + 604800 * 30);
                    header('Location: index.php');
                    exit;
                }
            }
开发者ID:brianmerry,项目名称:indiBeenFed,代码行数:31,代码来源:login.php


示例5: add_header

add_header("New Item");
if (!$conn) {
    echo "Could not establish connection to database.";
    exit;
}
if (isset($_SESSION['valid_user'])) {
    $sql = " SELECT email, active FROM users WHERE email = '" . $_SESSION['valid_user'] . "'";
    $result = $conn->query($sql);
    if (!$result) {
        echo "connection to the database couldn't be establish";
        exit;
    }
    while ($row = $result->fetch_assoc()) {
        extract($row);
        if ($active == 0) {
            user_active();
            break;
        }
    }
    @($user = addslashes($_GET['user']));
    @($list_id = addslashes($_GET['list_id']));
    @($description = addslashes($_GET['description']));
    @($date = date("m-d-Y"));
    if (isset($_POST['submit'])) {
        $name = addslashes(trim($_POST['name']));
        $content = addslashes(trim($_POST['content']));
        $date = addslashes(trim($_POST['date']));
        $completed = $_POST['completed'];
        $query = "\n         INSERT INTO todolist_items(name,content,item_id,date,completed)VALUES(?,?,?,?,?)\n         ";
        $result = $conn->prepare($query);
        $result->bind_param("ssiss", $name, $content, $date, $completed);
开发者ID:emmanuelal,项目名称:Todo_List-ported-to-PHP,代码行数:31,代码来源:new_item.php


示例6: login

include 'core/init.php';
?>

    <?php 
if (empty($_POST) === false) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    //Check if user exists
    if (empty($email) === true || empty($password) === true) {
        $errors[] = 'You need to enter a email and password';
    } else {
        if (user_exists($email) === false) {
            $errors[] = 'We cannot find that email. Have you registered?';
        } else {
            if (user_active($email) === false) {
                $errors[] = 'You haven\'t activated your account';
            } else {
                // Trying to get multiple things into the errors array to display
                if (strlen($password) > 32) {
                    $errors[] = "Password is too long";
                }
                // Try logging in user
                $login = login($email, $password);
                if ($login === false) {
                    $errors[] = 'That email and password combination is incorrect';
                } else {
                    echo 'goody';
                    // set user session
                    $_SESSION['user_id'] = $login;
                    // redirect user home
开发者ID:Jesster58,项目名称:Shoplift.ninja,代码行数:30,代码来源:loggedIn.php


示例7: header

				<li><a href="blog.php">blog</a></li>
				<li><a href="index.php#contact">contact</a></li>
				<li><a href="includes/logout.php">log out</a></li>
				<li><a href="login.php">profile settings</a></li>
				<li><a href="../ro/login.php">ro</a></li>
			</ul>
			<div id="logo"><a href="index.php"><img src="img/provisory-logo.gif"></a></div>
		</nav>';
    echo '<h3 class="delete_success">User deleted successfully!</h3>';
    echo '<a href="admin.php" class="email_success_a">Go back to the admin page</a>';
} else {
    if (empty($_POST) === false) {
        if (user_exists($_POST['username']) === false) {
            $errors[] = 'Username does not exist';
        } else {
            if (user_active($_POST['username']) === true) {
                $errors[] = 'That user is active';
            }
        }
    }
    if (empty($_POST) === false && empty($errors) === true) {
        delete_inactive_user($_POST['username']);
        header('Location: delete_users.php?success');
        exit;
    } else {
        if (empty($errors) === false) {
            echo output_errors($errors);
        }
    }
    ?>
	
开发者ID:vpandichi,项目名称:worldtour_proiect,代码行数:30,代码来源:delete_inactive_users.php


示例8: logged_in_redirect

logged_in_redirect();
// test:
//if (user_exists('foo')) {
//    echo 'exists';
//}
//die();
if (empty($_POST) === false) {
    $username = $_POST['username'];
    $password = $_POST['password'];
    if (empty($username) === true || empty($password) === true) {
        $errors[] = 'You need to enter a username and password';
    } else {
        if (user_exists($username) == 0) {
            $errors[] = 'We can\'t find that username. Have you registered?';
        } else {
            if (user_active($username) == 0) {
                $errors[] = 'You haven\'t activated your account;';
            } else {
                if (strlen($password) > 32) {
                    $errors[] = 'Password too long';
                }
                $login = login($username, $password);
                if ($login === false) {
                    $errors[] = 'That username/password combination is incorrect';
                } else {
                    // set the user session
                    $_SESSION['user_id'] = $login;
                    // redirect user to home
                    header('Location: index.php');
                    exit;
                }
开发者ID:stevensmetellus,项目名称:medium-clone,代码行数:31,代码来源:login.php


示例9: elseif

<?php

include 'core/init.php';
if (empty($_POST) === false) {
    $username = $_POST['username'];
    $password = $_POST['password'];
    if (empty($username) === true || empty($password) === true) {
        $errors[] = 'You need to enter a username and password';
    } elseif (user_exists($username) === false) {
        $errors[] = 'We can\'t find that username. Have you registered?';
    } elseif (user_active($username) === false) {
        $errors[] = 'You haven\'t activated your account.';
    } else {
        if (strlen($password) > 32) {
            $errors[] = 'Password too long.';
        }
        $login = login($username, $password);
        if ($login === false) {
            $errors[] = 'The username/password is incorrect.';
        } else {
            // set the user session
            $_SESSION['user_id'] = $login;
            //redirect user to home
            header('Location: index.php');
            exit;
        }
    }
} else {
    $errors[] = 'No data received.';
}
include 'includes/overall/header.php';
开发者ID:rushoratiu,项目名称:horatiusirut,代码行数:31,代码来源:login.php


示例10: session_start

<?php

session_start();
//error_reporting(0);
require 'database/connect.php';
require 'functions/general.php';
require 'functions/users.php';
if (logged_in()) {
    $session_serial = $_SESSION['serial'];
    $user_data = user_data($session_serial, 'serial', 'name', 'email', 'user_name', 'password', 'school', 'level');
    if (!user_active($user_data['user_name'])) {
        session_destroy();
        header("Location: index.php");
    }
}
$errors = array();
开发者ID:arealdeadone,项目名称:Treasurehunt,代码行数:16,代码来源:init.php


示例11: header

				<li><a href="blog.php">blog</a></li>
				<li><a href="index.php#contact">contact</a></li>
				<li><a href="includes/logout.php">delogare</a></li>
				<li><a href="login.php">setari profil</a></li>
				<li><a href="../en/login.php">en</a></li>
			</ul>
			<div id="logo"><a href="index.php"><img src="img/provisory-logo.gif"></a></div>
		</nav>';
    echo '<h3 class="delete_success">Utilizatorul a fost sters cu succes!</h3>';
    echo '<a href="admin.php" class="email_success_a">Inapoi la pagina de admin</a>';
} else {
    if (empty($_POST) === false) {
        if (user_exists($_POST['username']) === false) {
            $errors[] = 'Utilizatorul nu exista.';
        } else {
            if (user_active($_POST['username']) === false) {
                $errors[] = 'Acel utilizator nu este activ';
            }
        }
    }
    if (empty($_POST) === false && empty($errors) === true) {
        delete_user($_POST['username']);
        header('Location: delete_users.php?success');
        exit;
    } else {
        if (empty($errors) === false) {
            echo output_errors($errors);
        }
    }
    ?>
	
开发者ID:vpandichi,项目名称:worldtour_proiect,代码行数:30,代码来源:delete_users.php


示例12: mysql_real_escape_string

<?php

//require_once '../../core/init.php'; //not use for this action without jquery
// Login Script (function use from user.php)
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $username = mysql_real_escape_string(htmlentities(input_validation($_POST['username'])));
    //@$pin = mysql_real_escape_string(htmlentities(input_validation($_POST['pin'])));
    $password = mysql_real_escape_string(htmlentities(input_validation($_POST['password'])));
    $password_md5 = md5($password);
    @($remember_me = mysql_real_escape_string(htmlentities(input_validation($_POST['remember_me']))));
    if (!empty($username) && !empty($password)) {
        if (user_exists($con, $username) === false) {
            //$con is PDO connection variable
            $errors[] = 'We can\'t find your Username';
        } elseif (user_active($con, $username, $password_md5) === false) {
            //echo 'You haven\'t activated your account.';
            $errors[] = 'Your account isn\'t active. Please contact with administrator.';
        } elseif (user_lock($con, $username, $password_md5) === false) {
            //echo 'You account is Locked, Please contact with admin.';
            $errors[] = 'You account is Locked, Please contact with administrator.';
        } else {
            $login = login($con, $username, $password_md5);
            if ($login === false) {
                //if login return false
                //echo 'Your Username / Password combination is incorrect.';
                $errors[] = 'Your Username / Password combination is incorrect.';
            } else {
                $_SESSION['user_id'] = $login;
                session_regenerate_id();
                //creates a new unique-ID for to represent the current user’s session.
                //for login user log;
开发者ID:rrabbi,项目名称:servethepeoplebd,代码行数:31,代码来源:login_script.php


示例13: session_start

<?php

session_start();
error_reporting(0);
require 'database/connect.php';
require 'functions/general.php';
require 'functions/users.php';
$current_file = explode('/', $_SERVER['SCRIPT_NAME']);
$current_file = end($current_file);
if (logged_in() === true) {
    $session_user_id = $_SESSION['user_id'];
    $user_data = user_data($_SESSION['user_id'], 'user_id', 'first_name', 'middle_name', 'last_name', 'email', 'phone', 'dob', 'sex', 'dept_name', 'deptrn', 'uuregno', 'address', 'password', 'password_recover');
    $edu_data = edu_data($_SESSION['user_id'], 'x_board', 'x_pass', 'x_percent', 'xii_branch', 'xii_stream', 'xii_pass', 'xii_percent', 'grdu_university', 'grdu_course', 'grdu_join', 'grdu_pass', 'grdu_percent', 'pg_course', 'pg_join', 'pg_pass', 'pg_percent');
    if (user_active($user_data['email']) === false) {
        session_destroy();
        header('Location: index.php');
        exit;
    }
    if ($current_file !== 'changepassword.php' && $user_data['password_recover'] == 1) {
        header('Location: changepassword.php?force');
        exit;
    }
}
$errors = array();
开发者ID:prabhat2233,项目名称:UtkalPortal,代码行数:24,代码来源:init.php


示例14: test_input

<?php

include "../init.php";
$loginError = "";
$username = $password = "";
$username = test_input($_POST["username"]);
$password = test_input($_POST["password"]);
if (empty($username) === true || empty($password) === true) {
    $loginError = 'Ievadiet lietotājvārdu un paroli';
} else {
    if (username_exists($username, $conn) === false) {
        $loginError = 'Lietotājvārds netika atrasts';
    } else {
        if (user_active($username, $conn) === false) {
            $loginError = 'Apstipriniet savu e-pasu';
        } else {
            $login = login($username, $password, $conn);
            if ($login === false) {
                $loginError = 'Nepareiza parole';
            } else {
                $_SESSION['user_id'] = $login;
                if (logged_in() === true) {
                    $_SESSION['user_username'] = fetch_value('username', 'users', 'user_id', $_SESSION['user_id'], $conn);
                    $_SESSION['user_email'] = fetch_value('email', 'users', 'user_id', $_SESSION['user_id'], $conn);
                }
                exit;
            }
        }
    }
}
echo $loginError;
开发者ID:emilsrits,项目名称:RB,代码行数:31,代码来源:login_info.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_active_flip函数代码示例发布时间:2022-05-23
下一篇:
PHP user_accesstime_log函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap