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

PHP user_login函数代码示例

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

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



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

示例1: index

	function index()
	{
		//validate login
		if (user_login())
		{
			if($this->session->userdata('user_type') != 'reseller')
			{
				redirect ('home/');
			}
            else
            {
                $data['page_name']		=	'dashboard';
                $data['selected']		=	'dashboard';
                $data['page_title']		=	'DASHBOARD';
                $data['main_menu']	    =	'default/main_menu/reseller_main_menu';
                $data['sub_menu']	    =	'';
                $data['main_content']	=	'reseller/dashboard';
                $this->load->view('default/template',$data);
            }
		}
        else
        {
            redirect ('home/'); //main home controller
        }
	}
开发者ID:rithyskun,项目名称:vBilling,代码行数:25,代码来源:home.php


示例2: __construct

	function __construct()
	{
		parent::__construct();
		$this->load->model('freeswitch_model');
		// validate login
		if (!user_login())
		 {
		            redirect ('home/');
		 }
		//  else
		//  {
		//             if($this->session->userdata('user_type') == 'customer')
		//             {
		//                redirect ('customer/');
		//             }
		//             
		//             if($this->session->userdata('user_type') == 'reseller')
		// 	{
		// 		redirect ('reseller/');
		// 	}
		//              
		//             if($this->session->userdata('user_type') == 'sub_admin')
		//             {
		//                 if(sub_admin_access_any_cell($this->session->userdata('user_id'), 'view_profiles') == 0)
		//                 {
		//                     redirect ('home/');
		//                 }
		//             }
		//  }
	}
开发者ID:rithyskun,项目名称:vBilling,代码行数:30,代码来源:freeswitch.php


示例3: __construct

	function __construct()
	{
		parent::__construct();
		$this->load->model('groups_model');
		$this->load->model('carriers_model');

		//validate login
		if (!user_login())
		{
			redirect ('home/');
		}
		else
		{
			if($this->session->userdata('user_type') == 'customer')
			{
				redirect ('customer/');
			}
            
            if($this->session->userdata('user_type') == 'reseller')
			{
				redirect ('reseller/');
			}
            
            if($this->session->userdata('user_type') == 'sub_admin')
            {
                if(sub_admin_access_any_cell($this->session->userdata('user_id'), 'view_rate_groups') == 0)
                {
                    redirect ('home/');
                }
            }
		}
	}
开发者ID:rithyskun,项目名称:vBilling,代码行数:32,代码来源:groups.php


示例4: __construct

	function __construct()
	{
		parent::__construct();
		$this->load->model('manage_accounts_model');

		//validate login
		if (!user_login())
		{
			redirect ('home/');
		}
		else
		{
			if($this->session->userdata('user_type') == 'customer')
			{
				redirect ('customer/');
			}
            
            if($this->session->userdata('user_type') == 'reseller')
			{
				redirect ('reseller/');
			}
            
            if($this->session->userdata('user_type') == 'sub_admin')
			{
				redirect ('home/');
			}
		}
	}
开发者ID:rithyskun,项目名称:vBilling,代码行数:28,代码来源:manage_accounts.php


示例5: ajax_login

 public function ajax_login()
 {
     $return = false;
     if (user_login()) {
         $return = '<span>您好,' . $_SESSION['user_login']['uname'] . '</span><b>|</b><a href="' . U('user/logout') . '">登出</a>';
     }
     echo $return;
 }
开发者ID:kjzwj,项目名称:jcms,代码行数:8,代码来源:indexAction.class.php


示例6: access

 protected function access()
 {
     // 获取当前用户ID
     if (user_login() <= 0) {
         // 还没登录 跳转到登录页面
         $this->redirect('user/login', '', '1', '请登录...');
     }
 }
开发者ID:kjzwj,项目名称:jcms,代码行数:8,代码来源:frontendAction.class.php


示例7: authenticate

 /**
  * Authenticate user
  *
  * @static
  * @param _array $user
  * @param array $user['login']
  * @param array $user['password']
  * @return string session ID
  */
 public static function authenticate($user)
 {
     $login = user_login($user['user'], $user['password'], ZBX_AUTH_INTERNAL);
     if ($login) {
         return $login;
     } else {
         self::$error = array('error' => ZBX_API_ERROR_PARAMETERS, 'data' => 'Given login or password is incorrect.');
     }
 }
开发者ID:phedders,项目名称:zabbix,代码行数:18,代码来源:class.cuser.php


示例8: smarty_validate_criteria_isValidPassword

/**
 * test if a value is a valid range
 *
 * @param string $value the value being tested
 * @param boolean $empty if field can be empty
 * @param array params validate parameter values
 * @param array formvars form var values
 */
function smarty_validate_criteria_isValidPassword($value, $empty, &$params, &$formvars)
{
    if (!isset($params['field2'])) {
        trigger_error("SmartyValidate: [isValidPassword] parameter 'field2' is missing.");
        return false;
    }
    if (strlen($value) == 0) {
        return $empty;
    }
    return user_login($formvars[$params['field']], $formvars[$params['field2']]);
}
开发者ID:mroussel,项目名称:flatpress,代码行数:19,代码来源:validate_criteria.isValidPassword.php


示例9: Grader

 function Grader()
 {
     parent::Controller();
     $this->load->model('home_model');
     $this->load->model('user_model');
     $this->load->model('admin_model');
     $this->load->helper('check_login');
     $this->load->helper('breadcrumb');
     if (!user_login()) {
         redirect('main/home/user_login');
     }
 }
开发者ID:baltimoreteacher,项目名称:Grading,代码行数:12,代码来源:grader.php


示例10: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->_mod = D('user');
     $this->_userid = user_login();
     if ($this->_userid) {
         $userinfo = $this->_mod->find($this->_userid);
         $this->assign('userid', $this->_userid);
         $this->assign('userinfo', $userinfo);
     }
     $this->assign('current', 'user');
     $seo['title'] = '会员中心';
     $this->_seo($seo);
 }
开发者ID:kjzwj,项目名称:jcms,代码行数:14,代码来源:userAction.class.php


示例11: Login

function Login()
{
    $smarty = smarty_init(dirname(__FILE__) . '/templates');
    if (isset($_REQUEST['submit'])) {
        $data = formdata_from_post();
        $errors = formdata_validate($data);
        if (count($errors) == 0) {
            user_login($data['Extension']);
            header('Location: Account_Modify.php');
            die;
        }
    }
    $smarty->assign('Errors', $errors);
    return $smarty->fetch('Login.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:15,代码来源:Login.php


示例12: __construct

	function __construct()
	{
		parent::__construct();
		$this->load->model('reseller/billing_model');
		$this->load->library('pdf');
		//validate login
		if (!user_login())
		{
			redirect ('home/');
		}
		else
		{
            if($this->session->userdata('user_type') != 'reseller')
			{
				redirect ('home/');
			}
		}
	}
开发者ID:rithyskun,项目名称:vBilling,代码行数:18,代码来源:billing.php


示例13: __construct

	function __construct()
	{
		parent::__construct();
		$this->load->model('reseller/groups_model');
		$this->load->model('reseller/carriers_model');

		//validate login
		if (!user_login())
		{
			redirect ('home/');
		}
		else
		{
			if($this->session->userdata('user_type') != 'reseller')
			{
				redirect ('home/');
			}
		}
	}
开发者ID:rithyskun,项目名称:vBilling,代码行数:19,代码来源:groups.php


示例14: __construct

	function __construct()
	{
		parent::__construct();
		$this->load->model('customer_model');
		$this->load->model('groups_model');
		$this->load->model('manage_accounts_model');
        $this->load->model('billing_model');
		//validate login
		if (!user_login())
		{
			redirect ('home/');
		}
		else
		{
			if($this->session->userdata('user_type') != 'customer')
			{
				redirect ('home/');
			}
		}
	}
开发者ID:rithyskun,项目名称:vBilling,代码行数:20,代码来源:customer.php


示例15: login_validate

function login_validate()
{
    global $smarty, $lang;
    $user = trim(@$_POST['user']);
    $pass = trim(@$_POST['pass']);
    $error = array();
    $lerr =& $lang['login']['error'];
    if (!$user) {
        $error['user'] = $lerr['user'];
    }
    if (!$pass) {
        $error['pass'] = $lerr['pass'];
    }
    if (!$error && !user_login($user, $pass)) {
        $error['match'] = $lerr['match'];
    }
    if ($error) {
        $smarty->assign('error', $error);
        return 0;
    }
    return 1;
}
开发者ID:mroussel,项目名称:flatpress,代码行数:22,代码来源:login.php


示例16: login

 function login($account, $username, $password)
 {
     log_debug("authenticate", "Executing login({$account}, {$username}, {$password})");
     // sanitise input
     $account = @security_script_input_predefined("any", $account);
     $username = @security_script_input_predefined("any", $username);
     $password = @security_script_input_predefined("any", $password);
     // $account is only used by Amberdms's hosted billing system - for single instance configurations
     // it is unused, and simply exists to ensure a standard API across all product versions
     $result = user_login($account, $username, $password);
     switch ($result) {
         case "-5":
             throw new SoapFault("Sender", "DATABASE_VERSION_MISMATCH");
             break;
         case "-4":
             throw new SoapFault("Sender", "USER_DISABLED");
             break;
         case "-3":
             throw new SoapFault("Sender", "INVALID_AUTHDETAILS");
             break;
         case "-2":
             throw new SoapFault("Sender", "USER_DISABLED");
             break;
         case "-1":
             throw new SoapFault("Sender", "BLACKLISTED");
             break;
         case "0":
         default:
             throw new SoapFault("Sender", "INVALID_AUTHDETAILS");
             break;
         case "1":
             // successful authentication
             $sid = session_name() . "=" . session_id();
             return $sid;
             break;
     }
 }
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:37,代码来源:authenticate.php


示例17: PDO

$smarty->config_dir = $config['smarty']['config_dir'];
$smarty->cache_dir = $config['smarty']['cache_dir'];
//database connect
$pdo_db = new PDO(sprintf('mysql:host=%s;dbname=%s;charset=utf8', $config['mysql']['host'], $config['mysql']['dbname']), $config['mysql']['user'], $config['mysql']['passwd']);
$pdo_db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$pdo_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo_db->query("SET NAMES utf8");
$transaction_counter = 0;
$nested_transaction_counter = 0;
$total_time = 0;
$total_queries = 0;
set_exception_handler('oc_exception_handler');
//cookie check
if (!is_logged() && !isset($_SESSION['user_pending']) && isset($_COOKIE['auth'])) {
    if ($user_id = check_auth_cookie()) {
        if (user_login('', '', $user_id, $_COOKIE['auth'])) {
            header("Location:" . $_SERVER['REQUEST_URI']);
            exit;
        }
    }
}
//debug mode
if (is_admin() && isset($_GET['debug']) && ($debug = $_GET['debug'])) {
    if ($debug == 'on' && !isset($_SESSION['debug_mode'])) {
        $_SESSION['debug_mode'] = 1;
    } elseif ($debug == 'off' && $_SESSION['debug_mode']) {
        unset($_SESSION['debug_mode']);
    }
    header("Location:" . $_SERVER['HTTP_REFERER']);
    exit;
}
开发者ID:ayunah,项目名称:opencorpora,代码行数:31,代码来源:header.php


示例18: users_get_login

 * If the admin wants to visit the homepage of the client
 * then we use the VIEW otherwise the admin is visiting the
 * profile of the client which is the profile VARIABLE
 */
if (isset($_GET['VIEW']) && !empty($_GET['VIEW']) || isset($_GET['PROFILE']) && !empty($_GET['PROFILE'])) {
    // Login as the user
    if (isset($_GET['VIEW'])) {
        $client_id = $_GET['VIEW'];
        $redirect_url = '/dashboard/dashboard';
    } else {
        $client_id = $_GET['PROFILE'];
        $redirect_url = '/users/profile';
    }
    $_SESSION['FAKE_LOGIN'] = $_SESSION['user']['PARTY_ID'];
    $client = users_get_login($client_id);
    user_login($client['USER_LOGIN_ID'], $client['CURRENT_PASSWORD']);
    $_SESSION['user']['IS_ADMIN'] = false;
    $_SESSION['user']['LAST_ACTION'] = time();
    header(sprintf('location: %s', $redirect_url));
    exit;
}
if (isset($_GET['DELETE']) && !empty($_GET['DELETE'])) {
    if (!party_exists($_GET['DELETE'])) {
        $errors[] = sprintf('Customer with id %s does not exist', $_GET['DELETE']);
    } else {
        $person = person_get($_GET['DELETE']);
        person_status_update($_GET['DELETE'], DELETED);
        $success[] = sprintf('Customer: %s %s has been marked as deleted', $person['FIRST_NAME'], $person['LAST_NAME']);
    }
}
$page = forms_get_page();
开发者ID:sahartak,项目名称:megamedia,代码行数:31,代码来源:index.php


示例19: switch

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $success = false;
    if (isset($_POST['action'])) {
        $action = $_POST['action'];
        switch ($action) {
            case 'login':
                if (user_isloggedin()) {
                    break;
                }
                if (isset($_POST['username']) && isset($_POST['password'])) {
                    $username = mysql_real_escape_string(trim($_POST['username']));
                    $password = mysql_real_escape_string(trim($_POST['password']));
                    if (empty($username) or empty($password)) {
                        break;
                    }
                    $success = user_login($username, $password);
                }
                break;
            case 'logout':
                if (!user_isloggedin()) {
                    break;
                }
                $success = user_logout();
                break;
            default:
                break;
        }
    }
    if ($success) {
        echo 'success';
    } else {
开发者ID:fairuzan,项目名称:grinder,代码行数:31,代码来源:index.php


示例20: user_login

    <input type="submit" name="log">
  </form>

  <p>Регистрация</p>
  <form action="" method="post">
    <input type="text" name="login_reg">
    <input type="password" name="pass_reg">
    <input type="submit" name="reg">
  </form>
<?php 
    $login = '';
    $pass = '';
    if (isset($_POST['log'])) {
        $login = $_POST['login_log'];
        $pass = $_POST['pass_log'];
        $result = user_login($login, $pass);
        if ($result == false) {
            echo "Неверно указан логин или пароль";
        }
    }
    if (isset($_POST['reg'])) {
        $login = $_POST['login_reg'];
        $pass = $_POST['pass_reg'];
        $result = user_reg($login, $pass);
        var_dump($result);
        if ($result) {
            echo "Регистрация успешно удалась";
        } else {
            echo "Регистрация не удалась";
        }
    }
开发者ID:Gr1n4,项目名称:file2.ru,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP user_login_finalize函数代码示例发布时间:2022-05-23
下一篇:
PHP user_logged_in函数代码示例发布时间: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